@justeattakeaway/pie-button 0.12.1 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,KAAK,CAAC;AAMlD,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAGlE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC;AAEpD,qBACa,SAAU,SAAQ,UAAU;IAGjC,IAAI,EAAG,WAAW,CAAsB;IAIxC,IAAI,EAAG,WAAW,CAAsB;IAIxC,OAAO,EAAG,cAAc,CAA0B;IAGlD,QAAQ,UAAS;IAGjB,WAAW,UAAS;IAExB,MAAM;IAwBN,MAAM,CAAC,MAAM,0BAAqB;CACrC;AAED,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,YAAY,EAAE,SAAS,CAAC;KAC3B;CACJ"}
package/src/decorators.ts DELETED
@@ -1,34 +0,0 @@
1
- /**
2
- * A decorator for specifying a list of valid values for a property.
3
- * If this property's setter is called with an invalid value, an error is logged and the default value will be assigned instead.
4
- * @param validValues - The array of valid values
5
- * @param defaultValue - The value to fall back on
6
- * @returns
7
- */
8
- export const validPropertyValues = (validValues: any[], defaultValue: any) => {
9
- return function (target: any, propertyKey: string) : void {
10
- const privatePropertyKey = `#${propertyKey}`;
11
-
12
- Object.defineProperty(target, propertyKey, {
13
- get () : any {
14
- return this[privatePropertyKey];
15
- },
16
- set (value: any) : void {
17
- const oldValue = this[privatePropertyKey];
18
-
19
- if (!validValues.includes(value)) {
20
- console.error(
21
- `[pie-button] Invalid value "${value}" provided for property "${propertyKey}".`,
22
- `Must be one of: ${validValues.join(' | ')}.`,
23
- `Falling back to default value: "${defaultValue}"`
24
- );
25
- this[privatePropertyKey] = defaultValue;
26
- } else {
27
- this[privatePropertyKey] = value;
28
- }
29
-
30
- this.requestUpdate(propertyKey, oldValue);
31
- }
32
- });
33
- }
34
- };
package/vite.config.js DELETED
@@ -1,21 +0,0 @@
1
- /* eslint-disable import/no-extraneous-dependencies */
2
- import { defineConfig } from 'vite';
3
- import dts from 'vite-plugin-dts';
4
-
5
- // https://vitejs.dev/config/
6
- export default defineConfig({
7
- build: {
8
- lib: {
9
- entry: 'src/index.ts',
10
- fileName: 'index',
11
- formats: ['es'],
12
- },
13
- rollupOptions: {
14
- external: /^lit/,
15
- },
16
- },
17
- plugins: [dts({
18
- insertTypesEntry: true,
19
- outputDir: 'dist/types',
20
- })],
21
- });