File tree 11 files changed +66
-16
lines changed 11 files changed +66
-16
lines changed Original file line number Diff line number Diff line change 41
41
"lint" : " eslint \" src/**/*.{js,ts,tsx}\" "
42
42
},
43
43
"devDependencies" : {
44
+ "@rollup/plugin-replace" : " ^5.0.2" ,
44
45
"@rollup/plugin-typescript" : " ^10.0.1" ,
45
46
"@typescript-eslint/eslint-plugin" : " ^5.46.0" ,
46
47
"@typescript-eslint/parser" : " ^5.46.0" ,
Original file line number Diff line number Diff line change
1
+ /**
2
+ * --------------------------------------------------------------------------
3
+ * CoreUI (__COREUI_VERSION__): deep-objects-merge.ts
4
+ * Licensed under MIT (https://github.com/coreui/coreui-utils/blob/master/LICENSE)
5
+ * --------------------------------------------------------------------------
6
+ */
7
+
1
8
const deepObjectsMerge = ( target : object , source : object ) => {
2
9
// Iterate through `source` properties and if an `Object` set property to merge of `target` and `source` properties
3
10
for ( const key of Object . keys ( source ) ) {
Original file line number Diff line number Diff line change
1
+ /**
2
+ * --------------------------------------------------------------------------
3
+ * CoreUI (__COREUI_VERSION__): get-color.ts
4
+ * Licensed under MIT (https://github.com/coreui/coreui-utils/blob/master/LICENSE)
5
+ * --------------------------------------------------------------------------
6
+ */
7
+
1
8
import getStyle from './get-style'
2
9
3
10
const getColor = ( rawProperty : string , element = document . body ) => {
Original file line number Diff line number Diff line change
1
+ /**
2
+ * --------------------------------------------------------------------------
3
+ * CoreUI (__COREUI_VERSION__): hex-to-rgb.ts
4
+ * Licensed under MIT (https://github.com/coreui/coreui-utils/blob/master/LICENSE)
5
+ * --------------------------------------------------------------------------
6
+ */
7
+
1
8
/* eslint-disable no-magic-numbers */
2
9
const hexToRgb = ( color : string ) => {
3
10
if ( typeof color === 'undefined' ) {
Original file line number Diff line number Diff line change
1
+ /**
2
+ * --------------------------------------------------------------------------
3
+ * CoreUI (__COREUI_VERSION__): hex-to-rgba.ts
4
+ * Licensed under MIT (https://github.com/coreui/coreui-utils/blob/master/LICENSE)
5
+ * --------------------------------------------------------------------------
6
+ */
7
+
1
8
/* eslint-disable no-magic-numbers */
2
9
const hexToRgba = ( color : string , opacity = 100 ) => {
3
10
if ( typeof color === 'undefined' ) {
Original file line number Diff line number Diff line change
1
+ /**
2
+ * --------------------------------------------------------------------------
3
+ * CoreUI (__COREUI_VERSION__): index.ts
4
+ * Licensed under MIT (https://github.com/coreui/coreui-utils/blob/master/LICENSE)
5
+ * --------------------------------------------------------------------------
6
+ */
7
+
1
8
import deepObjectsMerge from './deep-objects-merge'
2
9
import getColor from './get-color'
3
10
import getStyle from './get-style'
@@ -8,20 +15,6 @@ import omitByKeys from './omit-by-keys'
8
15
import pickByKeys from './pick-by-keys'
9
16
import rgbToHex from './rgb-to-hex'
10
17
11
- // const utils = {
12
- // deepObjectsMerge,
13
- // getColor,
14
- // getStyle,
15
- // hexToRgb,
16
- // hexToRgba,
17
- // makeUid,
18
- // omitByKeys,
19
- // pickByKeys,
20
- // rgbToHex
21
- // }
22
-
23
- // export default utils
24
-
25
18
export {
26
19
deepObjectsMerge ,
27
20
getColor ,
Original file line number Diff line number Diff line change 1
1
/**
2
2
* --------------------------------------------------------------------------
3
- * CoreUI (v3.0.0-rc.0 ): index.umd.js
4
- * Licensed under MIT (https://coreui.io/license )
3
+ * CoreUI (__COREUI_VERSION__ ): index.umd.ts
4
+ * Licensed under MIT (https://github.com/coreui/coreui-utils/blob/master/LICENSE )
5
5
* --------------------------------------------------------------------------
6
6
*/
7
7
Original file line number Diff line number Diff line change
1
+ /**
2
+ * --------------------------------------------------------------------------
3
+ * CoreUI (__COREUI_VERSION__): make-uid.ts
4
+ * Licensed under MIT (https://github.com/coreui/coreui-utils/blob/master/LICENSE)
5
+ * --------------------------------------------------------------------------
6
+ */
7
+
1
8
//function for UI releted ID assignment, due to one in 10^15 probability of duplication
2
9
const makeUid = ( ) => {
3
10
const key = Math . random ( ) . toString ( 36 ) . substr ( 2 )
Original file line number Diff line number Diff line change
1
+ /**
2
+ * --------------------------------------------------------------------------
3
+ * CoreUI (__COREUI_VERSION__): omit-by-keys.ts
4
+ * Licensed under MIT (https://github.com/coreui/coreui-utils/blob/master/LICENSE)
5
+ * --------------------------------------------------------------------------
6
+ */
7
+
1
8
const omitByKeys = ( originalObject : object , keys : string | string [ ] ) => {
2
9
const newObj = { }
3
10
const objKeys = Object . keys ( originalObject )
Original file line number Diff line number Diff line change
1
+ /**
2
+ * --------------------------------------------------------------------------
3
+ * CoreUI (__COREUI_VERSION__): pick-by-keys.ts
4
+ * Licensed under MIT (https://github.com/coreui/coreui-utils/blob/master/LICENSE)
5
+ * --------------------------------------------------------------------------
6
+ */
7
+
1
8
const pickByKeys = ( originalObject : object , keys : string | string [ ] ) => {
2
9
const newObj = { }
3
10
for ( let i = 0 ; i < keys . length ; i ++ ) {
Original file line number Diff line number Diff line change
1
+ /**
2
+ * --------------------------------------------------------------------------
3
+ * CoreUI (__COREUI_VERSION__): rgb-to-hex.ts
4
+ * Licensed under MIT (https://github.com/coreui/coreui-utils/blob/master/LICENSE)
5
+ * --------------------------------------------------------------------------
6
+ */
7
+
1
8
const rgbToHex = ( color : string ) => {
2
9
if ( typeof color === 'undefined' ) {
3
10
throw new TypeError ( 'Hex color is not defined' )
You can’t perform that action at this time.
0 commit comments