@omegagrid/grid-core 0.11.33 → 0.11.35

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.
@@ -80,6 +80,11 @@ export declare class CellModel extends ElementModel {
80
80
  get displayValue(): string;
81
81
  set displayValue(v: string);
82
82
  get prefersDisplayValue(): boolean;
83
+ /**
84
+ * Whether the value of a date, a date and time or a time cell is a text none of them reads as one (see the cell value
85
+ * handlers): the cell shows it as an invalid format, the text itself is its formatted value and the row data keeps it
86
+ */
87
+ get isInvalidDate(): boolean;
83
88
  private _error;
84
89
  get error(): CellError;
85
90
  set error(v: CellError);
@@ -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,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAkB,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,wBAAwB,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAG/C,uCAAuC;AACvC,MAAM,MAAM,UAAU,GAAG;IACxB,gBAAgB;IAChB,CAAC,EAAE,MAAM,CAAC;IACV,gBAAgB;IAChB,CAAC,EAAE,MAAM,CAAC;IACV,iBAAiB;IACjB,CAAC,CAAC,EAAE,OAAO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AChF,IAAI,OAAO,CAAC,CAAC,EAAE,MAAM,EAGpB;IAED,WAAW,CAAC,GAAG,EAAE,MAAM;IAEvB,eAAe;IAUf,cAAc;IAKd,YAAY;gBAMA,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU;IAOhD,QAAQ,CAAC,MAAM,EAAE,UAAU;IAS3B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC;IAUlC,aAAa,CAAC,OAAO,CAAC,EAAE,wBAAwB,GAAI,UAAU;IAmB9D,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"}
@@ -26,6 +26,10 @@ function toDate(v, parseText) {
26
26
  }
27
27
  return date && !isNaN(date.getTime()) ? date : null;
28
28
  }
29
+ /** No value of a date, a date and time or a time cell: null, or a text of nothing but white space */
30
+ const isNoValue = (v) => v == null || (utils.isString(v) && !v.trim());
31
+ /** A text that is no number: one the date cells cannot read stays their value (isInvalidDate) */
32
+ const isPlainText = (v) => utils.isString(v) && !utils.isNumericString(v);
29
33
  const cellValueHandler = {
30
34
  // a Date (the row data of a date column) is its serial date
31
35
  ['n']: (v) => {
@@ -36,14 +40,23 @@ const cellValueHandler = {
36
40
  },
37
41
  // a Date stays a Date (the formulas read it as a serial date, see calculationValue)
38
42
  ['t']: (v) => v,
39
- // a date cell holds a serial date; a separator alone ('.', ','), which isNumericString lets through, is not one
43
+ // a date cell holds a serial date; a separator alone ('.', ','), which isNumericString lets through, is not one.
44
+ // A text none of the date cells reads stays their value (isInvalidDate): the cell shows it as an invalid format and
45
+ // the row data keeps it, so saving the row does not lose a text of the source, and the editor opens with it
40
46
  ['d']: (v, cell) => {
41
- if (v == null || v === '')
47
+ if (isNoValue(v))
42
48
  return null;
43
49
  let serial = v;
44
50
  if (utils.isString(v)) {
45
- const date = utils.isNumericString(v) ? null : dates.parse(v, cell.model.options.formatLocale);
46
- serial = utils.isNumericString(v) ? utils.strToNum(v) : (date ? dates.dateToSerialDate(date) : NaN);
51
+ if (utils.isNumericString(v)) {
52
+ serial = utils.strToNum(v);
53
+ }
54
+ else {
55
+ const date = dates.parse(v, cell.model.options.formatLocale);
56
+ if (!date)
57
+ return v;
58
+ serial = dates.dateToSerialDate(date);
59
+ }
47
60
  }
48
61
  else if (v instanceof Date) {
49
62
  serial = dates.dateToSerialDate(v); // NaN for an invalid Date
@@ -55,21 +68,25 @@ const cellValueHandler = {
55
68
  },
56
69
  // a time cell holds a Date on the day of the serial date 0 (dates.timeOfDay): a text, a serial date or a date give their time of day
57
70
  ['tm']: (v, cell) => {
58
- if (v == null || v === '')
71
+ if (isNoValue(v))
59
72
  return null;
60
73
  const date = toDate(v, text => dates.parseTime(text, cell.model.options.formatLocale));
61
74
  if (date)
62
75
  return dates.timeOfDay(date);
76
+ if (isPlainText(v))
77
+ return v;
63
78
  cell.model.logger?.error(`Invalid time value in cell ${cell.address}: ${v}`);
64
79
  return null;
65
80
  },
66
81
  // a date and time cell holds a Date: a serial date (with its day fraction) or a text is converted
67
82
  ['dt']: (v, cell) => {
68
- if (v == null || v === '')
83
+ if (isNoValue(v))
69
84
  return null;
70
85
  const date = toDate(v, text => dates.parseDateTime(text, cell.model.options.formatLocale));
71
86
  if (date)
72
87
  return date;
88
+ if (isPlainText(v))
89
+ return v;
73
90
  cell.model.logger?.error(`Invalid date time value in cell ${cell.address}: ${v}`);
74
91
  return null;
75
92
  },
@@ -174,6 +191,11 @@ export class CellModel extends ElementModel {
174
191
  set displayValue(v) { this._displayValue = v; }
175
192
  /* tells if cell has type that prefers usage of display value */
176
193
  get prefersDisplayValue() { return ['s', 'm'].includes(this.type); }
194
+ /**
195
+ * Whether the value of a date, a date and time or a time cell is a text none of them reads as one (see the cell value
196
+ * handlers): the cell shows it as an invalid format, the text itself is its formatted value and the row data keeps it
197
+ */
198
+ get isInvalidDate() { return (this.type == 'd' || this.type == 'dt' || this.type == 'tm') && utils.isString(this.value); }
177
199
  get error() { return this._error; }
178
200
  set error(v) { this._error = v; }
179
201
  get hasError() { return !!this._error; }
@@ -251,6 +273,8 @@ export class CellModel extends ElementModel {
251
273
  return this.displayValue;
252
274
  if (this.quotePrefix)
253
275
  return stripQuotePrefix(this.value);
276
+ if (this.isInvalidDate)
277
+ return this.value; // the date formatters have nothing to show of it
254
278
  return this.valueFormatter ? this.valueFormatter(this.value) : this.value.toString();
255
279
  }
256
280
  get elm1() { return this.row.priority >= this.column.priority ? this.row : this.column; }
@@ -1 +1 @@
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,cAAc,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACrG,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAGtC,OAAO,EAAE,YAAY,EAAiB,MAAM,gBAAgB,CAAC;AAI7D,OAAO,EAAY,cAAc,EAAE,MAAM,YAAY,CAAC;AAGtD,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAwB9C,qFAAqF;AACrF,MAAM,mBAAmB,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,gBAAgB,CAAC,GAAG,CAAC,C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AC;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 { hasQuotePrefix, isFormula, prefixFormula, stripQuotePrefix } 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\n// an unknown cell type must not break value handling - fall back to the general type\nconst getCellValueHandler = (type: string) => cellValueHandler[type] ?? cellValueHandler['g'];\n\n/** Whether a value given for a cell is a cell source (an object with its properties); a Date is a value (of a date and time cell) */\nexport const isCellSource = (value: unknown): value is CellSource => utils.isObject(value) && !(value instanceof Date);\n\n/**\n * The Date of a value of a date and time or a time cell: a Date, a serial date (also in a text) or a text parsed by the\n * given function. Null when it is none of them or not a valid date (a separator alone, '.' or ',', is a numeric text\n * of NaN): an invalid Date would make the formatters throw.\n */\nfunction toDate(v: unknown, parseText: (text: string) => Date|null): Date|null {\n\tlet date: Date|null = null;\n\tif (v instanceof Date) date = v;\n\telse if (utils.isNumber(v)) date = dates.serialDateToDateTime(v as number);\n\telse if (utils.isString(v)) {\n\t\tdate = utils.isNumericString(v as string)\n\t\t\t? dates.serialDateToDateTime(utils.strToNum(v as string))\n\t\t\t: parseText(v as string);\n\t}\n\treturn date && !isNaN(date.getTime()) ? date : null;\n}\n\nconst cellValueHandler: Record<string, (v: unknown, cell: CellModel) => unknown> = {\n\t// a Date (the row data of a date column) is its serial date\n\t['n']: (v) => {\n\t\tif (v instanceof Date) return dates.dateToSerialDate(v);\n\t\tconst value = utils.isString(v) ? parseFloat((v as string).replace(',', '.')) : v;\n\t\treturn Number.isNaN(value) ? v : value;\n\t},\n\t// a Date stays a Date (the formulas read it as a serial date, see calculationValue)\n\t['t']: (v) => v,\n\t// a date cell holds a serial date; a separator alone ('.', ','), which isNumericString lets through, is not one\n\t['d']: (v, cell) => {\n\t\tif (v == null || v === '') return null;\n\t\tlet serial: unknown = v;\n\t\tif (utils.isString(v)) {\n\t\t\tconst date = utils.isNumericString(v as string) ? null : dates.parse(v as string, cell.model.options.formatLocale);\n\t\t\tserial = utils.isNumericString(v as string) ? utils.strToNum(v as string) : (date ? dates.dateToSerialDate(date) : NaN);\n\t\t} else if (v instanceof Date) {\n\t\t\tserial = dates.dateToSerialDate(v); // NaN for an invalid Date\n\t\t}\n\t\tif (!utils.isNumber(serial) || Number.isFinite(serial)) return serial;\n\t\tcell.model.logger?.error(`Invalid date value in cell ${cell.address}: ${v}`);\n\t\treturn null;\n\t},\n\t// a time cell holds a Date on the day of the serial date 0 (dates.timeOfDay): a text, a serial date or a date give their time of day\n\t['tm']: (v, cell) => {\n\t\tif (v == null || v === '') return null;\n\t\tconst date = toDate(v, text => dates.parseTime(text, cell.model.options.formatLocale));\n\t\tif (date) return dates.timeOfDay(date);\n\t\tcell.model.logger?.error(`Invalid time value in cell ${cell.address}: ${v}`);\n\t\treturn null;\n\t},\n\t// a date and time cell holds a Date: a serial date (with its day fraction) or a text is converted\n\t['dt']: (v, cell) => {\n\t\tif (v == null || v === '') return null;\n\t\tconst date = toDate(v, text => dates.parseDateTime(text, cell.model.options.formatLocale));\n\t\tif (date) return date;\n\t\tcell.model.logger?.error(`Invalid date time value in cell ${cell.address}: ${v}`);\n\t\treturn null;\n\t},\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 || v === '') return null;\n\t\tif (v instanceof Date) return v; // a Date stays a Date, a text of it would turn into its first number when evaluated again\n\t\tconst f = parseFloat((v as string).toString().replace(',', '.'));\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\n/** cell types whose values are entered as a free text, only those accept the quote prefix */\nconst quotePrefixTypes: CellType[] = ['t', 'n', 'g'];\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\t/** the error stays until the cell value is invalidated, the cell is not evaluated meanwhile */\n\tpersistent?: boolean;\n}\n\nexport class CellModel extends ElementModel {\n\n\tpublic _content: HTMLDivElement;\n\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\n\tget merge() { return this.model.merges.mergedCells.get(this.address) }\n\n\tprivate _row: RowModel;\n\tget row() { return this._row }\n\tset row(v: RowModel) { this._row = v }\n\tget r() { return this._row.index}\n\n\tprivate _column: ColumnModel;\n\tget column() { return this._column }\n\tset column(v: ColumnModel) { this._column = v }\n\tget c() { return this._column.index }\n\n\t/** tells if the entered value of the cell can be prefixed by the quote prefix */\n\tget quotePrefixable() { return quotePrefixTypes.includes(this.type) }\n\n\t/**\n\t * tells if the cell value is a quote prefixed plain text,\n\t * the prefix stays a part of the value, the display value holds the value without it\n\t */\n\tget quotePrefix() { return this.quotePrefixable && !this.hasFormula && hasQuotePrefix(this._value) }\n\n\t/** cell value without the quote prefix, used where the value is compared as a text (sorting, filtering) */\n\tget plainValue() { return this.quotePrefix ? stripQuotePrefix(this._value) : this.value }\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 && this.model.formulasEnabled && 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 = this.quotePrefixable && hasQuotePrefix(v) ? v : getCellValueHandler(this.type)(v, this);\n\n\t\t\tif (!validateValue(this, value)) value = undefined;\n\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\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 = getCellValueHandler(this.type)(this.model.calculations.evaluate(this), this);\n\t\tthis._evaluated = true;\n\t\treturn this._value;\n\t}\n\n\t/** the formula of the cell, or its value the way the source data carries it (see serializedValue) */\n\tget value2() { return this.hasFormula ? prefixFormula(this.formula) : this.serializedValue }\n\n\t/**\n\t * The value the way the source data carries it: the Date of a date and time or a time cell as a text of its local\n\t * date and time ('2026-11-02 13:45:10', '13:45:10'), which is the same in every time zone, unlike the UTC instant\n\t * JSON writes a Date as. A Date of a cell of any other type is given as it is.\n\t */\n\tget serializedValue() {\n\t\tconst value = this.value;\n\t\tif (!(value instanceof Date) || isNaN(value.getTime())) return value;\n\t\tif (this.type == 'tm') return dates.formatLocalTime(value);\n\t\tif (this.type == 'dt') return dates.formatLocalDateTime(value);\n\t\treturn value;\n\t}\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\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\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 === '') { // TODO: maybe allow DropdownFormatter for 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 == 'dt') {\n\t\t\treturn format ? dates.getDateFormatter(formatLocale, format) : this.model.options.dateTimeFormatter;\n\t\t} else if (type == 'tm') {\n\t\t\treturn format ? dates.getDateFormatter(formatLocale, format) : this.model.options.timeFormatter;\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\tif (this.quotePrefix) return stripQuotePrefix(this.value) as string;\n\t\treturn this.valueFormatter ? this.valueFormatter(this.value) : this.value.toString();\n\t}\n\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\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 editorFactory() { return super.editorFactory ?? this.elm1.editorFactory ?? this.elm2.editorFactory }\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\tgetProperty(key: string) { return super.getProperty(key) ?? this.elm1.getProperty(key) ?? this.elm2.getProperty(key) }\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._hasFormula = null;\n\t\tthis.invalidateValue();\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._tooltip = source.tooltip;\n\t\tthis._hyperlink = source.hl;\n\t\tif (this._formula != null && this._formula !== '') 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: Partial<CellSource>) {\n\t\tconst updatedProps = super.update(source) as CellSource;\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.model.formulasEnabled) { 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\n\t\tif (this.merge) {\n\t\t\tdata.cs = this.merge.cs;\n\t\t\tdata.rs = this.merge.rs;\n\t\t}\n\n\t\tif (this.value != null) data.v = this.serializedValue;\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\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\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}\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,cAAc,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACrG,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAGtC,OAAO,EAAE,YAAY,EAAiB,MAAM,gBAAgB,CAAC;AAI7D,OAAO,EAAY,cAAc,EAAE,MAAM,YAAY,CAAC;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CAAC,CAAC;CAElC","sourcesContent":["import { ComponentAdapter, dates, numbers, utils, ValueFormatter } from \"@omegagrid/core\";\nimport { hasQuotePrefix, isFormula, prefixFormula, stripQuotePrefix } 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\n// an unknown cell type must not break value handling - fall back to the general type\nconst getCellValueHandler = (type: string) => cellValueHandler[type] ?? cellValueHandler['g'];\n\n/** Whether a value given for a cell is a cell source (an object with its properties); a Date is a value (of a date and time cell) */\nexport const isCellSource = (value: unknown): value is CellSource => utils.isObject(value) && !(value instanceof Date);\n\n/**\n * The Date of a value of a date and time or a time cell: a Date, a serial date (also in a text) or a text parsed by the\n * given function. Null when it is none of them or not a valid date (a separator alone, '.' or ',', is a numeric text\n * of NaN): an invalid Date would make the formatters throw.\n */\nfunction toDate(v: unknown, parseText: (text: string) => Date|null): Date|null {\n\tlet date: Date|null = null;\n\tif (v instanceof Date) date = v;\n\telse if (utils.isNumber(v)) date = dates.serialDateToDateTime(v as number);\n\telse if (utils.isString(v)) {\n\t\tdate = utils.isNumericString(v as string)\n\t\t\t? dates.serialDateToDateTime(utils.strToNum(v as string))\n\t\t\t: parseText(v as string);\n\t}\n\treturn date && !isNaN(date.getTime()) ? date : null;\n}\n\n/** No value of a date, a date and time or a time cell: null, or a text of nothing but white space */\nconst isNoValue = (v: unknown) => v == null || (utils.isString(v) && !(v as string).trim());\n\n/** A text that is no number: one the date cells cannot read stays their value (isInvalidDate) */\nconst isPlainText = (v: unknown) => utils.isString(v) && !utils.isNumericString(v as string);\n\nconst cellValueHandler: Record<string, (v: unknown, cell: CellModel) => unknown> = {\n\t// a Date (the row data of a date column) is its serial date\n\t['n']: (v) => {\n\t\tif (v instanceof Date) return dates.dateToSerialDate(v);\n\t\tconst value = utils.isString(v) ? parseFloat((v as string).replace(',', '.')) : v;\n\t\treturn Number.isNaN(value) ? v : value;\n\t},\n\t// a Date stays a Date (the formulas read it as a serial date, see calculationValue)\n\t['t']: (v) => v,\n\t// a date cell holds a serial date; a separator alone ('.', ','), which isNumericString lets through, is not one.\n\t// A text none of the date cells reads stays their value (isInvalidDate): the cell shows it as an invalid format and\n\t// the row data keeps it, so saving the row does not lose a text of the source, and the editor opens with it\n\t['d']: (v, cell) => {\n\t\tif (isNoValue(v)) return null;\n\t\tlet serial: unknown = v;\n\t\tif (utils.isString(v)) {\n\t\t\tif (utils.isNumericString(v as string)) {\n\t\t\t\tserial = utils.strToNum(v as string);\n\t\t\t} else {\n\t\t\t\tconst date = dates.parse(v as string, cell.model.options.formatLocale);\n\t\t\t\tif (!date) return v;\n\t\t\t\tserial = dates.dateToSerialDate(date);\n\t\t\t}\n\t\t} else if (v instanceof Date) {\n\t\t\tserial = dates.dateToSerialDate(v); // NaN for an invalid Date\n\t\t}\n\t\tif (!utils.isNumber(serial) || Number.isFinite(serial)) return serial;\n\t\tcell.model.logger?.error(`Invalid date value in cell ${cell.address}: ${v}`);\n\t\treturn null;\n\t},\n\t// a time cell holds a Date on the day of the serial date 0 (dates.timeOfDay): a text, a serial date or a date give their time of day\n\t['tm']: (v, cell) => {\n\t\tif (isNoValue(v)) return null;\n\t\tconst date = toDate(v, text => dates.parseTime(text, cell.model.options.formatLocale));\n\t\tif (date) return dates.timeOfDay(date);\n\t\tif (isPlainText(v)) return v;\n\t\tcell.model.logger?.error(`Invalid time value in cell ${cell.address}: ${v}`);\n\t\treturn null;\n\t},\n\t// a date and time cell holds a Date: a serial date (with its day fraction) or a text is converted\n\t['dt']: (v, cell) => {\n\t\tif (isNoValue(v)) return null;\n\t\tconst date = toDate(v, text => dates.parseDateTime(text, cell.model.options.formatLocale));\n\t\tif (date) return date;\n\t\tif (isPlainText(v)) return v;\n\t\tcell.model.logger?.error(`Invalid date time value in cell ${cell.address}: ${v}`);\n\t\treturn null;\n\t},\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 || v === '') return null;\n\t\tif (v instanceof Date) return v; // a Date stays a Date, a text of it would turn into its first number when evaluated again\n\t\tconst f = parseFloat((v as string).toString().replace(',', '.'));\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\n/** cell types whose values are entered as a free text, only those accept the quote prefix */\nconst quotePrefixTypes: CellType[] = ['t', 'n', 'g'];\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\t/** the error stays until the cell value is invalidated, the cell is not evaluated meanwhile */\n\tpersistent?: boolean;\n}\n\nexport class CellModel extends ElementModel {\n\n\tpublic _content: HTMLDivElement;\n\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\n\tget merge() { return this.model.merges.mergedCells.get(this.address) }\n\n\tprivate _row: RowModel;\n\tget row() { return this._row }\n\tset row(v: RowModel) { this._row = v }\n\tget r() { return this._row.index}\n\n\tprivate _column: ColumnModel;\n\tget column() { return this._column }\n\tset column(v: ColumnModel) { this._column = v }\n\tget c() { return this._column.index }\n\n\t/** tells if the entered value of the cell can be prefixed by the quote prefix */\n\tget quotePrefixable() { return quotePrefixTypes.includes(this.type) }\n\n\t/**\n\t * tells if the cell value is a quote prefixed plain text,\n\t * the prefix stays a part of the value, the display value holds the value without it\n\t */\n\tget quotePrefix() { return this.quotePrefixable && !this.hasFormula && hasQuotePrefix(this._value) }\n\n\t/** cell value without the quote prefix, used where the value is compared as a text (sorting, filtering) */\n\tget plainValue() { return this.quotePrefix ? stripQuotePrefix(this._value) : this.value }\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 && this.model.formulasEnabled && 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 = this.quotePrefixable && hasQuotePrefix(v) ? v : getCellValueHandler(this.type)(v, this);\n\n\t\t\tif (!validateValue(this, value)) value = undefined;\n\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\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 = getCellValueHandler(this.type)(this.model.calculations.evaluate(this), this);\n\t\tthis._evaluated = true;\n\t\treturn this._value;\n\t}\n\n\t/** the formula of the cell, or its value the way the source data carries it (see serializedValue) */\n\tget value2() { return this.hasFormula ? prefixFormula(this.formula) : this.serializedValue }\n\n\t/**\n\t * The value the way the source data carries it: the Date of a date and time or a time cell as a text of its local\n\t * date and time ('2026-11-02 13:45:10', '13:45:10'), which is the same in every time zone, unlike the UTC instant\n\t * JSON writes a Date as. A Date of a cell of any other type is given as it is.\n\t */\n\tget serializedValue() {\n\t\tconst value = this.value;\n\t\tif (!(value instanceof Date) || isNaN(value.getTime())) return value;\n\t\tif (this.type == 'tm') return dates.formatLocalTime(value);\n\t\tif (this.type == 'dt') return dates.formatLocalDateTime(value);\n\t\treturn value;\n\t}\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\n\t/* tells if cell has type that prefers usage of display value */\n\tget prefersDisplayValue() { return ['s', 'm'].includes(this.type) }\n\n\t/**\n\t * Whether the value of a date, a date and time or a time cell is a text none of them reads as one (see the cell value\n\t * handlers): the cell shows it as an invalid format, the text itself is its formatted value and the row data keeps it\n\t */\n\tget isInvalidDate() { return (this.type == 'd' || this.type == 'dt' || this.type == 'tm') && utils.isString(this.value) }\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\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 === '') { // TODO: maybe allow DropdownFormatter for 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 == 'dt') {\n\t\t\treturn format ? dates.getDateFormatter(formatLocale, format) : this.model.options.dateTimeFormatter;\n\t\t} else if (type == 'tm') {\n\t\t\treturn format ? dates.getDateFormatter(formatLocale, format) : this.model.options.timeFormatter;\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\tif (this.quotePrefix) return stripQuotePrefix(this.value) as string;\n\t\tif (this.isInvalidDate) return this.value as string; // the date formatters have nothing to show of it\n\t\treturn this.valueFormatter ? this.valueFormatter(this.value) : this.value.toString();\n\t}\n\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\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 editorFactory() { return super.editorFactory ?? this.elm1.editorFactory ?? this.elm2.editorFactory }\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\tgetProperty(key: string) { return super.getProperty(key) ?? this.elm1.getProperty(key) ?? this.elm2.getProperty(key) }\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._hasFormula = null;\n\t\tthis.invalidateValue();\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._tooltip = source.tooltip;\n\t\tthis._hyperlink = source.hl;\n\t\tif (this._formula != null && this._formula !== '') 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: Partial<CellSource>) {\n\t\tconst updatedProps = super.update(source) as CellSource;\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.model.formulasEnabled) { 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\n\t\tif (this.merge) {\n\t\t\tdata.cs = this.merge.cs;\n\t\t\tdata.rs = this.merge.rs;\n\t\t}\n\n\t\tif (this.value != null) data.v = this.serializedValue;\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\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\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}\n"]}
@@ -0,0 +1,28 @@
1
+ import { DateFilterGroups, DateFilterType } from "../types";
2
+ /**
3
+ * The time a value of a date column compares by: a Date, a serial date (the value of a date cell) or a text (an ISO
4
+ * date, a typed time); a time (type tm) by its time of day on the day of the serial date 0. Null for no value or a
5
+ * text that is none.
6
+ */
7
+ export declare const toDateFilterTime: (v: unknown, type: DateFilterType) => number | null;
8
+ /**
9
+ * Parses a date filter expression into a disjunction of conjunctions of bounds (OR groups, each an AND-combined
10
+ * list of `>=` and `<` bounds, see {@link DateFilterGroups}). A literal means the interval it names, to the precision
11
+ * it is written in: a day (`6.11.2026`), a month (`11.2026`, `2026-11`), a year (`2026`), a day with a time of day
12
+ * (`6.11.2026 14:00`, a minute; `6.11.2026 14:00:30`, a second), a time of day alone for a time column (`9:05`).
13
+ *
14
+ * Supported syntax:
15
+ * - a bare literal, matched as the whole interval: `6.11.2026` is the whole day
16
+ * - operators `>`, `>=`, `<`, `<=`, `=`/`==`, `!=`/`<>` followed by a literal: `> 6.11.2026` starts the day after,
17
+ * `<= 6.11.2026` reaches to the end of the day
18
+ * - a range `a..b`, from the start of `a` to the end of `b`: `6.11.2026..20.11.2026`, `9:00..17:00`
19
+ * - `and` / `or` connectors (case-insensitive); without one, two bare literals are an OR (a list of days), a
20
+ * comparison narrows (AND)
21
+ *
22
+ * The dates are read in the format of the current locale, an ISO date in any. A literal that is no date or time, or
23
+ * not one of the column type (a day in a time column), makes its unit match nothing. Null when the expression holds
24
+ * no unit at all: the text is no date expression.
25
+ */
26
+ export declare const parseDateExpression: (input: string, type: DateFilterType) => DateFilterGroups | null;
27
+ export declare const createDateMatcher: <TItem>(groups: DateFilterGroups, property: keyof TItem, type: DateFilterType) => (item: TItem) => boolean;
28
+ //# sourceMappingURL=dateFilter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dateFilter.d.ts","sourceRoot":"","sources":["../../src/model/dateFilter.ts"],"names":[],"mappings":"AAGA,OAAO,EAAmB,gBAAgB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE7E;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAAI,GAAG,OAAO,EAAE,MAAM,cAAc,KAAG,MAAM,GAAG,IAQ5E,CAAC;AAgIF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,mBAAmB,GAAI,OAAO,MAAM,EAAE,MAAM,cAAc,KAAG,gBAAgB,GAAC,IAoD1F,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,KAAK,EAAE,QAAQ,gBAAgB,EAAE,UAAU,MAAM,KAAK,EAAE,MAAM,cAAc,MAGrG,MAAM,KAAK,YAKnB,CAAC"}
@@ -0,0 +1,221 @@
1
+ import { dates, utils } from "@omegagrid/core";
2
+ import { getLocale } from "@omegagrid/localize";
3
+ import { addDays, addMilliseconds, addMinutes, addMonths, addSeconds, addYears } from "date-fns";
4
+ /**
5
+ * The time a value of a date column compares by: a Date, a serial date (the value of a date cell) or a text (an ISO
6
+ * date, a typed time); a time (type tm) by its time of day on the day of the serial date 0. Null for no value or a
7
+ * text that is none.
8
+ */
9
+ export const toDateFilterTime = (v, type) => {
10
+ if (v == null || v === '')
11
+ return null;
12
+ let date;
13
+ if (v instanceof Date)
14
+ date = v;
15
+ else if (utils.isNumber(v))
16
+ date = dates.serialDateToDateTime(v);
17
+ else
18
+ date = type === 'tm' ? dates.parseTime(String(v), getLocale()) : dates.parseDateTime(String(v), getLocale());
19
+ if (!date || Number.isNaN(date.getTime()))
20
+ return null;
21
+ return type === 'tm' ? dates.timeOfDay(date).getTime() : date.getTime();
22
+ };
23
+ // a date: two or three numbers with a dot, slash or dash between them ('6.11.2026', '6. 11. 2026', '11/6/2026',
24
+ // '2026-11-06', '11.2026', '2026-11'); the parts are read by their format later
25
+ const DATE_TOKEN = '\\d{1,4}\\s*[./-]\\s*\\d{1,4}(?:\\s*[./-]\\s*\\d{1,4})?';
26
+ // a time of day: hours and minutes, optional seconds with an optional fraction
27
+ const TIME_TOKEN = '\\d{1,2}:\\d{1,2}(?::\\d{1,2}(?:[.,]\\d+)?)?';
28
+ const tokenize = (input) => {
29
+ // the 'T' of an ISO date and time ('2026-11-06T14:00') separates them the way a space does
30
+ input = input.replace(/(\d)T(\d)/g, '$1 $2');
31
+ const re = new RegExp(`(\\.\\.)` + // 1 range
32
+ `|(>=|<=|<>|!=|==|=|>|<)` + // 2 comparison operator
33
+ `|\\b(and|or)\\b` + // 3 connector
34
+ `|(${DATE_TOKEN})` + // 4 date
35
+ `|(${TIME_TOKEN})` + // 5 time
36
+ `|(?<!\\d|\\d[.:/-])(\\d{4})(?!\\d|[.:/-]\\d)`, // 6 year (not a part of a date; '2026..2027' are two years)
37
+ 'gi');
38
+ const tokens = [];
39
+ let m;
40
+ while ((m = re.exec(input)) !== null) {
41
+ if (m[1] != null)
42
+ tokens.push({ kind: 'range' });
43
+ else if (m[2] != null) {
44
+ const op = m[2] === '==' ? '=' : m[2] === '<>' ? '!=' : m[2];
45
+ tokens.push({ kind: 'op', op: op });
46
+ }
47
+ else if (m[3] != null)
48
+ tokens.push({ kind: 'connector', connector: m[3].toLowerCase() });
49
+ else if (m[4] != null)
50
+ tokens.push({ kind: 'literal', literal: { date: m[4] } });
51
+ else if (m[5] != null) {
52
+ // a time right after a date belongs to it ('6.11.2026 14:00')
53
+ const last = tokens[tokens.length - 1];
54
+ if (last?.kind === 'literal' && last.literal.date && !last.literal.time)
55
+ last.literal.time = m[5];
56
+ else
57
+ tokens.push({ kind: 'literal', literal: { time: m[5] } });
58
+ }
59
+ else if (m[6] != null)
60
+ tokens.push({ kind: 'literal', literal: { year: m[6] } });
61
+ }
62
+ return tokens;
63
+ };
64
+ const MONTH_FIRST = /^(\d{1,2})\s*[./]\s*(\d{4})$/; // '11.2026', '11/2026'
65
+ const YEAR_FIRST = /^(\d{4})\s*[-/.]\s*(\d{1,2})$/; // '2026-11', '2026/11'
66
+ const monthInterval = (year, month) => {
67
+ if (month < 1 || month > 12)
68
+ return null;
69
+ const start = new Date(year, month - 1, 1);
70
+ return { start, end: addMonths(start, 1) };
71
+ };
72
+ // the interval of a time of day by the precision it is written in: a minute, a second or a millisecond
73
+ const timePrecisionEnd = (start, time) => {
74
+ const parts = time.split(':');
75
+ if (parts.length < 3)
76
+ return addMinutes(start, 1);
77
+ return /[.,]/.test(parts[2]) ? addMilliseconds(start, 1) : addSeconds(start, 1);
78
+ };
79
+ /**
80
+ * The interval a literal names for a column type: a year, a month, a day, or a time of day to the precision it is
81
+ * written in. A time of day on its own counts for a time column only, a day or a longer span for a date column only.
82
+ * Null when the literal is no date or time, or not one of the type.
83
+ */
84
+ const literalInterval = (literal, type) => {
85
+ const locale = getLocale();
86
+ if (type === 'tm') {
87
+ // a time of day, also the time of day of a date and time
88
+ const text = literal.time ? (literal.date ? `${literal.date} ${literal.time}` : literal.time) : null;
89
+ if (!text)
90
+ return null;
91
+ const start = dates.parseTime(text, locale);
92
+ return start ? { start, end: timePrecisionEnd(start, literal.time) } : null;
93
+ }
94
+ if (literal.year) {
95
+ const start = new Date(Number(literal.year), 0, 1);
96
+ return { start, end: addYears(start, 1) };
97
+ }
98
+ if (!literal.date)
99
+ return null;
100
+ const monthFirst = MONTH_FIRST.exec(literal.date);
101
+ if (monthFirst)
102
+ return monthInterval(Number(monthFirst[2]), Number(monthFirst[1]));
103
+ const yearFirst = YEAR_FIRST.exec(literal.date);
104
+ if (yearFirst)
105
+ return monthInterval(Number(yearFirst[1]), Number(yearFirst[2]));
106
+ const start = dates.parseDateTime(literal.time ? `${literal.date} ${literal.time}` : literal.date, locale);
107
+ if (!start)
108
+ return null;
109
+ return { start, end: literal.time ? timePrecisionEnd(start, literal.time) : addDays(start, 1) };
110
+ };
111
+ const NOTHING = [];
112
+ // a literal means the interval it names: '= day' is the whole day, '> day' starts the day after
113
+ const compareUnit = (op, interval) => {
114
+ const exact = op.op === '=';
115
+ if (!interval)
116
+ return { groups: NOTHING, exact };
117
+ const { start, end } = interval;
118
+ switch (op.op) {
119
+ case '=': return { groups: [[{ op: '>=', value: start }, { op: '<', value: end }]], exact };
120
+ case '!=': return { groups: [[{ op: '<', value: start }], [{ op: '>=', value: end }]], exact };
121
+ case '>': return { groups: [[{ op: '>=', value: end }]], exact };
122
+ case '>=': return { groups: [[{ op: '>=', value: start }]], exact };
123
+ case '<': return { groups: [[{ op: '<', value: start }]], exact };
124
+ case '<=': return { groups: [[{ op: '<', value: end }]], exact };
125
+ }
126
+ };
127
+ const rangeUnit = (from, to) => {
128
+ if (!from || !to)
129
+ return { groups: NOTHING, exact: false };
130
+ return { groups: [[{ op: '>=', value: from.start }, { op: '<', value: to.end }]], exact: false };
131
+ };
132
+ // the AND of two expressions in their OR groups: every group of one with every group of the other
133
+ const andGroups = (a, b) => {
134
+ const result = [];
135
+ a.forEach(ga => b.forEach(gb => result.push([...ga, ...gb])));
136
+ return result;
137
+ };
138
+ /**
139
+ * Parses a date filter expression into a disjunction of conjunctions of bounds (OR groups, each an AND-combined
140
+ * list of `>=` and `<` bounds, see {@link DateFilterGroups}). A literal means the interval it names, to the precision
141
+ * it is written in: a day (`6.11.2026`), a month (`11.2026`, `2026-11`), a year (`2026`), a day with a time of day
142
+ * (`6.11.2026 14:00`, a minute; `6.11.2026 14:00:30`, a second), a time of day alone for a time column (`9:05`).
143
+ *
144
+ * Supported syntax:
145
+ * - a bare literal, matched as the whole interval: `6.11.2026` is the whole day
146
+ * - operators `>`, `>=`, `<`, `<=`, `=`/`==`, `!=`/`<>` followed by a literal: `> 6.11.2026` starts the day after,
147
+ * `<= 6.11.2026` reaches to the end of the day
148
+ * - a range `a..b`, from the start of `a` to the end of `b`: `6.11.2026..20.11.2026`, `9:00..17:00`
149
+ * - `and` / `or` connectors (case-insensitive); without one, two bare literals are an OR (a list of days), a
150
+ * comparison narrows (AND)
151
+ *
152
+ * The dates are read in the format of the current locale, an ISO date in any. A literal that is no date or time, or
153
+ * not one of the column type (a day in a time column), makes its unit match nothing. Null when the expression holds
154
+ * no unit at all: the text is no date expression.
155
+ */
156
+ export const parseDateExpression = (input, type) => {
157
+ const tokens = tokenize(input ?? '');
158
+ const units = [];
159
+ let pending = null;
160
+ const interval = (i) => {
161
+ const t = tokens[i];
162
+ return t?.kind === 'literal' ? literalInterval(t.literal, type) : null;
163
+ };
164
+ for (let i = 0; i < tokens.length; i++) {
165
+ const t = tokens[i];
166
+ if (t.kind === 'connector') {
167
+ pending = t.connector;
168
+ continue;
169
+ }
170
+ let unit = null;
171
+ if (t.kind === 'op') {
172
+ if (tokens[i + 1]?.kind !== 'literal')
173
+ continue; // an operator without a value is skipped
174
+ unit = compareUnit(t, interval(i + 1));
175
+ i += 1;
176
+ }
177
+ else if (t.kind === 'literal') {
178
+ if (tokens[i + 1]?.kind === 'range') {
179
+ unit = rangeUnit(interval(i), tokens[i + 2]?.kind === 'literal' ? interval(i + 2) : null);
180
+ i += 2;
181
+ }
182
+ else {
183
+ unit = compareUnit({ kind: 'op', op: '=' }, interval(i));
184
+ }
185
+ }
186
+ else {
187
+ continue; // a stray range operator
188
+ }
189
+ units.push({ unit, connector: pending });
190
+ pending = null;
191
+ }
192
+ if (units.length === 0)
193
+ return null;
194
+ // an explicit connector, otherwise OR between two bare literals (a list of days) and AND elsewhere
195
+ const groups = [];
196
+ let current = units[0].unit.groups;
197
+ for (let i = 1; i < units.length; i++) {
198
+ const { unit, connector } = units[i];
199
+ const implicit = units[i - 1].unit.exact && unit.exact ? 'or' : 'and';
200
+ if ((connector ?? implicit) === 'or') {
201
+ groups.push(...current);
202
+ current = unit.groups;
203
+ }
204
+ else {
205
+ current = andGroups(current, unit.groups);
206
+ }
207
+ }
208
+ groups.push(...current);
209
+ return groups;
210
+ };
211
+ export const createDateMatcher = (groups, property, type) => {
212
+ // the bounds compare by their times: a time of day lies on the day of the serial date 0 the way the values do
213
+ const bounds = groups.map(group => group.map(b => ({ op: b.op, time: b.value.getTime() })));
214
+ return (item) => {
215
+ const v = toDateFilterTime(item[property], type);
216
+ if (v === null)
217
+ return false;
218
+ return bounds.some(group => group.every(b => b.op === '>=' ? v >= b.time : v < b.time));
219
+ };
220
+ };
221
+ //# sourceMappingURL=dateFilter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dateFilter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AAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QAC3C,CAAC;IACF,CAAC;IACD,MAAM,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC;IACxB,OAAO,MAAM,CAAC;AACf,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAQ,MAAwB,EAAE,QAAqB,EAAE,IAAoB,EAAE,EAAE;IACjH,8GAA8G;IAC9G,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IAC5F,OAAO,CAAC,IAAW,EAAE,EAAE;QACtB,MAAM,CAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,CAAC;QACjD,IAAI,CAAC,KAAK,IAAI;YAAE,OAAO,KAAK,CAAC;QAC7B,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IACzF,CAAC,CAAC;AACH,CAAC,CAAC","sourcesContent":["import { dates, utils } from \"@omegagrid/core\";\nimport { getLocale } from \"@omegagrid/localize\";\nimport { addDays, addMilliseconds, addMinutes, addMonths, addSeconds, addYears } from \"date-fns\";\nimport { DateFilterBound, DateFilterGroups, DateFilterType } from \"../types\";\n\n/**\n * The time a value of a date column compares by: a Date, a serial date (the value of a date cell) or a text (an ISO\n * date, a typed time); a time (type tm) by its time of day on the day of the serial date 0. Null for no value or a\n * text that is none.\n */\nexport const toDateFilterTime = (v: unknown, type: DateFilterType): number | null => {\n\tif (v == null || v === '') return null;\n\tlet date: Date|null;\n\tif (v instanceof Date) date = v;\n\telse if (utils.isNumber(v)) date = dates.serialDateToDateTime(v as number);\n\telse date = type === 'tm' ? dates.parseTime(String(v), getLocale()) : dates.parseDateTime(String(v), getLocale());\n\tif (!date || Number.isNaN(date.getTime())) return null;\n\treturn type === 'tm' ? dates.timeOfDay(date).getTime() : date.getTime();\n};\n\n/** The interval a date literal names: from its start to its end, the end excluded */\ntype Interval = { start: Date, end: Date };\n\ntype Literal = { date?: string, time?: string, year?: string };\n\ntype Token =\n\t| { kind: 'range' }\n\t| { kind: 'op', op: '=' | '!=' | '<' | '<=' | '>' | '>=' }\n\t| { kind: 'connector', connector: 'and' | 'or' }\n\t| { kind: 'literal', literal: Literal };\n\n// a date: two or three numbers with a dot, slash or dash between them ('6.11.2026', '6. 11. 2026', '11/6/2026',\n// '2026-11-06', '11.2026', '2026-11'); the parts are read by their format later\nconst DATE_TOKEN = '\\\\d{1,4}\\\\s*[./-]\\\\s*\\\\d{1,4}(?:\\\\s*[./-]\\\\s*\\\\d{1,4})?';\n// a time of day: hours and minutes, optional seconds with an optional fraction\nconst TIME_TOKEN = '\\\\d{1,2}:\\\\d{1,2}(?::\\\\d{1,2}(?:[.,]\\\\d+)?)?';\n\nconst tokenize = (input: string): Token[] => {\n\t// the 'T' of an ISO date and time ('2026-11-06T14:00') separates them the way a space does\n\tinput = input.replace(/(\\d)T(\\d)/g, '$1 $2');\n\tconst re = new RegExp(\n\t\t`(\\\\.\\\\.)` + // 1 range\n\t\t`|(>=|<=|<>|!=|==|=|>|<)` + // 2 comparison operator\n\t\t`|\\\\b(and|or)\\\\b` + // 3 connector\n\t\t`|(${DATE_TOKEN})` + // 4 date\n\t\t`|(${TIME_TOKEN})` + // 5 time\n\t\t`|(?<!\\\\d|\\\\d[.:/-])(\\\\d{4})(?!\\\\d|[.:/-]\\\\d)`, // 6 year (not a part of a date; '2026..2027' are two years)\n\t\t'gi'\n\t);\n\tconst tokens: Token[] = [];\n\tlet m: RegExpExecArray | null;\n\twhile ((m = re.exec(input)) !== null) {\n\t\tif (m[1] != null) tokens.push({ kind: 'range' });\n\t\telse if (m[2] != null) {\n\t\t\tconst op = m[2] === '==' ? '=' : m[2] === '<>' ? '!=' : m[2];\n\t\t\ttokens.push({ kind: 'op', op: op as '=' | '!=' | '<' | '<=' | '>' | '>=' });\n\t\t}\n\t\telse if (m[3] != null) tokens.push({ kind: 'connector', connector: m[3].toLowerCase() as 'and' | 'or' });\n\t\telse if (m[4] != null) tokens.push({ kind: 'literal', literal: { date: m[4] } });\n\t\telse if (m[5] != null) {\n\t\t\t// a time right after a date belongs to it ('6.11.2026 14:00')\n\t\t\tconst last = tokens[tokens.length - 1];\n\t\t\tif (last?.kind === 'literal' && last.literal.date && !last.literal.time) last.literal.time = m[5];\n\t\t\telse tokens.push({ kind: 'literal', literal: { time: m[5] } });\n\t\t}\n\t\telse if (m[6] != null) tokens.push({ kind: 'literal', literal: { year: m[6] } });\n\t}\n\treturn tokens;\n};\n\nconst MONTH_FIRST = /^(\\d{1,2})\\s*[./]\\s*(\\d{4})$/; // '11.2026', '11/2026'\nconst YEAR_FIRST = /^(\\d{4})\\s*[-/.]\\s*(\\d{1,2})$/; // '2026-11', '2026/11'\n\nconst monthInterval = (year: number, month: number): Interval|null => {\n\tif (month < 1 || month > 12) return null;\n\tconst start = new Date(year, month - 1, 1);\n\treturn { start, end: addMonths(start, 1) };\n};\n\n// the interval of a time of day by the precision it is written in: a minute, a second or a millisecond\nconst timePrecisionEnd = (start: Date, time: string) => {\n\tconst parts = time.split(':');\n\tif (parts.length < 3) return addMinutes(start, 1);\n\treturn /[.,]/.test(parts[2]) ? addMilliseconds(start, 1) : addSeconds(start, 1);\n};\n\n/**\n * The interval a literal names for a column type: a year, a month, a day, or a time of day to the precision it is\n * written in. A time of day on its own counts for a time column only, a day or a longer span for a date column only.\n * Null when the literal is no date or time, or not one of the type.\n */\nconst literalInterval = (literal: Literal, type: DateFilterType): Interval|null => {\n\tconst locale = getLocale();\n\tif (type === 'tm') {\n\t\t// a time of day, also the time of day of a date and time\n\t\tconst text = literal.time ? (literal.date ? `${literal.date} ${literal.time}` : literal.time) : null;\n\t\tif (!text) return null;\n\t\tconst start = dates.parseTime(text, locale);\n\t\treturn start ? { start, end: timePrecisionEnd(start, literal.time) } : null;\n\t}\n\tif (literal.year) {\n\t\tconst start = new Date(Number(literal.year), 0, 1);\n\t\treturn { start, end: addYears(start, 1) };\n\t}\n\tif (!literal.date) return null;\n\tconst monthFirst = MONTH_FIRST.exec(literal.date);\n\tif (monthFirst) return monthInterval(Number(monthFirst[2]), Number(monthFirst[1]));\n\tconst yearFirst = YEAR_FIRST.exec(literal.date);\n\tif (yearFirst) return monthInterval(Number(yearFirst[1]), Number(yearFirst[2]));\n\tconst start = dates.parseDateTime(literal.time ? `${literal.date} ${literal.time}` : literal.date, locale);\n\tif (!start) return null;\n\treturn { start, end: literal.time ? timePrecisionEnd(start, literal.time) : addDays(start, 1) };\n};\n\n/** A unit of the expression: a comparison or a range, as OR groups of its bounds; no group matches nothing */\ntype Unit = { groups: DateFilterGroups, exact: boolean };\n\nconst NOTHING: DateFilterGroups = [];\n\n// a literal means the interval it names: '= day' is the whole day, '> day' starts the day after\nconst compareUnit = (op: Token & { kind: 'op' }, interval: Interval|null): Unit => {\n\tconst exact = op.op === '=';\n\tif (!interval) return { groups: NOTHING, exact };\n\tconst { start, end } = interval;\n\tswitch (op.op) {\n\t\tcase '=': return { groups: [[{ op: '>=', value: start }, { op: '<', value: end }]], exact };\n\t\tcase '!=': return { groups: [[{ op: '<', value: start }], [{ op: '>=', value: end }]], exact };\n\t\tcase '>': return { groups: [[{ op: '>=', value: end }]], exact };\n\t\tcase '>=': return { groups: [[{ op: '>=', value: start }]], exact };\n\t\tcase '<': return { groups: [[{ op: '<', value: start }]], exact };\n\t\tcase '<=': return { groups: [[{ op: '<', value: end }]], exact };\n\t}\n};\n\nconst rangeUnit = (from: Interval|null, to: Interval|null): Unit => {\n\tif (!from || !to) return { groups: NOTHING, exact: false };\n\treturn { groups: [[{ op: '>=', value: from.start }, { op: '<', value: to.end }]], exact: false };\n};\n\n// the AND of two expressions in their OR groups: every group of one with every group of the other\nconst andGroups = (a: DateFilterGroups, b: DateFilterGroups): DateFilterGroups => {\n\tconst result: DateFilterBound[][] = [];\n\ta.forEach(ga => b.forEach(gb => result.push([...ga, ...gb])));\n\treturn result;\n};\n\n/**\n * Parses a date filter expression into a disjunction of conjunctions of bounds (OR groups, each an AND-combined\n * list of `>=` and `<` bounds, see {@link DateFilterGroups}). A literal means the interval it names, to the precision\n * it is written in: a day (`6.11.2026`), a month (`11.2026`, `2026-11`), a year (`2026`), a day with a time of day\n * (`6.11.2026 14:00`, a minute; `6.11.2026 14:00:30`, a second), a time of day alone for a time column (`9:05`).\n *\n * Supported syntax:\n * - a bare literal, matched as the whole interval: `6.11.2026` is the whole day\n * - operators `>`, `>=`, `<`, `<=`, `=`/`==`, `!=`/`<>` followed by a literal: `> 6.11.2026` starts the day after,\n * `<= 6.11.2026` reaches to the end of the day\n * - a range `a..b`, from the start of `a` to the end of `b`: `6.11.2026..20.11.2026`, `9:00..17:00`\n * - `and` / `or` connectors (case-insensitive); without one, two bare literals are an OR (a list of days), a\n * comparison narrows (AND)\n *\n * The dates are read in the format of the current locale, an ISO date in any. A literal that is no date or time, or\n * not one of the column type (a day in a time column), makes its unit match nothing. Null when the expression holds\n * no unit at all: the text is no date expression.\n */\nexport const parseDateExpression = (input: string, type: DateFilterType): DateFilterGroups|null => {\n\tconst tokens = tokenize(input ?? '');\n\tconst units: { unit: Unit, connector: 'and' | 'or' | null }[] = [];\n\tlet pending: 'and' | 'or' | null = null;\n\n\tconst interval = (i: number) => {\n\t\tconst t = tokens[i];\n\t\treturn t?.kind === 'literal' ? literalInterval(t.literal, type) : null;\n\t};\n\n\tfor (let i = 0; i < tokens.length; i++) {\n\t\tconst t = tokens[i];\n\t\tif (t.kind === 'connector') {\n\t\t\tpending = t.connector;\n\t\t\tcontinue;\n\t\t}\n\t\tlet unit: Unit|null = null;\n\t\tif (t.kind === 'op') {\n\t\t\tif (tokens[i + 1]?.kind !== 'literal') continue; // an operator without a value is skipped\n\t\t\tunit = compareUnit(t, interval(i + 1));\n\t\t\ti += 1;\n\t\t} else if (t.kind === 'literal') {\n\t\t\tif (tokens[i + 1]?.kind === 'range') {\n\t\t\t\tunit = rangeUnit(interval(i), tokens[i + 2]?.kind === 'literal' ? interval(i + 2) : null);\n\t\t\t\ti += 2;\n\t\t\t} else {\n\t\t\t\tunit = compareUnit({ kind: 'op', op: '=' }, interval(i));\n\t\t\t}\n\t\t} else {\n\t\t\tcontinue; // a stray range operator\n\t\t}\n\t\tunits.push({ unit, connector: pending });\n\t\tpending = null;\n\t}\n\n\tif (units.length === 0) return null;\n\n\t// an explicit connector, otherwise OR between two bare literals (a list of days) and AND elsewhere\n\tconst groups: DateFilterGroups = [];\n\tlet current: DateFilterGroups = units[0].unit.groups;\n\tfor (let i = 1; i < units.length; i++) {\n\t\tconst { unit, connector } = units[i];\n\t\tconst implicit = units[i - 1].unit.exact && unit.exact ? 'or' : 'and';\n\t\tif ((connector ?? implicit) === 'or') {\n\t\t\tgroups.push(...current);\n\t\t\tcurrent = unit.groups;\n\t\t} else {\n\t\t\tcurrent = andGroups(current, unit.groups);\n\t\t}\n\t}\n\tgroups.push(...current);\n\treturn groups;\n};\n\nexport const createDateMatcher = <TItem>(groups: DateFilterGroups, property: keyof TItem, type: DateFilterType) => {\n\t// the bounds compare by their times: a time of day lies on the day of the serial date 0 the way the values do\n\tconst bounds = groups.map(group => group.map(b => ({ op: b.op, time: b.value.getTime() })));\n\treturn (item: TItem) => {\n\t\tconst v = toDateFilterTime(item[property], type);\n\t\tif (v === null) return false;\n\t\treturn bounds.some(group => group.every(b => b.op === '>=' ? v >= b.time : v < b.time));\n\t};\n};\n"]}
@@ -1,7 +1,7 @@
1
1
  import { KeyValue } from "@omegagrid/core";
2
2
  import { CellModel } from "./cellModel";
3
3
  import { GridModel } from "./gridModel";
4
- import { CellType, FilterRange, FilterValue, NumericFilterGroups } from "../types";
4
+ import { CellType, FilterValue, NumericFilterGroups } from "../types";
5
5
  export type FilterMatcher = (cell: CellModel) => boolean;
6
6
  export type FilterSettings = {
7
7
  c: number;
@@ -11,9 +11,6 @@ export declare const createTextMatcher: <TItem>(term: string, property: keyof TI
11
11
  export declare const createBoolMatcher: <TItem>(term: boolean, property: keyof TItem) => (item: TItem) => boolean;
12
12
  export declare const createMultiMatcher: <TItem>(term: KeyValue[], property: keyof TItem) => (item: TItem) => boolean;
13
13
  export declare const createMultiMultiMatcher: <TItem>(_term: KeyValue[], _property: keyof TItem) => (_item: TItem) => boolean;
14
- export declare const isFilterRange: (term: FilterValue) => term is FilterRange;
15
- export declare const isFilterRangeEmpty: (term: FilterRange) => boolean;
16
- export declare const createRangeMatcher: <TItem>(term: FilterRange, property: keyof TItem, type: "d" | "dt" | "tm") => (item: TItem) => boolean;
17
14
  /** True when the whole (trimmed) input is a single bare number, e.g. `42`, `-3.5`, `1,5`. */
18
15
  export declare const isSingleNumber: (input: string) => boolean;
19
16
  /**
@@ -38,7 +35,7 @@ export declare const isSingleNumber: (input: string) => boolean;
38
35
  */
39
36
  export declare const parseNumericExpression: (input: string) => NumericFilterGroups;
40
37
  export declare const createNumericMatcher: <TItem>(groups: NumericFilterGroups, property: keyof TItem) => (item: TItem) => boolean;
41
- export declare const createCellMatcher: (type: CellType, term: FilterValue, property: keyof CellModel) => (item: CellModel) => boolean;
38
+ export declare const createCellMatcher: (type: CellType, term: FilterValue, property: keyof CellModel) => (cell: CellModel) => boolean;
42
39
  export declare class FilterEvent extends Event {
43
40
  constructor();
44
41
  }
@@ -1 +1 @@
1
- {"version":3,"file":"filterModel.d.ts","sourceRoot":"","sources":["../../src/model/filterModel.ts"],"names":[],"mappings":"AAA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,MAAM,CAA6B;IAC3C,OAAO,CAAC,SAAS,CAAwB;IACzC,IAAI,QAAQ,IACI,cAAc,EAAE,GAAC,IAAI,CADG;IACxC,IAAI,QAAQ,CAAC,CAAC,EAAE,cAAc,EAAE,GAAC,IAAI,EAQpC;gBAGgB,KAAK,EAAE,SAAS,EAChC,QAAQ,GAAE,cAAc,EAAE,GAAC,IAAW;IAMvC;;;OAGG;IACH,GAAG,CAAC,CAAC,EAAE,MAAM;IAIb;;;;OAIG;IACH,OAAO,CAAC,QAAQ,EAAE,cAAc,EAAE,EAAE,MAAM,UAAQ;IAUlD,MAAM,CAAC,MAAM,EAAE,cAAc,EAAE,aAAa,UAAO;IA6BnD,WAAW,CAAC,aAAa,UAAO;IAoDhC,WAAW,CAAC,aAAa,UAAO;IAOhC,OAAO,CAAC,YAAY;CAKpB"}
@@ -1,5 +1,5 @@
1
- import { dates, log, tree, utils } from "@omegagrid/core";
2
- import { getLocale } from "@omegagrid/localize";
1
+ import { log, tree, utils } from "@omegagrid/core";
2
+ import { createDateMatcher, parseDateExpression } from "./dateFilter";
3
3
  export const createTextMatcher = (term, property) => {
4
4
  const regex = new RegExp(`${utils.escapeRegExp(utils.removeAccents(term))}`, 'ig');
5
5
  return (item) => {
@@ -19,50 +19,6 @@ export const createMultiMatcher = (term, property) => {
19
19
  export const createMultiMultiMatcher = (_term, _property) => {
20
20
  return (_item) => false;
21
21
  };
22
- export const isFilterRange = (term) => !!term && typeof term === 'object' && !Array.isArray(term) && term.kind === 'range';
23
- export const isFilterRangeEmpty = (term) => (term.from == null || term.from === '') && (term.to == null || term.to === '');
24
- /**
25
- * The time a bound or a value of a range filter compares by: a Date, a serial date (the value of a date cell) or a text
26
- * (an ISO date, a time typed into the popup); a time (type tm) by its time of day on the day of the serial date 0.
27
- * Null for no value or a text that is none.
28
- */
29
- const toRangeTime = (v, type) => {
30
- if (v == null || v === '')
31
- return null;
32
- let date;
33
- if (v instanceof Date)
34
- date = v;
35
- else if (utils.isNumber(v))
36
- date = dates.serialDateToDateTime(v);
37
- else
38
- date = type === 'tm' ? dates.parseTime(String(v), getLocale()) : dates.parseDateTime(String(v), getLocale());
39
- if (!date || Number.isNaN(date.getTime()))
40
- return null;
41
- return type === 'tm' ? dates.timeOfDay(date).getTime() : date.getTime();
42
- };
43
- const hasBound = (bound) => bound != null && bound !== '';
44
- export const createRangeMatcher = (term, property, type) => {
45
- const from = toRangeTime(term.from, type);
46
- let to = toRangeTime(term.to, type);
47
- // a bound in no form of the type ('abc' as a time) matches nothing rather than everything
48
- const invalidBound = (hasBound(term.from) && from === null) || (hasBound(term.to) && to === null);
49
- // a day picked as the upper bound of a date type reaches to the end of that day
50
- // TODO: remove dt, when time picker is implemented
51
- if (to !== null && (type === 'd' || type === 'dt'))
52
- to += 24 * 60 * 60 * 1000 - 1;
53
- return (item) => {
54
- if (invalidBound)
55
- return false;
56
- const v = toRangeTime(item[property], type);
57
- if (v === null)
58
- return false;
59
- if (from !== null && v < from)
60
- return false;
61
- if (to !== null && v > to)
62
- return false;
63
- return true;
64
- };
65
- };
66
22
  // number token: optional sign, digits, optional decimal part using '.' or ',' as separator
67
23
  const NUM_TOKEN = '[-+]?\\d+(?:[.,]\\d+)?';
68
24
  const toClauseNumber = (t) => Number(t.replace(',', '.'));
@@ -162,9 +118,15 @@ export const createNumericMatcher = (groups, property) => {
162
118
  };
163
119
  export const createCellMatcher = (type, term, property) => {
164
120
  property = property ?? 'value';
165
- // range terms come only from the date/datetime/time range popup
166
- if ((type === 'd' || type === 'dt' || type === 'tm') && isFilterRange(term)) {
167
- return createRangeMatcher(term, property, type);
121
+ if (type === 'd' || type === 'dt' || type === 'tm') {
122
+ // a date expression ('6.11.2026', '6.11.2026..20.11.2026', '> 11.2026'), a text that is none searches the shown text
123
+ const groups = parseDateExpression((term?.toString()) ?? '', type);
124
+ if (groups) {
125
+ // a text the cell could not read as a date is no date, whatever the matcher would read of it (the cell shows it as invalid)
126
+ const matchDate = createDateMatcher(groups, property, type);
127
+ return (cell) => !cell.isInvalidDate && matchDate(cell);
128
+ }
129
+ return createTextMatcher((term?.toString()), 'formattedValue');
168
130
  }
169
131
  if (type === 'n') {
170
132
  const str = (term?.toString()) ?? '';
@@ -184,12 +146,6 @@ export const createCellMatcher = (type, term, property) => {
184
146
  return createTextMatcher((term?.toString()), 'formattedValue');
185
147
  else if (type === 'm' && Array.isArray(term))
186
148
  return createMultiMultiMatcher(term, property);
187
- else if (type === 'd')
188
- return createTextMatcher((term?.toString()), 'formattedValue');
189
- else if (type === 'dt')
190
- return createTextMatcher((term?.toString()), 'formattedValue');
191
- else if (type === 'tm')
192
- return createTextMatcher((term?.toString()), 'formattedValue');
193
149
  // text search in the value must not see the quote prefix, a custom property is kept as is
194
150
  return createTextMatcher((term?.toString()), property === 'value' ? 'plainValue' : property);
195
151
  };
@@ -242,8 +198,7 @@ export class FilterModel extends EventTarget {
242
198
  }
243
199
  filter(filter, dispatchEvent = true) {
244
200
  const filterSetting = this.get(filter.c);
245
- const empty = filter.term === null || filter.term === ''
246
- || (isFilterRange(filter.term) && isFilterRangeEmpty(filter.term));
201
+ const empty = filter.term === null || filter.term === '';
247
202
  if (filterSetting && empty) {
248
203
  // remove; splice shifts the following slots, so the map must be rebuilt
249
204
  this.settings.splice(this.colMap.get(filter.c), 1);
@@ -1 +1 @@
1
- {"version":3,"file":"filterModel.js","sourceRoot":"","sources":["../../src/model/filterModel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAchD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAQ,IAAY,EAAE,QAAqB,EAAE,EAAE;IAC/E,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,IA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,CAAC,CAAA;IACzD,CAAC;IAEO,YAAY;QACnB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAC3E,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC;IACxB,CAAC;CAED","sourcesContent":["import { KeyValue, dates, log, tree, utils } from \"@omegagrid/core\";\nimport { getLocale } from \"@omegagrid/localize\";\nimport { CellModel } from \"./cellModel\";\nimport { GridModel } from \"./gridModel\";\nimport { RowModel } from \"./rowModel\";\nimport { FilterOptions } from \"./options\";\nimport { CellType, FilterRange, FilterValue, NumericFilterClause, NumericFilterGroups, NumericFilterOperator } from \"../types\";\n\nexport type FilterMatcher = (cell: CellModel) => boolean;\n\nexport type FilterSettings = {\n\tc: number;\n\tterm: FilterValue;\n};\n\nexport const createTextMatcher = <TItem>(term: string, property: keyof TItem) => {\n\tconst regex = new RegExp(`${utils.escapeRegExp(utils.removeAccents(term))}`, 'ig');\n\treturn (item: TItem) => {\n\t\tregex.lastIndex = 0;\n\t\treturn regex.test(utils.removeAccents((item[property] ?? \"\").toString()));\n\t}\n};\n\nexport const createBoolMatcher = <TItem>(term: boolean, property: keyof TItem) => {\n\treturn (item: TItem) => !!item[property] === term;\n};\n\nexport const createMultiMatcher = <TItem>(term: KeyValue[], property: keyof TItem) => {\n\tconst keys = term.map(t => t.key?.toString());\n\treturn (item: TItem) => {\n\t\treturn item[property] == null ? false : keys.includes(item[property].toString());\n\t};\n};\n\nexport const createMultiMultiMatcher = <TItem>(_term: KeyValue[], _property: keyof TItem) => {\n\treturn (_item: TItem) => false;\n};\n\nexport const isFilterRange = (term: FilterValue): term is FilterRange =>\n\t!!term && typeof term === 'object' && !Array.isArray(term) && (term as FilterRange).kind === 'range';\n\nexport const isFilterRangeEmpty = (term: FilterRange) =>\n\t(term.from == null || term.from === '') && (term.to == null || term.to === '');\n\n/**\n * The time a bound or a value of a range filter compares by: a Date, a serial date (the value of a date cell) or a text\n * (an ISO date, a time typed into the popup); a time (type tm) by its time of day on the day of the serial date 0.\n * Null for no value or a text that is none.\n */\nconst toRangeTime = (v: unknown, type: 'd'|'dt'|'tm'): number | null => {\n\tif (v == null || v === '') return null;\n\tlet date: Date|null;\n\tif (v instanceof Date) date = v;\n\telse if (utils.isNumber(v)) date = dates.serialDateToDateTime(v as number);\n\telse date = type === 'tm' ? dates.parseTime(String(v), getLocale()) : dates.parseDateTime(String(v), getLocale());\n\tif (!date || Number.isNaN(date.getTime())) return null;\n\treturn type === 'tm' ? dates.timeOfDay(date).getTime() : date.getTime();\n};\n\nconst hasBound = (bound: unknown) => bound != null && bound !== '';\n\nexport const createRangeMatcher = <TItem>(term: FilterRange, property: keyof TItem, type: 'd'|'dt'|'tm') => {\n\tconst from = toRangeTime(term.from, type);\n\tlet to = toRangeTime(term.to, type);\n\t// a bound in no form of the type ('abc' as a time) matches nothing rather than everything\n\tconst invalidBound = (hasBound(term.from) && from === null) || (hasBound(term.to) && to === null);\n\t// a day picked as the upper bound of a date type reaches to the end of that day\n\t// TODO: remove dt, when time picker is implemented\n\tif (to !== null && (type === 'd' || type === 'dt')) to += 24 * 60 * 60 * 1000 - 1;\n\n\treturn (item: TItem) => {\n\t\tif (invalidBound) return false;\n\t\tconst v = toRangeTime(item[property], type);\n\t\tif (v === null) return false;\n\t\tif (from !== null && v < from) return false;\n\t\tif (to !== null && v > to) return false;\n\t\treturn true;\n\t};\n};\n\n// number token: optional sign, digits, optional decimal part using '.' or ',' as separator\nconst NUM_TOKEN = '[-+]?\\\\d+(?:[.,]\\\\d+)?';\nconst toClauseNumber = (t: string) => Number(t.replace(',', '.'));\n\n/** True when the whole (trimmed) input is a single bare number, e.g. `42`, `-3.5`, `1,5`. */\nexport const isSingleNumber = (input: string) => new RegExp(`^${NUM_TOKEN}$`).test(input.trim());\n\n/**\n * Parse a numeric filter expression into a disjunction of conjunctions\n * (OR groups, each an AND-combined list of clauses).\n *\n * Supported syntax:\n * - operators `>`, `>=`, `<`, `<=`, `=`/`==`, `!=`/`<>` followed by a number (e.g. `> 100`, `=42`, `!=5`)\n * - a bare number, treated as an exact match `= n` (e.g. `42`)\n * - a range `a..b`, expanded to `>= a` and `<= b` (e.g. `10..20`)\n * - `and` / `or` connectors (case-insensitive), e.g. `<10 or >20`, `>10 and <20`.\n *\n * Combining rules: an explicit `or` starts a new OR group, an explicit `and` keeps\n * clauses in the same AND group. When no connector is given between two clauses the\n * implicit connector is OR if both are exact (`=`) clauses — a value list such as\n * `1 2 3` — and AND otherwise (comparisons narrow, e.g. `>10 <20`).\n *\n * Note: a lone bare number is parsed here as `= n`; callers that want the\n * \"contains\" text-search behaviour for a single number must check {@link isSingleNumber}.\n *\n * Decimal separator may be `.` or `,`. Tokens that cannot be parsed are ignored.\n */\nexport const parseNumericExpression = (input: string): NumericFilterGroups => {\n\tconst groups: NumericFilterClause[][] = [];\n\tif (!input) return groups;\n\n\tlet current: NumericFilterClause[] = [];\n\tlet pending: 'and' | 'or' | null = null; // explicit connector awaiting the next clause\n\tlet lastOp: NumericFilterOperator | null = null;\n\n\tconst flush = () => { if (current.length > 0) { groups.push(current); current = []; } };\n\n\t// add one AND-unit (a single clause, or the two bounds of a range), honouring the\n\t// pending explicit connector or the implicit default (OR between two `=`, else AND)\n\tconst addUnit = (clauses: NumericFilterClause[]) => {\n\t\tconst first = groups.length === 0 && current.length === 0;\n\t\tif (!first) {\n\t\t\tconst connector = pending ?? ((lastOp === '=' && clauses[0].op === '=') ? 'or' : 'and');\n\t\t\tif (connector === 'or') flush();\n\t\t}\n\t\tcurrent.push(...clauses);\n\t\tpending = null;\n\t\tlastOp = clauses[clauses.length - 1].op;\n\t};\n\n\tconst tokenRe = new RegExp(\n\t\t`(${NUM_TOKEN})\\\\s*\\\\.\\\\.\\\\s*(${NUM_TOKEN})` + // 1,2 range a..b\n\t\t`|(>=|<=|<>|!=|==|=|>|<)\\\\s*(${NUM_TOKEN})` + // 3,4 comparison clause\n\t\t`|\\\\b(and|or)\\\\b` + // 5 connector\n\t\t`|(${NUM_TOKEN})`, // 6 bare number (exact match)\n\t\t'gi'\n\t);\n\n\tlet m: RegExpExecArray | null;\n\twhile ((m = tokenRe.exec(input)) !== null) {\n\t\tif (m[1] != null) {\n\t\t\taddUnit([{ op: '>=', value: toClauseNumber(m[1]) }, { op: '<=', value: toClauseNumber(m[2]) }]);\n\t\t} else if (m[3] != null) {\n\t\t\tconst op: NumericFilterOperator = m[3] === '==' ? '=' : m[3] === '<>' ? '!=' : m[3] as NumericFilterOperator;\n\t\t\taddUnit([{ op, value: toClauseNumber(m[4]) }]);\n\t\t} else if (m[5] != null) {\n\t\t\tpending = m[5].toLowerCase() === 'or' ? 'or' : 'and';\n\t\t} else if (m[6] != null) {\n\t\t\taddUnit([{ op: '=', value: toClauseNumber(m[6]) }]);\n\t\t}\n\t}\n\tflush();\n\treturn groups;\n};\n\nexport const createNumericMatcher = <TItem>(groups: NumericFilterGroups, property: keyof TItem) => {\n\tconst test = (v: number, c: NumericFilterClause) => {\n\t\tswitch (c.op) {\n\t\t\tcase '>': return v > c.value;\n\t\t\tcase '>=': return v >= c.value;\n\t\t\tcase '<': return v < c.value;\n\t\t\tcase '<=': return v <= c.value;\n\t\t\tcase '=': return v === c.value;\n\t\t\tcase '!=': return v !== c.value;\n\t\t}\n\t};\n\treturn (item: TItem) => {\n\t\tif (groups.length === 0) return true;\n\t\tconst raw = item[property];\n\t\tif (raw == null || raw === '') return false;\n\t\tconst v = typeof raw === 'number' ? raw : Number(raw);\n\t\tif (Number.isNaN(v)) return false;\n\t\t// value matches if it satisfies every clause of at least one OR group\n\t\treturn groups.some(group => group.every(c => test(v, c)));\n\t};\n};\n\nexport const createCellMatcher = (type: CellType, term: FilterValue, property: keyof CellModel) => {\n\tproperty = property ?? 'value';\n\t// range terms come only from the date/datetime/time range popup\n\tif ((type === 'd' || type === 'dt' || type === 'tm') && isFilterRange(term)) {\n\t\treturn createRangeMatcher<CellModel>(term, property, type);\n\t}\n\tif (type === 'n') {\n\t\tconst str = (term?.toString()) ?? '';\n\t\t// a lone bare number -> plain \"contains\" text search; anything else -> numeric expression\n\t\tif (isSingleNumber(str)) return createTextMatcher<CellModel>(str.trim(), 'formattedValue');\n\t\tconst groups = parseNumericExpression(str);\n\t\tif (groups.length > 0) return createNumericMatcher<CellModel>(groups, property);\n\t\treturn createTextMatcher<CellModel>(str, 'formattedValue');\n\t}\n\tif (type === 'b') return createBoolMatcher<CellModel>(term as boolean, property);\n\telse if (type === 's' && Array.isArray(term)) return createMultiMatcher<CellModel>((term as KeyValue[]), 'value');\n\telse if (type === 's') return createTextMatcher<CellModel>((term?.toString()), 'formattedValue');\n\telse if (type === 'm' && Array.isArray(term)) return createMultiMultiMatcher<CellModel>((term as KeyValue[]), property);\n\telse if (type === 'd') return createTextMatcher<CellModel>((term?.toString()) as string, 'formattedValue');\n\telse if (type === 'dt') return createTextMatcher<CellModel>((term?.toString()) as string, 'formattedValue');\n\telse if (type === 'tm') return createTextMatcher<CellModel>((term?.toString()) as string, 'formattedValue');\n\t// text search in the value must not see the quote prefix, a custom property is kept as is\n\treturn createTextMatcher<CellModel>((term?.toString()) as string, property === 'value' ? 'plainValue' : property);\n}\n\nexport class FilterEvent extends Event {\n\tconstructor() {\n\t\tsuper('filter', {bubbles: false, cancelable: true, composed: true});\n\t}\n}\n\nexport class FilterModel extends EventTarget {\n\t\n\tpublic custom = false;\n\n\tprivate colMap = new Map<number, number>();\n\tprivate _settings: FilterSettings[] = [];\n\tget settings() { return this._settings }\n\tset settings(v: FilterSettings[]|null) {\n\t\tthis._settings = v || [];\n\t\tthis.colMap.clear();\n\t\tif (this.settings.length > 0) {\n\t\t\tthis.settings.forEach((s, i) => this.colMap.set(s.c, i));\n\t\t\tthis.applyFilter();\n\t\t\tlog.getLogger().info(`filtering applied: ${JSON.stringify(this.settings)}`);\n\t\t}\n\t}\n\n\tconstructor(\n\t\tpublic readonly model: GridModel,\n\t\tsettings: FilterSettings[]|null = null\n\t) {\n\t\tsuper();\n\t\tthis.settings = settings;\n\t}\n\n\t/**\n\t * Get filtering settings for specified column\n\t * @param c column index\n\t */\n\tget(c: number) {\n\t\treturn this.colMap.has(c) ? this.settings[this.colMap.get(c)] : null;\n\t}\n\n\t/**\n\t * Restore settings captured from a previous model instance (grid refresh recreates the model).\n\t * With `custom` (the server filters) the rows came filtered by these settings already: they all count as\n\t * matched, whatever the settings the new model applied to itself in its constructor (the default ones).\n\t */\n\trestore(settings: FilterSettings[], custom = false) {\n\t\tthis.custom = custom;\n\t\t// drop settings for columns that no longer exist in the refreshed model\n\t\tthis._settings = (settings || []).filter(s => this.model.columns[s.c]);\n\t\tthis.colMap.clear();\n\t\tthis._settings.forEach((s, i) => this.colMap.set(s.c, i));\n\t\tif (custom) this.matchAllRows();\n\t\telse if (this._settings.length > 0) this.applyFilter(false);\n\t}\n\n\tfilter(filter: FilterSettings, dispatchEvent = true) {\n\t\tconst filterSetting = this.get(filter.c);\n\t\tconst empty = filter.term === null || filter.term === ''\n\t\t\t|| (isFilterRange(filter.term) && isFilterRangeEmpty(filter.term));\n\n\t\tif (filterSetting && empty) {\n\t\t\t// remove; splice shifts the following slots, so the map must be rebuilt\n\t\t\tthis.settings.splice(this.colMap.get(filter.c), 1);\n\t\t\tthis.colMap.clear();\n\t\t\tthis.settings.forEach((s, i) => this.colMap.set(s.c, i));\n\t\t} else if (filterSetting) {\n\t\t\t// update\n\t\t\tfilterSetting.term = filter.term;\n\t\t} else if (!empty) {\n\t\t\t// add\n\t\t\tthis.colMap.set(filter.c, this.settings.length);\n\t\t\tthis.settings.push(filter);\n\t\t}\n\n\t\tif (!this.custom) {\n\t\t\tif (this.settings.length > 0) {\n\t\t\t\tthis.applyFilter(false);\n\t\t\t} else {\n\t\t\t\tthis.resetFilter(false);\n\t\t\t}\n\t\t}\n\n\t\tif (dispatchEvent) this.dispatchEvent(new FilterEvent())\n\t}\n\n\tapplyFilter(dispatchEvent = true) {\n\t\tconst cellMatchers: {c: number, matcher: FilterMatcher}[] = [];\n\t\tthis.settings.forEach((s) => {\n\t\t\tconst column = this.model.columns[s.c];\n\t\t\tcellMatchers.push({c: s.c, matcher: createCellMatcher(column.type, s.term, column.filter?.property)});\n\t\t});\n\n\t\tconst count = cellMatchers.length;\n\t\tconst rowMatcher = (row: RowModel) => {\n\t\t\tif (!row.filterable) return true;\n\t\t\tfor (let i = 0; i < count; i++) {\n\t\t\t\tif (!cellMatchers[i].matcher(row.cell(cellMatchers[i].c))) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t};\n\n\t\tconst includeParents = (this.model.options.filters as FilterOptions)?.includeParents ?? true;\n\t\tconst includeChildren = (this.model.options.filters as FilterOptions)?.includeChildren ?? true;\n\n\t\tconst visitedRows = new Set<number>();\n\t\tthis.model.rows.forEach(row => {\n\t\t\tconst visited = visitedRows.has(row.index);\n\n\t\t\tif (rowMatcher(row)) {\n\t\t\t\trow.filterState = tree.FilterState.Matched;\n\t\t\t\tif (includeParents) {\n\t\t\t\t\trow.walkUp((parent: RowModel) => {\n\t\t\t\t\t\tif (visitedRows.has(parent.index) && parent.filterState > 0) return false;\n\t\t\t\t\t\tparent.filterState = tree.FilterState.ChildMatched;\n\t\t\t\t\t\tvisitedRows.add(parent.index);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif (includeChildren) {\n\t\t\t\t\trow.walk((child: RowModel) => {\n\t\t\t\t\t\tif (visitedRows.has(child.index) && child.filterState > 0) return false;\n\t\t\t\t\t\tchild.filterState = tree.FilterState.ParentMatched;\n\t\t\t\t\t\tvisitedRows.add(child.index);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} else if (!visited) {\n\t\t\t\trow.filterState = tree.FilterState.Filtered;\n\t\t\t}\n\n\t\t\tvisitedRows.add(row.index);\n\t\t});\n\n\t\tthis.model.indexRows();\n\t\tif (dispatchEvent) this.dispatchEvent(new FilterEvent())\n\t}\n\n\tresetFilter(dispatchEvent = true) {\n\t\tthis.settings = [];\n\t\tthis.colMap.clear();\n\t\tthis.matchAllRows();\n\t\tif (dispatchEvent) this.dispatchEvent(new FilterEvent())\n\t}\n\n\tprivate matchAllRows() {\n\t\tthis.model.rows.forEach(row => row.filterState = tree.FilterState.Matched);\n\t\tthis.model.indexRows();\n\t}\n\n}"]}
1
+ {"version":3,"file":"filterModel.js","sourceRoot":"","sources":["../../src/model/filterModel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAK7D,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAUtE,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAQ,IAAY,EAAE,QAAqB,EAAE,EAAE;IAC/E,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IACnF,OAAO,CAAC,IAAW,EAAE,EAAE;QACtB,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC;QACpB,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;IAC3E,CAAC,CAAA;AACF,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAQ,IAAa,EAAE,QAAqB,EAAE,EAAE;IAChF,OAAO,CAAC,IAAW,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC;AACnD,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAQ,IAAgB,EAAE,QAAqB,EAAE,EAAE;IACp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G,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC;YAC7C,CAAC;YAED,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAC5B,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC;QACvB,IAAI,aAAa;YAAE,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,EAAE,CAAC,CAAA;IACzD,CAAC;IAED,WAAW,CAAC,aAAa,GAAG,IAAI;QAC/B,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QACpB,IAAI,CAAC,YAAY,EAAE,CAAC;QACpB,IAAI,aAAa;YAAE,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,EAAE,CAAC,CAAA;IACzD,CAAC;IAEO,YAAY;QACnB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAC3E,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC;IACxB,CAAC;CAED","sourcesContent":["import { KeyValue, log, tree, utils } from \"@omegagrid/core\";\nimport { CellModel } from \"./cellModel\";\nimport { GridModel } from \"./gridModel\";\nimport { RowModel } from \"./rowModel\";\nimport { FilterOptions } from \"./options\";\nimport { createDateMatcher, parseDateExpression } from \"./dateFilter\";\nimport { CellType, FilterValue, NumericFilterClause, NumericFilterGroups, NumericFilterOperator } from \"../types\";\n\nexport type FilterMatcher = (cell: CellModel) => boolean;\n\nexport type FilterSettings = {\n\tc: number;\n\tterm: FilterValue;\n};\n\nexport const createTextMatcher = <TItem>(term: string, property: keyof TItem) => {\n\tconst regex = new RegExp(`${utils.escapeRegExp(utils.removeAccents(term))}`, 'ig');\n\treturn (item: TItem) => {\n\t\tregex.lastIndex = 0;\n\t\treturn regex.test(utils.removeAccents((item[property] ?? \"\").toString()));\n\t}\n};\n\nexport const createBoolMatcher = <TItem>(term: boolean, property: keyof TItem) => {\n\treturn (item: TItem) => !!item[property] === term;\n};\n\nexport const createMultiMatcher = <TItem>(term: KeyValue[], property: keyof TItem) => {\n\tconst keys = term.map(t => t.key?.toString());\n\treturn (item: TItem) => {\n\t\treturn item[property] == null ? false : keys.includes(item[property].toString());\n\t};\n};\n\nexport const createMultiMultiMatcher = <TItem>(_term: KeyValue[], _property: keyof TItem) => {\n\treturn (_item: TItem) => false;\n};\n\n// number token: optional sign, digits, optional decimal part using '.' or ',' as separator\nconst NUM_TOKEN = '[-+]?\\\\d+(?:[.,]\\\\d+)?';\nconst toClauseNumber = (t: string) => Number(t.replace(',', '.'));\n\n/** True when the whole (trimmed) input is a single bare number, e.g. `42`, `-3.5`, `1,5`. */\nexport const isSingleNumber = (input: string) => new RegExp(`^${NUM_TOKEN}$`).test(input.trim());\n\n/**\n * Parse a numeric filter expression into a disjunction of conjunctions\n * (OR groups, each an AND-combined list of clauses).\n *\n * Supported syntax:\n * - operators `>`, `>=`, `<`, `<=`, `=`/`==`, `!=`/`<>` followed by a number (e.g. `> 100`, `=42`, `!=5`)\n * - a bare number, treated as an exact match `= n` (e.g. `42`)\n * - a range `a..b`, expanded to `>= a` and `<= b` (e.g. `10..20`)\n * - `and` / `or` connectors (case-insensitive), e.g. `<10 or >20`, `>10 and <20`.\n *\n * Combining rules: an explicit `or` starts a new OR group, an explicit `and` keeps\n * clauses in the same AND group. When no connector is given between two clauses the\n * implicit connector is OR if both are exact (`=`) clauses — a value list such as\n * `1 2 3` — and AND otherwise (comparisons narrow, e.g. `>10 <20`).\n *\n * Note: a lone bare number is parsed here as `= n`; callers that want the\n * \"contains\" text-search behaviour for a single number must check {@link isSingleNumber}.\n *\n * Decimal separator may be `.` or `,`. Tokens that cannot be parsed are ignored.\n */\nexport const parseNumericExpression = (input: string): NumericFilterGroups => {\n\tconst groups: NumericFilterClause[][] = [];\n\tif (!input) return groups;\n\n\tlet current: NumericFilterClause[] = [];\n\tlet pending: 'and' | 'or' | null = null; // explicit connector awaiting the next clause\n\tlet lastOp: NumericFilterOperator | null = null;\n\n\tconst flush = () => { if (current.length > 0) { groups.push(current); current = []; } };\n\n\t// add one AND-unit (a single clause, or the two bounds of a range), honouring the\n\t// pending explicit connector or the implicit default (OR between two `=`, else AND)\n\tconst addUnit = (clauses: NumericFilterClause[]) => {\n\t\tconst first = groups.length === 0 && current.length === 0;\n\t\tif (!first) {\n\t\t\tconst connector = pending ?? ((lastOp === '=' && clauses[0].op === '=') ? 'or' : 'and');\n\t\t\tif (connector === 'or') flush();\n\t\t}\n\t\tcurrent.push(...clauses);\n\t\tpending = null;\n\t\tlastOp = clauses[clauses.length - 1].op;\n\t};\n\n\tconst tokenRe = new RegExp(\n\t\t`(${NUM_TOKEN})\\\\s*\\\\.\\\\.\\\\s*(${NUM_TOKEN})` + // 1,2 range a..b\n\t\t`|(>=|<=|<>|!=|==|=|>|<)\\\\s*(${NUM_TOKEN})` + // 3,4 comparison clause\n\t\t`|\\\\b(and|or)\\\\b` + // 5 connector\n\t\t`|(${NUM_TOKEN})`, // 6 bare number (exact match)\n\t\t'gi'\n\t);\n\n\tlet m: RegExpExecArray | null;\n\twhile ((m = tokenRe.exec(input)) !== null) {\n\t\tif (m[1] != null) {\n\t\t\taddUnit([{ op: '>=', value: toClauseNumber(m[1]) }, { op: '<=', value: toClauseNumber(m[2]) }]);\n\t\t} else if (m[3] != null) {\n\t\t\tconst op: NumericFilterOperator = m[3] === '==' ? '=' : m[3] === '<>' ? '!=' : m[3] as NumericFilterOperator;\n\t\t\taddUnit([{ op, value: toClauseNumber(m[4]) }]);\n\t\t} else if (m[5] != null) {\n\t\t\tpending = m[5].toLowerCase() === 'or' ? 'or' : 'and';\n\t\t} else if (m[6] != null) {\n\t\t\taddUnit([{ op: '=', value: toClauseNumber(m[6]) }]);\n\t\t}\n\t}\n\tflush();\n\treturn groups;\n};\n\nexport const createNumericMatcher = <TItem>(groups: NumericFilterGroups, property: keyof TItem) => {\n\tconst test = (v: number, c: NumericFilterClause) => {\n\t\tswitch (c.op) {\n\t\t\tcase '>': return v > c.value;\n\t\t\tcase '>=': return v >= c.value;\n\t\t\tcase '<': return v < c.value;\n\t\t\tcase '<=': return v <= c.value;\n\t\t\tcase '=': return v === c.value;\n\t\t\tcase '!=': return v !== c.value;\n\t\t}\n\t};\n\treturn (item: TItem) => {\n\t\tif (groups.length === 0) return true;\n\t\tconst raw = item[property];\n\t\tif (raw == null || raw === '') return false;\n\t\tconst v = typeof raw === 'number' ? raw : Number(raw);\n\t\tif (Number.isNaN(v)) return false;\n\t\t// value matches if it satisfies every clause of at least one OR group\n\t\treturn groups.some(group => group.every(c => test(v, c)));\n\t};\n};\n\nexport const createCellMatcher = (type: CellType, term: FilterValue, property: keyof CellModel) => {\n\tproperty = property ?? 'value';\n\tif (type === 'd' || type === 'dt' || type === 'tm') {\n\t\t// a date expression ('6.11.2026', '6.11.2026..20.11.2026', '> 11.2026'), a text that is none searches the shown text\n\t\tconst groups = parseDateExpression((term?.toString()) ?? '', type);\n\t\tif (groups) {\n\t\t\t// a text the cell could not read as a date is no date, whatever the matcher would read of it (the cell shows it as invalid)\n\t\t\tconst matchDate = createDateMatcher<CellModel>(groups, property, type);\n\t\t\treturn (cell: CellModel) => !cell.isInvalidDate && matchDate(cell);\n\t\t}\n\t\treturn createTextMatcher<CellModel>((term?.toString()) as string, 'formattedValue');\n\t}\n\tif (type === 'n') {\n\t\tconst str = (term?.toString()) ?? '';\n\t\t// a lone bare number -> plain \"contains\" text search; anything else -> numeric expression\n\t\tif (isSingleNumber(str)) return createTextMatcher<CellModel>(str.trim(), 'formattedValue');\n\t\tconst groups = parseNumericExpression(str);\n\t\tif (groups.length > 0) return createNumericMatcher<CellModel>(groups, property);\n\t\treturn createTextMatcher<CellModel>(str, 'formattedValue');\n\t}\n\tif (type === 'b') return createBoolMatcher<CellModel>(term as boolean, property);\n\telse if (type === 's' && Array.isArray(term)) return createMultiMatcher<CellModel>((term as KeyValue[]), 'value');\n\telse if (type === 's') return createTextMatcher<CellModel>((term?.toString()), 'formattedValue');\n\telse if (type === 'm' && Array.isArray(term)) return createMultiMultiMatcher<CellModel>((term as KeyValue[]), property);\n\t// text search in the value must not see the quote prefix, a custom property is kept as is\n\treturn createTextMatcher<CellModel>((term?.toString()) as string, property === 'value' ? 'plainValue' : property);\n}\n\nexport class FilterEvent extends Event {\n\tconstructor() {\n\t\tsuper('filter', {bubbles: false, cancelable: true, composed: true});\n\t}\n}\n\nexport class FilterModel extends EventTarget {\n\t\n\tpublic custom = false;\n\n\tprivate colMap = new Map<number, number>();\n\tprivate _settings: FilterSettings[] = [];\n\tget settings() { return this._settings }\n\tset settings(v: FilterSettings[]|null) {\n\t\tthis._settings = v || [];\n\t\tthis.colMap.clear();\n\t\tif (this.settings.length > 0) {\n\t\t\tthis.settings.forEach((s, i) => this.colMap.set(s.c, i));\n\t\t\tthis.applyFilter();\n\t\t\tlog.getLogger().info(`filtering applied: ${JSON.stringify(this.settings)}`);\n\t\t}\n\t}\n\n\tconstructor(\n\t\tpublic readonly model: GridModel,\n\t\tsettings: FilterSettings[]|null = null\n\t) {\n\t\tsuper();\n\t\tthis.settings = settings;\n\t}\n\n\t/**\n\t * Get filtering settings for specified column\n\t * @param c column index\n\t */\n\tget(c: number) {\n\t\treturn this.colMap.has(c) ? this.settings[this.colMap.get(c)] : null;\n\t}\n\n\t/**\n\t * Restore settings captured from a previous model instance (grid refresh recreates the model).\n\t * With `custom` (the server filters) the rows came filtered by these settings already: they all count as\n\t * matched, whatever the settings the new model applied to itself in its constructor (the default ones).\n\t */\n\trestore(settings: FilterSettings[], custom = false) {\n\t\tthis.custom = custom;\n\t\t// drop settings for columns that no longer exist in the refreshed model\n\t\tthis._settings = (settings || []).filter(s => this.model.columns[s.c]);\n\t\tthis.colMap.clear();\n\t\tthis._settings.forEach((s, i) => this.colMap.set(s.c, i));\n\t\tif (custom) this.matchAllRows();\n\t\telse if (this._settings.length > 0) this.applyFilter(false);\n\t}\n\n\tfilter(filter: FilterSettings, dispatchEvent = true) {\n\t\tconst filterSetting = this.get(filter.c);\n\t\tconst empty = filter.term === null || filter.term === '';\n\n\t\tif (filterSetting && empty) {\n\t\t\t// remove; splice shifts the following slots, so the map must be rebuilt\n\t\t\tthis.settings.splice(this.colMap.get(filter.c), 1);\n\t\t\tthis.colMap.clear();\n\t\t\tthis.settings.forEach((s, i) => this.colMap.set(s.c, i));\n\t\t} else if (filterSetting) {\n\t\t\t// update\n\t\t\tfilterSetting.term = filter.term;\n\t\t} else if (!empty) {\n\t\t\t// add\n\t\t\tthis.colMap.set(filter.c, this.settings.length);\n\t\t\tthis.settings.push(filter);\n\t\t}\n\n\t\tif (!this.custom) {\n\t\t\tif (this.settings.length > 0) {\n\t\t\t\tthis.applyFilter(false);\n\t\t\t} else {\n\t\t\t\tthis.resetFilter(false);\n\t\t\t}\n\t\t}\n\n\t\tif (dispatchEvent) this.dispatchEvent(new FilterEvent())\n\t}\n\n\tapplyFilter(dispatchEvent = true) {\n\t\tconst cellMatchers: {c: number, matcher: FilterMatcher}[] = [];\n\t\tthis.settings.forEach((s) => {\n\t\t\tconst column = this.model.columns[s.c];\n\t\t\tcellMatchers.push({c: s.c, matcher: createCellMatcher(column.type, s.term, column.filter?.property)});\n\t\t});\n\n\t\tconst count = cellMatchers.length;\n\t\tconst rowMatcher = (row: RowModel) => {\n\t\t\tif (!row.filterable) return true;\n\t\t\tfor (let i = 0; i < count; i++) {\n\t\t\t\tif (!cellMatchers[i].matcher(row.cell(cellMatchers[i].c))) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t};\n\n\t\tconst includeParents = (this.model.options.filters as FilterOptions)?.includeParents ?? true;\n\t\tconst includeChildren = (this.model.options.filters as FilterOptions)?.includeChildren ?? true;\n\n\t\tconst visitedRows = new Set<number>();\n\t\tthis.model.rows.forEach(row => {\n\t\t\tconst visited = visitedRows.has(row.index);\n\n\t\t\tif (rowMatcher(row)) {\n\t\t\t\trow.filterState = tree.FilterState.Matched;\n\t\t\t\tif (includeParents) {\n\t\t\t\t\trow.walkUp((parent: RowModel) => {\n\t\t\t\t\t\tif (visitedRows.has(parent.index) && parent.filterState > 0) return false;\n\t\t\t\t\t\tparent.filterState = tree.FilterState.ChildMatched;\n\t\t\t\t\t\tvisitedRows.add(parent.index);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif (includeChildren) {\n\t\t\t\t\trow.walk((child: RowModel) => {\n\t\t\t\t\t\tif (visitedRows.has(child.index) && child.filterState > 0) return false;\n\t\t\t\t\t\tchild.filterState = tree.FilterState.ParentMatched;\n\t\t\t\t\t\tvisitedRows.add(child.index);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} else if (!visited) {\n\t\t\t\trow.filterState = tree.FilterState.Filtered;\n\t\t\t}\n\n\t\t\tvisitedRows.add(row.index);\n\t\t});\n\n\t\tthis.model.indexRows();\n\t\tif (dispatchEvent) this.dispatchEvent(new FilterEvent())\n\t}\n\n\tresetFilter(dispatchEvent = true) {\n\t\tthis.settings = [];\n\t\tthis.colMap.clear();\n\t\tthis.matchAllRows();\n\t\tif (dispatchEvent) this.dispatchEvent(new FilterEvent())\n\t}\n\n\tprivate matchAllRows() {\n\t\tthis.model.rows.forEach(row => row.filterState = tree.FilterState.Matched);\n\t\tthis.model.indexRows();\n\t}\n\n}"]}
@@ -7,6 +7,7 @@ export * from './conditionalFormats';
7
7
  export * from './cssStyle';
8
8
  export * from './dependencies';
9
9
  export * from './elementModel';
10
+ export * from './dateFilter';
10
11
  export * from './filterModel';
11
12
  export * from './gridModel';
12
13
  export * from './groupModel';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/model/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/model/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC"}
@@ -7,6 +7,7 @@ export * from './conditionalFormats';
7
7
  export * from './cssStyle';
8
8
  export * from './dependencies';
9
9
  export * from './elementModel';
10
+ export * from './dateFilter';
10
11
  export * from './filterModel';
11
12
  export * from './gridModel';
12
13
  export * from './groupModel';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/model/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC","sourcesContent":["export * from './cellModel';\nexport * from './columnModel';\nexport * from './sortingModel';\nexport * from './commentModel';\nexport * from './calculationModel';\nexport * from './conditionalFormats';\nexport * from './cssStyle';\nexport * from './dependencies';\nexport * from './elementModel';\nexport * from './filterModel';\nexport * from './gridModel';\nexport * from './groupModel';\nexport * from './history';\nexport * from './iterableRange';\nexport * from './options';\nexport * from './rowModel';\nexport * from './namingModel';\nexport * from './selectionModel';\nexport * from './style';\nexport * from './tableTheme';\nexport * from './validations';\nexport * from './merges';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/model/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC","sourcesContent":["export * from './cellModel';\nexport * from './columnModel';\nexport * from './sortingModel';\nexport * from './commentModel';\nexport * from './calculationModel';\nexport * from './conditionalFormats';\nexport * from './cssStyle';\nexport * from './dependencies';\nexport * from './elementModel';\nexport * from './dateFilter';\nexport * from './filterModel';\nexport * from './gridModel';\nexport * from './groupModel';\nexport * from './history';\nexport * from './iterableRange';\nexport * from './options';\nexport * from './rowModel';\nexport * from './namingModel';\nexport * from './selectionModel';\nexport * from './style';\nexport * from './tableTheme';\nexport * from './validations';\nexport * from './merges';\n"]}
package/dist/types.d.ts CHANGED
@@ -11,17 +11,7 @@ export type BaseGroupModelSource = {
11
11
  };
12
12
  export type EditType = 'value' | 'style' | 'insert_row' | 'insert_column' | 'delete_row' | 'delete_column' | 'move_row' | 'move_column' | 'autofill';
13
13
  export type CellValueType = unknown;
14
- /**
15
- * Filter term produced by the date/datetime/time range filter popup (`og-filter-range`).
16
- * Numeric columns do NOT use this — they filter via a text expression (see
17
- * {@link NumericFilterGroups} and `parseNumericExpression`).
18
- */
19
- export type FilterRange = {
20
- kind: 'range';
21
- from?: number | string | Date | null;
22
- to?: number | string | Date | null;
23
- };
24
- export type FilterValue = string | number | boolean | KeyValue[] | FilterRange;
14
+ export type FilterValue = string | number | boolean | KeyValue[];
25
15
  /** Comparison operators usable in a numeric text filter expression (e.g. `> 100`). */
26
16
  export type NumericFilterOperator = '=' | '!=' | '<' | '<=' | '>' | '>=';
27
17
  export type NumericFilterClause = {
@@ -34,6 +24,22 @@ export type NumericFilterClause = {
34
24
  * satisfies every clause of at least one group.
35
25
  */
36
26
  export type NumericFilterGroups = NumericFilterClause[][];
27
+ /** The date column types: a date, a date and time, a time of day */
28
+ export type DateFilterType = 'd' | 'dt' | 'tm';
29
+ /**
30
+ * A bound of a date filter expression: the value is at or after a time (`>=`) or before it (`<`). A time of day
31
+ * (type tm) lies on the day of the serial date 0, the end of a day is the start of the next one.
32
+ */
33
+ export type DateFilterBound = {
34
+ op: '>=' | '<';
35
+ value: Date;
36
+ };
37
+ /**
38
+ * Parsed date expression (see `parseDateExpression`) as a disjunction of conjunctions: the outer array holds OR
39
+ * groups, each inner array holds bounds combined with AND. A value matches if it satisfies every bound of at
40
+ * least one group; no group matches nothing.
41
+ */
42
+ export type DateFilterGroups = DateFilterBound[][];
37
43
  /**
38
44
  * Actions = 'a',
39
45
  * Html = 'h'
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACjH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC1G,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,MAAM,MAAM,QAAQ,GAAG,CAAC,GAAG,EAAE,cAAc,EAAE,IAAI,EAAE,SAAS,KAAK,cAAc,CAAC;AAChF,MAA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AAED,MAAM,MAAM,2BAA2B,GAAG;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,sBAAsB,EAAE,CAAA;CACnC,CAAA;AAED,MAAM,MAAM,UAAU,GAAG;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;CACjB,CAAA;AAED,MAAM,MAAM,WAAW,GAAG;IACzB,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,SAAS,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;CAC/B,CAAA;AAED,MAAM,MAAM,WAAW,GAAG;IACzB,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,SAAS,EAAE,aAAa,EAAE,CAAC;IAC3B,KAAK,EAAE,SAAS,CAAC;CACjB,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAE5B,mEAAmE;IACnE,cAAc,CAAC,EAAE,OAAO,CAAC;CACzB,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG;IACtC,YAAY,CAAC,EAAE,OAAO,CAAC;CACvB,CAAA;AAED,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,cAAc,KAAK,CAAC,CAAC"}
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import { ColorTypes, Direction, Size, Location, UIValueType, Matrix, KeyValue, MenuItem } from \"@omegagrid/core\";\nimport { CSSStyle, CellModel, GridSource, Style, CommentItem, TableTheme, EditingOptions } from \"./model\";\nimport { CellRange } from \"./common\";\n\nexport type Renderer = (div: HTMLDivElement, cell: CellModel) => HTMLDivElement;\nexport type CommentRenderer = (div: HTMLDivElement, comment: CommentItem, cell: CellModel) => HTMLDivElement;\n\nexport type Comparer = (a: CellModel, b: CellModel) => number;\n\nexport type FormulaFunction = (...args: unknown[]) => unknown;\n\nexport type BaseGroupModelSource = {\n\tmodels: GridSource[],\n\tthemes?: TableTheme[]\n\t//layout: TabSplitContainerModel\n}\n\nexport type EditType = 'value'|'style'|'insert_row'|'insert_column'|'delete_row'|'delete_column'|'move_row'|'move_column'|'autofill';\nexport type CellValueType = unknown; //number|string|boolean|object|null;\n/**\n * Filter term produced by the date/datetime/time range filter popup (`og-filter-range`).\n * Numeric columns do NOT use this — they filter via a text expression (see\n * {@link NumericFilterGroups} and `parseNumericExpression`).\n */\nexport type FilterRange = {\n\tkind: 'range',\n\tfrom?: number|string|Date|null,\n\tto?: number|string|Date|null,\n};\nexport type FilterValue = string|number|boolean|KeyValue[]|FilterRange;\n\n/** Comparison operators usable in a numeric text filter expression (e.g. `> 100`). */\nexport type NumericFilterOperator = '=' | '!=' | '<' | '<=' | '>' | '>=';\nexport type NumericFilterClause = { op: NumericFilterOperator, value: number };\n/**\n * Parsed numeric expression as a disjunction of conjunctions: the outer array holds\n * OR groups, each inner array holds clauses combined with AND. A value matches if it\n * satisfies every clause of at least one group.\n */\nexport type NumericFilterGroups = NumericFilterClause[][];\n\n/**\n * Actions = 'a',\n * Html = 'h'\n */\nexport type AditionalUIValueType = 'a'|'h';\n\nexport type CellType = UIValueType | AditionalUIValueType;\n\nexport type StyleSource = number|string|Style|CSSStyle;\n\nexport type CellAction = {\n\taction: string,\n\ticon?: string,\n\ttext?: string,\n\ttitle?: string,\n\tcolor?: ColorTypes,\n\ttype?: 'button'|'menu',\n\titems?: MenuItem[]\n}\n\nexport type CellValidationSource = {\n\t/** Allow invalid cell values */\n\tallowInvalid?: boolean,\n\n\t/** Validation pattern */\n\tpattern?: string|RegExp,\n\n\t/** Validation function */\n\tvalidate?: (cell: CellModel, value: unknown) => boolean,\n}\n\nexport type CellValidation = Omit<CellValidationSource, 'pattern'> & {\n\t/** Validation pattern */\n\tpattern?: RegExp,\n}\n\nexport type ShiftOptions = {\n\t/** Index of the first shifted row/column */\n\tindex: number;\n\t/** Number of rows/columns to shift */\n\toffset: number;\n\t/** Shift direction up/down for rows, left/right for columns */\n\tdirection: Direction;\n\t/** Name of the sheet where the shift occured */\n\tsheet?: string;\n\t/** Force shift on all references */\n\tallSheets?: boolean;\n\t/** Maximum affected index */\n\tmaxIndex?: number;\n\t/** Shift anchored coords */\n\tignoreAnchors?: boolean;\n}\n\nexport type FormulaFuncParamDescription = {\n\tname: string,\n\ttype: string,\n\tdescription: string,\n\toptional: boolean,\n\tdefault?: string\n}\n\nexport type FormulaFuncDescription = {\n\tname: string,\n\tparams: FormulaFuncParamDescription[],\n\treturns: string,\n\tdescription: string,\n\tlinks: string[]\n}\n\nexport type FormulaFuncGroupDescription = {\n\tname: string,\n\tfunctions: FormulaFuncDescription[]\n}\n\nexport type TabOptions = {\n\tcolor?: string,\n\thidden?: boolean,\n}\n\nexport type ObjectModel = {\n\tlocation: Location;\n\tsize: Size;\n\tzIndex?: number;\n}\n\nexport type SpillOptions = {\n\tcell: CellModel; \n\tvalues: Matrix;\n\tpropertyCell?: CellModel;\n\tdisplayValues?: Matrix<string>;\n}\n\nexport type SpillResult = {\n\tcells: CellModel[];\n\toldValues: CellValueType[];\n\trange: CellRange;\n}\n\nexport type AutofitOptions = {\n\t// visibleOnly?: boolean;\n\t/** column autofit measures the header labels too (default true) */\n\tincludeHeaders?: boolean;\n}\n\nexport type CellSerializationOptions = {\n\tdisplayValue?: boolean;\n}\n\nexport type EditorFactory<T extends HTMLElement = HTMLElement> = (cell: CellModel, options?: EditingOptions) => T;\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import { ColorTypes, Direction, Size, Location, UIValueType, Matrix, KeyValue, MenuItem } from \"@omegagrid/core\";\nimport { CSSStyle, CellModel, GridSource, Style, CommentItem, TableTheme, EditingOptions } from \"./model\";\nimport { CellRange } from \"./common\";\n\nexport type Renderer = (div: HTMLDivElement, cell: CellModel) => HTMLDivElement;\nexport type CommentRenderer = (div: HTMLDivElement, comment: CommentItem, cell: CellModel) => HTMLDivElement;\n\nexport type Comparer = (a: CellModel, b: CellModel) => number;\n\nexport type FormulaFunction = (...args: unknown[]) => unknown;\n\nexport type BaseGroupModelSource = {\n\tmodels: GridSource[],\n\tthemes?: TableTheme[]\n\t//layout: TabSplitContainerModel\n}\n\nexport type EditType = 'value'|'style'|'insert_row'|'insert_column'|'delete_row'|'delete_column'|'move_row'|'move_column'|'autofill';\nexport type CellValueType = unknown; //number|string|boolean|object|null;\nexport type FilterValue = string|number|boolean|KeyValue[];\n\n/** Comparison operators usable in a numeric text filter expression (e.g. `> 100`). */\nexport type NumericFilterOperator = '=' | '!=' | '<' | '<=' | '>' | '>=';\nexport type NumericFilterClause = { op: NumericFilterOperator, value: number };\n/**\n * Parsed numeric expression as a disjunction of conjunctions: the outer array holds\n * OR groups, each inner array holds clauses combined with AND. A value matches if it\n * satisfies every clause of at least one group.\n */\nexport type NumericFilterGroups = NumericFilterClause[][];\n\n/** The date column types: a date, a date and time, a time of day */\nexport type DateFilterType = 'd' | 'dt' | 'tm';\n/**\n * A bound of a date filter expression: the value is at or after a time (`>=`) or before it (`<`). A time of day\n * (type tm) lies on the day of the serial date 0, the end of a day is the start of the next one.\n */\nexport type DateFilterBound = { op: '>=' | '<', value: Date };\n/**\n * Parsed date expression (see `parseDateExpression`) as a disjunction of conjunctions: the outer array holds OR\n * groups, each inner array holds bounds combined with AND. A value matches if it satisfies every bound of at\n * least one group; no group matches nothing.\n */\nexport type DateFilterGroups = DateFilterBound[][];\n\n/**\n * Actions = 'a',\n * Html = 'h'\n */\nexport type AditionalUIValueType = 'a'|'h';\n\nexport type CellType = UIValueType | AditionalUIValueType;\n\nexport type StyleSource = number|string|Style|CSSStyle;\n\nexport type CellAction = {\n\taction: string,\n\ticon?: string,\n\ttext?: string,\n\ttitle?: string,\n\tcolor?: ColorTypes,\n\ttype?: 'button'|'menu',\n\titems?: MenuItem[]\n}\n\nexport type CellValidationSource = {\n\t/** Allow invalid cell values */\n\tallowInvalid?: boolean,\n\n\t/** Validation pattern */\n\tpattern?: string|RegExp,\n\n\t/** Validation function */\n\tvalidate?: (cell: CellModel, value: unknown) => boolean,\n}\n\nexport type CellValidation = Omit<CellValidationSource, 'pattern'> & {\n\t/** Validation pattern */\n\tpattern?: RegExp,\n}\n\nexport type ShiftOptions = {\n\t/** Index of the first shifted row/column */\n\tindex: number;\n\t/** Number of rows/columns to shift */\n\toffset: number;\n\t/** Shift direction up/down for rows, left/right for columns */\n\tdirection: Direction;\n\t/** Name of the sheet where the shift occured */\n\tsheet?: string;\n\t/** Force shift on all references */\n\tallSheets?: boolean;\n\t/** Maximum affected index */\n\tmaxIndex?: number;\n\t/** Shift anchored coords */\n\tignoreAnchors?: boolean;\n}\n\nexport type FormulaFuncParamDescription = {\n\tname: string,\n\ttype: string,\n\tdescription: string,\n\toptional: boolean,\n\tdefault?: string\n}\n\nexport type FormulaFuncDescription = {\n\tname: string,\n\tparams: FormulaFuncParamDescription[],\n\treturns: string,\n\tdescription: string,\n\tlinks: string[]\n}\n\nexport type FormulaFuncGroupDescription = {\n\tname: string,\n\tfunctions: FormulaFuncDescription[]\n}\n\nexport type TabOptions = {\n\tcolor?: string,\n\thidden?: boolean,\n}\n\nexport type ObjectModel = {\n\tlocation: Location;\n\tsize: Size;\n\tzIndex?: number;\n}\n\nexport type SpillOptions = {\n\tcell: CellModel; \n\tvalues: Matrix;\n\tpropertyCell?: CellModel;\n\tdisplayValues?: Matrix<string>;\n}\n\nexport type SpillResult = {\n\tcells: CellModel[];\n\toldValues: CellValueType[];\n\trange: CellRange;\n}\n\nexport type AutofitOptions = {\n\t// visibleOnly?: boolean;\n\t/** column autofit measures the header labels too (default true) */\n\tincludeHeaders?: boolean;\n}\n\nexport type CellSerializationOptions = {\n\tdisplayValue?: boolean;\n}\n\nexport type EditorFactory<T extends HTMLElement = HTMLElement> = (cell: CellModel, options?: EditingOptions) => T;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omegagrid/grid-core",
3
- "version": "0.11.33",
3
+ "version": "0.11.35",
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.11.33",
32
- "@omegagrid/localize": "^0.11.33",
31
+ "@omegagrid/core": "^0.11.35",
32
+ "@omegagrid/localize": "^0.11.35",
33
33
  "@stdlib/stats": "^0.0.13",
34
34
  "color": "^4.2.3",
35
35
  "date-fns": "^3.2.0",