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

@justeattakeaway/pie-webc-core

Package Overview
Dependencies
Maintainers
13
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@justeattakeaway/pie-webc-core - npm Package Compare versions

Comparing version 0.0.0-snapshot-release-20240209112948 to 0.0.0-snapshot-release-20240321141351

src/functions/dispatchCustomEvent.ts

20

CHANGELOG.md
# Changelog
## 0.0.0-snapshot-release-20240209112948
## 0.0.0-snapshot-release-20240321141351
### Minor Changes
- [Changed] - Update tsconfig target to es2021 ([#1341](https://github.com/justeattakeaway/pie/pull/1341)) by [@jamieomaguire](https://github.com/jamieomaguire)
## 0.19.1
### Patch Changes
- [Changed] - Updated lit to `3.1.2` ([#1300](https://github.com/justeattakeaway/pie/pull/1300)) by [@renovate](https://github.com/apps/renovate)
## 0.19.0
### Minor Changes
- [Added] - dispatchCustomEvent helper function. ([#1272](https://github.com/justeattakeaway/pie/pull/1272)) by [@dandel10n](https://github.com/dandel10n)
## 0.18.0
### Minor Changes
- [Added] - PIEInputElement interface ([#1257](https://github.com/justeattakeaway/pie/pull/1257)) by [@fernandofranca](https://github.com/fernandofranca)

@@ -8,0 +26,0 @@

74

dist/index.js

@@ -1,25 +0,25 @@

import { isServer as l } from "lit";
const a = (e, t, n) => function(o, r) {
const s = `#${r}`;
Object.defineProperty(o, r, {
import { isServer as c } from "lit";
const a = (t, e, r) => function(s, n) {
const o = `#${n}`;
Object.defineProperty(s, n, {
get() {
return this[s];
return this[o];
},
set(c) {
t.includes(c) ? this[s] = c : (console.error(
`<${e}> Invalid value "${c}" provided for property "${r}".`,
`Must be one of: ${t.join(" | ")}.`,
`Falling back to default value: "${n}"`
), this[s] = n);
set(u) {
e.includes(u) ? this[o] = u : (console.error(
`<${t}> Invalid value "${u}" provided for property "${n}".`,
`Must be one of: ${e.join(" | ")}.`,
`Falling back to default value: "${r}"`
), this[o] = r);
},
configurable: !0
});
}, d = (e) => function(n, i) {
const o = `#${i}`;
Object.defineProperty(n, i, {
}, d = (t) => function(r, i) {
const s = `#${i}`;
Object.defineProperty(r, i, {
get() {
return this[o];
return this[s];
},
set(r) {
(r == null || typeof r == "string" && r.trim() === "") && console.error(`<${e}> Missing required attribute "${i}"`), this[o] = r;
set(n) {
(n == null || typeof n == "string" && n.trim() === "") && console.error(`<${t}> Missing required attribute "${i}"`), this[s] = n;
},

@@ -29,16 +29,25 @@ configurable: !0

};
function f(e, t) {
customElements.get(e) ? console.warn(`PIE Web Component: "${e}" has already been defined. Please ensure the component is only being defined once in your application.`) : customElements.define(e, t);
function f(t, e) {
customElements.get(t) ? console.warn(`PIE Web Component: "${t}" has already been defined. Please ensure the component is only being defined once in your application.`) : customElements.define(t, e);
}
function m(e) {
return new CustomEvent(e.type, {
function m(t) {
return new CustomEvent(t.type, {
detail: {
sourceEvent: e
sourceEvent: t
},
bubbles: e.bubbles,
cancelable: e.cancelable
bubbles: t.bubbles,
cancelable: t.cancelable
});
}
const b = (e) => {
class t extends e {
function b(t, e, r) {
e.startsWith("pie-") || console.warn("A custom event name should start with `pie-`");
const i = new CustomEvent(e, {
bubbles: !0,
composed: !0,
detail: r
});
t.dispatchEvent(i);
}
const h = (t) => {
class e extends t {
/**

@@ -54,8 +63,8 @@ * A getter to determine whether the text direction is right-to-left (RTL).

get isRTL() {
return this.dir ? this.dir === "rtl" : !l && !this.dir ? document.documentElement.getAttribute("dir") === "rtl" : !1;
return this.dir ? this.dir === "rtl" : !c && !this.dir ? document.documentElement.getAttribute("dir") === "rtl" : !1;
}
}
return t;
}, p = (e) => {
class t extends e {
return e;
}, p = (t) => {
class e extends t {
// eslint-disable-next-line @typescript-eslint/no-explicit-any

@@ -69,8 +78,9 @@ constructor(...i) {

}
return t.formAssociated = !0, t;
return e.formAssociated = !0, e;
};
export {
p as FormControlMixin,
b as RtlMixin,
h as RtlMixin,
f as defineCustomElement,
b as dispatchCustomEvent,
d as requiredProperty,

@@ -77,0 +87,0 @@ a as validPropertyValues,

{
"name": "@justeattakeaway/pie-webc-core",
"version": "0.0.0-snapshot-release-20240209112948",
"version": "0.0.0-snapshot-release-20240321141351",
"description": "PIE design system base classes, mixins and utilities for web components",

@@ -15,2 +15,3 @@ "type": "module",

"test:ci": "yarn test",
"test:browsers-setup": "npx playwright-lit-setup",
"test:browsers": "npx playwright test -c ./playwright-lit.config.ts",

@@ -21,6 +22,6 @@ "test:browsers:ci": "yarn test:browsers",

"dependencies": {
"lit": "3.1.1"
"lit": "3.1.2"
},
"devDependencies": {
"@justeattakeaway/pie-components-config": "0.11.0"
"@justeattakeaway/pie-components-config": "0.0.0-snapshot-release-20240321141351"
},

@@ -27,0 +28,0 @@ "volta": {

export * from './defineCustomElement';
export * from './wrapNativeEvent';
export * from './dispatchCustomEvent';

@@ -21,3 +21,3 @@ import { defineConfig } from 'vite';

'**/test/{accessibility,component,system,visual}/*.spec.{js,ts}',
'**/test/mixins/**/*.browser.spec.{js,ts}',
'**/test/**/*.browser.spec.{js,ts}',
'**/node_modules/**/*'

@@ -24,0 +24,0 @@ ],

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