@formsort/custom-question-api
Advanced tools
Comparing version 0.1.1 to 0.2.1
# CHANGELOG | ||
## 0.2.1 | ||
### Various fixes & improvements | ||
- FLOW-370: set disable back navigation in custom question api (#95) by @alikirec | ||
## 0.1.1 | ||
@@ -3,0 +9,0 @@ |
@@ -13,1 +13,6 @@ import { AnswerSemanticType } from '@formsort/constants'; | ||
export declare const setAnswerValue: (value: AnswerType) => void; | ||
interface IDisableBackNavigationOptions { | ||
beforeUnloadMessage?: string; | ||
} | ||
export declare const setDisableBackNavigation: (disable: boolean, options?: IDisableBackNavigationOptions | undefined) => void; | ||
export {}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.setAnswerValue = exports.clearAnswerValue = exports.getResponderUuid = exports.getAllAnswerValues = exports.getSemanticAnswerValue = exports.getAnswerValue = exports.setQuestionSize = void 0; | ||
exports.setDisableBackNavigation = exports.setAnswerValue = exports.clearAnswerValue = exports.getResponderUuid = exports.getAllAnswerValues = exports.getSemanticAnswerValue = exports.getAnswerValue = exports.setQuestionSize = void 0; | ||
const constants_1 = require("@formsort/constants"); | ||
@@ -29,1 +29,8 @@ const utils_1 = require("./utils"); | ||
exports.setAnswerValue = setAnswerValue; | ||
const setDisableBackNavigation = (disable, options) => { | ||
(0, utils_1.sendMessageToWindowParent)(constants_1.CustomQuestionMessage.SET_DISABLE_BACK_NAVIGATION_MSG, { | ||
disable, | ||
beforeUnloadMessage: options === null || options === void 0 ? void 0 : options.beforeUnloadMessage, | ||
}); | ||
}; | ||
exports.setDisableBackNavigation = setDisableBackNavigation; |
{ | ||
"name": "@formsort/custom-question-api", | ||
"version": "0.1.1", | ||
"version": "0.2.1", | ||
"description": "Helpers for implementing custom questions in Formsort", | ||
@@ -49,5 +49,5 @@ "publishConfig": { | ||
"dependencies": { | ||
"@formsort/constants": "^1.7.0", | ||
"@formsort/constants": "^1.8.0", | ||
"events": "^3.2.0" | ||
} | ||
} |
@@ -112,2 +112,8 @@ # @formsort/custom-question-api | ||
```tsx | ||
setDisableBackNavigation(disable: boolean, options?: { beforeUnloadMessage?: string }) => void; | ||
``` | ||
Disable/enable back navigation in parent form. If you want to prompt a message when user clicks on browser's back button, like [`window.confirm`](https://developer.mozilla.org/en-US/docs/Web/API/Window/confirm), you can set `beforeUnloadMessage`. | ||
```tsx | ||
setQuestionSize(width?: number | string, height?: number | string) => void | ||
@@ -121,3 +127,2 @@ ``` | ||
For example, if you implement your custom question as a React component, you may want to measure the component once it's rendered and tell Formsort its height and width: | ||
@@ -124,0 +129,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
15677
125
178
0
Updated@formsort/constants@^1.8.0