@omegagrid/grid-core 0.11.32 → 0.11.34

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.
Files changed (48) hide show
  1. package/dist/calculations/context.d.ts.map +1 -1
  2. package/dist/calculations/context.js +6 -5
  3. package/dist/calculations/context.js.map +1 -1
  4. package/dist/calculations/functions/dates.d.ts.map +1 -1
  5. package/dist/calculations/functions/dates.js +4 -4
  6. package/dist/calculations/functions/dates.js.map +1 -1
  7. package/dist/calculations/functions/lookup.d.ts.map +1 -1
  8. package/dist/calculations/functions/lookup.js +2 -1
  9. package/dist/calculations/functions/lookup.js.map +1 -1
  10. package/dist/calculations/index.d.ts +1 -0
  11. package/dist/calculations/index.d.ts.map +1 -1
  12. package/dist/calculations/index.js +1 -0
  13. package/dist/calculations/index.js.map +1 -1
  14. package/dist/calculations/values.d.ts +6 -0
  15. package/dist/calculations/values.d.ts.map +1 -0
  16. package/dist/calculations/values.js +14 -0
  17. package/dist/calculations/values.js.map +1 -0
  18. package/dist/model/cellModel.d.ts +9 -0
  19. package/dist/model/cellModel.d.ts.map +1 -1
  20. package/dist/model/cellModel.js +81 -17
  21. package/dist/model/cellModel.js.map +1 -1
  22. package/dist/model/dateFilter.d.ts +28 -0
  23. package/dist/model/dateFilter.d.ts.map +1 -0
  24. package/dist/model/dateFilter.js +221 -0
  25. package/dist/model/dateFilter.js.map +1 -0
  26. package/dist/model/filterModel.d.ts +1 -4
  27. package/dist/model/filterModel.d.ts.map +1 -1
  28. package/dist/model/filterModel.js +8 -39
  29. package/dist/model/filterModel.js.map +1 -1
  30. package/dist/model/index.d.ts +1 -0
  31. package/dist/model/index.d.ts.map +1 -1
  32. package/dist/model/index.js +1 -0
  33. package/dist/model/index.js.map +1 -1
  34. package/dist/model/options.d.ts +15 -0
  35. package/dist/model/options.d.ts.map +1 -1
  36. package/dist/model/options.js +18 -0
  37. package/dist/model/options.js.map +1 -1
  38. package/dist/model/rowModel.d.ts.map +1 -1
  39. package/dist/model/rowModel.js +4 -3
  40. package/dist/model/rowModel.js.map +1 -1
  41. package/dist/model/validations.d.ts +3 -0
  42. package/dist/model/validations.d.ts.map +1 -1
  43. package/dist/model/validations.js +10 -5
  44. package/dist/model/validations.js.map +1 -1
  45. package/dist/types.d.ts +17 -11
  46. package/dist/types.d.ts.map +1 -1
  47. package/dist/types.js.map +1 -1
  48. package/package.json +3 -3
@@ -1 +1 @@
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;AAc7D,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;IACpF,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAA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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 { 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\nexport const createRangeMatcher = <TItem>(term: FilterRange, property: keyof TItem, type: 'd'|'dt'|'tm') => {\n\tconst toNum = (v: unknown): number | null => {\n\t\tif (v == null || v === '') return null;\n\t\tif (v instanceof Date) return v.getTime();\n\t\tconst t = new Date(v as string).getTime();\n\t\treturn Number.isNaN(t) ? null : t;\n\t};\n\n\tconst from = toNum(term.from);\n\tlet to = toNum(term.to);\n\t// move to the end of the day for date types\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\tconst v = toNum(item[property]);\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,OA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AAC,KAAe,EAAE,EAAE;wBAC5B,IAAI,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,WAAW,GAAG,CAAC;4BAAE,OAAO,KAAK,CAAC;wBACxE,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC;wBACnD,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;oBAC9B,CAAC,CAAC,CAAC;gBACJ,CAAC;YACF,CAAC;iBAAM,IAAI,CAAC,OAAO,EAAE,CAAC;gBACrB,GAAG,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) return createDateMatcher<CellModel>(groups, property, type);\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"]}
@@ -187,6 +187,14 @@ export type Options = {
187
187
  numberFormatter?: numbers.NumberFormatterFunction;
188
188
  /** custom date formatter function */
189
189
  dateFormatter?: dates.DateFormatterFunction;
190
+ /** format of the date and time cells (type dt), default the date format with ' HH:mm:ss' unless it has a time part */
191
+ dateTimeFormat?: string;
192
+ /** date and time formatter function, made of the format given by `getDateTimeFormat` */
193
+ dateTimeFormatter?: dates.DateFormatterFunction;
194
+ /** format of the time cells (type tm), default 'HH:mm:ss' */
195
+ timeFormat?: string;
196
+ /** time formatter function, made of the format given by `getTimeFormat` */
197
+ timeFormatter?: dates.DateFormatterFunction;
190
198
  /** enables default cell editing */
191
199
  editable?: boolean;
192
200
  /** enables formulas, enabled by default */
@@ -259,5 +267,12 @@ export type OptionSource = Omit<Options, 'rowTree' | 'columnTree' | 'filters' |
259
267
  filters?: boolean | FilterOptions;
260
268
  cellValidation?: CellValidationSource;
261
269
  };
270
+ /**
271
+ * Format of the date and time cells: the `dateTimeFormat`, or the date format with ' HH:mm:ss' unless it has a time part.
272
+ * The derived format is not stored in the options, so it follows the date format when that changes.
273
+ */
274
+ export declare function getDateTimeFormat(options: Pick<Options, 'dateTimeFormat' | 'dateFormat' | 'formatLocale'>): string;
275
+ /** Format of the time cells: the `timeFormat`, or 'HH:mm:ss' */
276
+ export declare function getTimeFormat(options: Pick<Options, 'timeFormat'>): string;
262
277
  export declare function initOptions(options?: Partial<OptionSource>, origOptions?: OptionSource): Options;
263
278
  //# sourceMappingURL=options.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/model/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAqB,aAAa,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACpG,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,oBAAoB,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvG,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGxE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,UAAU,EA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,YAAY,GAAC,cAAc,CAAC,UAIrG;AAED,gEAAgE;AAChE,wBAAgB,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC,UAEjE;AAED,wBAAgB,WAAW,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,EAAE,WAAW,GAAE,YAAmB,GAAG,OAAO,CAoCtG"}
@@ -2,6 +2,20 @@ import { numbers, initCommonOptions, dates } from "@omegagrid/core";
2
2
  import constants, { DEFAULT_FILTER_OPTIONS, DEFAULT_TREE_OPTIONS } from "../constants";
3
3
  import { utils } from "@omegagrid/core";
4
4
  import { normalizeCellValidation } from "./validations";
5
+ /**
6
+ * Format of the date and time cells: the `dateTimeFormat`, or the date format with ' HH:mm:ss' unless it has a time part.
7
+ * The derived format is not stored in the options, so it follows the date format when that changes.
8
+ */
9
+ export function getDateTimeFormat(options) {
10
+ if (options.dateTimeFormat)
11
+ return options.dateTimeFormat;
12
+ const format = options.dateFormat ?? dates.detectDefaultFormat(options.formatLocale);
13
+ return dates.splitDateTimeFormat(format).time ? format : `${format} HH:mm:ss`;
14
+ }
15
+ /** Format of the time cells: the `timeFormat`, or 'HH:mm:ss' */
16
+ export function getTimeFormat(options) {
17
+ return options.timeFormat || 'HH:mm:ss';
18
+ }
5
19
  export function initOptions(options, origOptions = null) {
6
20
  const opt = utils.mergeDeep({}, constants.DEFAULT_OPTIONS, origOptions, initCommonOptions(options, origOptions));
7
21
  if (opt.numberFormat) {
@@ -16,6 +30,10 @@ export function initOptions(options, origOptions = null) {
16
30
  else if (!opt.dateFormatter) {
17
31
  opt.dateFormatter = dates.getDateFormatter(opt.formatLocale);
18
32
  }
33
+ // made anew each time: the options are merged with the previous ones (a grid starts with the defaults),
34
+ // a kept formatter would outlive a changed date, date and time or time format
35
+ opt.dateTimeFormatter = dates.getDateFormatter(opt.formatLocale, getDateTimeFormat(opt));
36
+ opt.timeFormatter = dates.getDateFormatter(opt.formatLocale, getTimeFormat(opt));
19
37
  if (opt.columnSorting) {
20
38
  opt.sorting = opt.sorting || { enabled: true };
21
39
  }
@@ -1 +1 @@
1
- {"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/model/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAiB,KAAK,EAAmB,MAAM,iBAAiB,CAAC;AAGpG,OAAO,SAAS,EAAE,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACvF,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAMxC,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AA+VxD,MAAM,UAAU,WAAW,CAAC,OAA+B,EAAE,cAA4B,IAAI;IAC5F,MAAM,GAAG,GAAG,KAAK,CAAC,SAAS,CAAe,EAAE,EAAE,SAAS,CAAC,eAAe,EAAE,WAAW,EAAE,iBAAiB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC;IAE/H,IAAI,GAAG,CAAC,YAAY,EAAE,CAAC;QACtB,GAAG,CAAC,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC,GAAG,CAAC,YAAY,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC;IACtF,CAAC;SAAM,IAAI,CAAC,GAAG,CAAC,eAAe,EAAE,CAAC;QACjC,GAAG,CAAC,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IACpE,CAAC;IAED,IAAI,GAAG,CAAC,UAAU,EAAE,CAAC;QACpB,GAAG,CAAC,aAAa,GAAG,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,YAAY,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC;IAC9E,CAAC;SAAM,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;QAC/B,GAAG,CAAC,aAAa,GAAG,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAC9D,CAAC;IAED,IAAI,GAAG,CAAC,aAAa,EAAE,CAAC;QACvB,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,IAAI,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;IAC9C,CAAC;IAED,IAAI,OAAO,GAAG,CAAC,OAAO,KAAK,SAAS;QAAE,GAAG,CAAC,OAAO,GAAG,EAAC,OAAO,EAAE,GAAG,CAAC,OAAO,EAAC,CAAC;IAC3E,GAAG,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,sBAAsB,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IAErE,IAAI,OAAO,GAAG,CAAC,OAAO,KAAK,SAAS;QAAE,GAAG,CAAC,OAAO,GAAG,EAAC,OAAO,EAAE,GAAG,CAAC,OAAO,EAAC,CAAC;IAC3E,GAAG,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,oBAAoB,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IAEnE,IAAI,OAAO,GAAG,CAAC,UAAU,KAAK,SAAS;QAAE,GAAG,CAAC,UAAU,GAAG,EAAC,OAAO,EAAE,GAAG,CAAC,UAAU,EAAC,CAAC;IACpF,GAAG,CAAC,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,oBAAoB,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC;IAEzE,IAAI,GAAG,CAAC,cAAc;QAAE,GAAG,CAAC,cAAc,GAAG,uBAAuB,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAEzF,OAAO,GAAc,CAAC;AACvB,CAAC","sourcesContent":["import { numbers, initCommonOptions, CommonOptions, dates, MenuItem, paper } from \"@omegagrid/core\";\nimport { AutofitOptions, CellValidation, CellValidationSource, Renderer, StyleSource } from \"../types\";\nimport { CommentOptions, FilterSettings, SortSettings } from \"../model\";\nimport constants, { DEFAULT_FILTER_OPTIONS, DEFAULT_TREE_OPTIONS } from \"../constants\";\nimport { utils } from \"@omegagrid/core\";\nimport { ElementModel } from \"./elementModel\";\nimport { CellModel, CellSource } from \"./cellModel\";\nimport { RowModel } from \"./rowModel\";\nimport { ColumnModel } from \"./columnModel\";\nimport { CellAddress, RangeAddress } from \"../common\";\nimport { normalizeCellValidation } from \"./validations\";\n\nexport type ViewMode = 'grid' | 'singleObject';\n\nexport type EditingOptions = {\n\t/** enable inserting new rows */\n\trowInsertion?: boolean,\n\n\t/** enable deleting rows */\n\trowDeletion?: boolean,\n\n\t/** enable editing row outline levels */\n\trowOutline?: boolean,\n\n\t/** enable inserting new columns */\n\tcolInsertion?: boolean,\n\n\t/** enable deleting columns */\n\tcolDeletion?: boolean,\n\n\t/** enable editing column outline levels */\n\tcolOutline?: boolean,\n\n\t/** use calendar editor for date cells */\n\tdateCalendarEditor?: boolean,\n\n};\n\nexport type ScrollingOptions = {\n\t/** maximum proximity of cursor to scrollbar to be visible */\n\tscrollbarVisibilityTreshold?: number,\n\n\t/** enable vertical overscroll */\n\tverticalOverscroll?: boolean,\n\n\t/** enable horizontal overscroll */\n\thorizontalOverscroll?: boolean,\n};\n\nexport type GridMenuItem<T extends ElementModel> = MenuItem & {\n\thidden?: (model: T) => boolean,\n}\n\nexport type MenuOptionsItem<T extends ElementModel> = {\n\titems: GridMenuItem<T>[],\n\thidden?: (model: T) => boolean,\n\treplace?: boolean\n};\n\nexport type MenuOptions = {\n\tcell: MenuOptionsItem<CellModel>,\n\trow: MenuOptionsItem<RowModel>,\n\tcolumn: MenuOptionsItem<ColumnModel>,\n};\n\nexport type EventOptions = {\n\t/** grid click event options */\n\tclick: {\n\t\t/** maximum mouse move path length, after click event is allowed */\n\t\tmouseMoveTreshold: number\n\t}\n};\n\nexport type SortingOptions = {\n\t/** column sorting enabled */\n\tenabled?: boolean,\n\t\n\t/** maximum number of columns that can be sorted */\n\tmaxColumns?: number,\n\t\n\t/** initial sorting settings */\n\tdefaultSettings?: SortSettings[]\n};\n\nexport type FilterOptions = {\n\tenabled?: boolean;\n\t/** the parents of the matched rows will be included in the results */\n\tincludeParents?: boolean;\n\t/** the children of the matched rows will be included in the results */\n\tincludeChildren?: boolean;\n\t/** initial filter settings */\n\tdefaultSettings?: FilterSettings[]\n}\n\nexport type SelectingOptions = {\n\tenabled?: boolean;\n\tmultiSelect?: boolean;\n}\n\n\nexport type TreeOptions = {\n\tenabled?: boolean;\n\treversed?: boolean;\n}\n\nexport type PasteMode = 'insert'|'rewrite'|'rewrite_append';\n\nexport type ClipboardOptions = {\n\tpasteProps: (keyof CellSource)[]|'all';\n\n\t/**\n\t * paste mode for rows, \n\t * \tinsert = always insert new rows\n\t * \trewrite = rewrite when rows are availible\n\t * \trewrite_append = rewrite when rows are availible, otherwise insert new rows; default\n\t */\n\trowPasteMode?: PasteMode;\n\n\t/**\n\t * paste mode for columns, \n\t * \tinsert = always insert new columns\n\t * \trewrite = rewrite when columns are availible; default\n\t * \trewrite_append = rewrite when columns are availible, otherwise insert new columns\n\t */\n\tcolumnPasteMode?: PasteMode;\n\n\t/**\n\t * Skips hidden rows when pasting data.\n\t * Values are pasted into nearest visible row.\n\t */\n\tskipHiddenRows?: boolean;\n}\n\nexport type PrintOptions = {\n\t/** idexes of rows, after which page break will be inserted */\n\trowBreaks?: number[];\n\n\t/** range of rows to repeat at the top of each page, eg: \"1:20\" */\n\trowTitles?: RangeAddress;\n\n\t/** print scale, 50 = 50% */\n\tscale?: number;\n\n\t/** print page orientation */\n\torientation?: 'landscape'|'portrait';\n\n\t/** print quality */\n\tdpi?: number;\n\n\t/** print paper size */\n\tpaper?: paper.PaperType|paper.PaperSize;\n\n\t/** page margin settings */\n\tmargins?: {\n\t\ttop: number,\n\t\tbottom: number,\n\t\tleft: number,\n\t\tright: number,\n\t\theader: number,\n\t\tfooter: number\n\t}\n}\n\nexport type HeaderOptions = {\n\tstyle?: StyleSource;\n}\n\nexport type Options = {\n\tviewMode?: ViewMode,\n\n\t/** default number of rows */\n\trows?: number;\n\n\t/** default number of columns */\n\tcolumns?: number;\n\n\t/** readOnly cells */\n\treadOnly?: boolean;\n\n\t/** header options */\n\theaders?: HeaderOptions;\n\n\t/** render column with row numbers */\n\trowNumbers?: boolean;\n\n\t/** render column with row numbers */\n\trowResize?: boolean;\n\n\t/** default row priority */\n\trowPriority?: number;\n\n\t/** render column with row tree outline */\n\trowTree?: TreeOptions;\n\n\t/** render header row with column letters */\n\tcolLetters?: boolean;\n\n\t/** render row with column tree outline */\n\tcolumnTree?: TreeOptions;\n\n\t/** default column priority */\n\tcolumnPriority?: number;\n\n\t/** render column with row numbers */\n\tcolumnResize?: boolean;\n\n\t/** render tree buttons in column header labels */\n\tcolumnHeaderTreeButtons?: boolean;\n\n\t/** number of freezed rows on the top */\n\tfreezeTop?: number;\n\t\n\t/** number of freezed columns on the left */\n\tfreezeLeft?: number;\n\n\t/** number of freezed columns on the right, not implemented yet */\n\tfreezeRight?: number;\n\n\t/** number of freezed rows on the bottom, not implemented yet */\n\tfreezeBottom?: number;\n\n\t/** default font size */\n\tfontSize?: number;\n\n\t/** default row height */\n\trowHeight?: number;\n\n\t/** remove row hidden property after its parent is expanded */\n\tunhideRowAfterExpand?: boolean;\n\n\t/** default column width */\n\tcolumnWidth?: number;\n\n\t/** remove column hidden property after its parent is expanded */\n\tunhideColumnAfterExpand?: boolean;\n\n\t/** style source are native css styles */\n\tcssStyles?: boolean;\n\n\t/** cell border visibility */\n\tgrid?: boolean,\n\t\n\t/** column filter options */\n\tfilters?: FilterOptions,\n\n\t/** default number format */\n\tnumberFormat?: string,\n\t\n\t/** tries to repair invalid number/date formats */\n\tfixNumberFormat?: boolean,\n\n\t/** shows click indicator even in cells without value */\n\temptyClickable?: boolean,\n\n\t/** custom number formatter function */\n\tnumberFormatter?: numbers.NumberFormatterFunction,\n\n\t/** custom date formatter function */\n\tdateFormatter?: dates.DateFormatterFunction,\n\t\n\t/** enables default cell editing */\n\teditable?: boolean,\n\n\t/** enables formulas, enabled by default */\n\tformulas?: boolean,\n\n\t/** maximum nesting depth of the formula evaluation, deeper reference chains end with an error */\n\tmaxCalculationDepth?: number,\n\n\t/** enables default cell commenting */\n\tcommentable?: boolean,\n\n\t/** enables autofill function */\n\tautofill?: boolean,\n\n\t/** number of rows on one page for dynamic row fetching */\n\tpageSize?: number,\n\n\t/** enables command window */\n\tcommandWindow?: boolean,\n\n\t/** enables undo/redo */\n\tundoRedo?: boolean,\n\n\t/** location of cell with level buttons */\n\tlevelButtonCell?: {c: number, r: number},\n\n\t/** shows placeholder if grid is empty */\n\temptyPlaceholder?: boolean,\n\n\t/** custom cell renderer applied after default renderers */\n\tafterRenderer?: Renderer,\n\n\t/** factor of cell indentation */\n\tcellIndentFactor?: number,\n\n\t/** factor of level indentation */\n\tlevelIndentFactor?: number,\n\n\t/** menu options */\n\tmenus?: MenuOptions,\n\n\t/** editing options */\n\tediting?: EditingOptions,\n\n\t/** selecting options */\n\tselecting?: SelectingOptions,\n\n\t/** comment options */\n\tcomments?: CommentOptions,\n\t\n\t/** scrolling options */\n\tscrolling?: ScrollingOptions,\n\n\t/** event options */\n\tevents?: EventOptions,\n\t\n\t/** max number of sorted columns, deprecated */\n\tmaxSortingColumns?: number;\n\n\t/** enabled column sorting, deprecated */\n\tcolumnSorting?: boolean,\n\n\t/** column sorting options */\n\tsorting?: SortingOptions,\n\n\t/** clipboard options */\n\tclipboard?: ClipboardOptions,\n\n\t/** default cell validation rules */\n\tcellValidation?: CellValidation,\n\n\t/** first cell in viewport */\n\tfirstCell?: CellAddress,\n\n\t/** cell element caching */\n\tcellCache?: boolean,\n\n\t/** use single cell model instance for all grid cells */\n\tsingleCellModel?: boolean,\n\n\t/** options for raw html export/print */\n\tprint?: PrintOptions,\n\n\t/** grid zoom factor */\n\tzoom?: number,\n\n\t/** autofit options */\n\tautofit?: AutofitOptions,\n\n\t/** hides the outer border of the grid (right and top) */\n\thideOuterBorder?: boolean,\n} & CommonOptions;\n\nexport type OptionSource = Omit<Options, 'rowTree'|'columnTree'|'filters'|'cellValidation'> & {\n\trowTree?: boolean|TreeOptions;\n\tcolumnTree?: boolean|TreeOptions;\n\tfilters?: boolean|FilterOptions;\n\tcellValidation?: CellValidationSource;\n}\n\nexport function initOptions(options?: Partial<OptionSource>, origOptions: OptionSource = null): Options {\n\tconst opt = utils.mergeDeep<OptionSource>({}, constants.DEFAULT_OPTIONS, origOptions, initCommonOptions(options, origOptions));\n\t\n\tif (opt.numberFormat) {\n\t\topt.numberFormatter = numbers.getNumberFormatter(opt.formatLocale, opt.numberFormat);\n\t} else if (!opt.numberFormatter) {\n\t\topt.numberFormatter = numbers.getNumberFormatter(opt.formatLocale);\n\t}\n\n\tif (opt.dateFormat) {\n\t\topt.dateFormatter = dates.getDateFormatter(opt.formatLocale, opt.dateFormat);\n\t} else if (!opt.dateFormatter) {\n\t\topt.dateFormatter = dates.getDateFormatter(opt.formatLocale);\n\t}\n\n\tif (opt.columnSorting) {\n\t\topt.sorting = opt.sorting || {enabled: true};\n\t}\n\t\n\tif (typeof opt.filters === 'boolean') opt.filters = {enabled: opt.filters};\n\topt.filters = Object.assign({}, DEFAULT_FILTER_OPTIONS, opt.filters);\n\n\tif (typeof opt.rowTree === 'boolean') opt.rowTree = {enabled: opt.rowTree};\n\topt.rowTree = Object.assign({}, DEFAULT_TREE_OPTIONS, opt.rowTree);\n\n\tif (typeof opt.columnTree === 'boolean') opt.columnTree = {enabled: opt.columnTree};\n\topt.columnTree = Object.assign({}, DEFAULT_TREE_OPTIONS, opt.columnTree);\n\n\tif (opt.cellValidation) opt.cellValidation = normalizeCellValidation(opt.cellValidation);\n\n\treturn opt as Options;\n}"]}
1
+ {"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/model/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAiB,KAAK,EAAmB,MAAM,iBAAiB,CAAC;AAGpG,OAAO,SAAS,EAAE,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACvF,OAAO,EAAE,KAAK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E,EAAE,oBAAoB,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC;IAEzE,IAAI,GAAG,CAAC,cAAc;QAAE,GAAG,CAAC,cAAc,GAAG,uBAAuB,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAEzF,OAAO,GAAc,CAAC;AACvB,CAAC","sourcesContent":["import { numbers, initCommonOptions, CommonOptions, dates, MenuItem, paper } from \"@omegagrid/core\";\nimport { AutofitOptions, CellValidation, CellValidationSource, Renderer, StyleSource } from \"../types\";\nimport { CommentOptions, FilterSettings, SortSettings } from \"../model\";\nimport constants, { DEFAULT_FILTER_OPTIONS, DEFAULT_TREE_OPTIONS } from \"../constants\";\nimport { utils } from \"@omegagrid/core\";\nimport { ElementModel } from \"./elementModel\";\nimport { CellModel, CellSource } from \"./cellModel\";\nimport { RowModel } from \"./rowModel\";\nimport { ColumnModel } from \"./columnModel\";\nimport { CellAddress, RangeAddress } from \"../common\";\nimport { normalizeCellValidation } from \"./validations\";\n\nexport type ViewMode = 'grid' | 'singleObject';\n\nexport type EditingOptions = {\n\t/** enable inserting new rows */\n\trowInsertion?: boolean,\n\n\t/** enable deleting rows */\n\trowDeletion?: boolean,\n\n\t/** enable editing row outline levels */\n\trowOutline?: boolean,\n\n\t/** enable inserting new columns */\n\tcolInsertion?: boolean,\n\n\t/** enable deleting columns */\n\tcolDeletion?: boolean,\n\n\t/** enable editing column outline levels */\n\tcolOutline?: boolean,\n\n\t/** use calendar editor for date cells */\n\tdateCalendarEditor?: boolean,\n\n};\n\nexport type ScrollingOptions = {\n\t/** maximum proximity of cursor to scrollbar to be visible */\n\tscrollbarVisibilityTreshold?: number,\n\n\t/** enable vertical overscroll */\n\tverticalOverscroll?: boolean,\n\n\t/** enable horizontal overscroll */\n\thorizontalOverscroll?: boolean,\n};\n\nexport type GridMenuItem<T extends ElementModel> = MenuItem & {\n\thidden?: (model: T) => boolean,\n}\n\nexport type MenuOptionsItem<T extends ElementModel> = {\n\titems: GridMenuItem<T>[],\n\thidden?: (model: T) => boolean,\n\treplace?: boolean\n};\n\nexport type MenuOptions = {\n\tcell: MenuOptionsItem<CellModel>,\n\trow: MenuOptionsItem<RowModel>,\n\tcolumn: MenuOptionsItem<ColumnModel>,\n};\n\nexport type EventOptions = {\n\t/** grid click event options */\n\tclick: {\n\t\t/** maximum mouse move path length, after click event is allowed */\n\t\tmouseMoveTreshold: number\n\t}\n};\n\nexport type SortingOptions = {\n\t/** column sorting enabled */\n\tenabled?: boolean,\n\t\n\t/** maximum number of columns that can be sorted */\n\tmaxColumns?: number,\n\t\n\t/** initial sorting settings */\n\tdefaultSettings?: SortSettings[]\n};\n\nexport type FilterOptions = {\n\tenabled?: boolean;\n\t/** the parents of the matched rows will be included in the results */\n\tincludeParents?: boolean;\n\t/** the children of the matched rows will be included in the results */\n\tincludeChildren?: boolean;\n\t/** initial filter settings */\n\tdefaultSettings?: FilterSettings[]\n}\n\nexport type SelectingOptions = {\n\tenabled?: boolean;\n\tmultiSelect?: boolean;\n}\n\n\nexport type TreeOptions = {\n\tenabled?: boolean;\n\treversed?: boolean;\n}\n\nexport type PasteMode = 'insert'|'rewrite'|'rewrite_append';\n\nexport type ClipboardOptions = {\n\tpasteProps: (keyof CellSource)[]|'all';\n\n\t/**\n\t * paste mode for rows, \n\t * \tinsert = always insert new rows\n\t * \trewrite = rewrite when rows are availible\n\t * \trewrite_append = rewrite when rows are availible, otherwise insert new rows; default\n\t */\n\trowPasteMode?: PasteMode;\n\n\t/**\n\t * paste mode for columns, \n\t * \tinsert = always insert new columns\n\t * \trewrite = rewrite when columns are availible; default\n\t * \trewrite_append = rewrite when columns are availible, otherwise insert new columns\n\t */\n\tcolumnPasteMode?: PasteMode;\n\n\t/**\n\t * Skips hidden rows when pasting data.\n\t * Values are pasted into nearest visible row.\n\t */\n\tskipHiddenRows?: boolean;\n}\n\nexport type PrintOptions = {\n\t/** idexes of rows, after which page break will be inserted */\n\trowBreaks?: number[];\n\n\t/** range of rows to repeat at the top of each page, eg: \"1:20\" */\n\trowTitles?: RangeAddress;\n\n\t/** print scale, 50 = 50% */\n\tscale?: number;\n\n\t/** print page orientation */\n\torientation?: 'landscape'|'portrait';\n\n\t/** print quality */\n\tdpi?: number;\n\n\t/** print paper size */\n\tpaper?: paper.PaperType|paper.PaperSize;\n\n\t/** page margin settings */\n\tmargins?: {\n\t\ttop: number,\n\t\tbottom: number,\n\t\tleft: number,\n\t\tright: number,\n\t\theader: number,\n\t\tfooter: number\n\t}\n}\n\nexport type HeaderOptions = {\n\tstyle?: StyleSource;\n}\n\nexport type Options = {\n\tviewMode?: ViewMode,\n\n\t/** default number of rows */\n\trows?: number;\n\n\t/** default number of columns */\n\tcolumns?: number;\n\n\t/** readOnly cells */\n\treadOnly?: boolean;\n\n\t/** header options */\n\theaders?: HeaderOptions;\n\n\t/** render column with row numbers */\n\trowNumbers?: boolean;\n\n\t/** render column with row numbers */\n\trowResize?: boolean;\n\n\t/** default row priority */\n\trowPriority?: number;\n\n\t/** render column with row tree outline */\n\trowTree?: TreeOptions;\n\n\t/** render header row with column letters */\n\tcolLetters?: boolean;\n\n\t/** render row with column tree outline */\n\tcolumnTree?: TreeOptions;\n\n\t/** default column priority */\n\tcolumnPriority?: number;\n\n\t/** render column with row numbers */\n\tcolumnResize?: boolean;\n\n\t/** render tree buttons in column header labels */\n\tcolumnHeaderTreeButtons?: boolean;\n\n\t/** number of freezed rows on the top */\n\tfreezeTop?: number;\n\t\n\t/** number of freezed columns on the left */\n\tfreezeLeft?: number;\n\n\t/** number of freezed columns on the right, not implemented yet */\n\tfreezeRight?: number;\n\n\t/** number of freezed rows on the bottom, not implemented yet */\n\tfreezeBottom?: number;\n\n\t/** default font size */\n\tfontSize?: number;\n\n\t/** default row height */\n\trowHeight?: number;\n\n\t/** remove row hidden property after its parent is expanded */\n\tunhideRowAfterExpand?: boolean;\n\n\t/** default column width */\n\tcolumnWidth?: number;\n\n\t/** remove column hidden property after its parent is expanded */\n\tunhideColumnAfterExpand?: boolean;\n\n\t/** style source are native css styles */\n\tcssStyles?: boolean;\n\n\t/** cell border visibility */\n\tgrid?: boolean,\n\t\n\t/** column filter options */\n\tfilters?: FilterOptions,\n\n\t/** default number format */\n\tnumberFormat?: string,\n\t\n\t/** tries to repair invalid number/date formats */\n\tfixNumberFormat?: boolean,\n\n\t/** shows click indicator even in cells without value */\n\temptyClickable?: boolean,\n\n\t/** custom number formatter function */\n\tnumberFormatter?: numbers.NumberFormatterFunction,\n\n\t/** custom date formatter function */\n\tdateFormatter?: dates.DateFormatterFunction,\n\n\t/** format of the date and time cells (type dt), default the date format with ' HH:mm:ss' unless it has a time part */\n\tdateTimeFormat?: string,\n\n\t/** date and time formatter function, made of the format given by `getDateTimeFormat` */\n\tdateTimeFormatter?: dates.DateFormatterFunction,\n\n\t/** format of the time cells (type tm), default 'HH:mm:ss' */\n\ttimeFormat?: string,\n\n\t/** time formatter function, made of the format given by `getTimeFormat` */\n\ttimeFormatter?: dates.DateFormatterFunction,\n\n\t/** enables default cell editing */\n\teditable?: boolean,\n\n\t/** enables formulas, enabled by default */\n\tformulas?: boolean,\n\n\t/** maximum nesting depth of the formula evaluation, deeper reference chains end with an error */\n\tmaxCalculationDepth?: number,\n\n\t/** enables default cell commenting */\n\tcommentable?: boolean,\n\n\t/** enables autofill function */\n\tautofill?: boolean,\n\n\t/** number of rows on one page for dynamic row fetching */\n\tpageSize?: number,\n\n\t/** enables command window */\n\tcommandWindow?: boolean,\n\n\t/** enables undo/redo */\n\tundoRedo?: boolean,\n\n\t/** location of cell with level buttons */\n\tlevelButtonCell?: {c: number, r: number},\n\n\t/** shows placeholder if grid is empty */\n\temptyPlaceholder?: boolean,\n\n\t/** custom cell renderer applied after default renderers */\n\tafterRenderer?: Renderer,\n\n\t/** factor of cell indentation */\n\tcellIndentFactor?: number,\n\n\t/** factor of level indentation */\n\tlevelIndentFactor?: number,\n\n\t/** menu options */\n\tmenus?: MenuOptions,\n\n\t/** editing options */\n\tediting?: EditingOptions,\n\n\t/** selecting options */\n\tselecting?: SelectingOptions,\n\n\t/** comment options */\n\tcomments?: CommentOptions,\n\t\n\t/** scrolling options */\n\tscrolling?: ScrollingOptions,\n\n\t/** event options */\n\tevents?: EventOptions,\n\t\n\t/** max number of sorted columns, deprecated */\n\tmaxSortingColumns?: number;\n\n\t/** enabled column sorting, deprecated */\n\tcolumnSorting?: boolean,\n\n\t/** column sorting options */\n\tsorting?: SortingOptions,\n\n\t/** clipboard options */\n\tclipboard?: ClipboardOptions,\n\n\t/** default cell validation rules */\n\tcellValidation?: CellValidation,\n\n\t/** first cell in viewport */\n\tfirstCell?: CellAddress,\n\n\t/** cell element caching */\n\tcellCache?: boolean,\n\n\t/** use single cell model instance for all grid cells */\n\tsingleCellModel?: boolean,\n\n\t/** options for raw html export/print */\n\tprint?: PrintOptions,\n\n\t/** grid zoom factor */\n\tzoom?: number,\n\n\t/** autofit options */\n\tautofit?: AutofitOptions,\n\n\t/** hides the outer border of the grid (right and top) */\n\thideOuterBorder?: boolean,\n} & CommonOptions;\n\nexport type OptionSource = Omit<Options, 'rowTree'|'columnTree'|'filters'|'cellValidation'> & {\n\trowTree?: boolean|TreeOptions;\n\tcolumnTree?: boolean|TreeOptions;\n\tfilters?: boolean|FilterOptions;\n\tcellValidation?: CellValidationSource;\n}\n\n/**\n * Format of the date and time cells: the `dateTimeFormat`, or the date format with ' HH:mm:ss' unless it has a time part.\n * The derived format is not stored in the options, so it follows the date format when that changes.\n */\nexport function getDateTimeFormat(options: Pick<Options, 'dateTimeFormat'|'dateFormat'|'formatLocale'>) {\n\tif (options.dateTimeFormat) return options.dateTimeFormat;\n\tconst format = options.dateFormat ?? dates.detectDefaultFormat(options.formatLocale);\n\treturn dates.splitDateTimeFormat(format).time ? format : `${format} HH:mm:ss`;\n}\n\n/** Format of the time cells: the `timeFormat`, or 'HH:mm:ss' */\nexport function getTimeFormat(options: Pick<Options, 'timeFormat'>) {\n\treturn options.timeFormat || 'HH:mm:ss';\n}\n\nexport function initOptions(options?: Partial<OptionSource>, origOptions: OptionSource = null): Options {\n\tconst opt = utils.mergeDeep<OptionSource>({}, constants.DEFAULT_OPTIONS, origOptions, initCommonOptions(options, origOptions));\n\t\n\tif (opt.numberFormat) {\n\t\topt.numberFormatter = numbers.getNumberFormatter(opt.formatLocale, opt.numberFormat);\n\t} else if (!opt.numberFormatter) {\n\t\topt.numberFormatter = numbers.getNumberFormatter(opt.formatLocale);\n\t}\n\n\tif (opt.dateFormat) {\n\t\topt.dateFormatter = dates.getDateFormatter(opt.formatLocale, opt.dateFormat);\n\t} else if (!opt.dateFormatter) {\n\t\topt.dateFormatter = dates.getDateFormatter(opt.formatLocale);\n\t}\n\n\t// made anew each time: the options are merged with the previous ones (a grid starts with the defaults),\n\t// a kept formatter would outlive a changed date, date and time or time format\n\topt.dateTimeFormatter = dates.getDateFormatter(opt.formatLocale, getDateTimeFormat(opt));\n\topt.timeFormatter = dates.getDateFormatter(opt.formatLocale, getTimeFormat(opt));\n\n\tif (opt.columnSorting) {\n\t\topt.sorting = opt.sorting || {enabled: true};\n\t}\n\t\n\tif (typeof opt.filters === 'boolean') opt.filters = {enabled: opt.filters};\n\topt.filters = Object.assign({}, DEFAULT_FILTER_OPTIONS, opt.filters);\n\n\tif (typeof opt.rowTree === 'boolean') opt.rowTree = {enabled: opt.rowTree};\n\topt.rowTree = Object.assign({}, DEFAULT_TREE_OPTIONS, opt.rowTree);\n\n\tif (typeof opt.columnTree === 'boolean') opt.columnTree = {enabled: opt.columnTree};\n\topt.columnTree = Object.assign({}, DEFAULT_TREE_OPTIONS, opt.columnTree);\n\n\tif (opt.cellValidation) opt.cellValidation = normalizeCellValidation(opt.cellValidation);\n\n\treturn opt as Options;\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"rowModel.d.ts","sourceRoot":"","sources":["../../src/model/rowModel.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAa,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,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EAAE,MAAM,CAAC,EAAE,SAAS;IAMhD,QAAQ,CAAC,MAAM,EAAE,SAAS;IAY1B,aAAa;IAOb,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO;IAKvB,QAAQ;IAKR,IAAI,IAAI,aAA6C;IACrD,IAAI,IAAI,aAA6C;IAErD,IAAI,WAAW,IAAK,QAAQ,CAI3B;IAED,IAAI,WAAW,IAAK,QAAQ,CAI3B;IAED;;;;OAIG;IACH,cAAc,CAAC,CAAC,EAAE,MAAM;IAKxB,WAAW,CAAC,CAAC,EAAE,MAAM;IAKrB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,UAAQ;IAqBjE,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,UAAQ;IAqBjE,qBAAqB;CAIrB"}
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
2
  import { CellRange, encodeRow } from "../common/range";
3
- import { CellModel } from "./cellModel";
4
- import { tree, utils } from "@omegagrid/core";
3
+ import { CellModel, isCellSource } from "./cellModel";
4
+ import { tree } from "@omegagrid/core";
5
5
  import { ElementModel } from "./elementModel";
6
6
  export class RowModel extends tree.TreeNodeMixin(ElementModel) {
7
7
  get cells() { return this._cells; }
@@ -35,7 +35,8 @@ export class RowModel extends tree.TreeNodeMixin(ElementModel) {
35
35
  const dataField = this.model.columns[c].data;
36
36
  if (dataField != null) {
37
37
  const d = this._data[dataField];
38
- if (utils.isObject(d)) {
38
+ // an object is a cell source, except a Date: the value of a date and time cell
39
+ if (isCellSource(d)) {
39
40
  if (d.comment) {
40
41
  this.model.comments.set(cell.address, [d.comment]);
41
42
  }
@@ -1 +1 @@
1
- {"version":3,"file":"rowModel.js","sourceRoot":"","sources":["../../src/model/rowModel.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAEvD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,iBAAiB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;IAED,qBAAqB;QACpB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC;IAClF,CAAC;CAED","sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport { CellRange, encodeRow } from \"../common/range\";\nimport { CellModel, CellSource } from \"./cellModel\";\nimport { GridModel } from \"./gridModel\";\nimport { tree, utils } from \"@omegagrid/core\";\nimport { ElementModel, ElementSource } from \"./elementModel\";\n\n// /** Source object type for row header item */\n// export type RowHeaderModel = {\n// \tlabel?: string;\n// \tcolspan?: number;\n// \trowspan?: number;\n// \twidth?: number;\n// };\n\n/** Source object type for grid row */\nexport type RowSource = {\n\th?: number|'auto', // height\n\tdata?: Record<string|number, any>,\n\t/** if row priority is higher then column priority, row properties has precedence over column properties */\n\tpriority?: number,\n} & tree.TreeNodeSource & ElementSource\n\nexport class RowModel extends tree.TreeNodeMixin(ElementModel) {\n\n\torigIndex: number;\n\t\n\tprivate _singleCell: CellModel;\n\n\tprivate _cells: CellModel[];\n\tget cells() { return this._cells }\n\t\n\tprivate _data: Record<string|number, any>;\n\tget data() { return this._data }\n\tset data(v : Record<string|number, any>) { this._data = v }\n\t\n\tprivate _height: number;\n\tget height() { return this._height ?? this.model.options.rowHeight }\n\tset height(value: number) { this._height = value }\n\t\n\tprivate _priority: number;\n\tget priority() { return this._priority }\n\tset priority(value: number) { this._priority = value }\n\n\tget address() { return encodeRow(this.index) }\n\tget range() { return new CellRange(null, this.index, null, this.index) }\n\n\tget hasFormula() { return !!this._formula }\n\tget formula() { return this._formula }\n\tset formula(v: string) {\n\t\tsuper.formula = v;\n\t\tthis.model.columns.forEach(col => this.cell(col.index).refreshFormula());\n\t}\n\n\tget values() { return this.model.columns.map(col => this.cell(col.index).value) }\n\n\tisCellInitialized = (c: number) => !!this.cells[c];\n\t\n\tcell(c: number, source?: CellSource) : CellModel {\n\t\tif (this.model.options.singleCellModel) {\n\t\t\tif (!this._singleCell) this._singleCell = new CellModel(this.model, {c: c, r: this.index});\n\t\t\tthis._singleCell.row = this;\n\t\t\tthis._singleCell.column = this.model.columns[c];\n\t\t\treturn this._singleCell;\n\t\t}\n\n\t\tlet cell = this._cells[c];\n\t\tif ((source || !cell) && this.model.columns[c]) {\n\t\t\tcell = new CellModel(this.model, source ?? {c: c, r: this.index});\n\t\t\tif (this._data) {\n\t\t\t\tconst dataField = this.model.columns[c].data;\n\t\t\t\tif (dataField != null) {\n\t\t\t\t\tconst d = this._data[dataField];\n\t\t\t\t\tif (utils.isObject(d)) {\n\t\t\t\t\t\tif ((d as CellSource).comment) {\n\t\t\t\t\t\t\tthis.model.comments.set(cell.address, [(d as CellSource).comment]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (d.cs > 1 || d.rs > 1) {\n\t\t\t\t\t\t\tthis.model.merges.add({r: this.index, c: c, cs: d.cs || 1, rs: d.rs || 1});\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tcell.populate(d);\n\t\t\t\t\t} else if (!cell.hasValue) {\n\t\t\t\t\t\t// keep display value from cell source - value assignment resets it\n\t\t\t\t\t\tconst dv = cell.displayValue;\n\t\t\t\t\t\tcell.value = d;\n\t\t\t\t\t\tif (dv != null) cell.displayValue = dv;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (cell.name) this.model.names.set(cell.name, cell.range);\n\t\t\tthis._cells[c] = cell;\n\t\t}\n\t\treturn cell;\n\t}\n\n\tconstructor(model: GridModel, source?: RowSource) {\n\t\tsuper(model, source);\n\t\tthis._cells = [];\n\t\tif (this._priority == null) this._priority = model.options.rowPriority;\n\t}\n\n\tpopulate(source: RowSource) {\n\t\tsuper.populate(source);\n\t\tthis._height = source.h == null || source.h == 'auto' ? this.model.options.rowHeight : source.h;\n\n\t\tif (source.data) {\n\t\t\tif (Array.isArray(source.data)) this._data = [...source.data];\n\t\t\telse this._data = {...source.data};\n\t\t}\n\n\t\tif (source.priority != null) this._priority = source.priority;\n\t}\n\n\tgetSourceData() {\n\t\tconst data = super.getSourceData() as RowSource;\n\t\t//if (this._data != null) data.data = this._data;\n\t\tif (this._height != null && this._height != this.model.options.rowHeight) data.h = this._height;\n\t\treturn data;\n\t}\n\n\texpand(unhide?: boolean) {\n\t\tsuper.expand(unhide);\n\t\tthis.model.indexVisibleRows();\n\t}\n\n\tcollapse() {\n\t\tsuper.collapse();\n\t\tthis.model.indexVisibleRows();\n\t}\n\n\tget prev() { return this.model.rows[this.index - 1] }\n\tget next() { return this.model.rows[this.index + 1] }\n\n\tget prevVisible() : RowModel {\n\t\tlet prev = this.prev;\n\t\twhile (prev && !prev.visible) prev = prev.prev;\n\t\treturn prev;\n\t}\n\n\tget nextVisible() : RowModel {\n\t\tlet next = this.next;\n\t\twhile (next && !next.visible) next = next.next;\n\t\treturn next;\n\t}\n\n\t/**\n\t * Checks if cell has formula, even for uninitialized cells\n\t * @param c number\n\t * @returns boolean\n\t */\n\thasCellFormula(c: number) {\n\t\treturn (this.cells[c] && this.cells[c].hasFormula)\n\t\t\t|| (this._data && this._data[this.model.columns[c].data] && this._data[this.model.columns[c].data].f);\n\t}\n\n\thasCellName(c: number) {\n\t\treturn (this.cells[c] && this.cells[c].name != null)\n\t\t\t|| (this._data && this._data[this.model.columns[c].data] && this._data[this.model.columns[c].data].name != null);\n\t}\n\n\tinsertColumns(index: number, count: number, shiftFormulas = false) {\n\t\tlet cell: CellModel;\n\t\tconst columns = this.model.columns.length;\n\t\tconst calculations = this.model.calculations;\n\n\t\tif (shiftFormulas) {\n\t\t\tfor (let c = 0; c < columns; c++) {\n\t\t\t\tif (this.hasCellFormula(c)) {\n\t\t\t\t\tcell = this.cell(c);\n\t\t\t\t\tcell.formula = calculations.getFormula(cell).shift({\n\t\t\t\t\t\tindex: index, \n\t\t\t\t\t\toffset: count, \n\t\t\t\t\t\tdirection: 'right'\n\t\t\t\t\t}).createFormulaString(false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (index < this.cells.length) this.cells.splice(index, 0, ...Array(count).fill(null));\n\t}\n\n\tdeleteColumns(index: number, count: number, shiftFormulas = false) {\n\t\tlet cell: CellModel;\n\t\tconst columns = this.model.columns.length;\n\t\tconst calculations = this.model.calculations;\n\n\t\tif (shiftFormulas) {\n\t\t\tfor (let c = 0; c < columns; c++) {\n\t\t\t\tif (this.hasCellFormula(c)) {\n\t\t\t\t\tcell = this.cell(c);\n\t\t\t\t\tcell.formula = calculations.getFormula(cell).shift({\n\t\t\t\t\t\tindex: index, \n\t\t\t\t\t\toffset: count,\n\t\t\t\t\t\tdirection: 'left'\n\t\t\t\t\t}).createFormulaString(false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn index < this.cells.length ? this.cells.splice(index, count) : null;\n\t}\n\n\tclearCalculatedValues() {\n\t\tthis.cells.forEach(cell => cell && this.model.calculations.refreshFormula(cell));\n\t}\n\n}"]}
1
+ {"version":3,"file":"rowModel.js","sourceRoot":"","sources":["../../src/model/rowModel.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAEvD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAc,YAAY,EAAE,MAAM,aAAa,CAAC;AAElE,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,YAAY,EAAiB,MAAM,gBAAgB,CAAC;AAkB7D,MAAM,OAAO,QAAS,SAAQ,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC;IAO7D,IAAI,KAAK,KAAK,OAAO,IAAI,CAAC,MAAM,CAAA,CAAC,CAAC;IAGlC,IAAI,IAAI,KAAK,OAAO,IAAI,CAAC,KAAK,CAAA,CAAC,CAAC;IAChC,IAAI,IAAI,CAAC,CAA8B,IAAI,IAAI,CAAC,KAAK,GAAG,CAAC,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AM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;QAC1C,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC;QAE7C,IAAI,aAAa,EAAE,CAAC;YACnB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC;gBAClC,IAAI,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC;oBAC5B,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;oBACpB,IAAI,CAAC,OAAO,GAAG,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC;wBAClD,KAAK,EAAE,KAAK;wBACZ,MAAM,EAAE,KAAK;wBACb,SAAS,EAAE,MAAM;qBACjB,CAAC,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;gBAC/B,CAAC;YACF,CAAC;QACF,CAAC;QAED,OAAO,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC3E,CAAC;IAED,qBAAqB;QACpB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC;IAClF,CAAC;CAED","sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport { CellRange, encodeRow } from \"../common/range\";\nimport { CellModel, CellSource, isCellSource } from \"./cellModel\";\nimport { GridModel } from \"./gridModel\";\nimport { tree } from \"@omegagrid/core\";\nimport { ElementModel, ElementSource } from \"./elementModel\";\n\n// /** Source object type for row header item */\n// export type RowHeaderModel = {\n// \tlabel?: string;\n// \tcolspan?: number;\n// \trowspan?: number;\n// \twidth?: number;\n// };\n\n/** Source object type for grid row */\nexport type RowSource = {\n\th?: number|'auto', // height\n\tdata?: Record<string|number, any>,\n\t/** if row priority is higher then column priority, row properties has precedence over column properties */\n\tpriority?: number,\n} & tree.TreeNodeSource & ElementSource\n\nexport class RowModel extends tree.TreeNodeMixin(ElementModel) {\n\n\torigIndex: number;\n\t\n\tprivate _singleCell: CellModel;\n\n\tprivate _cells: CellModel[];\n\tget cells() { return this._cells }\n\t\n\tprivate _data: Record<string|number, any>;\n\tget data() { return this._data }\n\tset data(v : Record<string|number, any>) { this._data = v }\n\t\n\tprivate _height: number;\n\tget height() { return this._height ?? this.model.options.rowHeight }\n\tset height(value: number) { this._height = value }\n\t\n\tprivate _priority: number;\n\tget priority() { return this._priority }\n\tset priority(value: number) { this._priority = value }\n\n\tget address() { return encodeRow(this.index) }\n\tget range() { return new CellRange(null, this.index, null, this.index) }\n\n\tget hasFormula() { return !!this._formula }\n\tget formula() { return this._formula }\n\tset formula(v: string) {\n\t\tsuper.formula = v;\n\t\tthis.model.columns.forEach(col => this.cell(col.index).refreshFormula());\n\t}\n\n\tget values() { return this.model.columns.map(col => this.cell(col.index).value) }\n\n\tisCellInitialized = (c: number) => !!this.cells[c];\n\t\n\tcell(c: number, source?: CellSource) : CellModel {\n\t\tif (this.model.options.singleCellModel) {\n\t\t\tif (!this._singleCell) this._singleCell = new CellModel(this.model, {c: c, r: this.index});\n\t\t\tthis._singleCell.row = this;\n\t\t\tthis._singleCell.column = this.model.columns[c];\n\t\t\treturn this._singleCell;\n\t\t}\n\n\t\tlet cell = this._cells[c];\n\t\tif ((source || !cell) && this.model.columns[c]) {\n\t\t\tcell = new CellModel(this.model, source ?? {c: c, r: this.index});\n\t\t\tif (this._data) {\n\t\t\t\tconst dataField = this.model.columns[c].data;\n\t\t\t\tif (dataField != null) {\n\t\t\t\t\tconst d = this._data[dataField];\n\t\t\t\t\t// an object is a cell source, except a Date: the value of a date and time cell\n\t\t\t\t\tif (isCellSource(d)) {\n\t\t\t\t\t\tif ((d as CellSource).comment) {\n\t\t\t\t\t\t\tthis.model.comments.set(cell.address, [(d as CellSource).comment]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (d.cs > 1 || d.rs > 1) {\n\t\t\t\t\t\t\tthis.model.merges.add({r: this.index, c: c, cs: d.cs || 1, rs: d.rs || 1});\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tcell.populate(d);\n\t\t\t\t\t} else if (!cell.hasValue) {\n\t\t\t\t\t\t// keep display value from cell source - value assignment resets it\n\t\t\t\t\t\tconst dv = cell.displayValue;\n\t\t\t\t\t\tcell.value = d;\n\t\t\t\t\t\tif (dv != null) cell.displayValue = dv;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (cell.name) this.model.names.set(cell.name, cell.range);\n\t\t\tthis._cells[c] = cell;\n\t\t}\n\t\treturn cell;\n\t}\n\n\tconstructor(model: GridModel, source?: RowSource) {\n\t\tsuper(model, source);\n\t\tthis._cells = [];\n\t\tif (this._priority == null) this._priority = model.options.rowPriority;\n\t}\n\n\tpopulate(source: RowSource) {\n\t\tsuper.populate(source);\n\t\tthis._height = source.h == null || source.h == 'auto' ? this.model.options.rowHeight : source.h;\n\n\t\tif (source.data) {\n\t\t\tif (Array.isArray(source.data)) this._data = [...source.data];\n\t\t\telse this._data = {...source.data};\n\t\t}\n\n\t\tif (source.priority != null) this._priority = source.priority;\n\t}\n\n\tgetSourceData() {\n\t\tconst data = super.getSourceData() as RowSource;\n\t\t//if (this._data != null) data.data = this._data;\n\t\tif (this._height != null && this._height != this.model.options.rowHeight) data.h = this._height;\n\t\treturn data;\n\t}\n\n\texpand(unhide?: boolean) {\n\t\tsuper.expand(unhide);\n\t\tthis.model.indexVisibleRows();\n\t}\n\n\tcollapse() {\n\t\tsuper.collapse();\n\t\tthis.model.indexVisibleRows();\n\t}\n\n\tget prev() { return this.model.rows[this.index - 1] }\n\tget next() { return this.model.rows[this.index + 1] }\n\n\tget prevVisible() : RowModel {\n\t\tlet prev = this.prev;\n\t\twhile (prev && !prev.visible) prev = prev.prev;\n\t\treturn prev;\n\t}\n\n\tget nextVisible() : RowModel {\n\t\tlet next = this.next;\n\t\twhile (next && !next.visible) next = next.next;\n\t\treturn next;\n\t}\n\n\t/**\n\t * Checks if cell has formula, even for uninitialized cells\n\t * @param c number\n\t * @returns boolean\n\t */\n\thasCellFormula(c: number) {\n\t\treturn (this.cells[c] && this.cells[c].hasFormula)\n\t\t\t|| (this._data && this._data[this.model.columns[c].data] && this._data[this.model.columns[c].data].f);\n\t}\n\n\thasCellName(c: number) {\n\t\treturn (this.cells[c] && this.cells[c].name != null)\n\t\t\t|| (this._data && this._data[this.model.columns[c].data] && this._data[this.model.columns[c].data].name != null);\n\t}\n\n\tinsertColumns(index: number, count: number, shiftFormulas = false) {\n\t\tlet cell: CellModel;\n\t\tconst columns = this.model.columns.length;\n\t\tconst calculations = this.model.calculations;\n\n\t\tif (shiftFormulas) {\n\t\t\tfor (let c = 0; c < columns; c++) {\n\t\t\t\tif (this.hasCellFormula(c)) {\n\t\t\t\t\tcell = this.cell(c);\n\t\t\t\t\tcell.formula = calculations.getFormula(cell).shift({\n\t\t\t\t\t\tindex: index, \n\t\t\t\t\t\toffset: count, \n\t\t\t\t\t\tdirection: 'right'\n\t\t\t\t\t}).createFormulaString(false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (index < this.cells.length) this.cells.splice(index, 0, ...Array(count).fill(null));\n\t}\n\n\tdeleteColumns(index: number, count: number, shiftFormulas = false) {\n\t\tlet cell: CellModel;\n\t\tconst columns = this.model.columns.length;\n\t\tconst calculations = this.model.calculations;\n\n\t\tif (shiftFormulas) {\n\t\t\tfor (let c = 0; c < columns; c++) {\n\t\t\t\tif (this.hasCellFormula(c)) {\n\t\t\t\t\tcell = this.cell(c);\n\t\t\t\t\tcell.formula = calculations.getFormula(cell).shift({\n\t\t\t\t\t\tindex: index, \n\t\t\t\t\t\toffset: count,\n\t\t\t\t\t\tdirection: 'left'\n\t\t\t\t\t}).createFormulaString(false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn index < this.cells.length ? this.cells.splice(index, count) : null;\n\t}\n\n\tclearCalculatedValues() {\n\t\tthis.cells.forEach(cell => cell && this.model.calculations.refreshFormula(cell));\n\t}\n\n}"]}
@@ -1,5 +1,8 @@
1
1
  import { CellValidation, CellValidationSource } from "../types";
2
2
  import { CellModel } from "./cellModel";
3
3
  export declare function normalizeCellValidation(cellValidation: CellValidationSource): CellValidation;
4
+ /** Whether the value passes the validation of the cell (its pattern and validate function), allowInvalid aside */
5
+ export declare function isValidValue(cell: CellModel, value: unknown): boolean;
6
+ /** Whether the cell takes the value: a valid one, any with allowInvalid */
4
7
  export declare function validateValue(cell: CellModel, newValue: unknown): boolean;
5
8
  //# sourceMappingURL=validations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"validations.d.ts","sourceRoot":"","sources":["../../src/model/validations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,wBAAgB,uBAAuB,CAAC,cAAc,EAAE,oBAAoB,GAAG,cAAc,CAK5F;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAczE"}
1
+ {"version":3,"file":"validations.d.ts","sourceRoot":"","sources":["../../src/model/validations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,wBAAgB,uBAAuB,CAAC,cAAc,EAAE,oBAAoB,GAAG,cAAc,CAK5F;AAED,kHAAkH;AAClH,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAarE;AAED,2EAA2E;AAC3E,wBAAgB,aAAa,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAGzE"}
@@ -4,21 +4,26 @@ export function normalizeCellValidation(cellValidation) {
4
4
  }
5
5
  return cellValidation;
6
6
  }
7
- export function validateValue(cell, newValue) {
7
+ /** Whether the value passes the validation of the cell (its pattern and validate function), allowInvalid aside */
8
+ export function isValidValue(cell, value) {
8
9
  const validation = cell.validation;
9
10
  if (!validation)
10
11
  return true;
11
- if (validation.allowInvalid)
12
- return true;
13
12
  let valid = true;
14
13
  if (validation.pattern) {
15
- if (!validation.pattern.test((newValue ?? '').toString()))
14
+ if (!validation.pattern.test((value ?? '').toString()))
16
15
  valid = false;
17
16
  }
18
17
  if (validation.validate) {
19
- if (!validation.validate(cell, newValue))
18
+ if (!validation.validate(cell, value))
20
19
  valid = false;
21
20
  }
22
21
  return valid;
23
22
  }
23
+ /** Whether the cell takes the value: a valid one, any with allowInvalid */
24
+ export function validateValue(cell, newValue) {
25
+ if (cell.validation?.allowInvalid)
26
+ return true;
27
+ return isValidValue(cell, newValue);
28
+ }
24
29
  //# sourceMappingURL=validations.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"validations.js","sourceRoot":"","sources":["../../src/model/validations.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,uBAAuB,CAAC,cAAoC;IAC3E,IAAI,cAAc,CAAC,OAAO,IAAI,OAAO,cAAc,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;QAC1E,cAAc,CAAC,OAAO,GAAG,IAAI,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;IAC7D,CAAC;IACD,OAAO,cAAgC,CAAC;AACzC,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,IAAe,EAAE,QAAiB;IAC/D,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;IACnC,IAAI,CAAC,UAAU;QAAE,OAAO,IAAI,CAAC;IAC7B,IAAI,UAAU,CAAC,YAAY;QAAE,OAAO,IAAI,CAAC;IAEzC,IAAI,KAAK,GAAG,IAAI,CAAC;IACjB,IAAI,UAAU,CAAC,OAAO,EAAE,CAAC;QACxB,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAE,QAAmB,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;YAAE,KAAK,GAAG,KAAK,CAAC;IACtF,CAAC;IAED,IAAI,UAAU,CAAC,QAAQ,EAAE,CAAC;QACzB,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;YAAE,KAAK,GAAG,KAAK,CAAC;IACzD,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC","sourcesContent":["import { CellValidation, CellValidationSource } from \"../types\";\nimport { CellModel } from \"./cellModel\";\n\nexport function normalizeCellValidation(cellValidation: CellValidationSource): CellValidation {\n\tif (cellValidation.pattern && typeof cellValidation.pattern === 'string') {\n\t\tcellValidation.pattern = new RegExp(cellValidation.pattern);\n\t}\n\treturn cellValidation as CellValidation;\n}\n\nexport function validateValue(cell: CellModel, newValue: unknown): boolean {\n\tconst validation = cell.validation;\n\tif (!validation) return true;\n\tif (validation.allowInvalid) return true;\n\n\tlet valid = true;\n\tif (validation.pattern) {\n\t\tif (!validation.pattern.test(((newValue as string) ?? '').toString())) valid = false;\n\t}\n\n\tif (validation.validate) {\n\t\tif (!validation.validate(cell, newValue)) valid = false;\n\t}\n\treturn valid;\n}\n"]}
1
+ {"version":3,"file":"validations.js","sourceRoot":"","sources":["../../src/model/validations.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,uBAAuB,CAAC,cAAoC;IAC3E,IAAI,cAAc,CAAC,OAAO,IAAI,OAAO,cAAc,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;QAC1E,cAAc,CAAC,OAAO,GAAG,IAAI,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;IAC7D,CAAC;IACD,OAAO,cAAgC,CAAC;AACzC,CAAC;AAED,kHAAkH;AAClH,MAAM,UAAU,YAAY,CAAC,IAAe,EAAE,KAAc;IAC3D,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;IACnC,IAAI,CAAC,UAAU;QAAE,OAAO,IAAI,CAAC;IAE7B,IAAI,KAAK,GAAG,IAAI,CAAC;IACjB,IAAI,UAAU,CAAC,OAAO,EAAE,CAAC;QACxB,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAE,KAAgB,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;YAAE,KAAK,GAAG,KAAK,CAAC;IACnF,CAAC;IAED,IAAI,UAAU,CAAC,QAAQ,EAAE,CAAC;QACzB,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;YAAE,KAAK,GAAG,KAAK,CAAC;IACtD,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC;AAED,2EAA2E;AAC3E,MAAM,UAAU,aAAa,CAAC,IAAe,EAAE,QAAiB;IAC/D,IAAI,IAAI,CAAC,UAAU,EAAE,YAAY;QAAE,OAAO,IAAI,CAAC;IAC/C,OAAO,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AACrC,CAAC","sourcesContent":["import { CellValidation, CellValidationSource } from \"../types\";\nimport { CellModel } from \"./cellModel\";\n\nexport function normalizeCellValidation(cellValidation: CellValidationSource): CellValidation {\n\tif (cellValidation.pattern && typeof cellValidation.pattern === 'string') {\n\t\tcellValidation.pattern = new RegExp(cellValidation.pattern);\n\t}\n\treturn cellValidation as CellValidation;\n}\n\n/** Whether the value passes the validation of the cell (its pattern and validate function), allowInvalid aside */\nexport function isValidValue(cell: CellModel, value: unknown): boolean {\n\tconst validation = cell.validation;\n\tif (!validation) return true;\n\n\tlet valid = true;\n\tif (validation.pattern) {\n\t\tif (!validation.pattern.test(((value as string) ?? '').toString())) valid = false;\n\t}\n\n\tif (validation.validate) {\n\t\tif (!validation.validate(cell, value)) valid = false;\n\t}\n\treturn valid;\n}\n\n/** Whether the cell takes the value: a valid one, any with allowInvalid */\nexport function validateValue(cell: CellModel, newValue: unknown): boolean {\n\tif (cell.validation?.allowInvalid) return true;\n\treturn isValidValue(cell, newValue);\n}\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,MAAM,MAAM,eAAe,GAAG,CAAC,GAAG,EAAE,cAAc,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,KAAK,cAAc,CAAC;AAE7G,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,KAAK,MAAM,CAAC;AAE9D,MAAM,MAAM,eAAe,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC;AAE9D,MAAM,MAAM,oBAAoB,GAAG;IAClC,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,MAAM,CAAC,EAAE,UAAU,EAAE,CAAA;CAErB,CAAA;AAED,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAC,OAAO,GAAC,YAAY,GAAC,eAAe,GAAC,YAAY,GAAC,eAAe,GAAC,UAAU,GAAC,aAAa,GAAC,UAAU,CAAC;AACrI,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC;AACpC;;;;GAIG;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AC;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"]}