@omegagrid/grid-core 0.6.68 → 0.6.70
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/model/cellModel.d.ts +7 -2
- package/dist/model/cellModel.d.ts.map +1 -1
- package/dist/model/cellModel.js +14 -4
- package/dist/model/cellModel.js.map +1 -1
- package/dist/model/cssStyle.d.ts.map +1 -1
- package/dist/model/cssStyle.js +1 -1
- package/dist/model/cssStyle.js.map +1 -1
- package/package.json +3 -3
|
@@ -45,9 +45,13 @@ export declare class CellModel extends ElementModel {
|
|
|
45
45
|
private _colspan;
|
|
46
46
|
get colspan(): number;
|
|
47
47
|
set colspan(v: number);
|
|
48
|
-
|
|
48
|
+
private _row;
|
|
49
|
+
get row(): RowModel;
|
|
49
50
|
get r(): number;
|
|
50
|
-
|
|
51
|
+
set row(v: RowModel);
|
|
52
|
+
private _column;
|
|
53
|
+
get column(): ColumnModel;
|
|
54
|
+
set column(v: ColumnModel);
|
|
51
55
|
get c(): number;
|
|
52
56
|
private _value;
|
|
53
57
|
private _evaluated;
|
|
@@ -95,6 +99,7 @@ export declare class CellModel extends ElementModel {
|
|
|
95
99
|
get editorContent(): unknown;
|
|
96
100
|
get adapter(): ComponentAdapter;
|
|
97
101
|
set adapter(value: ComponentAdapter);
|
|
102
|
+
private _address;
|
|
98
103
|
get address(): string;
|
|
99
104
|
get range(): CellRange;
|
|
100
105
|
get validation(): import("../types").CellValidation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cellModel.d.ts","sourceRoot":"","sources":["../../src/model/cellModel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAS,OAAO,EAAS,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAE1F,OAAO,
|
|
1
|
+
{"version":3,"file":"cellModel.d.ts","sourceRoot":"","sources":["../../src/model/cellModel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAS,OAAO,EAAS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AAI,aAAa,gCAA2H;IAC5I,IAAI,eAAe,uCAAqI;IACxJ,IAAI,MAAM,IACI,OAAO,CAAC,kBAAkB,CADoC;IAC5E,IAAI,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,kBAAkB,EAAsB;IAE9D,OAAO,CAAC,UAAU,CAAU;IAC5B,IAAI,SAAS,IACI,MAAM,CADmB;IAC1C,IAAI,SAAS,CAAC,CAAC,EAAE,MAAM,EAAyB;IAEhD,OAAO,CAAC,WAAW,CAAU;IAE7B,IAAI,aAAa,YAA6B;IAC9C,IAAI,UAAU,YAGb;IACD,IAAI,OAAO,IACI,MAAM,CAD2D;IAChF,IAAI,OAAO,CAAC,CAAC,EAAE,MAAM,EAGpB;IAED,eAAe;IAUf,cAAc;IAKd,YAAY;gBAMA,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU;IAOhD,QAAQ,CAAC,MAAM,EAAE,UAAU;IAW3B,MAAM,CAAC,MAAM,EAAE,UAAU;IAYzB,aAAa,CAAC,OAAO,CAAC,EAAE,wBAAwB,GAAI,UAAU;IAe9D,OAAO,CAAC,mBAAmB;IAqB3B,IAAI,aAAa,IAAK,KAAK,CAO1B;IAED,IAAI,gBAAgB,IAAI,MAAM,GAAC,IAAI,CAUlC;IAED,IAAI,QAAQ,IAAK,QAAQ,CASxB;IAED,eAAe;IAQf,kBAAkB,CAAC,KAAK,EAAE,MAAM,CAAC,gBAAgB,EAAE,OAAO,CAAC;IAK3D,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE;IAKrC,sBAAsB,CACrB,KAAK,EAAE,MAAM,CAAC,gBAAgB,EAAE,OAAO,CAAC,EACxC,IAAI,GAAE,MAAM,GAAC,QAAQ,GAAC,KAAc;IAWrC,QAAQ;IAKR,QAAQ;CAER"}
|
package/dist/model/cellModel.js
CHANGED
|
@@ -58,8 +58,18 @@ export class CellModel extends ElementModel {
|
|
|
58
58
|
set rowspan(v) { this._rowspan = v; }
|
|
59
59
|
get colspan() { return this._colspan; }
|
|
60
60
|
set colspan(v) { this._colspan = v; }
|
|
61
|
-
get
|
|
62
|
-
get
|
|
61
|
+
get row() { return this._row; }
|
|
62
|
+
get r() { return this._row.index; }
|
|
63
|
+
set row(v) {
|
|
64
|
+
this._row = v;
|
|
65
|
+
this._address = null;
|
|
66
|
+
}
|
|
67
|
+
get column() { return this._column; }
|
|
68
|
+
set column(v) {
|
|
69
|
+
this._column = v;
|
|
70
|
+
this._address = null;
|
|
71
|
+
}
|
|
72
|
+
get c() { return this._column.index; }
|
|
63
73
|
get hasValue() { return this._value != null; }
|
|
64
74
|
get value() {
|
|
65
75
|
if (!this._evaluated)
|
|
@@ -174,7 +184,7 @@ export class CellModel extends ElementModel {
|
|
|
174
184
|
get editorContent() { return super.editorContent ?? this.elm1.editorContent ?? this.elm2.editorContent ?? null; }
|
|
175
185
|
get adapter() { return super.adapter ?? this.elm1.adapter ?? this.elm2.adapter; }
|
|
176
186
|
set adapter(value) { this._adapter = value; }
|
|
177
|
-
get address() { return this.column.address + this.row.address; }
|
|
187
|
+
get address() { return this._address ?? (this._address = this.column.address + this.row.address); }
|
|
178
188
|
get range() { return CellRange.fromA1(this.address); }
|
|
179
189
|
get validation() { return super.validation ?? this.elm1.validation ?? this.elm2.validation ?? this.model.options.cellValidation; }
|
|
180
190
|
get editable() { return super.editable ?? this.elm1.editable ?? this.elm2.editable ?? this.model.options.editable; }
|
|
@@ -233,7 +243,7 @@ export class CellModel extends ElementModel {
|
|
|
233
243
|
this._rowspan = source.rs ?? 1;
|
|
234
244
|
this._tooltip = source.tooltip;
|
|
235
245
|
this._hyperlink = source.hl;
|
|
236
|
-
if (source.f != null)
|
|
246
|
+
if (source.f != null && source.f !== '')
|
|
237
247
|
this._evaluated = false;
|
|
238
248
|
else if (source.v != null)
|
|
239
249
|
this.value = source.v; // load static value only if no formula is present
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cellModel.js","sourceRoot":"","sources":["../../src/model/cellModel.ts"],"names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I,CAAC,SAAS,GAAG,cAAc,CAAC,aAAa,CAAC,CAAC;IAChD,CAAC;IAED,QAAQ;QACP,IAAI,CAAC,IAAI,CAAC,UAAU;YAAE,OAAO,IAAI,CAAC;QAClC,OAAO,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC;IAED,QAAQ,KAAK,OAAO,IAAI,CAAC,OAAO,CAAA,CAAC,CAAC;CAElC","sourcesContent":["import { ComponentAdapter, dates, numbers, utils, ValueFormatter } from \"@omegagrid/core\";\nimport { isFormula, prefixFormula } from \"../calculations/formula\";\nimport { CellRange } from \"../common\";\n// import { cellTypeRendererMap } from \"../renderers\";\nimport { ColumnModel } from \"./columnModel\";\nimport { ElementModel, ElementSource } from \"./elementModel\";\nimport { GridModel } from \"./gridModel\";\nimport { RowModel } from \"./rowModel\";\nimport { Style, StylePropertyKey } from \"./style\";\nimport { CSSStyle, styleToCSStyle } from \"./cssStyle\";\nimport { CellSerializationOptions, CellType } from \"../types\";\nimport { CommentSource } from \"./commentModel\";\nimport { validateValue } from \"./validations\";\n\n/** Source object type for grid cell */\nexport type CellSource = {\n\t/** row index */\n\tr: number;\n\t/** col index */\n\tc: number;\n\t/** cell value */\n\tv?: unknown;\n\t/** cell display value */\n\tdv?: string;\n\t/** cell column span */\n\tcs?: number;\n\t/** cell row span */\n\trs?: number;\n\t/** hyperlink */\n\thl?: string;\n\t/** cell tooltip content */\n\ttooltip?: string|unknown;\n\t/** comment */\n\tcomment?: CommentSource;\n} & ElementSource;\n\nconst cellValueHandler: Record<string, (v: unknown, cell: CellModel) => unknown> = {\n\t['n']: (v) => {\n\t\tconst value = utils.isString(v) ? parseFloat(v as string) : v;\n\t\treturn Number.isNaN(value) ? v : value;\n\t},\n\t['t']: (v) => v,\n\t['d']: (v, cell) => {\n\t\tif (utils.isString(v)) {\n\t\t\treturn utils.isNumericString(v as string) \n\t\t\t\t? utils.strToNum(v as string)\n\t\t\t\t: dates.dateToSerialDate(dates.parse(v as string, cell.model.options.formatLocale));\n\t\t} else if (v instanceof Date) {\n\t\t\treturn dates.dateToSerialDate(v);\n\t\t} else return v;\n\t},\n\t['tm']: (v) => utils.isString(v) ? new Date(v as string) : v,\n\t['dt']: (v) => utils.isString(v) ? new Date(v as string) : v,\n\t['b']: (v) => !!v && v !== '0' && v.toString().toLowerCase() !== 'false',\n\t['s']: (v) => v,\n\t['m']: (v) => v,\n\t['g']: (v) => {\n\t\tif (v == null) return null;\n\t\tconst f = parseFloat(v as string);\n\t\treturn isNaN(f) ? v : f;\n\t},\n\t['a']: (v) => utils.isString(v) && v !== '' ? JSON.parse(v as string) : v,\n\t['h']: (v) => v,\n};\n\nconst dropdownFormatters = new Map<{k: string, v: string}[], ValueFormatter<string>>();\nconst getDropdownFormatter = (content?: {k: string, v: string}[]) => {\n\tcontent = content || null;\n\tif (!dropdownFormatters.has(content)) {\n\t\tif (content) {\n\t\t\tconst items = content.reduce((map, e) => map.set(e.k, e.v), new Map<string, string>());\n\t\t\tdropdownFormatters.set(content, (k: string) => items.has(k) ? items.get(k) : k);\n\t\t} else {\n\t\t\tdropdownFormatters.set(content, (k: string) => k);\n\t\t}\n\t}\n\treturn dropdownFormatters.get(content);\n};\n\nexport type CellError = {\n\tmessage: string;\n\thandled?: boolean;\n}\n\nexport class CellModel extends ElementModel {\n\t\n\tpublic _content: HTMLDivElement;\n\t\n\tprivate _tooltip: string|unknown;\n\tget tooltip() { return this._tooltip }\n\tset tooltip(v: string|unknown) { this._tooltip = v }\n\tget hasTooltip() { return this._tooltip != null }\n\t\n\tprivate _rowspan : number;\n\tget rowspan() { return this._rowspan }\n\tset rowspan(v: number) { this._rowspan = v }\n\t\n\tprivate _colspan : number;\n\tget colspan() { return this._colspan }\n\tset colspan(v: number) { this._colspan = v }\n\t\n\tpublic row: RowModel;\n\tget r() { return this.row.index}\n\t\n\tpublic column: ColumnModel;\n\tget c() { return this.column.index }\n\n\tprivate _value: unknown;\n\tprivate _evaluated = true;\n\tget hasValue() { return this._value != null }\n\tget value() { \n\t\tif (!this._evaluated) this.evaluate();\n\t\treturn this._value \n\t}\n\tset value(v: unknown) {\n\t\tif (v && isFormula(v.toString())) {\n\t\t\tthis._value = undefined;\n\t\t\tthis.formula = v as string;\n\t\t} else {\n\t\t\tlet value = cellValueHandler[this.type](v, this);\n\t\t\t\n\t\t\tif (!validateValue(this, value)) value = undefined;\n\t\t\t\n\t\t\tif (value !== this._value) {\n\t\t\t\tthis._value = value;\n\t\t\t\tthis._displayValue = undefined;\n\t\t\t}\n\t\t\t\n\t\t\tif (this.row.data && this.column.data) {\n\t\t\t\tthis.row.data[this.column.data] = this._value;\n\t\t\t}\n\t\t}\n\t}\n\tevaluate() {\n\t\tthis._value = cellValueHandler[this.type](this.model.calculations.evaluate(this), this);\n\t\tthis._evaluated = true;\n\t\treturn this._value;\n\t}\n\t\n\tget value2() { return this.hasFormula ? prefixFormula(this.formula) : this.value }\n\n\tprivate _displayValue: string;\n\tget hasDisplayValue() { return this._displayValue != null }\n\tget displayValue() { return this._displayValue }\n\tset displayValue(v: string) { this._displayValue = v }\n\t\n\t/* tells if cell has type that prefers usage of display value */\n\tget prefersDisplayValue() { return ['s', 'm'].includes(this.type) }\n\n\tprivate _error: CellError;\n\tget error() { return this._error }\n\tset error(v: CellError) { this._error = v }\n\tget hasError() { return !!this._error }\n\tclearError() { this._error = undefined }\n\n\tprivate _spillRange: CellRange;\n\tprivate _prevSpillRange: CellRange;\n\tget spillRange() { return this._spillRange }\n\tget prevSpillRange() { return this._prevSpillRange }\n\tset spillRange(v: CellRange) {\n\t\tif (this._spillRange && (!v || !this._spillRange.equals(v))) {\n\t\t\tthis._prevSpillRange = this._spillRange;\n\t\t}\n\t\tthis._spillRange = v;\n\t}\n\tget isSpillSource() { return this._spillRange != null }\n\n\tprivate _spillSource: CellModel;\n\tget spillSource() { return this._spillSource }\n\tget isSpilled() { return this._spillSource != null }\n\tspillValue(v: unknown, source?: CellModel) {\n\t\tthis.value = v;\n\t\tthis._spillSource = source;\n\t}\n\tclearSpilledValue() {\n\t\tthis._spillSource = undefined;\n\t\tthis._value = undefined;\n\t}\n\n\tprivate _sparkline: boolean = null;\n\tget hasSparkline() {\n\t\treturn this._sparkline === null ? (this._sparkline = this.model.sparklines.has(this.address)) : this._sparkline;\n\t}\n\t\n\tprivate _hasComment?: boolean = null;\n\tget hasComment() {\n\t\treturn this._hasComment === null ? (\n\t\t\tthis._hasComment = (this.model.comments.get(this.address) ?? []).length > 0\n\t\t) : this._hasComment;\n\t}\n\tget comments() { return this.model.comments.get(this.address) }\n\n\tprivate _composedStyle: Style;\n\tprivate _cssStyle: CSSStyle;\n\tprivate _hasStyle?: boolean = null;\n\n\tget valueFormatter(): ValueFormatter<unknown> {\n\t\tconst formatter = super.valueFormatter ?? this.row.valueFormatter ?? this.column.valueFormatter;\n\t\tif (formatter) return formatter;\n\n\t\tconst type = this.type;\n\t\tconst format = this.format;\n\t\tconst { formatLocale, fixNumberFormat } = this.model.options;\n\t\tconst v = this.value;\n\n\t\tif (v == null || v === '') {\n\t\t\treturn null;\n\t\t} else if (type == 'n') {\n\t\t\tif (format != null) return numbers.getNumberFormatter(formatLocale, format, fixNumberFormat);\n\t\t\telse return this.model.options.numberFormatter;\n\t\t} else if (type == 'g') {\n\t\t\tif (format != null) return numbers.getNumberFormatter(formatLocale, format, fixNumberFormat);\n\t\t\telse if (utils.isNumber(v)) return this.model.options.numberFormatter;\n\t\t} else if (type == 't') {\n\t\t\treturn format == null ? null : numbers.getNumberFormatter(formatLocale, format, false);\n\t\t} else if (type == 'd') {\n\t\t\treturn format ? dates.getDateFormatter(formatLocale, format) : this.model.options.dateFormatter;\n\t\t} else if (type == 's' && this.editorContent) {\n\t\t\treturn getDropdownFormatter(this.editorContent as {k: string, v: string}[]);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tget formattedValue(): string {\n\t\tif (this.value == null) return '';\n\t\tif (this.hasDisplayValue) return this.displayValue;\n\t\treturn this.valueFormatter ? this.valueFormatter(this.value) : this.value.toString();\n\t}\n\t\n\tprivate get elm1() { return this.row.priority >= this.column.priority ? this.row : this.column }\n\tprivate get elm2() { return this.row.priority < this.column.priority ? this.row : this.column }\n\n\tget clickable() { return super.clickable ?? this.elm1.clickable ?? this.elm2.clickable }\n\tget type() { return super.type ?? this.elm1.type ?? this.elm2.type ?? 'g' }\n\tset type(value: CellType) { this._type = value }\n\tget editorContent() { return super.editorContent ?? this.elm1.editorContent ?? this.elm2.editorContent ?? null }\n\tget adapter() { return super.adapter ?? this.elm1.adapter ?? this.elm2.adapter }\n\tset adapter(value: ComponentAdapter) { this._adapter = value }\n\tget address() { return this.column.address + this.row.address }\n\tget range() { return CellRange.fromA1(this.address) }\n\tget validation() { return super.validation ?? this.elm1.validation ?? this.elm2.validation ?? this.model.options.cellValidation }\n\tget editable() { return super.editable ?? this.elm1.editable ?? this.elm2.editable ?? this.model.options.editable }\n\tset editable(v: boolean) { this._editable = v }\n\tget commentable() { return super.commentable ?? this.elm1.commentable ?? this.elm2.commentable ?? this.model.options.commentable }\n\tget renderer() { return super.renderer ?? this.elm1.renderer ?? this.elm2.renderer }\n\tget afterRenderer() { return super.afterRenderer ?? this.elm1.afterRenderer ?? this.elm2.afterRenderer ?? this.model.options.afterRenderer }\n\tget commentRenderer() { return super.commentRenderer ?? this.elm1.commentRenderer ?? this.elm2.commentRenderer ?? this.model.options.comments.renderer }\n\tget format() { return super.format ?? this.elm1.format ?? this.elm2.format }\n\tset format(v: numbers.NumberFormatString) { super.format = v }\n\n\tprivate _hyperlink : string;\n\tget hyperlink() { return this._hyperlink }\n\tset hyperlink(v: string) { this._hyperlink = v }\n\n\tprivate _hasFormula: boolean;\n\n\tget hasOwnFormula() { return !!this._formula }\n\tget hasFormula() {\n\t\tif (this._hasFormula == null) this._hasFormula = !!this.formula;\n\t\treturn this._hasFormula;\n\t}\n\tget formula() { return this._formula ?? this.elm1.formula ?? this.elm2.formula }\n\tset formula(v: string) {\n\t\tsuper.formula = v;\n\t\tthis.refreshFormula();\n\t}\n\n\tinvalidateValue() {\n\t\tif (this.hasFormula) {\n\t\t\tthis._value = undefined;\n\t\t\tthis._evaluated = false;\n\t\t} else {\n\t\t\tthis._evaluated = true;\n\t\t}\n\t\tthis.clearError();\n\t}\n\n\trefreshFormula() { \n\t\tthis.invalidateValue();\n\t\tthis._hasFormula = null;\n\t}\n\n\tclearFormula() {\n\t\tthis._formula = null;\n\t\tthis._hasFormula = false;\n\t\tthis._evaluated = true;\n\t}\n\n\tconstructor(model: GridModel, source: CellSource) {\n\t\tsuper(model);\n\t\tthis.row = model.rows[source.r];\n\t\tthis.column = model.columns[source.c];\n\t\tthis.populate(source);\n\t}\n\n\tpopulate(source: CellSource) {\n\t\tsuper.populate(source);\n\t\tthis._colspan = source.cs ?? 1;\n\t\tthis._rowspan = source.rs ?? 1;\n\t\tthis._tooltip = source.tooltip;\n\t\tthis._hyperlink = source.hl;\n\t\tif (source.f != null) this._evaluated = false;\n\t\telse if (source.v != null) this.value = source.v; // load static value only if no formula is present\n\t\tthis._displayValue = source.dv; // display value must be set after value\n\t}\n\n\tupdate(source: CellSource) {\n\t\tconst updatedProps = super.update(source) as CellSource;\n\t\tif ('cs' in source) { updatedProps.cs = this._colspan; this._colspan = source.cs; }\n\t\tif ('rs' in source) { updatedProps.rs = this._rowspan; this._rowspan = source.rs; }\n\t\tif ('tooltip' in source) { updatedProps.tooltip = this._tooltip; this._tooltip = source.tooltip; }\n\t\tif ('hl' in source) { updatedProps.hl = this._hyperlink; this._hyperlink = source.hl; }\n\t\tif ('f' in source) { this._evaluated = false; }\n\t\telse if ('v' in source) { updatedProps.v = this.value; this.value = source.v; }\n\t\tif ('dv' in source) { updatedProps.dv = this._displayValue; this._displayValue = source.dv; }\n\t\treturn updatedProps;\n\t}\n\n\tgetSourceData(options?: CellSerializationOptions) : CellSource {\n\t\tconst data = super.getSourceData() as CellSource;\n\t\tif (this._colspan > 1) data.cs = this._colspan;\n\t\tif (this._rowspan > 1) data.rs = this._rowspan;\n\t\tif (this.value != null) data.v = this.value;\n\t\tif (this.hasTooltip) data.tooltip = this._tooltip;\n\t\tif (this._hyperlink) data.hl = this._hyperlink;\n\n\t\tif (options) {\n\t\t\tif (options.displayValue && this.hasDisplayValue) data.dv = this._displayValue;\n\t\t}\n\n\t\treturn data;\n\t}\n\n\tprivate createComposedStyle(columnStyle?: Style|number, rowStyle?: Style|number, extraStyle?: Style) {\n\t\tconst styles: (number|Style)[] = [];\n\t\t\n\t\tcolumnStyle = columnStyle || this.column.style;\n\t\trowStyle = rowStyle || this.row.style;\n\t\tif (columnStyle != null && rowStyle != null) {\n\t\t\tif (this.column.priority > this.row.priority) {\n\t\t\t\tstyles.push(rowStyle, columnStyle);\n\t\t\t} else {\n\t\t\t\tstyles.push(columnStyle, rowStyle);\n\t\t\t}\n\t\t} \n\t\telse if (columnStyle != null) styles.push(columnStyle);\n\t\telse if (rowStyle != null) styles.push(rowStyle); \n\n\t\tif (this.style != null) styles.push(this.style);\n\t\tif (extraStyle != null) styles.push(extraStyle);\n\n\t\treturn styles.length > 0 ? this.model.styles.merge(...styles) : null;\n\t}\n\n\tget composedStyle() : Style {\n\t\tif (this._hasStyle === null) {\n\t\t\tconst s = this.createComposedStyle(null, null, this.model.conditionalFormats.evaluate(this));\n\t\t\tthis._hasStyle = s != null;\n\t\t\tthis._composedStyle = s;\n\t\t}\n\t\treturn this._composedStyle;\n\t}\n\n\tget calculatedIndent(): number|null {\n\t\tconst s = this.composedStyle;\n\t\tif (s?.alignment?.indent) return s.alignment.indent;\n\n\t\t// calculates cell text indent based on row level\n\t\tif (this.column.levelIndent && this.row.level > 0) {\n\t\t\treturn this.row.level * this.model.options.levelIndentFactor;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tget cssStyle() : CSSStyle {\n\t\tif (this._hasStyle === false) return null;\n\t\tif (!this._cssStyle) {\n\t\t\tconst composedStyle = this.composedStyle;\n\t\t\tif (composedStyle) {\n\t\t\t\tthis._cssStyle = styleToCSStyle(composedStyle);\n\t\t\t}\n\t\t}\n\t\treturn this._cssStyle;\n\t}\n\n\tinvalidateStyle() {\n\t\tthis._hasComment = null;\n\t\tthis._hasStyle = null;\n\t\tthis._composedStyle = null;\n\t\tthis._cssStyle = null;\n\t\tthis._sparkline = null;\n\t}\n\n\tsetStyleProperties(props: Record<StylePropertyKey, unknown>) {\n\t\tsuper.setStyleProperties(props);\n\t\tthis.invalidateStyle();\n\t}\n\n\tremoveStyleProperties(props: string[]) {\n\t\tsuper.removeStyleProperties(props);\n\t\tthis.invalidateStyle();\n\t}\n\n\tpreviewStyleProperties(\n\t\tprops: Record<StylePropertyKey, unknown>,\n\t\ttype: 'cell'|'column'|'row' = 'cell'\n\t) {\n\t\tconst composedStyle = Object.assign({}, this.createComposedStyle(type == 'column' ? props : null, type == 'row' ? props : null) ?? {});\n\t\t\n\t\tif (type == 'cell') {\n\t\t\tfor (const k in props) composedStyle[k] = props[k];\n\t\t}\n\t\tthis._hasStyle = true;\n\t\tthis._cssStyle = styleToCSStyle(composedStyle);\n\t}\n\n\tvalidate() {\n\t\tif (!this.validation) return true;\n\t\treturn validateValue(this, this.value);\n\t}\n\n\ttoString() { return this.address }\n\n}"]}
|
|
1
|
+
{"version":3,"file":"cellModel.js","sourceRoot":"","sources":["../../src/model/cellModel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,EAAE,OAAO,EAAE,KAAK,EAAkB,MAAM,iBAAiB,CAAC;AAC1F,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAe,SAAS,EAAE,MAAM,WAAW,CAAC;AAGnD,OAAO,EAAE,YAAY,EAAiB,MAAM,gBAAgB,CAAC;AAI7D,OAAO,EAAY,cAAc,EAAE,MAAM,YAAY,CAAC;AAGtD,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAwB9C,MAAM,gBAAgB,GAA6D;IAClF,CAAC,GAAG,CAAC,EAAE,C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C,CAAC;QACpD,CAAC;QACD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,SAAS,GAAG,cAAc,CAAC,aAAa,CAAC,CAAC;IAChD,CAAC;IAED,QAAQ;QACP,IAAI,CAAC,IAAI,CAAC,UAAU;YAAE,OAAO,IAAI,CAAC;QAClC,OAAO,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC;IAED,QAAQ,KAAK,OAAO,IAAI,CAAC,OAAO,CAAA,CAAC,CAAC;CAElC","sourcesContent":["import { ComponentAdapter, dates, numbers, utils, ValueFormatter } from \"@omegagrid/core\";\nimport { isFormula, prefixFormula } from \"../calculations/formula\";\nimport { CellAddress, CellRange } from \"../common\";\n// import { cellTypeRendererMap } from \"../renderers\";\nimport { ColumnModel } from \"./columnModel\";\nimport { ElementModel, ElementSource } from \"./elementModel\";\nimport { GridModel } from \"./gridModel\";\nimport { RowModel } from \"./rowModel\";\nimport { Style, StylePropertyKey } from \"./style\";\nimport { CSSStyle, styleToCSStyle } from \"./cssStyle\";\nimport { CellSerializationOptions, CellType } from \"../types\";\nimport { CommentSource } from \"./commentModel\";\nimport { validateValue } from \"./validations\";\n\n/** Source object type for grid cell */\nexport type CellSource = {\n\t/** row index */\n\tr: number;\n\t/** col index */\n\tc: number;\n\t/** cell value */\n\tv?: unknown;\n\t/** cell display value */\n\tdv?: string;\n\t/** cell column span */\n\tcs?: number;\n\t/** cell row span */\n\trs?: number;\n\t/** hyperlink */\n\thl?: string;\n\t/** cell tooltip content */\n\ttooltip?: string|unknown;\n\t/** comment */\n\tcomment?: CommentSource;\n} & ElementSource;\n\nconst cellValueHandler: Record<string, (v: unknown, cell: CellModel) => unknown> = {\n\t['n']: (v) => {\n\t\tconst value = utils.isString(v) ? parseFloat(v as string) : v;\n\t\treturn Number.isNaN(value) ? v : value;\n\t},\n\t['t']: (v) => v,\n\t['d']: (v, cell) => {\n\t\tif (utils.isString(v)) {\n\t\t\treturn utils.isNumericString(v as string) \n\t\t\t\t? utils.strToNum(v as string)\n\t\t\t\t: dates.dateToSerialDate(dates.parse(v as string, cell.model.options.formatLocale));\n\t\t} else if (v instanceof Date) {\n\t\t\treturn dates.dateToSerialDate(v);\n\t\t} else return v;\n\t},\n\t['tm']: (v) => utils.isString(v) ? new Date(v as string) : v,\n\t['dt']: (v) => utils.isString(v) ? new Date(v as string) : v,\n\t['b']: (v) => !!v && v !== '0' && v.toString().toLowerCase() !== 'false',\n\t['s']: (v) => v,\n\t['m']: (v) => v,\n\t['g']: (v) => {\n\t\tif (v == null) return null;\n\t\tconst f = parseFloat(v as string);\n\t\treturn isNaN(f) ? v : f;\n\t},\n\t['a']: (v) => utils.isString(v) && v !== '' ? JSON.parse(v as string) : v,\n\t['h']: (v) => v,\n};\n\nconst dropdownFormatters = new Map<{k: string, v: string}[], ValueFormatter<string>>();\nconst getDropdownFormatter = (content?: {k: string, v: string}[]) => {\n\tcontent = content || null;\n\tif (!dropdownFormatters.has(content)) {\n\t\tif (content) {\n\t\t\tconst items = content.reduce((map, e) => map.set(e.k, e.v), new Map<string, string>());\n\t\t\tdropdownFormatters.set(content, (k: string) => items.has(k) ? items.get(k) : k);\n\t\t} else {\n\t\t\tdropdownFormatters.set(content, (k: string) => k);\n\t\t}\n\t}\n\treturn dropdownFormatters.get(content);\n};\n\nexport type CellError = {\n\tmessage: string;\n\thandled?: boolean;\n}\n\nexport class CellModel extends ElementModel {\n\t\n\tpublic _content: HTMLDivElement;\n\t\n\tprivate _tooltip: string|unknown;\n\tget tooltip() { return this._tooltip }\n\tset tooltip(v: string|unknown) { this._tooltip = v }\n\tget hasTooltip() { return this._tooltip != null }\n\t\n\tprivate _rowspan : number;\n\tget rowspan() { return this._rowspan }\n\tset rowspan(v: number) { this._rowspan = v }\n\t\n\tprivate _colspan : number;\n\tget colspan() { return this._colspan }\n\tset colspan(v: number) { this._colspan = v }\n\t\n\tprivate _row: RowModel;\n\tget row() { return this._row }\n\tget r() { return this._row.index}\n\tset row(v: RowModel) {\n\t\tthis._row = v;\n\t\tthis._address = null;\n\t}\n\t\n\tprivate _column: ColumnModel;\n\tget column() { return this._column }\n\tset column(v: ColumnModel) {\n\t\tthis._column = v;\n\t\tthis._address = null;\n\t}\n\tget c() { return this._column.index }\n\n\tprivate _value: unknown;\n\tprivate _evaluated = true;\n\tget hasValue() { return this._value != null }\n\tget value() { \n\t\tif (!this._evaluated) this.evaluate();\n\t\treturn this._value \n\t}\n\tset value(v: unknown) {\n\t\tif (v && isFormula(v.toString())) {\n\t\t\tthis._value = undefined;\n\t\t\tthis.formula = v as string;\n\t\t} else {\n\t\t\tlet value = cellValueHandler[this.type](v, this);\n\t\t\t\n\t\t\tif (!validateValue(this, value)) value = undefined;\n\t\t\t\n\t\t\tif (value !== this._value) {\n\t\t\t\tthis._value = value;\n\t\t\t\tthis._displayValue = undefined;\n\t\t\t}\n\t\t\t\n\t\t\tif (this.row.data && this.column.data) {\n\t\t\t\tthis.row.data[this.column.data] = this._value;\n\t\t\t}\n\t\t}\n\t}\n\tevaluate() {\n\t\tthis._value = cellValueHandler[this.type](this.model.calculations.evaluate(this), this);\n\t\tthis._evaluated = true;\n\t\treturn this._value;\n\t}\n\t\n\tget value2() { return this.hasFormula ? prefixFormula(this.formula) : this.value }\n\n\tprivate _displayValue: string;\n\tget hasDisplayValue() { return this._displayValue != null }\n\tget displayValue() { return this._displayValue }\n\tset displayValue(v: string) { this._displayValue = v }\n\t\n\t/* tells if cell has type that prefers usage of display value */\n\tget prefersDisplayValue() { return ['s', 'm'].includes(this.type) }\n\n\tprivate _error: CellError;\n\tget error() { return this._error }\n\tset error(v: CellError) { this._error = v }\n\tget hasError() { return !!this._error }\n\tclearError() { this._error = undefined }\n\n\tprivate _spillRange: CellRange;\n\tprivate _prevSpillRange: CellRange;\n\tget spillRange() { return this._spillRange }\n\tget prevSpillRange() { return this._prevSpillRange }\n\tset spillRange(v: CellRange) {\n\t\tif (this._spillRange && (!v || !this._spillRange.equals(v))) {\n\t\t\tthis._prevSpillRange = this._spillRange;\n\t\t}\n\t\tthis._spillRange = v;\n\t}\n\tget isSpillSource() { return this._spillRange != null }\n\n\tprivate _spillSource: CellModel;\n\tget spillSource() { return this._spillSource }\n\tget isSpilled() { return this._spillSource != null }\n\tspillValue(v: unknown, source?: CellModel) {\n\t\tthis.value = v;\n\t\tthis._spillSource = source;\n\t}\n\tclearSpilledValue() {\n\t\tthis._spillSource = undefined;\n\t\tthis._value = undefined;\n\t}\n\n\tprivate _sparkline: boolean = null;\n\tget hasSparkline() {\n\t\treturn this._sparkline === null ? (this._sparkline = this.model.sparklines.has(this.address)) : this._sparkline;\n\t}\n\t\n\tprivate _hasComment?: boolean = null;\n\tget hasComment() {\n\t\treturn this._hasComment === null ? (\n\t\t\tthis._hasComment = (this.model.comments.get(this.address) ?? []).length > 0\n\t\t) : this._hasComment;\n\t}\n\tget comments() { return this.model.comments.get(this.address) }\n\n\tprivate _composedStyle: Style;\n\tprivate _cssStyle: CSSStyle;\n\tprivate _hasStyle?: boolean = null;\n\n\tget valueFormatter(): ValueFormatter<unknown> {\n\t\tconst formatter = super.valueFormatter ?? this.row.valueFormatter ?? this.column.valueFormatter;\n\t\tif (formatter) return formatter;\n\n\t\tconst type = this.type;\n\t\tconst format = this.format;\n\t\tconst { formatLocale, fixNumberFormat } = this.model.options;\n\t\tconst v = this.value;\n\n\t\tif (v == null || v === '') {\n\t\t\treturn null;\n\t\t} else if (type == 'n') {\n\t\t\tif (format != null) return numbers.getNumberFormatter(formatLocale, format, fixNumberFormat);\n\t\t\telse return this.model.options.numberFormatter;\n\t\t} else if (type == 'g') {\n\t\t\tif (format != null) return numbers.getNumberFormatter(formatLocale, format, fixNumberFormat);\n\t\t\telse if (utils.isNumber(v)) return this.model.options.numberFormatter;\n\t\t} else if (type == 't') {\n\t\t\treturn format == null ? null : numbers.getNumberFormatter(formatLocale, format, false);\n\t\t} else if (type == 'd') {\n\t\t\treturn format ? dates.getDateFormatter(formatLocale, format) : this.model.options.dateFormatter;\n\t\t} else if (type == 's' && this.editorContent) {\n\t\t\treturn getDropdownFormatter(this.editorContent as {k: string, v: string}[]);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tget formattedValue(): string {\n\t\tif (this.value == null) return '';\n\t\tif (this.hasDisplayValue) return this.displayValue;\n\t\treturn this.valueFormatter ? this.valueFormatter(this.value) : this.value.toString();\n\t}\n\t\n\tprivate get elm1() { return this.row.priority >= this.column.priority ? this.row : this.column }\n\tprivate get elm2() { return this.row.priority < this.column.priority ? this.row : this.column }\n\n\tget clickable() { return super.clickable ?? this.elm1.clickable ?? this.elm2.clickable }\n\tget type() { return super.type ?? this.elm1.type ?? this.elm2.type ?? 'g' }\n\tset type(value: CellType) { this._type = value }\n\tget editorContent() { return super.editorContent ?? this.elm1.editorContent ?? this.elm2.editorContent ?? null }\n\tget adapter() { return super.adapter ?? this.elm1.adapter ?? this.elm2.adapter }\n\tset adapter(value: ComponentAdapter) { this._adapter = value }\n\n\tprivate _address: CellAddress;\n\tget address() { return this._address ?? (this._address = this.column.address + this.row.address) }\n\n\tget range() { return CellRange.fromA1(this.address) }\n\tget validation() { return super.validation ?? this.elm1.validation ?? this.elm2.validation ?? this.model.options.cellValidation }\n\tget editable() { return super.editable ?? this.elm1.editable ?? this.elm2.editable ?? this.model.options.editable }\n\tset editable(v: boolean) { this._editable = v }\n\tget commentable() { return super.commentable ?? this.elm1.commentable ?? this.elm2.commentable ?? this.model.options.commentable }\n\tget renderer() { return super.renderer ?? this.elm1.renderer ?? this.elm2.renderer }\n\tget afterRenderer() { return super.afterRenderer ?? this.elm1.afterRenderer ?? this.elm2.afterRenderer ?? this.model.options.afterRenderer }\n\tget commentRenderer() { return super.commentRenderer ?? this.elm1.commentRenderer ?? this.elm2.commentRenderer ?? this.model.options.comments.renderer }\n\tget format() { return super.format ?? this.elm1.format ?? this.elm2.format }\n\tset format(v: numbers.NumberFormatString) { super.format = v }\n\n\tprivate _hyperlink : string;\n\tget hyperlink() { return this._hyperlink }\n\tset hyperlink(v: string) { this._hyperlink = v }\n\n\tprivate _hasFormula: boolean;\n\n\tget hasOwnFormula() { return !!this._formula }\n\tget hasFormula() {\n\t\tif (this._hasFormula == null) this._hasFormula = !!this.formula;\n\t\treturn this._hasFormula;\n\t}\n\tget formula() { return this._formula ?? this.elm1.formula ?? this.elm2.formula }\n\tset formula(v: string) {\n\t\tsuper.formula = v;\n\t\tthis.refreshFormula();\n\t}\n\n\tinvalidateValue() {\n\t\tif (this.hasFormula) {\n\t\t\tthis._value = undefined;\n\t\t\tthis._evaluated = false;\n\t\t} else {\n\t\t\tthis._evaluated = true;\n\t\t}\n\t\tthis.clearError();\n\t}\n\n\trefreshFormula() { \n\t\tthis.invalidateValue();\n\t\tthis._hasFormula = null;\n\t}\n\n\tclearFormula() {\n\t\tthis._formula = null;\n\t\tthis._hasFormula = false;\n\t\tthis._evaluated = true;\n\t}\n\n\tconstructor(model: GridModel, source: CellSource) {\n\t\tsuper(model);\n\t\tthis.row = model.rows[source.r];\n\t\tthis.column = model.columns[source.c];\n\t\tthis.populate(source);\n\t}\n\n\tpopulate(source: CellSource) {\n\t\tsuper.populate(source);\n\t\tthis._colspan = source.cs ?? 1;\n\t\tthis._rowspan = source.rs ?? 1;\n\t\tthis._tooltip = source.tooltip;\n\t\tthis._hyperlink = source.hl;\n\t\tif (source.f != null && source.f !== '') this._evaluated = false;\n\t\telse if (source.v != null) this.value = source.v; // load static value only if no formula is present\n\t\tthis._displayValue = source.dv; // display value must be set after value\n\t}\n\n\tupdate(source: CellSource) {\n\t\tconst updatedProps = super.update(source) as CellSource;\n\t\tif ('cs' in source) { updatedProps.cs = this._colspan; this._colspan = source.cs; }\n\t\tif ('rs' in source) { updatedProps.rs = this._rowspan; this._rowspan = source.rs; }\n\t\tif ('tooltip' in source) { updatedProps.tooltip = this._tooltip; this._tooltip = source.tooltip; }\n\t\tif ('hl' in source) { updatedProps.hl = this._hyperlink; this._hyperlink = source.hl; }\n\t\tif ('f' in source) { this._evaluated = false; }\n\t\telse if ('v' in source) { updatedProps.v = this.value; this.value = source.v; }\n\t\tif ('dv' in source) { updatedProps.dv = this._displayValue; this._displayValue = source.dv; }\n\t\treturn updatedProps;\n\t}\n\n\tgetSourceData(options?: CellSerializationOptions) : CellSource {\n\t\tconst data = super.getSourceData() as CellSource;\n\t\tif (this._colspan > 1) data.cs = this._colspan;\n\t\tif (this._rowspan > 1) data.rs = this._rowspan;\n\t\tif (this.value != null) data.v = this.value;\n\t\tif (this.hasTooltip) data.tooltip = this._tooltip;\n\t\tif (this._hyperlink) data.hl = this._hyperlink;\n\n\t\tif (options) {\n\t\t\tif (options.displayValue && this.hasDisplayValue) data.dv = this._displayValue;\n\t\t}\n\n\t\treturn data;\n\t}\n\n\tprivate createComposedStyle(columnStyle?: Style|number, rowStyle?: Style|number, extraStyle?: Style) {\n\t\tconst styles: (number|Style)[] = [];\n\t\t\n\t\tcolumnStyle = columnStyle || this.column.style;\n\t\trowStyle = rowStyle || this.row.style;\n\t\tif (columnStyle != null && rowStyle != null) {\n\t\t\tif (this.column.priority > this.row.priority) {\n\t\t\t\tstyles.push(rowStyle, columnStyle);\n\t\t\t} else {\n\t\t\t\tstyles.push(columnStyle, rowStyle);\n\t\t\t}\n\t\t} \n\t\telse if (columnStyle != null) styles.push(columnStyle);\n\t\telse if (rowStyle != null) styles.push(rowStyle); \n\n\t\tif (this.style != null) styles.push(this.style);\n\t\tif (extraStyle != null) styles.push(extraStyle);\n\n\t\treturn styles.length > 0 ? this.model.styles.merge(...styles) : null;\n\t}\n\n\tget composedStyle() : Style {\n\t\tif (this._hasStyle === null) {\n\t\t\tconst s = this.createComposedStyle(null, null, this.model.conditionalFormats.evaluate(this));\n\t\t\tthis._hasStyle = s != null;\n\t\t\tthis._composedStyle = s;\n\t\t}\n\t\treturn this._composedStyle;\n\t}\n\n\tget calculatedIndent(): number|null {\n\t\tconst s = this.composedStyle;\n\t\tif (s?.alignment?.indent) return s.alignment.indent;\n\n\t\t// calculates cell text indent based on row level\n\t\tif (this.column.levelIndent && this.row.level > 0) {\n\t\t\treturn this.row.level * this.model.options.levelIndentFactor;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tget cssStyle() : CSSStyle {\n\t\tif (this._hasStyle === false) return null;\n\t\tif (!this._cssStyle) {\n\t\t\tconst composedStyle = this.composedStyle;\n\t\t\tif (composedStyle) {\n\t\t\t\tthis._cssStyle = styleToCSStyle(composedStyle);\n\t\t\t}\n\t\t}\n\t\treturn this._cssStyle;\n\t}\n\n\tinvalidateStyle() {\n\t\tthis._hasComment = null;\n\t\tthis._hasStyle = null;\n\t\tthis._composedStyle = null;\n\t\tthis._cssStyle = null;\n\t\tthis._sparkline = null;\n\t}\n\n\tsetStyleProperties(props: Record<StylePropertyKey, unknown>) {\n\t\tsuper.setStyleProperties(props);\n\t\tthis.invalidateStyle();\n\t}\n\n\tremoveStyleProperties(props: string[]) {\n\t\tsuper.removeStyleProperties(props);\n\t\tthis.invalidateStyle();\n\t}\n\n\tpreviewStyleProperties(\n\t\tprops: Record<StylePropertyKey, unknown>,\n\t\ttype: 'cell'|'column'|'row' = 'cell'\n\t) {\n\t\tconst composedStyle = Object.assign({}, this.createComposedStyle(type == 'column' ? props : null, type == 'row' ? props : null) ?? {});\n\t\t\n\t\tif (type == 'cell') {\n\t\t\tfor (const k in props) composedStyle[k] = props[k];\n\t\t}\n\t\tthis._hasStyle = true;\n\t\tthis._cssStyle = styleToCSStyle(composedStyle);\n\t}\n\n\tvalidate() {\n\t\tif (!this.validation) return true;\n\t\treturn validateValue(this, this.value);\n\t}\n\n\ttoString() { return this.address }\n\n}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cssStyle.d.ts","sourceRoot":"","sources":["../../src/model/cssStyle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAuB,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE7F,MAAM,MA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AQ,CAAC;AACvE,eAAO,MAAM,iBAAiB;WACtB,MAAM;WACN,cAAc;EAgBpB,CAAC;AAEH,eAAO,MAAM,iBAAiB,+CAQ1B,CAAC;AAEL,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,GACP,iBAAiB,CAClE;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,UAK5C;AAED,eAAO,MAAM,gBAAgB,WAAY,MAAM,KAAG,MAYjD,CAAA;AAED,eAAO,MAAM,kBAAkB,MAAO,MAAM,WAQ3C,CAAA;AAED,eAAO,MAAM,UAAU,QAAS,QAAQ,KAAK,KAAK,KAAI,QAiFrD,CAAA;AAED,eAAO,MAAM,WAAW,QAAS,QAAQ,KAAK,KAAK,KAAI,QAGtD,CAAA;AAED,eAAO,MAAM,cAAc,MAAO,KAAK,KAAG,QAmCzC,CAAA;AAED,eAAO,MAAM,eAAe,MAAO,QAAQ,GAAC,MAAM,KAAG,KA2FpD,CAAA"}
|
package/dist/model/cssStyle.js
CHANGED
|
@@ -176,7 +176,7 @@ export const styleToCSStyle = (s) => {
|
|
|
176
176
|
style.justifyContent = s.alignment.horizontal;
|
|
177
177
|
style.alignItems = s.alignment.vertical == 'top' ? 'start' : (s.alignment.vertical == 'bottom' ? 'end' : 'center');
|
|
178
178
|
}
|
|
179
|
-
|
|
179
|
+
if (s.alignment && s.alignment.horizontal) {
|
|
180
180
|
style.textAlign = s.alignment.horizontal;
|
|
181
181
|
}
|
|
182
182
|
if (s.alignment && s.alignment.wrapText) {
|
|
@@ -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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,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;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} else if (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,EA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jC,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// }"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omegagrid/grid-core",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.70",
|
|
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.6.
|
|
32
|
-
"@omegagrid/localize": "^0.6.
|
|
31
|
+
"@omegagrid/core": "^0.6.70",
|
|
32
|
+
"@omegagrid/localize": "^0.6.70",
|
|
33
33
|
"@stdlib/stats": "^0.0.13",
|
|
34
34
|
"color": "^4.2.3",
|
|
35
35
|
"date-fns": "^3.2.0",
|