New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@formsort/custom-question-api

Package Overview
Dependencies
Maintainers
4
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@formsort/custom-question-api - npm Package Compare versions

Comparing version 0.0.25 to 0.0.26

2

lib/index.d.ts
import { AnswerSemanticType } from '@formsort/constants';
declare type AnswerPrimitiveType = number | string | boolean | object;
declare type AnswerType = AnswerPrimitiveType | AnswerPrimitiveType[];
export declare const setQuestionSize: (width?: number | undefined, height?: number | undefined) => void;
export declare const setQuestionSize: (width?: string | number | undefined, height?: string | number | undefined) => void;
export declare const getAnswerValue: <T extends AnswerType = AnswerType>() => Promise<T | undefined>;

@@ -6,0 +6,0 @@ export declare const getSemanticAnswerValue: <T extends AnswerType = AnswerType>(semanticType: AnswerSemanticType) => Promise<T>;

{
"name": "@formsort/custom-question-api",
"version": "0.0.25",
"version": "0.0.26",
"description": "Helpers for implementing custom questions in Formsort",

@@ -52,3 +52,3 @@ "main": "lib/index.js",

},
"gitHead": "a7b0156bbc2ce661ad75fa222c7edcc40942fa26"
"gitHead": "14006a50f2caa887d0fdb9b95eeb4edbebe1d216"
}

@@ -106,9 +106,11 @@ # @formsort/custom-question-api

```tsx
setQuestionSize(width?: number, height?: number) => void
setQuestionSize(width?: number | string, height?: number | string) => void
```
Sets the width and height of the question within Formsort.
Sets the width and height of the question within Formsort. The default unit of measurement when passing a number is pixels (px). A different unit of measurement can be passed as a string.
For example, `'2em'` or `'100%'`.
To avoid jumpiness, if you know the size of your component beforehand, it's best to set the default width and height within the custom question directly within the Formsort studio. Use `setQuestionSize` when you do not know the dimensions of your question component beforehand, and want to make sure that Formsort gives it enough size to render without scrollbars.
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:

@@ -115,0 +117,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc