Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ally-ui/solid

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ally-ui/solid - npm Package Compare versions

Comparing version 0.0.19 to 0.0.20

dist/source/main.jsx

40

dist/cjs/main.js

@@ -91,7 +91,3 @@ 'use strict';

function Slot(slotProps) {
const mergeProps = slotProps.mergeProps ?? ((a, b) => ({ ...a,
...b
})); // `asChild` is never updated dynamically, so an early return here is okay.
// `asChild` is never updated dynamically, so an early return here is okay.
if (slotProps.props.asChild) {

@@ -117,2 +113,36 @@ return web.memo(() => slotProps.props.children(userProps => ({

function mergeProps(slotProps, childProps) {
// All child props should override.
const overrideProps = { ...childProps
};
for (const propName in childProps) {
const slotPropValue = slotProps[propName];
const childPropValue = childProps[propName];
const isHandler = /^on[A-Z]/.test(propName); // If it's a handler, modify the override by composing the base handler.
if (isHandler) {
overrideProps[propName] = (...args) => {
childPropValue?.(...args);
slotPropValue?.(...args);
};
} // If it's `style`, we merge them.
else if (propName === 'style') {
overrideProps[propName] = { ...slotPropValue,
...childPropValue
};
} else if (propName === 'class') {
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(' ');
} else if (propName === 'classList') {
overrideProps[propName] = { ...slotPropValue,
...childPropValue
};
}
}
return { ...slotProps,
...overrideProps
};
}
exports.Slot = Slot;

@@ -119,0 +149,0 @@ exports.combinedRef = combinedRef;

@@ -87,7 +87,3 @@ import { onCleanup, createEffect, untrack, splitProps } from 'solid-js';

function Slot(slotProps) {
const mergeProps = slotProps.mergeProps ?? ((a, b) => ({ ...a,
...b
})); // `asChild` is never updated dynamically, so an early return here is okay.
// `asChild` is never updated dynamically, so an early return here is okay.
if (slotProps.props.asChild) {

@@ -113,3 +109,37 @@ return memo(() => slotProps.props.children(userProps => ({

function mergeProps(slotProps, childProps) {
// All child props should override.
const overrideProps = { ...childProps
};
for (const propName in childProps) {
const slotPropValue = slotProps[propName];
const childPropValue = childProps[propName];
const isHandler = /^on[A-Z]/.test(propName); // If it's a handler, modify the override by composing the base handler.
if (isHandler) {
overrideProps[propName] = (...args) => {
childPropValue?.(...args);
slotPropValue?.(...args);
};
} // If it's `style`, we merge them.
else if (propName === 'style') {
overrideProps[propName] = { ...slotPropValue,
...childPropValue
};
} else if (propName === 'class') {
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(' ');
} else if (propName === 'classList') {
overrideProps[propName] = { ...slotPropValue,
...childPropValue
};
}
}
return { ...slotProps,
...overrideProps
};
}
export { Slot, combinedRef, createBindRef, createDelayedBindRef, createSyncedOption, forwardEvent };
//# sourceMappingURL=main.js.map

@@ -6,3 +6,2 @@ import { splitProps } from 'solid-js';

export function Slot(slotProps) {
const mergeProps = slotProps.mergeProps ?? ((a, b) => ({ ...a, ...b }));
// `asChild` is never updated dynamically, so an early return here is okay.

@@ -29,1 +28,30 @@ if (slotProps.props.asChild) {

}
function mergeProps(slotProps, childProps) {
// All child props should override.
const overrideProps = { ...childProps };
for (const propName in childProps) {
const slotPropValue = slotProps[propName];
const childPropValue = childProps[propName];
const isHandler = /^on[A-Z]/.test(propName);
// If it's a handler, modify the override by composing the base handler.
if (isHandler) {
overrideProps[propName] = (...args) => {
childPropValue?.(...args);
slotPropValue?.(...args);
};
}
// If it's `style`, we merge them.
else if (propName === 'style') {
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
}
else if (propName === 'class') {
overrideProps[propName] = [slotPropValue, childPropValue]
.filter(Boolean)
.join(' ');
}
else if (propName === 'classList') {
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
}
}
return { ...slotProps, ...overrideProps };
}

6

dist/types/Slot.solid.d.ts

@@ -47,8 +47,2 @@ import { Accessor, JSX, ParentProps } from 'solid-js';

children: (props: RegularRenderProp<TAttributes>) => JSX.Element;
/**
* How attributes should be merged with user props.
*
* Defaults to merging user props **over** attributes.
*/
mergeProps?: (attributes: TAttributes, userProps: TRegularProps) => TRegularProps;
}

@@ -55,0 +49,0 @@ /**

{
"name": "@ally-ui/solid",
"version": "0.0.19",
"version": "0.0.20",
"scripts": {

@@ -29,3 +29,3 @@ "example": "vite",

".": {
"solid": "./dist/source/main.js",
"solid": "./dist/source/main.jsx",
"import": "./dist/esm/main.js",

@@ -40,3 +40,3 @@ "require": "./dist/cjs/main.js"

},
"gitHead": "e054ec991dade6ac231147744ff4a6a8b214175b"
"gitHead": "7333c399ccb0f74f93baad914ccec56adcfa68f0"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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