react-hook-core 0.2.9 → 0.3.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/core.js CHANGED
@@ -133,8 +133,8 @@ function initForm(form, initMat) {
133
133
  }
134
134
  exports.initForm = initForm;
135
135
  function error(err, gv, ae) {
136
- var title = gv('error');
137
- var msg = gv('error_internal');
136
+ var title = getString('error', gv);
137
+ var msg = getString('error_internal', gv);
138
138
  if (!err) {
139
139
  ae(msg, undefined, title);
140
140
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-hook-core",
3
- "version": "0.2.9",
3
+ "version": "0.3.0",
4
4
  "description": "react",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./src/index.ts",
package/src/core.ts CHANGED
@@ -395,9 +395,9 @@ export function initForm(form?: HTMLFormElement, initMat?: (f: HTMLFormElement)
395
395
  }
396
396
  return form;
397
397
  }
398
- export function error(err: any, gv: (key: string) => string, ae: (msg: string, callback?: () => void, header?: string) => void) {
399
- const title = gv('error');
400
- let msg = gv('error_internal');
398
+ export function error(err: any, gv: StringMap | ((key: string) => string), ae: (msg: string, callback?: () => void, header?: string) => void) {
399
+ const title = getString('error', gv);
400
+ let msg = getString('error_internal', gv);
401
401
  if (!err) {
402
402
  ae(msg, undefined, title);
403
403
  return;
package/src/input.ts CHANGED
@@ -49,9 +49,9 @@ export function getMsgFunc(p: ResourceService|ShowMessageInput, showMsg?: (msg:
49
49
  return (p as any).showMessage;
50
50
  }
51
51
  interface ConfirmInput {
52
- confirm: (m2: string, header: string, yesCallback?: () => void, btnLeftText?: string, btnRightText?: string, noCallback?: () => void) => void;
52
+ confirm: (m2: string, yesCallback?: () => void, header?: string, btnLeftText?: string, btnRightText?: string, noCallback?: () => void) => void;
53
53
  }
54
- export function getConfirmFunc(p: ResourceService|ConfirmInput, cf?: (m2: string, header: string, yesCallback?: () => void, btnLeftText?: string, btnRightText?: string, noCallback?: () => void) => void): (m2: string, header: string, yesCallback?: () => void, btnLeftText?: string, btnRightText?: string, noCallback?: () => void) => void {
54
+ export function getConfirmFunc(p: ResourceService|ConfirmInput, cf?: (m2: string, yesCallback?: () => void, header?: string, btnLeftText?: string, btnRightText?: string, noCallback?: () => void) => void): (m2: string, yesCallback?: () => void, header?: string, btnLeftText?: string, btnRightText?: string, noCallback?: () => void) => void {
55
55
  if (cf) {
56
56
  return cf;
57
57
  }
@@ -67,9 +67,9 @@ export function getLocaleFunc(p: ResourceService|GetLocaleInput, getLoc?: () =>
67
67
  return (p as any).getLocale;
68
68
  }
69
69
  interface ShowErrorInput {
70
- showError: (m: string, header?: string, detail?: string, callback?: () => void) => void;
70
+ showError: (m: string, callback?: () => void, header?: string) => void;
71
71
  }
72
- export function getErrorFunc(p: ResourceService|ShowErrorInput, showErr?: (m: string, header?: string, detail?: string, callback?: () => void) => void): (m: string, header?: string, detail?: string, callback?: () => void) => void {
72
+ export function getErrorFunc(p: ResourceService|ShowErrorInput, showErr?: (m: string, callback?: () => void, header?: string) => void): (m: string, callback?: () => void, header?: string) => void {
73
73
  if (showErr) {
74
74
  return showErr;
75
75
  }