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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@penta-b/attributes-compare-customfield

v1.3.2

Published

Attributes Compare custom field for Editing Plugin smart forms: compares configured attributes across configured sources and shows Matched/Different statuses live.

Readme

Attributes Compare Custom Field

A Penta-b MNA smart-forms custom field (attributes-compare-customfield) for Editing Plugin forms. It compares the value of each admin-configured attribute across two or more admin-configured sources (for example Card, Register, Field Visit), shows a Matched / Different status per attribute, a compact summary of how many attributes differ, and saves the comparison result into the form data under the field's mnaKey. Recalculates live as the user edits any configured source field. Optionally blocks form submission while differences exist.

Designer configuration

| Setting | Type | Meaning | | --- | --- | --- | | mnaKey | mnaKey | Key the comparison result is saved under. | | sources | grid (repeatable rows) | The authoritative sources list: Source id (stable internal id, e.g. card) and Source label (column header). Row order = column order. Minimum two rows. | | attributeMappings | grid (repeatable rows) | One row per (attribute, source) pair: Attribute (text), Source id (must match a declared source), Field (dropdown listing the form's fields). | | blockSubmitOnDifference | checkbox | When enabled, submission is blocked while at least one attribute is Different. Default off. | | classname | text | CSS class name, default penta-r12. |

The Field cell is a dropdown populated with the fields available in the form (any Wizard/Tabs/Group nesting) — the admin picks a field instead of typing its key. Source identity and column order come only from the sources grid: a mapping row referencing an undeclared source id is reported as a configuration error instead of silently creating an extra column, and renaming a source label never re-keys saved results.

Example:

sources

| Source id | Source label | | --- | --- | | card | Card | | register | Register |

attributeMappings

| Attribute | Source id | Field | | --- | --- | --- | | Crop Type | card | cardCropType | | Crop Type | register | registerCropType | | Irrigation | card | cardIrrigation | | Irrigation | register | registerIrrigation |

A missing or empty value in any source makes the attribute Different. A selected field that no longer exists in the form shows a clear per-cell message (FR-12). If the same field key exists at several locations in the form data, the first match is used and the conflicting paths are logged to the browser console (nothing is shown to the end user).

Saved value shape

values is keyed by the stable source id:

{
	"summary": { "total": 3, "differentCount": 2, "hasDifferences": true },
	"attributes": [
		{ "label": "Crop Type", "status": "DIFFERENT", "values": { "card": "Wheat", "register": "Corn" } }
	]
}

Installing as an npm package

The package ships the prebuilt UMD bundle (dist/build/attributes-compare-customfield.js) as its entry point. Importing it registers the field with the smart-forms loader as a side effect:

import "attributes-compare-customfield";

react, react-dom, redux, react-redux, @penta-b/ma-lib and @penta-b/mna-penta-smart-forms are peer dependencies — the host application must provide them (they are marked as webpack externals and are not bundled).

To test locally without publishing:

npm run build
npm pack                          # produces attributes-compare-customfield-1.0.0.tgz
npm install ../attributes-compare-customfield-1.0.0.tgz   # from the consuming app

To publish (runs the build automatically via prepublishOnly):

npm publish

Development

  • npm run dev — dev server on port 3003 (http://localhost:3003/attributes-compare-customfield.js).
  • npm run prod — UMD bundle to dist/build/attributes-compare-customfield.js.
  • npm run storybook — Storybook on port 6006.