@vc-shell/framework 1.0.109 → 1.0.110

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 CHANGED
@@ -1,3 +1,19 @@
1
+ ## [1.0.110](https://github.com/VirtoCommerce/vc-shell/compare/v1.0.109...v1.0.110) (2023-10-16)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * code review improvements ([5c6c6dc](https://github.com/VirtoCommerce/vc-shell/commit/5c6c6dc7a60c1212e4c23e0ddbbc42611f16303b))
7
+ * code review improvements ([5453ba0](https://github.com/VirtoCommerce/vc-shell/commit/5453ba0388a51b2946408b980e119a0ad20f7647))
8
+ * delete index.ts from framework api ([8cc2fee](https://github.com/VirtoCommerce/vc-shell/commit/8cc2feef30ac38bcf229234456cac78c8e23f158))
9
+
10
+
11
+ ### Features
12
+
13
+ * vm-1215 vc-video ([52680f6](https://github.com/VirtoCommerce/vc-shell/commit/52680f6f2bd649d7226818f6432e605502ab9eab))
14
+
15
+
16
+
1
17
  ## [1.0.109](https://github.com/VirtoCommerce/vc-shell/compare/v1.0.108...v1.0.109) (2023-10-13)
2
18
 
3
19
 
@@ -1,5 +1,6 @@
1
1
  import { defineRule } from "vee-validate";
2
- import AllRules from "@vee-validate/rules";
2
+ /*eslint import/namespace: ['error', { allowComputed: true }]*/
3
+ import * as AllRules from "@vee-validate/rules";
3
4
 
4
5
  Object.keys(AllRules).forEach((rule) => {
5
6
  defineRule(rule, AllRules[rule]);
@@ -84,20 +85,35 @@ export const fileWeight = (file: HTMLInputElement, [size]: [number]) => {
84
85
  defineRule("fileWeight", fileWeight);
85
86
 
86
87
  const compare = (
87
- value: string,
88
- [target]: string[],
88
+ value: string | Date,
89
+ [target]: string[] | Date[],
89
90
  comparer: (first: number, second: number) => boolean,
90
91
  errorMessage: string
91
92
  ): boolean | string => {
92
93
  // The field is empty so it should pass
93
- if (!value || !value.length) {
94
+ if (!value || (typeof value == "string" && !value.length)) {
94
95
  return true;
95
96
  }
96
97
 
97
- const first_date = new Date(value);
98
- const second_date = new Date(target);
98
+ let first_date;
99
+ let second_date;
100
+ if (value instanceof Date) {
101
+ first_date = value;
102
+ }
103
+
104
+ if (target instanceof Date) {
105
+ second_date = target;
106
+ }
107
+
108
+ if (typeof value === "string") {
109
+ first_date = new Date(value);
110
+ }
111
+
112
+ if (typeof target === "string") {
113
+ second_date = new Date(target);
114
+ }
99
115
 
100
- if (first_date.getTime() > 0 && second_date.getTime() > 0) {
116
+ if (first_date?.getTime() > 0 && second_date?.getTime() > 0) {
101
117
  if (comparer(second_date.getTime(), first_date.getTime())) {
102
118
  return errorMessage;
103
119
  }
@@ -114,6 +130,7 @@ defineRule("before", before);
114
130
  // after
115
131
  export const after = (value: string, [target]: string[]) =>
116
132
  compare(value, [target], (first, second) => first > second, "End date must be later than start date");
133
+
117
134
  defineRule("after", after);
118
135
 
119
136
  export const bigInt = (value: string) => {
@@ -1,3 +1,3 @@
1
1
  /** @deprecated use `useI18n({ useScope: "global" })` directly from `vue-i18n` */
2
- export declare function useI18n(): import("vue-i18n").Composer<{}, {}, {}, {}, never, {}>;
2
+ export declare function useI18n(): import("vue-i18n").Composer<{}, {}, {}, string, never, string>;
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../core/composables/useI18n/index.ts"],"names":[],"mappings":"AAEA,iFAAiF;AACjF,wBAAgB,OAAO,2DAGtB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../core/composables/useI18n/index.ts"],"names":[],"mappings":"AAEA,iFAAiF;AACjF,wBAAgB,OAAO,mEAGtB"}
@@ -1 +1 @@
1
- {"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../../../core/plugins/validation/rules.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,eAAO,MAAM,aAAa,WAAY,gBAAgB,mBAAmB,CAAC,MAAM,GAAG,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,qCAwC1G,CAAC;AAIF;;GAEG;AACH,eAAO,MAAM,UAAU,SAAU,gBAAgB,UAAU,CAAC,MAAM,CAAC,kBAwBlE,CAAC;AA4BF,eAAO,MAAM,MAAM,UAAW,MAAM,YAAY,MAAM,EAAE,qBACiD,CAAC;AAI1G,eAAO,MAAM,KAAK,UAAW,MAAM,YAAY,MAAM,EAAE,qBACgD,CAAC;AAGxG,eAAO,MAAM,MAAM,UAAW,MAAM,gCAMnC,CAAC"}
1
+ {"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../../../core/plugins/validation/rules.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,eAAO,MAAM,aAAa,WAAY,gBAAgB,mBAAmB,CAAC,MAAM,GAAG,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,qCAwC1G,CAAC;AAIF;;GAEG;AACH,eAAO,MAAM,UAAU,SAAU,gBAAgB,UAAU,CAAC,MAAM,CAAC,kBAwBlE,CAAC;AA2CF,eAAO,MAAM,MAAM,UAAW,MAAM,YAAY,MAAM,EAAE,qBACiD,CAAC;AAI1G,eAAO,MAAM,KAAK,UAAW,MAAM,YAAY,MAAM,EAAE,qBACgD,CAAC;AAIxG,eAAO,MAAM,MAAM,UAAW,MAAM,gCAMnC,CAAC"}