@omegagrid/grid-core 0.9.43 → 0.9.46
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/dist/constants.js
CHANGED
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAI7D,MAAM,yBAAyB,GAAG;IACjC,QAAQ,EAAE,MAAM;IAChB,QAAQ,EAAE,MAAM;IAChB,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE;QACN,KAAK,EAAE,QAAQ;QACf,MAAM,EAAE,CAAC;KACT;IACD,MAAM,EAAE;QACP,KAAK,EAAE,QAAQ;KACf;CACmB,CAAC;AAEtB,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACrC,OAAO,EAAE,KAAK;IACd,eAAe,EAAE,IAAI;IACrB,cAAc,EAAE,IAAI;CACH,CAAC;AAEnB,MAAM,CAAC,MAAM,oBAAoB,GAAG;IACnC,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,KAAK;CACA,CAAC;AAEjB,MAAM,UAAU,GAAG,EAAE,CAAC;AAEtB,MAAM,eAAe,GAAY;IAChC,IAAI,EAAE,GAAG;IACT,OAAO,EAAE,EAAE;IACX,QAAQ,EAAE,KAAK;IACf,UAAU,EAAE,IAAI;IAChB,WAAW,EAAE,CAAC;IACd,OAAO,EAAE,EAAC,OAAO,EAAE,IAAI,EAAC;IACxB,UAAU,EAAE,EAAC,OAAO,EAAE,IAAI,EAAC;IAC3B,UAAU,EAAE,IAAI;IAChB,gBAAgB,EAAE,IAAI;IACtB,SAAS,EAAE,CAAC;IACZ,QAAQ,EAAE,EAAE;IACZ,SAAS,EAAE,UAAU;IACrB,SAAS,EAAE,IAAI;IACf,WAAW,EAAE,GAAG;IAChB,YAAY,EAAE,IAAI;IA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K;YACb,MAAM,EAAE,IAAI;YACZ,MAAM,EAAE,IAAI;SACZ;QACD,WAAW,EAAE,UAAU;QACvB,KAAK,EAAE,IAAI;KACX;CACD,CAAC;AAEF,eAAe;IACd,UAAU,EAAE,UAAU;IACtB,eAAe,EAAE,EAAE;IACnB,gBAAgB,EAAE,EAAE;IACpB,WAAW,EAAE,EAAE;IACf,aAAa,EAAE,EAAE;IACjB,eAAe,EAAE,IAAI,EAAE,QAAQ;IAC/B,oBAAoB,EAAE,EAAE;IACxB,oBAAoB,EAAE,IAAI;IAC1B,qBAAqB,EAAE,CAAC;IACxB,cAAc,EAAE,CAAC;IACjB,aAAa,EAAE,CAAC;IAChB,aAAa,EAAE,CAAC;IAChB,mBAAmB,EAAE,GAAG;IACxB,gBAAgB,EAAE,GAAG;IACrB,mBAAmB,EAAE,GAAG;IACxB,yBAAyB,EAAE,yBAAyB;IACpD,eAAe,EAAE,eAAe;IAChC,sBAAsB,EAAE,GAAG;IAC3B,sBAAsB,EAAE,EAAE;IAC1B,GAAG,aAAa;CAChB,CAAA","sourcesContent":["import { constants as coreConstants } from '@omegagrid/core';\nimport { Options, FilterOptions, TreeOptions } from './model';\nimport { SparklineOptions } from './sparklines';\n\nconst DEFAULT_SPARKLINE_OPTIONS = {\n\tminValue: 'auto',\n\tmaxValue: 'auto',\n\ttype: 'line',\n\tstyle: {\n\t\tcolor: '0094FF',\n\t\tweight: 1\n\t},\n\tmarker: {\n\t\tcolor: 'ff0000'\n\t}\n} as SparklineOptions;\n\nexport const DEFAULT_FILTER_OPTIONS = {\n\tenabled: false,\n\tincludeChildren: true,\n\tincludeParents: true\n} as FilterOptions;\n\nexport const DEFAULT_TREE_OPTIONS = {\n\tenabled: true,\n\treversed: false,\n} as TreeOptions;\n\nconst ROW_HEIGHT = 22;\n\nconst DEFAULT_OPTIONS: Options = {\n\trows: 100,\n\tcolumns: 20,\n\treadOnly: false,\n\trowNumbers: true,\n\trowPriority: 2,\n\trowTree: {enabled: true},\n\tcolumnTree: {enabled: true},\n\tcolLetters: true,\n\temptyPlaceholder: true,\n\tfreezeTop: 0,\n\tfontSize:
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAI7D,MAAM,yBAAyB,GAAG;IACjC,QAAQ,EAAE,MAAM;IAChB,QAAQ,EAAE,MAAM;IAChB,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE;QACN,KAAK,EAAE,QAAQ;QACf,MAAM,EAAE,CAAC;KACT;IACD,MAAM,EAAE;QACP,KAAK,EAAE,QAAQ;KACf;CACmB,CAAC;AAEtB,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACrC,OAAO,EAAE,KAAK;IACd,eAAe,EAAE,IAAI;IACrB,cAAc,EAAE,IAAI;CACH,CAAC;AAEnB,MAAM,CAAC,MAAM,oBAAoB,GAAG;IACnC,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,KAAK;CACA,CAAC;AAEjB,MAAM,UAAU,GAAG,EAAE,CAAC;AAEtB,MAAM,eAAe,GAAY;IAChC,IAAI,EAAE,GAAG;IACT,OAAO,EAAE,EAAE;IACX,QAAQ,EAAE,KAAK;IACf,UAAU,EAAE,IAAI;IAChB,WAAW,EAAE,CAAC;IACd,OAAO,EAAE,EAAC,OAAO,EAAE,IAAI,EAAC;IACxB,UAAU,EAAE,EAAC,OAAO,EAAE,IAAI,EAAC;IAC3B,UAAU,EAAE,IAAI;IAChB,gBAAgB,EAAE,IAAI;IACtB,SAAS,EAAE,CAAC;IACZ,QAAQ,EAAE,EAAE;IACZ,SAAS,EAAE,UAAU;IACrB,SAAS,EAAE,IAAI;IACf,WAAW,EAAE,GAAG;IAChB,YAAY,EAAE,IAAI;IAClB,cAAc,EAAE,CAAC;IACjB,UAAU,EAAE,CAAC;IACb,WAAW,EAAE,CAAC;IACd,YAAY,EAAE,CAAC;IACf,i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AAI;KACX;CACD,CAAC;AAEF,eAAe;IACd,UAAU,EAAE,UAAU;IACtB,eAAe,EAAE,EAAE;IACnB,gBAAgB,EAAE,EAAE;IACpB,WAAW,EAAE,EAAE;IACf,aAAa,EAAE,EAAE;IACjB,eAAe,EAAE,IAAI,EAAE,QAAQ;IAC/B,oBAAoB,EAAE,EAAE;IACxB,oBAAoB,EAAE,IAAI;IAC1B,qBAAqB,EAAE,CAAC;IACxB,cAAc,EAAE,CAAC;IACjB,aAAa,EAAE,CAAC;IAChB,aAAa,EAAE,CAAC;IAChB,mBAAmB,EAAE,GAAG;IACxB,gBAAgB,EAAE,GAAG;IACrB,mBAAmB,EAAE,GAAG;IACxB,yBAAyB,EAAE,yBAAyB;IACpD,eAAe,EAAE,eAAe;IAChC,sBAAsB,EAAE,GAAG;IAC3B,sBAAsB,EAAE,EAAE;IAC1B,GAAG,aAAa;CAChB,CAAA","sourcesContent":["import { constants as coreConstants } from '@omegagrid/core';\nimport { Options, FilterOptions, TreeOptions } from './model';\nimport { SparklineOptions } from './sparklines';\n\nconst DEFAULT_SPARKLINE_OPTIONS = {\n\tminValue: 'auto',\n\tmaxValue: 'auto',\n\ttype: 'line',\n\tstyle: {\n\t\tcolor: '0094FF',\n\t\tweight: 1\n\t},\n\tmarker: {\n\t\tcolor: 'ff0000'\n\t}\n} as SparklineOptions;\n\nexport const DEFAULT_FILTER_OPTIONS = {\n\tenabled: false,\n\tincludeChildren: true,\n\tincludeParents: true\n} as FilterOptions;\n\nexport const DEFAULT_TREE_OPTIONS = {\n\tenabled: true,\n\treversed: false,\n} as TreeOptions;\n\nconst ROW_HEIGHT = 22;\n\nconst DEFAULT_OPTIONS: Options = {\n\trows: 100,\n\tcolumns: 20,\n\treadOnly: false,\n\trowNumbers: true,\n\trowPriority: 2,\n\trowTree: {enabled: true},\n\tcolumnTree: {enabled: true},\n\tcolLetters: true,\n\temptyPlaceholder: true,\n\tfreezeTop: 0,\n\tfontSize: 14,\n\trowHeight: ROW_HEIGHT,\n\trowResize: true,\n\tcolumnWidth: 100,\n\tcolumnResize: true,\n\tcolumnPriority: 1,\n\tfreezeLeft: 0,\n\tfreezeRight: 0,\n\tfreezeBottom: 0,\n\tmaxSortingColumns: 3,\n\tnumberFormat: null,\n\tlevelIndentFactor: 2,\n\tcellIndentFactor: 10,\n\temptyClickable: false,\n\tgrid: true,\n\tautofill: true,\n\tundoRedo: true,\n\tcommandWindow: true,\n\tcellCache: true,\n\tsingleCellModel: false,\n\tzoom: 1,\n\tediting: {\n\t\trowInsertion: true,\n\t\trowDeletion: true,\n\t\tcolInsertion: true,\n\t\tcolDeletion: true,\n\t\trowOutline: true,\n\t\tcolOutline: true,\n\t\tdateCalendarEditor: false\n\t},\n\tcomments: {\n\t\thideTimeout: 1000,\n\t\toffsetX: 30,\n\t\toffsetY: -30,\n\t\tzIndex: 500,\n\t\theaderPosition: 'top'\n\t},\n\tscrolling: {\n\t\tverticalOverscroll: true,\n\t\thorizontalOverscroll: true,\n\t\tscrollbarVisibilityTreshold: 100\n\t},\n\tselecting: {\n\t\tenabled: true,\n\t\tmultiSelect: true,\n\t},\n\tevents: {\n\t\tclick: {\n\t\t\tmouseMoveTreshold: 10\n\t\t}\n\t},\n\tclipboard: {\n\t\tpasteProps: ['v', 'dv'],\n\t\trowPasteMode: 'rewrite_append',\n\t\tcolumnPasteMode: 'rewrite'\n\t},\n\tprint: {\n\t\tdpi: 600,\n\t\tmargins: {\n\t\t\tleft: 6.35,\n\t\t\tright: 6.35,\n\t\t\ttop: 19.05,\n\t\t\tbottom: 19.05,\n\t\t\theader: 7.62,\n\t\t\tfooter: 7.62\n\t\t},\n\t\torientation: 'portrait',\n\t\tpaper: 'A4'\n\t}\n};\n\nexport default {\n\tROW_HEIGHT: ROW_HEIGHT,\n\tRESIZE_TRESHOLD: 10,\n\tROW_HEADER_WIDTH: 60,\n\tSLIDER_SIZE: 12,\n\tEXPANDER_SIZE: 13,\n\tMAX_CACHE_ITEMS: 5000, //50000,\n\tCACHE_CLEAN_INTERVAL: 30,\n\tCOMMENT_HIDE_TIMEOUT: 1000,\n\tSELECTOR_BORDER_WIDTH: 1,\n\tMIN_ROW_HEIGHT: 5,\n\tMIN_COL_WIDTH: 5,\n\tSPARKLINE_GAP: 4,\n\tAUTOSCROLL_TRESHOLD: 100,\n\tAUTOSCROLL_RATIO: 1.1,\n\tAUTOSCROLL_INTERVAL: 100,\n\tDEFAULT_SPARKLINE_OPTIONS: DEFAULT_SPARKLINE_OPTIONS,\n\tDEFAULT_OPTIONS: DEFAULT_OPTIONS,\n\tMAX_COMMENT_AUTOHEIGHT: 300,\n\tMIN_COMMENT_AUTOHEIGHT: 25,\n\t...coreConstants\n}\n\n"]}
|
package/dist/model/cssStyle.js
CHANGED
|
@@ -297,8 +297,4 @@ export const cssStyleToStyle = (s) => {
|
|
|
297
297
|
}
|
|
298
298
|
return style;
|
|
299
299
|
};
|
|
300
|
-
// function convertFontSize(size) {
|
|
301
|
-
// let fSize = parseFloat(size);
|
|
302
|
-
// return isNaN(s.fSize) ? (s.fontSizeMap[size.toString().toLowerCase()] || DEFAULT_FONT_SIZE) : (s.fSize * 0.75);
|
|
303
|
-
// }
|
|
304
300
|
//# sourceMappingURL=cssStyle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cssStyle.js","sourceRoot":"","sources":["../../src/model/cssStyle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAKrD,MAAM,oBAAoB,GAAG,QAAQ,CAAC;AAEtC,MAAM,UAAU,kBAAkB,CAAC,QAAgB;IAClD,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QAClC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;Q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CAAC;gBAC7B,MAAM;YACP,KAAK,YAAY,CAAC;YAClB,KAAK,aAAa;gBACjB,KAAK,CAAC,IAAI,GAAG,KAAK,IAAI,MAAM,CAAC;gBAC7B,MAAM;YACP,KAAK,WAAW,CAAC;YACjB,KAAK,YAAY;gBAChB,KAAK,CAAC,MAAM,GAAG,KAAK,IAAI,QAAQ,CAAC;gBACjC,MAAM;YACP;gBACC,KAAK,CAAC,CAAgB,CAAC,GAAG,KAAK,CAAC;gBAChC,MAAM;QACR,CAAC;IACF,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC,CAAA;AAED,mCAAmC;AACnC,iCAAiC;AACjC,mHAAmH;AACnH,IAAI","sourcesContent":["import { colors, dom, utils } from \"@omegagrid/core\";\nimport { Border, BorderStyle, HorizontalAlignment, Style, VerticalAlignment } from \"./style\";\n\nexport type CSSStyle = Partial<CSSStyleDeclaration> & { [propName: string]: string };\n\nconst DEFAULT_BORDER_COLOR = 'CCCCCC';\n\nexport function cssStyleFromString(strStyle: string): CSSStyle {\n\tconst style: CSSStyle = {};\n\tstrStyle.split(';').forEach(item => {\n\t\tconst [key, value] = item.split(':');\n\t\tstyle[key] = value.trim();\n\t});\n\treturn style;\n}\n\nexport type CSSBorderStyle = 'none'|'solid'|'double'|'dotted'|'dashed';\nexport const borderStyleCSSMap = new Map<BorderStyle, {\n\twidth: number, \n\tstyle: CSSBorderStyle,\n}>([\n\t['thin', {width: 1.5, style: 'solid'}],\n\t['medium', {width: 2, style: 'solid'}],\n\t['thick', {width: 3, style: 'solid'}],\n\t['double', {width: 3, style: 'double'}],\n\t['dotted', {width: 1.5, style: 'dotted'}],\n\t['hair', {width: 1, style: 'solid'}],\n\t['dashed', {width: 1.5, style: 'dashed'}],\n\t['mediumDashed', {width: 2, style: 'dashed'}],\n\t['dashDot', {width: 1.5, style: 'dashed'}],\n\t['mediumDashDot', {width: 2, style: 'dashed'}],\n\t['dashDotDot', {width: 1.5, style: 'dotted'}],\n\t['mediumDashDotDot', {width: 2, style: 'dotted'}],\n\t['slantDashDot', {width: 1.5, style: 'dashed'}],\n\t['none', {width: 1.5, style: 'solid'}],\n]);\n\nexport const borderCSSStyleMap = (() => {\n\tconst map = new Map<CSSBorderStyle, Map<number, BorderStyle>>();\n\tborderStyleCSSMap.forEach((value, key) => {\n\t\tlet widthMap: Map<number, BorderStyle> = map.get(value.style);\n\t\tif (!widthMap) widthMap = map.set(value.style, new Map()).get(value.style);\n\t\twidthMap.set(value.width, key);\n\t});\n\treturn map;\n})();\n\nexport function convertCSSVerticalAlignment(align: string) {\n\treturn (align == 'middle' ? 'center' : align) as VerticalAlignment;\n}\n\nexport function convertCSSColor(color: string) {\n\tcolor = color.charAt(0) == '#' ? color.substring(1) : color;\n\treturn color.length == 3\n\t\t? color[0] + color[0] + color[1] + color[1] + color[2] + color[2]\n\t\t: color;\n}\n\nexport const convertCSSBorder = (border: string): Border => {\n\tif (border == 'none') return null;\n\t\n\tconst chunks = border.split(' ');\n\tconst width = parseInt(chunks[0].charAt(0)) || 1;\n\tconst borderStyle = chunks.length > 1 ? (chunks[1] as CSSBorderStyle) : 'solid';\n\n\tconst widthMap = borderCSSStyleMap.get(borderStyle);\n\treturn {\n\t\tstyle: (widthMap ? widthMap.get(width) : null) ?? 'thin',\n\t\tcolor: chunks.length > 2 ? convertCSSColor(chunks[2]) : DEFAULT_BORDER_COLOR\n\t};\n}\n\nexport const convertToCSSBorder = (b: Border) => {\n\tconst borderStyle = borderStyleCSSMap.get(b.style || 'none');\n\tif (!borderStyle) return 'none';\n\treturn [\n\t\tdom.px(borderStyle.width),\n\t\tborderStyle.style,\n\t\tb.style == 'none' ? 'var(--og-cell-background)' : (b.color ? `#${b.color}` : 'var(--og-border-color)'),\n\t].join(' ');\n}\n\nexport const addPattern = (css: CSSStyle, s: Style) : CSSStyle => {\n\t// background-image: radial-gradient(rgb(255, 255, 255) 10%, transparent 10%), radial-gradient(rgb(255, 255, 255) 10%, transparent 10%);\n\t// background-position: 0px 0px, 4px 4px;\n\t// background-size: 8px 8px;\n\t// background-color: rgb(255, 51, 51);\n\n\t// console.log('addPattern', s.patternType, fgColor, bgColor);\n\n\tconst fg = '#' + (s.fgColor || '000000');\n\tconst bg = '#' + (s.bgColor || 'FFFFFF');\n\n\tswitch (s.patternType) {\n\t\tcase 'solid':\n\t\t\tcss.backgroundColor = fg || bg;\n\t\t\tbreak;\n\t\tcase 'darkGray':\n\t\t\tcss.backgroundColor = colors.darken(bg, 0.75);\n\t\t\tbreak;\n\t\tcase 'mediumGray':\n\t\t\tcss.backgroundColor = colors.darken(bg, 0.50);\n\t\t\tbreak;\n\t\tcase 'lightGray':\n\t\t\tcss.backgroundColor = colors.darken(bg, 0.25);\n\t\t\tbreak;\n\t\tcase 'gray125':\n\t\t\tcss.backgroundColor = colors.darken(bg, 0.125);\n\t\t\tbreak;\n\t\tcase 'gray0625':\n\t\t\tcss.backgroundColor = colors.darken(bg, 0.0625);\n\t\t\tbreak;\n\t\tcase 'darkHorizontal':\n\t\t\tcss.backgroundImage = `linear-gradient(0deg, ${fg} 33.33%, ${bg} 33.33%, ${bg} 50%, ${fg} 50%, ${fg} 83.33%, ${bg} 83.33%, ${bg} 100%)`;\n\t\t\tcss.backgroundSize = '6px 6px';\n\t\t\tbreak;\n\t\tcase 'darkVertical':\n\t\t\tcss.backgroundImage = `linear-gradient(90deg, ${fg} 33.33%, ${bg} 33.33%, ${bg} 50%, ${fg} 50%, ${fg} 83.33%, ${bg} 83.33%, ${bg} 100%)`;\n\t\t\tcss.backgroundSize = '6px 6px';\n\t\t\tbreak;\n\t\tcase 'darkDown':\n\t\t\tcss.backgroundImage = `linear-gradient(45deg, ${fg} 33.33%, ${bg} 33.33%, ${bg} 50%, ${fg} 50%, ${fg} 83.33%, ${bg} 83.33%, ${bg} 100%)`;\n\t\t\tcss.backgroundSize = '6px 6px';\n\t\t\tbreak;\n\t\tcase 'darkUp':\n\t\t\tcss.backgroundImage = `linear-gradient(-45deg, ${fg} 33.33%, ${bg} 33.33%, ${bg} 50%, ${fg} 50%, ${fg} 83.33%, ${bg} 83.33%, ${bg} 100%)`;\n\t\t\tcss.backgroundSize = '6px 6px';\n\t\t\tbreak;\n\t\tcase 'lightHorizontal':\n\t\t\tcss.backgroundImage = `linear-gradient(0deg, ${bg} 25%, ${fg} 25%, ${fg} 50%, ${bg} 50%, ${bg} 75%, ${fg} 75%, ${fg} 100%)`;\n\t\t\tcss.backgroundSize = '4px 4px';\n\t\t\tbreak;\n\t\tcase 'lightVertical':\n\t\t\tcss.backgroundImage = `linear-gradient(90deg, ${bg} 25%, ${fg} 25%, ${fg} 50%, ${bg} 50%, ${bg} 75%, ${fg} 75%, ${fg} 100%)`;\n\t\t\tcss.backgroundSize = '4px 4px';\n\t\t\tbreak;\n\t\tcase 'lightDown':\n\t\t\tcss.backgroundImage = `linear-gradient(45deg, ${bg} 25%, ${fg} 25%, ${fg} 50%, ${bg} 50%, ${bg} 75%, ${fg} 75%, ${fg} 100%)`;\n\t\t\tcss.backgroundSize = '4px 4px';\n\t\t\tbreak;\n\t\tcase 'lightUp':\n\t\t\tcss.backgroundImage = `linear-gradient(-45deg, ${bg} 25%, ${fg} 25%, ${fg} 50%, ${bg} 50%, ${bg} 75%, ${fg} 75%, ${fg} 100%)`;\n\t\t\tcss.backgroundSize = '4px 4px';\n\t\t\tbreak;\n\t\tcase 'darkGrid':\n\t\t\tcss.backgroundImage = `linear-gradient(${bg} 0.5px, transparent 0.5px), linear-gradient(90deg, ${bg} 0.5px, transparent 0.5px)`;\n\t\t\tcss.backgroundSize = '2px 2px';\n\t\t\tbreak;\n\t\tcase 'lightGrid':\n\t\t\tcss.backgroundImage = `linear-gradient(${bg} 0.5px, transparent 0.5px), linear-gradient(90deg, ${bg} 0.5px, transparent 0.5px)`;\n\t\t\tcss.backgroundSize = '1px 1px';\n\t\t\tbreak;\n\t\tcase 'darkTrellis':\n\t\t\tcss.backgroundImage = `linear-gradient(45deg, ${bg} 0.5px, transparent 0.5px), linear-gradient(90deg, ${bg} 0.5px, transparent 0.5px)`;\n\t\t\tcss.backgroundSize = '2px 2px';\n\t\t\tbreak;\n\t\tcase 'lightTrellis':\n\t\t\tcss.backgroundImage = `linear-gradient(45deg, ${bg} 0.5px, transparent 0.5px), linear-gradient(90deg, ${bg} 0.5px, transparent 0.5px)`;\n\t\t\tcss.backgroundSize = '1px 1px';\n\t\t\tbreak;\n\t}\n\n\treturn css;\n}\n\nexport const addGradient = (css: CSSStyle, s: Style) : CSSStyle => {\n\tcss.backgroundImage = `linear-gradient(${(s.angle ?? 0) + 90}deg,${s.stops.map(stop => `#${stop.rgb} ${stop.v * 100}%`).join(',')})`;\n\treturn css;\n}\n\nexport const styleToCSStyle = (s: Style): CSSStyle => {\n\tconst style: CSSStyle = s.cssStyle ? {...s.cssStyle} : {};\n\tif (s.bold != null) style.fontWeight = s.bold ? 'bold' : 'normal';\n\tif (s.italic) style.fontStyle = 'italic';\n\tif (s.underline) style.textDecoration = 'underline';\n\telse if (s.strike) style.textDecoration = 'line-through';\n\tif (s.sz) style.fontSize = dom.numToPixels(s.sz); // (s.sz * 0.75).toString() + 'px';\n\tif (s.color) style.color = '#' + s.color;\n\tif (s.top) style.borderTop = convertToCSSBorder(s.top);\n\tif (s.right) style.borderRight = convertToCSSBorder(s.right);\n\tif (s.bottom) style.borderBottom = convertToCSSBorder(s.bottom);\n\tif (s.left) style.borderLeft = convertToCSSBorder(s.left);\n\tif (s.top || s.right || s.bottom || s.left) style.zIndex = '1';\n\tif (s.alignment && s.alignment.vertical) {\n\t\tstyle.display = 'flex';\n\t\tstyle.justifyContent = s.alignment.horizontal;\n\t\tstyle.alignItems = s.alignment.vertical == 'top' ? 'start' : (s.alignment.vertical == 'bottom' ? 'end' : 'center');\n\t}\n\tif (s.alignment && s.alignment.horizontal) {\n\t\tstyle.textAlign = s.alignment.horizontal;\n\t}\n\tif (s.alignment && s.alignment.wrapText) {\n\t\tstyle.display = 'flex';\n\t\tstyle.justifyContent = style.justifyContent ?? style.textAlign ?? 'left';\n\t\tstyle.alignItems = style.alignItems ?? 'center';\n\t\tstyle.whiteSpace = 'pre-wrap';\n\t}\n\tif (s.patternType) addPattern(style, s);\n\telse if (s.stops && s.stops.length) addGradient(style, s);\n\telse if (s.fgColor) style.backgroundColor = '#' + s.fgColor;\n\telse if (s.bgColor) style.backgroundColor = '#' + s.bgColor;\n\t\n\t///TODO - rotation\n\t\n\treturn style;\n}\n\nexport const cssStyleToStyle = (s: CSSStyle|string): Style => {\n\tconst cssStyle: CSSStyle = utils.isObject(s) ? s as CSSStyle : cssStyleFromString(s as string);\n\tconst style: Style = {};\n\tlet border: Border;\n\tfor (const k in cssStyle) {\n\t\tconst value = cssStyle[k];\n\t\tif (value == null) continue;\n\t\tswitch(k) {\n\t\t\tcase 'borderTop':\n\t\t\tcase 'border-top':\n\t\t\t\tstyle.top = convertCSSBorder(value as string);\n\t\t\t\tbreak;\n\t\t\tcase 'borderTopColor':\n\t\t\tcase 'border-top-color':\n\t\t\t\tif (style.top) style.top.color = convertCSSColor(value as string);\n\t\t\t\telse style.top = {style: 'thin', color: convertCSSColor(value as string)};\n\t\t\t\tbreak;\n\t\t\tcase 'borderRight':\n\t\t\tcase 'border-right':\n\t\t\t\tstyle.right = convertCSSBorder(value as string);\n\t\t\t\tbreak;\n\t\t\tcase 'borderRightColor':\n\t\t\tcase 'border-right-color':\n\t\t\t\tif (style.right) style.right.color = convertCSSColor(value as string);\n\t\t\t\telse style.right = {style: 'thin', color: convertCSSColor(value as string)};\n\t\t\t\tbreak;\n\t\t\tcase 'borderBottom':\n\t\t\tcase 'border-bottom':\n\t\t\t\tstyle.bottom = convertCSSBorder(value as string);\n\t\t\t\tbreak;\n\t\t\tcase 'borderBottomColor':\n\t\t\tcase 'border-bottom-color':\n\t\t\t\tif (style.bottom) style.bottom.color = convertCSSColor(value as string);\n\t\t\t\telse style.bottom = {style: 'thin', color: convertCSSColor(value as string)};\n\t\t\t\tbreak;\n\t\t\tcase 'borderLeft':\n\t\t\tcase 'border-left':\n\t\t\t\tstyle.left = convertCSSBorder(value as string);\n\t\t\t\tbreak;\n\t\t\tcase 'borderLeftColor':\n\t\t\tcase 'border-left-color':\n\t\t\t\tif (style.left) style.left.color = convertCSSColor(value as string);\n\t\t\t\telse style.left = {style: 'thin', color: convertCSSColor(value as string)};\n\t\t\t\tbreak;\t\t\n\t\t\tcase 'border':\n\t\t\t\tborder = convertCSSBorder(value as string);\n\t\t\t\tstyle.top = style.top || border;\n\t\t\t\tstyle.right = style.right || border;\n\t\t\t\tstyle.bottom = style.bottom || border;\n\t\t\t\tstyle.left = style.left || border;\n\t\t\t\tbreak;\n\t\t\tcase 'textAlign':\n\t\t\tcase 'text-align':\n\t\t\t\tstyle.alignment = style.alignment || {};\n\t\t\t\tstyle.alignment.horizontal = value as HorizontalAlignment;\n\t\t\t\tbreak;\n\t\t\tcase 'verticalAlign':\n\t\t\tcase 'vertical-align':\n\t\t\t\tstyle.alignment = style.alignment || {};\n\t\t\t\tstyle.alignment.vertical = convertCSSVerticalAlignment(value);\n\t\t\t\tbreak;\n\t\t\tcase 'whiteSpace':\n\t\t\tcase 'white-space':\n\t\t\t\tstyle.alignment = style.alignment || {};\n\t\t\t\tstyle.alignment.wrapText = value && value != 'nowrap';\n\t\t\t\tbreak;\n\t\t\tcase 'color':\n\t\t\t\tstyle.color = convertCSSColor(value);\n\t\t\t\tbreak;\n\t\t\tcase 'background':\n\t\t\tcase 'backgroundColor':\n\t\t\t\tstyle.fgColor = convertCSSColor(value);\n\t\t\t\tbreak;\n\t\t\tcase 'fontSize':\n\t\t\tcase 'font-size':\n\t\t\t\tstyle.sz = parseFloat(value);\n\t\t\t\tbreak;\n\t\t\tcase 'fontWeight':\n\t\t\tcase 'font-weight':\n\t\t\t\tstyle.bold = value == 'bold';\n\t\t\t\tbreak;\n\t\t\tcase 'fontStyle':\n\t\t\tcase 'font-style':\n\t\t\t\tstyle.italic = value == 'italic';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstyle[k as keyof Style] = value;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\treturn style;\n}\n\n// function convertFontSize(size) {\n// \tlet fSize = parseFloat(size);\n// \treturn isNaN(s.fSize) ? (s.fontSizeMap[size.toString().toLowerCase()] || DEFAULT_FONT_SIZE) : (s.fSize * 0.75);\n// }"]}
|
|
1
|
+
{"version":3,"file":"cssStyle.js","sourceRoot":"","sources":["../../src/model/cssStyle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAKrD,MAAM,oBAAoB,GAAG,QAAQ,CAAC;AAEtC,MAAM,UAAU,kBAAkB,CAAC,QAAgB;IAClD,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QAClC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACrC,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC3B,CAAC,CAAC,CAAC;IACH,OAAO,KAAK,CAAC;AACd,CAAC;AAGD,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAGrC;IACF,CAAC,MAAM,EAAE,EAAC,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAC,CAAC;IACtC,CAAC,QAAQ,EAAE,EAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,EAAC,CAAC;IACtC,CAAC,OAAO,EAAE,EAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,EAAC,CAAC;IACrC,CAAC,QAAQ,EAAE,EAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAC,CAAC;IACvC,CAAC,QAAQ,EAAE,EAAC,KAAK,EAAE,GAAG,EAAE,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AK,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,IAAI,EAAE,CAAC;gBACxC,KAAK,CAAC,SAAS,CAAC,QAAQ,GAAG,2BAA2B,CAAC,KAAK,CAAC,CAAC;gBAC9D,MAAM;YACP,KAAK,YAAY,CAAC;YAClB,KAAK,aAAa;gBACjB,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,IAAI,EAAE,CAAC;gBACxC,KAAK,CAAC,SAAS,CAAC,QAAQ,GAAG,KAAK,IAAI,KAAK,IAAI,QAAQ,CAAC;gBACtD,MAAM;YACP,KAAK,OAAO;gBACX,KAAK,CAAC,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;gBACrC,MAAM;YACP,KAAK,YAAY,CAAC;YAClB,KAAK,iBAAiB;gBACrB,KAAK,CAAC,OAAO,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;gBACvC,MAAM;YACP,KAAK,UAAU,CAAC;YAChB,KAAK,WAAW;gBACf,KAAK,CAAC,EAAE,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;gBAC7B,MAAM;YACP,KAAK,YAAY,CAAC;YAClB,KAAK,aAAa;gBACjB,KAAK,CAAC,IAAI,GAAG,KAAK,IAAI,MAAM,CAAC;gBAC7B,MAAM;YACP,KAAK,WAAW,CAAC;YACjB,KAAK,YAAY;gBAChB,KAAK,CAAC,MAAM,GAAG,KAAK,IAAI,QAAQ,CAAC;gBACjC,MAAM;YACP;gBACC,KAAK,CAAC,CAAgB,CAAC,GAAG,KAAK,CAAC;gBAChC,MAAM;QACR,CAAC;IACF,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC,CAAA","sourcesContent":["import { colors, dom, utils } from \"@omegagrid/core\";\nimport { Border, BorderStyle, HorizontalAlignment, Style, VerticalAlignment } from \"./style\";\n\nexport type CSSStyle = Partial<CSSStyleDeclaration> & { [propName: string]: string };\n\nconst DEFAULT_BORDER_COLOR = 'CCCCCC';\n\nexport function cssStyleFromString(strStyle: string): CSSStyle {\n\tconst style: CSSStyle = {};\n\tstrStyle.split(';').forEach(item => {\n\t\tconst [key, value] = item.split(':');\n\t\tstyle[key] = value.trim();\n\t});\n\treturn style;\n}\n\nexport type CSSBorderStyle = 'none'|'solid'|'double'|'dotted'|'dashed';\nexport const borderStyleCSSMap = new Map<BorderStyle, {\n\twidth: number, \n\tstyle: CSSBorderStyle,\n}>([\n\t['thin', {width: 1.5, style: 'solid'}],\n\t['medium', {width: 2, style: 'solid'}],\n\t['thick', {width: 3, style: 'solid'}],\n\t['double', {width: 3, style: 'double'}],\n\t['dotted', {width: 1.5, style: 'dotted'}],\n\t['hair', {width: 1, style: 'solid'}],\n\t['dashed', {width: 1.5, style: 'dashed'}],\n\t['mediumDashed', {width: 2, style: 'dashed'}],\n\t['dashDot', {width: 1.5, style: 'dashed'}],\n\t['mediumDashDot', {width: 2, style: 'dashed'}],\n\t['dashDotDot', {width: 1.5, style: 'dotted'}],\n\t['mediumDashDotDot', {width: 2, style: 'dotted'}],\n\t['slantDashDot', {width: 1.5, style: 'dashed'}],\n\t['none', {width: 1.5, style: 'solid'}],\n]);\n\nexport const borderCSSStyleMap = (() => {\n\tconst map = new Map<CSSBorderStyle, Map<number, BorderStyle>>();\n\tborderStyleCSSMap.forEach((value, key) => {\n\t\tlet widthMap: Map<number, BorderStyle> = map.get(value.style);\n\t\tif (!widthMap) widthMap = map.set(value.style, new Map()).get(value.style);\n\t\twidthMap.set(value.width, key);\n\t});\n\treturn map;\n})();\n\nexport function convertCSSVerticalAlignment(align: string) {\n\treturn (align == 'middle' ? 'center' : align) as VerticalAlignment;\n}\n\nexport function convertCSSColor(color: string) {\n\tcolor = color.charAt(0) == '#' ? color.substring(1) : color;\n\treturn color.length == 3\n\t\t? color[0] + color[0] + color[1] + color[1] + color[2] + color[2]\n\t\t: color;\n}\n\nexport const convertCSSBorder = (border: string): Border => {\n\tif (border == 'none') return null;\n\t\n\tconst chunks = border.split(' ');\n\tconst width = parseInt(chunks[0].charAt(0)) || 1;\n\tconst borderStyle = chunks.length > 1 ? (chunks[1] as CSSBorderStyle) : 'solid';\n\n\tconst widthMap = borderCSSStyleMap.get(borderStyle);\n\treturn {\n\t\tstyle: (widthMap ? widthMap.get(width) : null) ?? 'thin',\n\t\tcolor: chunks.length > 2 ? convertCSSColor(chunks[2]) : DEFAULT_BORDER_COLOR\n\t};\n}\n\nexport const convertToCSSBorder = (b: Border) => {\n\tconst borderStyle = borderStyleCSSMap.get(b.style || 'none');\n\tif (!borderStyle) return 'none';\n\treturn [\n\t\tdom.px(borderStyle.width),\n\t\tborderStyle.style,\n\t\tb.style == 'none' ? 'var(--og-cell-background)' : (b.color ? `#${b.color}` : 'var(--og-border-color)'),\n\t].join(' ');\n}\n\nexport const addPattern = (css: CSSStyle, s: Style) : CSSStyle => {\n\t// background-image: radial-gradient(rgb(255, 255, 255) 10%, transparent 10%), radial-gradient(rgb(255, 255, 255) 10%, transparent 10%);\n\t// background-position: 0px 0px, 4px 4px;\n\t// background-size: 8px 8px;\n\t// background-color: rgb(255, 51, 51);\n\n\t// console.log('addPattern', s.patternType, fgColor, bgColor);\n\n\tconst fg = '#' + (s.fgColor || '000000');\n\tconst bg = '#' + (s.bgColor || 'FFFFFF');\n\n\tswitch (s.patternType) {\n\t\tcase 'solid':\n\t\t\tcss.backgroundColor = fg || bg;\n\t\t\tbreak;\n\t\tcase 'darkGray':\n\t\t\tcss.backgroundColor = colors.darken(bg, 0.75);\n\t\t\tbreak;\n\t\tcase 'mediumGray':\n\t\t\tcss.backgroundColor = colors.darken(bg, 0.50);\n\t\t\tbreak;\n\t\tcase 'lightGray':\n\t\t\tcss.backgroundColor = colors.darken(bg, 0.25);\n\t\t\tbreak;\n\t\tcase 'gray125':\n\t\t\tcss.backgroundColor = colors.darken(bg, 0.125);\n\t\t\tbreak;\n\t\tcase 'gray0625':\n\t\t\tcss.backgroundColor = colors.darken(bg, 0.0625);\n\t\t\tbreak;\n\t\tcase 'darkHorizontal':\n\t\t\tcss.backgroundImage = `linear-gradient(0deg, ${fg} 33.33%, ${bg} 33.33%, ${bg} 50%, ${fg} 50%, ${fg} 83.33%, ${bg} 83.33%, ${bg} 100%)`;\n\t\t\tcss.backgroundSize = '6px 6px';\n\t\t\tbreak;\n\t\tcase 'darkVertical':\n\t\t\tcss.backgroundImage = `linear-gradient(90deg, ${fg} 33.33%, ${bg} 33.33%, ${bg} 50%, ${fg} 50%, ${fg} 83.33%, ${bg} 83.33%, ${bg} 100%)`;\n\t\t\tcss.backgroundSize = '6px 6px';\n\t\t\tbreak;\n\t\tcase 'darkDown':\n\t\t\tcss.backgroundImage = `linear-gradient(45deg, ${fg} 33.33%, ${bg} 33.33%, ${bg} 50%, ${fg} 50%, ${fg} 83.33%, ${bg} 83.33%, ${bg} 100%)`;\n\t\t\tcss.backgroundSize = '6px 6px';\n\t\t\tbreak;\n\t\tcase 'darkUp':\n\t\t\tcss.backgroundImage = `linear-gradient(-45deg, ${fg} 33.33%, ${bg} 33.33%, ${bg} 50%, ${fg} 50%, ${fg} 83.33%, ${bg} 83.33%, ${bg} 100%)`;\n\t\t\tcss.backgroundSize = '6px 6px';\n\t\t\tbreak;\n\t\tcase 'lightHorizontal':\n\t\t\tcss.backgroundImage = `linear-gradient(0deg, ${bg} 25%, ${fg} 25%, ${fg} 50%, ${bg} 50%, ${bg} 75%, ${fg} 75%, ${fg} 100%)`;\n\t\t\tcss.backgroundSize = '4px 4px';\n\t\t\tbreak;\n\t\tcase 'lightVertical':\n\t\t\tcss.backgroundImage = `linear-gradient(90deg, ${bg} 25%, ${fg} 25%, ${fg} 50%, ${bg} 50%, ${bg} 75%, ${fg} 75%, ${fg} 100%)`;\n\t\t\tcss.backgroundSize = '4px 4px';\n\t\t\tbreak;\n\t\tcase 'lightDown':\n\t\t\tcss.backgroundImage = `linear-gradient(45deg, ${bg} 25%, ${fg} 25%, ${fg} 50%, ${bg} 50%, ${bg} 75%, ${fg} 75%, ${fg} 100%)`;\n\t\t\tcss.backgroundSize = '4px 4px';\n\t\t\tbreak;\n\t\tcase 'lightUp':\n\t\t\tcss.backgroundImage = `linear-gradient(-45deg, ${bg} 25%, ${fg} 25%, ${fg} 50%, ${bg} 50%, ${bg} 75%, ${fg} 75%, ${fg} 100%)`;\n\t\t\tcss.backgroundSize = '4px 4px';\n\t\t\tbreak;\n\t\tcase 'darkGrid':\n\t\t\tcss.backgroundImage = `linear-gradient(${bg} 0.5px, transparent 0.5px), linear-gradient(90deg, ${bg} 0.5px, transparent 0.5px)`;\n\t\t\tcss.backgroundSize = '2px 2px';\n\t\t\tbreak;\n\t\tcase 'lightGrid':\n\t\t\tcss.backgroundImage = `linear-gradient(${bg} 0.5px, transparent 0.5px), linear-gradient(90deg, ${bg} 0.5px, transparent 0.5px)`;\n\t\t\tcss.backgroundSize = '1px 1px';\n\t\t\tbreak;\n\t\tcase 'darkTrellis':\n\t\t\tcss.backgroundImage = `linear-gradient(45deg, ${bg} 0.5px, transparent 0.5px), linear-gradient(90deg, ${bg} 0.5px, transparent 0.5px)`;\n\t\t\tcss.backgroundSize = '2px 2px';\n\t\t\tbreak;\n\t\tcase 'lightTrellis':\n\t\t\tcss.backgroundImage = `linear-gradient(45deg, ${bg} 0.5px, transparent 0.5px), linear-gradient(90deg, ${bg} 0.5px, transparent 0.5px)`;\n\t\t\tcss.backgroundSize = '1px 1px';\n\t\t\tbreak;\n\t}\n\n\treturn css;\n}\n\nexport const addGradient = (css: CSSStyle, s: Style) : CSSStyle => {\n\tcss.backgroundImage = `linear-gradient(${(s.angle ?? 0) + 90}deg,${s.stops.map(stop => `#${stop.rgb} ${stop.v * 100}%`).join(',')})`;\n\treturn css;\n}\n\nexport const styleToCSStyle = (s: Style): CSSStyle => {\n\tconst style: CSSStyle = s.cssStyle ? {...s.cssStyle} : {};\n\tif (s.bold != null) style.fontWeight = s.bold ? 'bold' : 'normal';\n\tif (s.italic) style.fontStyle = 'italic';\n\tif (s.underline) style.textDecoration = 'underline';\n\telse if (s.strike) style.textDecoration = 'line-through';\n\tif (s.sz) style.fontSize = dom.numToPixels(s.sz); // (s.sz * 0.75).toString() + 'px';\n\tif (s.color) style.color = '#' + s.color;\n\tif (s.top) style.borderTop = convertToCSSBorder(s.top);\n\tif (s.right) style.borderRight = convertToCSSBorder(s.right);\n\tif (s.bottom) style.borderBottom = convertToCSSBorder(s.bottom);\n\tif (s.left) style.borderLeft = convertToCSSBorder(s.left);\n\tif (s.top || s.right || s.bottom || s.left) style.zIndex = '1';\n\tif (s.alignment && s.alignment.vertical) {\n\t\tstyle.display = 'flex';\n\t\tstyle.justifyContent = s.alignment.horizontal;\n\t\tstyle.alignItems = s.alignment.vertical == 'top' ? 'start' : (s.alignment.vertical == 'bottom' ? 'end' : 'center');\n\t}\n\tif (s.alignment && s.alignment.horizontal) {\n\t\tstyle.textAlign = s.alignment.horizontal;\n\t}\n\tif (s.alignment && s.alignment.wrapText) {\n\t\tstyle.display = 'flex';\n\t\tstyle.justifyContent = style.justifyContent ?? style.textAlign ?? 'left';\n\t\tstyle.alignItems = style.alignItems ?? 'center';\n\t\tstyle.whiteSpace = 'pre-wrap';\n\t}\n\tif (s.patternType) addPattern(style, s);\n\telse if (s.stops && s.stops.length) addGradient(style, s);\n\telse if (s.fgColor) style.backgroundColor = '#' + s.fgColor;\n\telse if (s.bgColor) style.backgroundColor = '#' + s.bgColor;\n\t\n\t///TODO - rotation\n\t\n\treturn style;\n}\n\nexport const cssStyleToStyle = (s: CSSStyle|string): Style => {\n\tconst cssStyle: CSSStyle = utils.isObject(s) ? s as CSSStyle : cssStyleFromString(s as string);\n\tconst style: Style = {};\n\tlet border: Border;\n\tfor (const k in cssStyle) {\n\t\tconst value = cssStyle[k];\n\t\tif (value == null) continue;\n\t\tswitch(k) {\n\t\t\tcase 'borderTop':\n\t\t\tcase 'border-top':\n\t\t\t\tstyle.top = convertCSSBorder(value as string);\n\t\t\t\tbreak;\n\t\t\tcase 'borderTopColor':\n\t\t\tcase 'border-top-color':\n\t\t\t\tif (style.top) style.top.color = convertCSSColor(value as string);\n\t\t\t\telse style.top = {style: 'thin', color: convertCSSColor(value as string)};\n\t\t\t\tbreak;\n\t\t\tcase 'borderRight':\n\t\t\tcase 'border-right':\n\t\t\t\tstyle.right = convertCSSBorder(value as string);\n\t\t\t\tbreak;\n\t\t\tcase 'borderRightColor':\n\t\t\tcase 'border-right-color':\n\t\t\t\tif (style.right) style.right.color = convertCSSColor(value as string);\n\t\t\t\telse style.right = {style: 'thin', color: convertCSSColor(value as string)};\n\t\t\t\tbreak;\n\t\t\tcase 'borderBottom':\n\t\t\tcase 'border-bottom':\n\t\t\t\tstyle.bottom = convertCSSBorder(value as string);\n\t\t\t\tbreak;\n\t\t\tcase 'borderBottomColor':\n\t\t\tcase 'border-bottom-color':\n\t\t\t\tif (style.bottom) style.bottom.color = convertCSSColor(value as string);\n\t\t\t\telse style.bottom = {style: 'thin', color: convertCSSColor(value as string)};\n\t\t\t\tbreak;\n\t\t\tcase 'borderLeft':\n\t\t\tcase 'border-left':\n\t\t\t\tstyle.left = convertCSSBorder(value as string);\n\t\t\t\tbreak;\n\t\t\tcase 'borderLeftColor':\n\t\t\tcase 'border-left-color':\n\t\t\t\tif (style.left) style.left.color = convertCSSColor(value as string);\n\t\t\t\telse style.left = {style: 'thin', color: convertCSSColor(value as string)};\n\t\t\t\tbreak;\t\t\n\t\t\tcase 'border':\n\t\t\t\tborder = convertCSSBorder(value as string);\n\t\t\t\tstyle.top = style.top || border;\n\t\t\t\tstyle.right = style.right || border;\n\t\t\t\tstyle.bottom = style.bottom || border;\n\t\t\t\tstyle.left = style.left || border;\n\t\t\t\tbreak;\n\t\t\tcase 'textAlign':\n\t\t\tcase 'text-align':\n\t\t\t\tstyle.alignment = style.alignment || {};\n\t\t\t\tstyle.alignment.horizontal = value as HorizontalAlignment;\n\t\t\t\tbreak;\n\t\t\tcase 'verticalAlign':\n\t\t\tcase 'vertical-align':\n\t\t\t\tstyle.alignment = style.alignment || {};\n\t\t\t\tstyle.alignment.vertical = convertCSSVerticalAlignment(value);\n\t\t\t\tbreak;\n\t\t\tcase 'whiteSpace':\n\t\t\tcase 'white-space':\n\t\t\t\tstyle.alignment = style.alignment || {};\n\t\t\t\tstyle.alignment.wrapText = value && value != 'nowrap';\n\t\t\t\tbreak;\n\t\t\tcase 'color':\n\t\t\t\tstyle.color = convertCSSColor(value);\n\t\t\t\tbreak;\n\t\t\tcase 'background':\n\t\t\tcase 'backgroundColor':\n\t\t\t\tstyle.fgColor = convertCSSColor(value);\n\t\t\t\tbreak;\n\t\t\tcase 'fontSize':\n\t\t\tcase 'font-size':\n\t\t\t\tstyle.sz = parseFloat(value);\n\t\t\t\tbreak;\n\t\t\tcase 'fontWeight':\n\t\t\tcase 'font-weight':\n\t\t\t\tstyle.bold = value == 'bold';\n\t\t\t\tbreak;\n\t\t\tcase 'fontStyle':\n\t\t\tcase 'font-style':\n\t\t\t\tstyle.italic = value == 'italic';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstyle[k as keyof Style] = value;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\treturn style;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omegagrid/grid-core",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.46",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"description": "Grid model, no ui components",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"generate-functions-docs": "node ./scripts/generate-functions-docs.cjs"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@omegagrid/core": "^0.9.
|
|
32
|
-
"@omegagrid/localize": "^0.9.
|
|
31
|
+
"@omegagrid/core": "^0.9.46",
|
|
32
|
+
"@omegagrid/localize": "^0.9.46",
|
|
33
33
|
"@stdlib/stats": "^0.0.13",
|
|
34
34
|
"color": "^4.2.3",
|
|
35
35
|
"date-fns": "^3.2.0",
|