npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

spform-field-wrapper

v1.0.9

Published

Package to work with SharePoint classic form fields

Readme

SP-Form-Field-Wrapper

Summary

The SPForm-Field-Wrapper module provides a simple interface for managing fields of classic SharePoint forms. For example, reading, setting field values, determining their type, hiding, showing, blocking, adding handlers etc. Helps to build more complex components to customize SP forms, for example: autocomple url/text fields by another sp list items or external service, setting "Title" field by another form fields, extended lookups, custom forms etc.

Installation

npm install spform-field-wrapper --save

Usage

Importing

import { FormFieldWrappersManager } from 'spform-field-wrapper';
import { FormFieldWrapper } from 'spform-field-wrapper';

Getting started

Create instance of FormFieldWrappersManager class

const ffwManager = FormFieldWrappersManager.getInstance();

Get field from html form

const fieldWrapper = ffwManager.getField(fieldDispalayName);

Get field value

let fieldValue = fieldWrapper.value;

Set field value

fieldWrapper.value = "some value";

Check field type

fieldWrapper.fieldType == "SPFieldDateTime"

Available public methods

Class FormFieldWrappersManager

| Method | Description | | --------- | ----------- | |getInstance()| static method, gets instance of FormFieldWrappersManager class | |getField()| gets field wrapper form html SP form | |allFieldsWrappers()| gets all field wrapper form html SP form | |resetCache()| all field wrappers are cached, this method reinitialized this cache |

Class FormFieldWrapper

| Fields/properties | Description | | --------- | ----------- | |fieldName| field DisplayName | |fieldInternalName| field InternalName | |fieldType| field Type, ex. SPFieldDateTime | |fieldElement| field html node with input element | |required| field to dynamically set required flag for interactive checks | |value| property to set or get field value |

Each field type can have own methods implementations depending on field type.

| Method | Description | | --------- | ----------- | |getValue()| same as value | |setValue()| same as value | |getValueDispForm()| get value from Display Form | |toString()| converts field value to string depending of field type specific | |getFieldType()| get field type | |getType(fieldElement: Element)| static method for getting field type | |hide(selector: string)| hides closest "selector" to fieldWrapper.fieldElement.parentNode | |show(selector: string)| shows closest "selector" to fieldWrapper.fieldElement.parentNode | |disable(selector = "[title]")| disables closest selector to fieldWrapper.fieldElement | |enables(selector = "[title]")| enables closest selector to fieldWrapper.fieldElement | |disableWithStyle()| additionally to disabling adds transparent styling | |enableWithStyle()| enables element disabled by disableWithStyle | |addEventListener()| adds ement listener to fieldWrapper.fieldElement.firstElementChild | |constructor(fieldTitle: string)| gets field wrapper instance by class constructor |

Supported field types

  1. SPFieldText
  2. SPFieldChoice
  3. SPFieldMultiChoice
  4. SPFieldBoolean
  5. SPFieldNumber
  6. SPFieldDateTime
  7. SPFieldURL
  8. SPFieldUser
  9. SPFieldUserMulti
  10. SPFieldLookup
  11. SPFieldLookupMulti
  12. SPFieldFilteredLookupField
  13. SPFieldNote
  14. SPFieldCurrency
  15. SPFieldCalculated
  16. CustomFieldData (virtual field manually added to html form, value can be any html code)