@dvrd/dvr-controls 0.0.30 → 0.0.31

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dvrd/dvr-controls",
3
- "version": "0.0.30",
3
+ "version": "0.0.31",
4
4
  "description": "Custom web controls",
5
5
  "main": "index.ts",
6
6
  "scripts": {},
@@ -31,6 +31,7 @@ interface Props {
31
31
  wholeNumbers: boolean;
32
32
  asNumber?: boolean;
33
33
  asCurrency: boolean;
34
+ autoSelect?: boolean;
34
35
  }
35
36
 
36
37
  export default class DvrdNumberInput extends PureComponent<Props> {
@@ -156,14 +156,11 @@ export const copyClipboard = (text: string): Promise<void> => {
156
156
  return window.navigator.clipboard.writeText(text);
157
157
  }
158
158
 
159
- export const getImg = (imgName: string, fallbackExtension: string = 'png'): string => {
160
- const webpSupported = webpIsSupported(), extension = webpSupported ? 'webp' : fallbackExtension;
159
+ export function webpSupported(): boolean {
161
160
  try {
162
- return require(`../../res/img/${imgName}.${extension}`).default;
161
+ return document.createElement('canvas').toDataURL('image/webp')
162
+ .indexOf('data:image/webp') === 0;
163
163
  } catch {
164
- return require(`../../res/img/${imgName}.${fallbackExtension}`).default;
164
+ return false;
165
165
  }
166
- };
167
-
168
- const webpIsSupported = (): boolean => document.createElement('canvas').toDataURL('image/webp')
169
- .indexOf('data:image/webp') === 0;
166
+ }