@justeattakeaway/pie-webc-core
Advanced tools
Comparing version 0.0.0-snapshot-release-20240709100447 to 0.0.0-snapshot-release-20240927094312
# Changelog | ||
## 0.0.0-snapshot-release-20240709100447 | ||
## 0.0.0-snapshot-release-20240927094312 | ||
### Patch Changes | ||
- [Changed] - Suggested package updates for security ([#1953](https://github.com/justeattakeaway/pie/pull/1953)) by [@xander-marjoram](https://github.com/xander-marjoram) | ||
## 0.24.0 | ||
### Minor Changes | ||
@@ -6,0 +12,0 @@ |
@@ -1,25 +0,25 @@ | ||
import { isServer as c } from "lit"; | ||
const a = (t, e, r) => function(s, n) { | ||
const o = `#${n}`; | ||
Object.defineProperty(s, n, { | ||
import { isServer as u } from "lit"; | ||
const d = (t, e, n) => function(s, r) { | ||
const o = `#${r}`; | ||
Object.defineProperty(s, r, { | ||
get() { | ||
return this[o]; | ||
}, | ||
set(u) { | ||
e.includes(u) ? this[o] = u : (console.error( | ||
`<${t}> Invalid value "${u}" provided for property "${n}".`, | ||
set(c) { | ||
e.includes(c) ? this[o] = c : (console.error( | ||
`<${t}> Invalid value "${c}" provided for property "${r}".`, | ||
`Must be one of: ${e.join(" | ")}.`, | ||
`Falling back to default value: "${r}"` | ||
), this[o] = r); | ||
`Falling back to default value: "${n}"` | ||
), this[o] = n); | ||
}, | ||
configurable: !0 | ||
}); | ||
}, d = (t) => function(r, i) { | ||
}, l = (t) => function(n, i) { | ||
const s = `#${i}`; | ||
Object.defineProperty(r, i, { | ||
Object.defineProperty(n, i, { | ||
get() { | ||
return this[s]; | ||
}, | ||
set(n) { | ||
(n == null || typeof n == "string" && n.trim() === "") && console.error(`<${t}> Missing required attribute "${i}"`), this[s] = n; | ||
set(r) { | ||
(r == null || typeof r == "string" && r.trim() === "") && console.error(`<${t}> Missing required attribute "${i}"`), this[s] = r; | ||
}, | ||
@@ -32,3 +32,3 @@ configurable: !0 | ||
} | ||
function m(t) { | ||
function b(t) { | ||
return new CustomEvent(t.type, { | ||
@@ -42,3 +42,3 @@ detail: { | ||
} | ||
function b(t, e, r) { | ||
function h(t, e, n) { | ||
e.startsWith("pie-") || console.warn("A custom event name should start with `pie-`"); | ||
@@ -48,7 +48,7 @@ const i = new CustomEvent(e, { | ||
composed: !0, | ||
detail: r | ||
detail: n | ||
}); | ||
t.dispatchEvent(i); | ||
} | ||
const h = (t) => { | ||
const m = (t) => { | ||
class e extends t { | ||
@@ -65,3 +65,3 @@ /** | ||
get isRTL() { | ||
return this.dir ? this.dir === "rtl" : !c && !this.dir ? document.documentElement.getAttribute("dir") === "rtl" : !1; | ||
return this.dir ? this.dir === "rtl" : !u && !this.dir ? document.documentElement.getAttribute("dir") === "rtl" : !1; | ||
} | ||
@@ -71,21 +71,23 @@ } | ||
}, p = (t) => { | ||
class e extends t { | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
constructor(...i) { | ||
super(...i), this._internals = this.attachInternals(); | ||
} | ||
const n = class n extends t { | ||
get form() { | ||
return this._internals.form; | ||
} | ||
} | ||
return e.formAssociated = !0, e; | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
constructor(...s) { | ||
super(...s), this._internals = this.attachInternals(); | ||
} | ||
}; | ||
n.formAssociated = !0; | ||
let e = n; | ||
return e; | ||
}; | ||
export { | ||
p as FormControlMixin, | ||
h as RtlMixin, | ||
m as RtlMixin, | ||
f as defineCustomElement, | ||
b as dispatchCustomEvent, | ||
d as requiredProperty, | ||
a as validPropertyValues, | ||
m as wrapNativeEvent | ||
h as dispatchCustomEvent, | ||
l as requiredProperty, | ||
d as validPropertyValues, | ||
b as wrapNativeEvent | ||
}; |
{ | ||
"name": "@justeattakeaway/pie-webc-core", | ||
"version": "0.0.0-snapshot-release-20240709100447", | ||
"version": "0.0.0-snapshot-release-20240927094312", | ||
"description": "PIE design system base classes, mixins and utilities for web components", | ||
@@ -21,6 +21,6 @@ "type": "module", | ||
"dependencies": { | ||
"lit": "3.1.3" | ||
"lit": "3.2.0" | ||
}, | ||
"devDependencies": { | ||
"@justeattakeaway/pie-components-config": "0.16.0" | ||
"@justeattakeaway/pie-components-config": "0.18.0" | ||
}, | ||
@@ -27,0 +27,0 @@ "volta": { |
@@ -44,3 +44,3 @@ /* eslint-disable max-classes-per-file */ | ||
* render() { | ||
* return html`<div class="foo" ?isRTL=${this.isRTL}>Content</div>`; | ||
* return html`<div class="foo" ?data-is-rtl=${this.isRTL}>Content</div>`; | ||
* } | ||
@@ -52,5 +52,5 @@ * } | ||
* | ||
* The corresponding SCSS to leverage the `isRTL` attribute: | ||
* The corresponding SCSS to leverage the `data-is-rtl` attribute: | ||
* ```scss | ||
* .foo[isRTL] { | ||
* .foo[data-is-rtl] { | ||
* background-color: red; | ||
@@ -57,0 +57,0 @@ * text-align: right; |
@@ -11,4 +11,5 @@ /** | ||
* interface MyComponentProps { | ||
* a: string; | ||
* a: string; | ||
* b?: number; | ||
* c: boolean; | ||
* } | ||
@@ -18,9 +19,15 @@ * const allProps: ComponentDefaultProps<MyComponentProps> = { | ||
* b: 42, | ||
* c: true, | ||
* }; | ||
* | ||
* const someProps: ComponentDefaultProps<MyComponentProps, 'a'> = { | ||
* const pickProps: ComponentDefaultProps<MyComponentProps, 'a'> = { | ||
* a: 'default value', | ||
* }; | ||
* | ||
* const omitProps: ComponentDefaultProps<MyComponentProps, keyof Omit<MyComponentProps, 'a'>> = { | ||
* b: 42, | ||
* c: true, | ||
* }; | ||
* ``` | ||
*/ | ||
export type ComponentDefaultProps<T, K extends keyof T = keyof T> = Readonly<Required<Pick<T, K>>>; |
Sorry, the diff of this file is not supported yet
47842
916