GithubHelp home page GithubHelp logo

coreui-utils's People

Contributors

dependabot[bot] avatar mrholek avatar woothu avatar xidedix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

coreui-utils's Issues

Error after upgrading from v1.3.1 to v2.0.0

Could you please advise on this as I am getting below error when I try to upgrade from v1.3.1 to v2.0.0.

ERROR in node_modules/@coreui/utils/src/deepObjectsMerge.ts:11:9
TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{}'.
  No index signature with a parameter of type 'string' was found on type '{}'.
     9 |   // Iterate through `source` properties and if an `Object` set property to merge of `target` and `source` properties
    10 |   for (const key of Object.keys(source)) {
  > 11 |     if (source[key] instanceof Object) {
       |         ^^^^^^^^^^^
    12 |       Object.assign(source[key], deepObjectsMerge(target[key], source[key]))
    13 |     }
    14 |   }

ERROR in node_modules/@coreui/utils/src/deepObjectsMerge.ts:12:21
TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{}'.
  No index signature with a parameter of type 'string' was found on type '{}'.
    10 |   for (const key of Object.keys(source)) {
    11 |     if (source[key] instanceof Object) {
  > 12 |       Object.assign(source[key], deepObjectsMerge(target[key], source[key]))
       |                     ^^^^^^^^^^^
    13 |     }
    14 |   }
    15 |

ERROR in node_modules/@coreui/utils/src/deepObjectsMerge.ts:12:51
TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{}'.
  No index signature with a parameter of type 'string' was found on type '{}'.
    10 |   for (const key of Object.keys(source)) {
    11 |     if (source[key] instanceof Object) {
  > 12 |       Object.assign(source[key], deepObjectsMerge(target[key], source[key]))
       |                                                   ^^^^^^^^^^^
    13 |     }
    14 |   }
    15 |

ERROR in node_modules/@coreui/utils/src/deepObjectsMerge.ts:12:64
TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{}'.
  No index signature with a parameter of type 'string' was found on type '{}'.
    10 |   for (const key of Object.keys(source)) {
    11 |     if (source[key] instanceof Object) {
  > 12 |       Object.assign(source[key], deepObjectsMerge(target[key], source[key]))
       |                                                                ^^^^^^^^^^^
    13 |     }
    14 |   }
    15 |

ERROR in node_modules/@coreui/utils/src/omitByKeys.ts:12:36
TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{}'.
  No index signature with a parameter of type 'string' was found on type '{}'.
    10 |   const objKeys = Object.keys(originalObject)
    11 |   for (let i = 0; i < objKeys.length; i++) {
  > 12 |     !keys.includes(objKeys[i]) && (newObj[objKeys[i]] = originalObject[objKeys[i]])
       |                                    ^^^^^^^^^^^^^^^^^^
    13 |   }
    14 |   return newObj
    15 | }

ERROR in node_modules/@coreui/utils/src/omitByKeys.ts:12:57
TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{}'.
  No index signature with a parameter of type 'string' was found on type '{}'.
    10 |   const objKeys = Object.keys(originalObject)
    11 |   for (let i = 0; i < objKeys.length; i++) {
  > 12 |     !keys.includes(objKeys[i]) && (newObj[objKeys[i]] = originalObject[objKeys[i]])
       |                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^
    13 |   }
    14 |   return newObj
    15 | }

ERROR in node_modules/@coreui/utils/src/pickByKeys.ts:11:5
TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{}'.
  No index signature with a parameter of type 'string' was found on type '{}'.
     9 |   const newObj = {}
    10 |   for (let i = 0; i < keys.length; i++) {
  > 11 |     newObj[keys[i]] = originalObject[keys[i]]
       |     ^^^^^^^^^^^^^^^
    12 |   }
    13 |   return newObj
    14 | }

ERROR in node_modules/@coreui/utils/src/pickByKeys.ts:11:23
TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{}'.
  No index signature with a parameter of type 'string' was found on type '{}'.
     9 |   const newObj = {}
    10 |   for (let i = 0; i < keys.length; i++) {
  > 11 |     newObj[keys[i]] = originalObject[keys[i]]
       |                       ^^^^^^^^^^^^^^^^^^^^^^^
    12 |   }
    13 |   return newObj
    14 | }

hexToRgba fails for hex shortcodes

Testing the v3-next functionality, the new coreui.Utils.hexToRgba fails on the --info color code, because it is a 3-digit hex value, instead of a standard 6 digit hex value.

<style>
:root {
  --primary: #321fdb;
  --secondary: #ced2d8;
  --success: #2eb85c;
  --info: #39f;
  --warning: #f9b115;
  --danger: #e55353;
  --light: #ebedef;
  --dark: #636f83;
  --breakpoint-xs: 0;
  --breakpoint-sm: 576px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 992px;
  --breakpoint-xl: 1200px;
  --font-family-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
</style>
<script src="vendors/@coreui/chartjs/js/coreui-chartjs.bundle.js"></script>
<script src="vendors/@coreui/utils/js/coreui-utils.js"></script>
<script>
  console.log(coreui.Utils.getStyle('--info'));
  console.log(coreui.Utils.hexToRgba(coreui.Utils.getStyle('--info'), 90));
  console.log('#3399ff');
  console.log(coreui.Utils.hexToRgba('#3399ff', 90));
</script>

Output in JS console is the following:

#39f
rgba(3, 9, 15, 0.9)
#3399ff
rgba(51, 153, 255, 0.9)

Expected output should be:

#39f
rgba(51, 153, 255, 0.9)
#3399ff
rgba(51, 153, 255, 0.9)

hexToRgba fails for hex shortcodes

Testing the v3-next functionality, the new coreui.Utils.hexToRgba fails on the --info color code, because it is a 3-digit hex value, instead of a standard 6 digit hex value.

<style>
:root {
  --primary: #321fdb;
  --secondary: #ced2d8;
  --success: #2eb85c;
  --info: #39f;
  --warning: #f9b115;
  --danger: #e55353;
  --light: #ebedef;
  --dark: #636f83;
  --breakpoint-xs: 0;
  --breakpoint-sm: 576px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 992px;
  --breakpoint-xl: 1200px;
  --font-family-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
</style>
<script src="vendors/@coreui/chartjs/js/coreui-chartjs.bundle.js"></script>
<script src="vendors/@coreui/utils/js/coreui-utils.js"></script>
<script>
  console.log(coreui.Utils.getStyle('--info'));
  console.log(coreui.Utils.hexToRgba(coreui.Utils.getStyle('--info'), 90));
  console.log('#3399ff');
  console.log(coreui.Utils.hexToRgba('#3399ff', 90));
</script>

Output in JS console is the following:

#39f
rgba(3, 9, 15, 0.9)
#3399ff
rgba(51, 153, 255, 0.9)

Expected output should be:

#39f
rgba(51, 153, 255, 0.9)
#3399ff
rgba(51, 153, 255, 0.9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.