pixel-react 1.14.82 → 1.14.84

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.
Files changed (32) hide show
  1. package/lib/assets/icons/apps_icon.svg.js +6 -0
  2. package/lib/assets/icons/apps_icon.svg.js.map +1 -0
  3. package/lib/assets/icons/home_icon.svg.js +6 -0
  4. package/lib/assets/icons/home_icon.svg.js.map +1 -0
  5. package/lib/components/Charts/BarChart/BarChart.js +38 -8
  6. package/lib/components/Charts/BarChart/BarChart.js.map +1 -1
  7. package/lib/components/CreateVariable/CreateVariableSlider.js +25 -7
  8. package/lib/components/CreateVariable/CreateVariableSlider.js.map +1 -1
  9. package/lib/components/CreateVariable/types.d.ts +4 -0
  10. package/lib/components/Excel/ExcelToolBar/ExcelToolBar.js +8 -8
  11. package/lib/components/Excel/ExcelToolBar/ExcelToolBar.js.map +1 -1
  12. package/lib/components/Icon/iconList.js +4 -0
  13. package/lib/components/Icon/iconList.js.map +1 -1
  14. package/lib/components/IconButton/IconButton.js +5 -1
  15. package/lib/components/IconButton/IconButton.js.map +1 -1
  16. package/lib/components/IconButton/types.d.ts +1 -0
  17. package/lib/components/MultiSelect/Dropdown.js +2 -1
  18. package/lib/components/MultiSelect/Dropdown.js.map +1 -1
  19. package/lib/components/MultiSelect/MultiSelect.js +1 -1
  20. package/lib/components/MultiSelect/MultiSelect.js.map +1 -1
  21. package/lib/index.cjs +109 -27
  22. package/lib/index.cjs.map +1 -1
  23. package/lib/index.d.ts +6 -0
  24. package/lib/node_modules/js-beautify/js/src/css/beautifier.js +1 -1
  25. package/lib/node_modules/js-beautify/js/src/html/beautifier.js +1 -1
  26. package/lib/node_modules/js-beautify/js/src/javascript/beautifier.js +1 -1
  27. package/lib/styles.css +1 -1
  28. package/lib/styles.css.map +1 -1
  29. package/lib/utils/debounce/debounce.d.ts +1 -0
  30. package/lib/utils/debounce/debounce.js +24 -1
  31. package/lib/utils/debounce/debounce.js.map +1 -1
  32. package/package.json +1 -1
@@ -1,6 +1,7 @@
1
1
  type Callback = (...args: any[]) => void;
2
2
  export interface DebouncedFunction extends Function {
3
3
  cancel: () => void;
4
+ flush: () => void;
4
5
  }
5
6
  export declare const debounce: (func: Callback, delay: number) => DebouncedFunction;
6
7
  export {};
@@ -1,17 +1,40 @@
1
1
  const debounce = (func, delay) => {
2
2
  let timeoutId = null;
3
+ let lastArgs = null;
4
+ let lastThis;
3
5
  const debounced = function (...args) {
4
6
  // Clear the previous timeout if it exists
5
7
  if (timeoutId) clearTimeout(timeoutId);
8
+ lastArgs = args;
9
+ lastThis = this;
6
10
  // Set a new timeout
7
11
  timeoutId = setTimeout(() => {
8
- func.apply(this, args);
12
+ if (lastArgs) {
13
+ func.apply(lastThis, lastArgs);
14
+ lastArgs = null;
15
+ lastThis = null;
16
+ }
17
+ timeoutId = null;
9
18
  }, delay);
10
19
  };
11
20
  // Method to cancel the debounced function
12
21
  debounced.cancel = () => {
13
22
  if (timeoutId) clearTimeout(timeoutId);
14
23
  timeoutId = null;
24
+ lastArgs = null;
25
+ lastThis = null;
26
+ };
27
+ // Method to flush the debounced function without waiting for delay
28
+ debounced.flush = () => {
29
+ if (timeoutId) {
30
+ clearTimeout(timeoutId);
31
+ if (lastArgs) {
32
+ func.apply(lastThis, lastArgs);
33
+ lastArgs = null;
34
+ lastThis = null;
35
+ }
36
+ timeoutId = null;
37
+ }
15
38
  };
16
39
  return debounced;
17
40
  };
@@ -1 +1 @@
1
- {"version":3,"file":"debounce.js","sources":["../../../src/utils/debounce/debounce.ts"],"sourcesContent":[null],"names":["debounce","func","delay","timeoutId","debounced","args","clearTimeout","setTimeout","apply","cancel"],"mappings":"MAOaA,QAAQ,GAAGA,CAACC,IAAc,EAAEC,KAAa,KAAuB;EAC3E,IAAIC,SAAS,GAAyC,IAAI;AAE1D,EAAA,MAAMC,SAAS,GAAsB,UAAqB,GAAGC,IAAW,EAAA;AACtE;AACA,IAAA,IAAIF,SAAS,EAAEG,YAAY,CAACH,SAAS,CAAC;AAEtC;IACAA,SAAS,GAAGI,UAAU,CAAC,MAAK;AAC1BN,MAAAA,IAAI,CAACO,KAAK,CAAC,IAAI,EAAEH,IAAI,CAAC;IACxB,CAAC,EAAEH,KAAK,CAAC;EACX,CAAC;AAED;EACAE,SAAS,CAACK,MAAM,GAAG,MAAK;AACtB,IAAA,IAAIN,SAAS,EAAEG,YAAY,CAACH,SAAS,CAAC;AACtCA,IAAAA,SAAS,GAAG,IAAI;EAClB,CAAC;AAED,EAAA,OAAOC,SAAS;AAClB;;;;"}
1
+ {"version":3,"file":"debounce.js","sources":["../../../src/utils/debounce/debounce.ts"],"sourcesContent":[null],"names":["debounce","func","delay","timeoutId","lastArgs","lastThis","debounced","args","clearTimeout","setTimeout","apply","cancel","flush"],"mappings":"MAQaA,QAAQ,GAAGA,CAACC,IAAc,EAAEC,KAAa,KAAuB;EAC3E,IAAIC,SAAS,GAAyC,IAAI;EAC1D,IAAIC,QAAQ,GAAiB,IAAI;AACjC,EAAA,IAAIC,QAAa;AAEjB,EAAA,MAAMC,SAAS,GAAsB,UAAqB,GAAGC,IAAW,EAAA;AACtE;AACA,IAAA,IAAIJ,SAAS,EAAEK,YAAY,CAACL,SAAS,CAAC;AAEtCC,IAAAA,QAAQ,GAAGG,IAAI;AACfF,IAAAA,QAAQ,GAAG,IAAI;AAEf;IACAF,SAAS,GAAGM,UAAU,CAAC,MAAK;AAC1B,MAAA,IAAIL,QAAQ,EAAE;AACZH,QAAAA,IAAI,CAACS,KAAK,CAACL,QAAQ,EAAED,QAAQ,CAAC;AAC9BA,QAAAA,QAAQ,GAAG,IAAI;AACfC,QAAAA,QAAQ,GAAG,IAAI;AACjB,MAAA;AACAF,MAAAA,SAAS,GAAG,IAAI;IAClB,CAAC,EAAED,KAAK,CAAC;EACX,CAAC;AAED;EACAI,SAAS,CAACK,MAAM,GAAG,MAAK;AACtB,IAAA,IAAIR,SAAS,EAAEK,YAAY,CAACL,SAAS,CAAC;AACtCA,IAAAA,SAAS,GAAG,IAAI;AAChBC,IAAAA,QAAQ,GAAG,IAAI;AACfC,IAAAA,QAAQ,GAAG,IAAI;EACjB,CAAC;AAED;EACAC,SAAS,CAACM,KAAK,GAAG,MAAK;AACrB,IAAA,IAAIT,SAAS,EAAE;MACbK,YAAY,CAACL,SAAS,CAAC;AACvB,MAAA,IAAIC,QAAQ,EAAE;AACZH,QAAAA,IAAI,CAACS,KAAK,CAACL,QAAQ,EAAED,QAAQ,CAAC;AAC9BA,QAAAA,QAAQ,GAAG,IAAI;AACfC,QAAAA,QAAQ,GAAG,IAAI;AACjB,MAAA;AACAF,MAAAA,SAAS,GAAG,IAAI;AAClB,IAAA;EACF,CAAC;AAED,EAAA,OAAOG,SAAS;AAClB;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pixel-react",
3
3
  "description": "Great for pixel-perfect, design-focused components in React",
4
- "version": "1.14.82",
4
+ "version": "1.14.84",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "lib/index.js",
7
7
  "types": "lib/index.d.ts",