@trebco/treb 37.0.0 → 37.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/package.json +119 -0
- package/build/treb-base-types/src/api_types.d.ts +11 -0
- package/build/treb-base-types/src/api_types.js +22 -0
- package/build/treb-base-types/src/api_types.js.map +1 -0
- package/build/treb-base-types/src/area-utils.d.ts +9 -0
- package/build/treb-base-types/src/area-utils.js +50 -0
- package/build/treb-base-types/src/area-utils.js.map +1 -0
- package/build/treb-base-types/src/area.d.ts +182 -0
- package/build/treb-base-types/src/area.js +715 -0
- package/build/treb-base-types/src/area.js.map +1 -0
- package/build/treb-base-types/src/basic_types.d.ts +20 -0
- package/build/treb-base-types/src/basic_types.js +22 -0
- package/build/treb-base-types/src/basic_types.js.map +1 -0
- package/build/treb-base-types/src/cell.d.ts +167 -0
- package/build/treb-base-types/src/cell.js +432 -0
- package/build/treb-base-types/src/cell.js.map +1 -0
- package/build/treb-base-types/src/cells.d.ts +251 -0
- package/build/treb-base-types/src/cells.js +1136 -0
- package/build/treb-base-types/src/cells.js.map +1 -0
- package/build/treb-base-types/src/color.d.ts +35 -0
- package/build/treb-base-types/src/color.js +162 -0
- package/build/treb-base-types/src/color.js.map +1 -0
- package/build/treb-base-types/src/dom-utilities.d.ts +70 -0
- package/build/treb-base-types/src/dom-utilities.js +144 -0
- package/build/treb-base-types/src/dom-utilities.js.map +1 -0
- package/build/treb-base-types/src/evaluate-options.d.ts +35 -0
- package/build/treb-base-types/src/evaluate-options.js +22 -0
- package/build/treb-base-types/src/evaluate-options.js.map +1 -0
- package/build/treb-base-types/src/font-stack.d.ts +37 -0
- package/build/treb-base-types/src/font-stack.js +93 -0
- package/build/treb-base-types/src/font-stack.js.map +1 -0
- package/build/treb-base-types/src/gradient.d.ts +18 -0
- package/build/treb-base-types/src/gradient.js +86 -0
- package/build/treb-base-types/src/gradient.js.map +1 -0
- package/build/treb-base-types/src/import.d.ts +48 -0
- package/build/treb-base-types/src/import.js +22 -0
- package/build/treb-base-types/src/import.js.map +1 -0
- package/build/treb-base-types/src/index-standalone.d.ts +6 -0
- package/build/treb-base-types/src/index-standalone.js +27 -0
- package/build/treb-base-types/src/index-standalone.js.map +1 -0
- package/build/treb-base-types/src/index.d.ts +22 -0
- package/build/treb-base-types/src/index.js +45 -0
- package/build/treb-base-types/src/index.js.map +1 -0
- package/build/treb-base-types/src/layout.d.ts +22 -0
- package/build/treb-base-types/src/layout.js +22 -0
- package/build/treb-base-types/src/layout.js.map +1 -0
- package/build/treb-base-types/src/localization.d.ts +37 -0
- package/build/treb-base-types/src/localization.js +157 -0
- package/build/treb-base-types/src/localization.js.map +1 -0
- package/build/treb-base-types/src/rectangle.d.ts +51 -0
- package/build/treb-base-types/src/rectangle.js +123 -0
- package/build/treb-base-types/src/rectangle.js.map +1 -0
- package/build/treb-base-types/src/render_text.d.ts +34 -0
- package/build/treb-base-types/src/render_text.js +22 -0
- package/build/treb-base-types/src/render_text.js.map +1 -0
- package/build/treb-base-types/src/style.d.ts +214 -0
- package/build/treb-base-types/src/style.js +373 -0
- package/build/treb-base-types/src/style.js.map +1 -0
- package/build/treb-base-types/src/table.d.ts +58 -0
- package/build/treb-base-types/src/table.js +27 -0
- package/build/treb-base-types/src/table.js.map +1 -0
- package/build/treb-base-types/src/text_part.d.ts +26 -0
- package/build/treb-base-types/src/text_part.js +47 -0
- package/build/treb-base-types/src/text_part.js.map +1 -0
- package/build/treb-base-types/src/theme.d.ts +120 -0
- package/build/treb-base-types/src/theme.js +460 -0
- package/build/treb-base-types/src/theme.js.map +1 -0
- package/build/treb-base-types/src/union.d.ts +73 -0
- package/build/treb-base-types/src/union.js +61 -0
- package/build/treb-base-types/src/union.js.map +1 -0
- package/build/treb-base-types/src/value-type.d.ts +86 -0
- package/build/treb-base-types/src/value-type.js +168 -0
- package/build/treb-base-types/src/value-type.js.map +1 -0
- package/build/treb-base-types/src/worker-proxy.d.ts +95 -0
- package/build/treb-base-types/src/worker-proxy.js +221 -0
- package/build/treb-base-types/src/worker-proxy.js.map +1 -0
- package/build/treb-calculator/src/calculator.d.ts +249 -0
- package/build/treb-calculator/src/calculator.js +2755 -0
- package/build/treb-calculator/src/calculator.js.map +1 -0
- package/build/treb-calculator/src/complex-math.d.ts +75 -0
- package/build/treb-calculator/src/complex-math.js +559 -0
- package/build/treb-calculator/src/complex-math.js.map +1 -0
- package/build/treb-calculator/src/dag/array-vertex.d.ts +71 -0
- package/build/treb-calculator/src/dag/array-vertex.js +156 -0
- package/build/treb-calculator/src/dag/array-vertex.js.map +1 -0
- package/build/treb-calculator/src/dag/calculation_leaf_vertex.d.ts +48 -0
- package/build/treb-calculator/src/dag/calculation_leaf_vertex.js +84 -0
- package/build/treb-calculator/src/dag/calculation_leaf_vertex.js.map +1 -0
- package/build/treb-calculator/src/dag/graph.d.ts +134 -0
- package/build/treb-calculator/src/dag/graph.js +842 -0
- package/build/treb-calculator/src/dag/graph.js.map +1 -0
- package/build/treb-calculator/src/dag/spreadsheet_vertex.d.ts +58 -0
- package/build/treb-calculator/src/dag/spreadsheet_vertex.js +232 -0
- package/build/treb-calculator/src/dag/spreadsheet_vertex.js.map +1 -0
- package/build/treb-calculator/src/dag/spreadsheet_vertex_base.d.ts +20 -0
- package/build/treb-calculator/src/dag/spreadsheet_vertex_base.js +25 -0
- package/build/treb-calculator/src/dag/spreadsheet_vertex_base.js.map +1 -0
- package/build/treb-calculator/src/dag/state_leaf_vertex.d.ts +43 -0
- package/build/treb-calculator/src/dag/state_leaf_vertex.js +81 -0
- package/build/treb-calculator/src/dag/state_leaf_vertex.js.map +1 -0
- package/build/treb-calculator/src/dag/vertex.d.ts +71 -0
- package/build/treb-calculator/src/dag/vertex.js +274 -0
- package/build/treb-calculator/src/dag/vertex.js.map +1 -0
- package/build/treb-calculator/src/descriptors.d.ts +189 -0
- package/build/treb-calculator/src/descriptors.js +22 -0
- package/build/treb-calculator/src/descriptors.js.map +1 -0
- package/build/treb-calculator/src/expression-calculator.d.ts +127 -0
- package/build/treb-calculator/src/expression-calculator.js +1033 -0
- package/build/treb-calculator/src/expression-calculator.js.map +1 -0
- package/build/treb-calculator/src/function-error.d.ts +35 -0
- package/build/treb-calculator/src/function-error.js +85 -0
- package/build/treb-calculator/src/function-error.js.map +1 -0
- package/build/treb-calculator/src/function-library.d.ts +22 -0
- package/build/treb-calculator/src/function-library.js +96 -0
- package/build/treb-calculator/src/function-library.js.map +1 -0
- package/build/treb-calculator/src/functions/base-functions.d.ts +7 -0
- package/build/treb-calculator/src/functions/base-functions.js +2611 -0
- package/build/treb-calculator/src/functions/base-functions.js.map +1 -0
- package/build/treb-calculator/src/functions/beta.d.ts +17 -0
- package/build/treb-calculator/src/functions/beta.js +201 -0
- package/build/treb-calculator/src/functions/beta.js.map +1 -0
- package/build/treb-calculator/src/functions/checkbox.d.ts +3 -0
- package/build/treb-calculator/src/functions/checkbox.js +128 -0
- package/build/treb-calculator/src/functions/checkbox.js.map +1 -0
- package/build/treb-calculator/src/functions/complex-functions.d.ts +2 -0
- package/build/treb-calculator/src/functions/complex-functions.js +217 -0
- package/build/treb-calculator/src/functions/complex-functions.js.map +1 -0
- package/build/treb-calculator/src/functions/date-utils.d.ts +3 -0
- package/build/treb-calculator/src/functions/date-utils.js +59 -0
- package/build/treb-calculator/src/functions/date-utils.js.map +1 -0
- package/build/treb-calculator/src/functions/finance-functions.d.ts +2 -0
- package/build/treb-calculator/src/functions/finance-functions.js +547 -0
- package/build/treb-calculator/src/functions/finance-functions.js.map +1 -0
- package/build/treb-calculator/src/functions/fp.d.ts +2 -0
- package/build/treb-calculator/src/functions/fp.js +463 -0
- package/build/treb-calculator/src/functions/fp.js.map +1 -0
- package/build/treb-calculator/src/functions/function-utilities.d.ts +2 -0
- package/build/treb-calculator/src/functions/function-utilities.js +36 -0
- package/build/treb-calculator/src/functions/function-utilities.js.map +1 -0
- package/build/treb-calculator/src/functions/gamma.d.ts +20 -0
- package/build/treb-calculator/src/functions/gamma.js +142 -0
- package/build/treb-calculator/src/functions/gamma.js.map +1 -0
- package/build/treb-calculator/src/functions/information-functions.d.ts +2 -0
- package/build/treb-calculator/src/functions/information-functions.js +71 -0
- package/build/treb-calculator/src/functions/information-functions.js.map +1 -0
- package/build/treb-calculator/src/functions/lambda-functions.d.ts +2 -0
- package/build/treb-calculator/src/functions/lambda-functions.js +85 -0
- package/build/treb-calculator/src/functions/lambda-functions.js.map +1 -0
- package/build/treb-calculator/src/functions/matrix-functions.d.ts +2 -0
- package/build/treb-calculator/src/functions/matrix-functions.js +144 -0
- package/build/treb-calculator/src/functions/matrix-functions.js.map +1 -0
- package/build/treb-calculator/src/functions/normal.d.ts +2 -0
- package/build/treb-calculator/src/functions/normal.js +32 -0
- package/build/treb-calculator/src/functions/normal.js.map +1 -0
- package/build/treb-calculator/src/functions/regex-functions.d.ts +2 -0
- package/build/treb-calculator/src/functions/regex-functions.js +188 -0
- package/build/treb-calculator/src/functions/regex-functions.js.map +1 -0
- package/build/treb-calculator/src/functions/sparkline.d.ts +37 -0
- package/build/treb-calculator/src/functions/sparkline.js +264 -0
- package/build/treb-calculator/src/functions/sparkline.js.map +1 -0
- package/build/treb-calculator/src/functions/statistics-functions.d.ts +6 -0
- package/build/treb-calculator/src/functions/statistics-functions.js +989 -0
- package/build/treb-calculator/src/functions/statistics-functions.js.map +1 -0
- package/build/treb-calculator/src/functions/students-t.d.ts +3 -0
- package/build/treb-calculator/src/functions/students-t.js +64 -0
- package/build/treb-calculator/src/functions/students-t.js.map +1 -0
- package/build/treb-calculator/src/functions/text-functions.d.ts +3 -0
- package/build/treb-calculator/src/functions/text-functions.js +320 -0
- package/build/treb-calculator/src/functions/text-functions.js.map +1 -0
- package/build/treb-calculator/src/index.d.ts +2 -0
- package/build/treb-calculator/src/index.js +22 -0
- package/build/treb-calculator/src/index.js.map +1 -0
- package/build/treb-calculator/src/notifier-types.d.ts +26 -0
- package/build/treb-calculator/src/notifier-types.js +22 -0
- package/build/treb-calculator/src/notifier-types.js.map +1 -0
- package/build/treb-calculator/src/primitives.d.ts +15 -0
- package/build/treb-calculator/src/primitives.js +398 -0
- package/build/treb-calculator/src/primitives.js.map +1 -0
- package/build/treb-calculator/src/utilities.d.ts +68 -0
- package/build/treb-calculator/src/utilities.js +324 -0
- package/build/treb-calculator/src/utilities.js.map +1 -0
- package/build/treb-charts/src/chart-functions.d.ts +8 -0
- package/build/treb-charts/src/chart-functions.js +209 -0
- package/build/treb-charts/src/chart-functions.js.map +1 -0
- package/build/treb-charts/src/chart-types.d.ts +233 -0
- package/build/treb-charts/src/chart-types.js +57 -0
- package/build/treb-charts/src/chart-types.js.map +1 -0
- package/build/treb-charts/src/chart-utils.d.ts +106 -0
- package/build/treb-charts/src/chart-utils.js +1060 -0
- package/build/treb-charts/src/chart-utils.js.map +1 -0
- package/build/treb-charts/src/chart.d.ts +23 -0
- package/build/treb-charts/src/chart.js +94 -0
- package/build/treb-charts/src/chart.js.map +1 -0
- package/build/treb-charts/src/default-chart-renderer.d.ts +16 -0
- package/build/treb-charts/src/default-chart-renderer.js +533 -0
- package/build/treb-charts/src/default-chart-renderer.js.map +1 -0
- package/build/treb-charts/src/index.d.ts +5 -0
- package/build/treb-charts/src/index.js +24 -0
- package/build/treb-charts/src/index.js.map +1 -0
- package/build/treb-charts/src/main.d.ts +1 -0
- package/build/treb-charts/src/main.js +34 -0
- package/build/treb-charts/src/main.js.map +1 -0
- package/build/treb-charts/src/quicksort.d.ts +1 -0
- package/build/treb-charts/src/quicksort.js +49 -0
- package/build/treb-charts/src/quicksort.js.map +1 -0
- package/build/treb-charts/src/rectangle.d.ts +18 -0
- package/build/treb-charts/src/rectangle.js +41 -0
- package/build/treb-charts/src/rectangle.js.map +1 -0
- package/build/treb-charts/src/renderer-type.d.ts +24 -0
- package/build/treb-charts/src/renderer-type.js +22 -0
- package/build/treb-charts/src/renderer-type.js.map +1 -0
- package/build/treb-charts/src/renderer.d.ts +127 -0
- package/build/treb-charts/src/renderer.js +1518 -0
- package/build/treb-charts/src/renderer.js.map +1 -0
- package/build/treb-charts/src/util.d.ts +18 -0
- package/build/treb-charts/src/util.js +71 -0
- package/build/treb-charts/src/util.js.map +1 -0
- package/build/treb-data-model/src/annotation.d.ts +167 -0
- package/build/treb-data-model/src/annotation.js +120 -0
- package/build/treb-data-model/src/annotation.js.map +1 -0
- package/build/treb-data-model/src/conditional_format.d.ts +155 -0
- package/build/treb-data-model/src/conditional_format.js +62 -0
- package/build/treb-data-model/src/conditional_format.js.map +1 -0
- package/build/treb-data-model/src/data-validation.d.ts +28 -0
- package/build/treb-data-model/src/data-validation.js +22 -0
- package/build/treb-data-model/src/data-validation.js.map +1 -0
- package/build/treb-data-model/src/data_model.d.ts +173 -0
- package/build/treb-data-model/src/data_model.js +637 -0
- package/build/treb-data-model/src/data_model.js.map +1 -0
- package/build/treb-data-model/src/index.d.ts +13 -0
- package/build/treb-data-model/src/index.js +28 -0
- package/build/treb-data-model/src/index.js.map +1 -0
- package/build/treb-data-model/src/language-model.d.ts +22 -0
- package/build/treb-data-model/src/language-model.js +22 -0
- package/build/treb-data-model/src/language-model.js.map +1 -0
- package/build/treb-data-model/src/named.d.ts +124 -0
- package/build/treb-data-model/src/named.js +372 -0
- package/build/treb-data-model/src/named.js.map +1 -0
- package/build/treb-data-model/src/serialize_options.d.ts +49 -0
- package/build/treb-data-model/src/serialize_options.js +22 -0
- package/build/treb-data-model/src/serialize_options.js.map +1 -0
- package/build/treb-data-model/src/sheet.d.ts +499 -0
- package/build/treb-data-model/src/sheet.js +2904 -0
- package/build/treb-data-model/src/sheet.js.map +1 -0
- package/build/treb-data-model/src/sheet_collection.d.ts +58 -0
- package/build/treb-data-model/src/sheet_collection.js +112 -0
- package/build/treb-data-model/src/sheet_collection.js.map +1 -0
- package/build/treb-data-model/src/sheet_selection.d.ts +42 -0
- package/build/treb-data-model/src/sheet_selection.js +39 -0
- package/build/treb-data-model/src/sheet_selection.js.map +1 -0
- package/build/treb-data-model/src/sheet_types.d.ts +104 -0
- package/build/treb-data-model/src/sheet_types.js +22 -0
- package/build/treb-data-model/src/sheet_types.js.map +1 -0
- package/build/treb-data-model/src/types.d.ts +59 -0
- package/build/treb-data-model/src/types.js +22 -0
- package/build/treb-data-model/src/types.js.map +1 -0
- package/build/treb-embed/src/custom-element/spreadsheet-constructor.d.ts +75 -0
- package/build/treb-embed/src/custom-element/spreadsheet-constructor.js +1144 -0
- package/build/treb-embed/src/custom-element/spreadsheet-constructor.js.map +1 -0
- package/build/treb-embed/src/custom-element/treb-global.d.ts +36 -0
- package/build/treb-embed/src/custom-element/treb-global.js +64 -0
- package/build/treb-embed/src/custom-element/treb-global.js.map +1 -0
- package/build/treb-embed/src/custom-element/treb-spreadsheet-element.d.ts +1 -0
- package/build/treb-embed/src/custom-element/treb-spreadsheet-element.js +61 -0
- package/build/treb-embed/src/custom-element/treb-spreadsheet-element.js.map +1 -0
- package/build/treb-embed/src/embedded-spreadsheet.d.ts +1358 -0
- package/build/treb-embed/src/embedded-spreadsheet.js +5205 -0
- package/build/treb-embed/src/embedded-spreadsheet.js.map +1 -0
- package/build/treb-embed/src/index.d.ts +12 -0
- package/build/treb-embed/src/index.js +34 -0
- package/build/treb-embed/src/index.js.map +1 -0
- package/build/treb-embed/src/options.d.ts +266 -0
- package/build/treb-embed/src/options.js +56 -0
- package/build/treb-embed/src/options.js.map +1 -0
- package/build/treb-embed/src/plugin.d.ts +9 -0
- package/build/treb-embed/src/plugin.js +22 -0
- package/build/treb-embed/src/plugin.js.map +1 -0
- package/build/treb-embed/src/progress-dialog.d.ts +49 -0
- package/build/treb-embed/src/progress-dialog.js +178 -0
- package/build/treb-embed/src/progress-dialog.js.map +1 -0
- package/build/treb-embed/src/selection-state.d.ts +15 -0
- package/build/treb-embed/src/selection-state.js +22 -0
- package/build/treb-embed/src/selection-state.js.map +1 -0
- package/build/treb-embed/src/spinner.d.ts +8 -0
- package/build/treb-embed/src/spinner.js +40 -0
- package/build/treb-embed/src/spinner.js.map +1 -0
- package/build/treb-embed/src/toolbar-message.d.ts +72 -0
- package/build/treb-embed/src/toolbar-message.js +22 -0
- package/build/treb-embed/src/toolbar-message.js.map +1 -0
- package/build/treb-embed/src/types.d.ts +185 -0
- package/build/treb-embed/src/types.js +45 -0
- package/build/treb-embed/src/types.js.map +1 -0
- package/build/treb-embed/tsconfig.tsbuildinfo +1 -0
- package/build/treb-export/src/address-type.d.ts +34 -0
- package/build/treb-export/src/address-type.js +53 -0
- package/build/treb-export/src/address-type.js.map +1 -0
- package/build/treb-export/src/base-template.d.ts +1 -0
- package/build/treb-export/src/base-template.js +22 -0
- package/build/treb-export/src/base-template.js.map +1 -0
- package/build/treb-export/src/column-width.d.ts +2 -0
- package/build/treb-export/src/column-width.js +80 -0
- package/build/treb-export/src/column-width.js.map +1 -0
- package/build/treb-export/src/drawing/bubble-chart-template.d.ts +514 -0
- package/build/treb-export/src/drawing/bubble-chart-template.js +544 -0
- package/build/treb-export/src/drawing/bubble-chart-template.js.map +1 -0
- package/build/treb-export/src/drawing/chart-template-components2.d.ts +365 -0
- package/build/treb-export/src/drawing/chart-template-components2.js +386 -0
- package/build/treb-export/src/drawing/chart-template-components2.js.map +1 -0
- package/build/treb-export/src/drawing/chart.d.ts +26 -0
- package/build/treb-export/src/drawing/chart.js +247 -0
- package/build/treb-export/src/drawing/chart.js.map +1 -0
- package/build/treb-export/src/drawing/column-chart-template2.d.ts +490 -0
- package/build/treb-export/src/drawing/column-chart-template2.js +518 -0
- package/build/treb-export/src/drawing/column-chart-template2.js.map +1 -0
- package/build/treb-export/src/drawing/donut-chart-template2.d.ts +272 -0
- package/build/treb-export/src/drawing/donut-chart-template2.js +293 -0
- package/build/treb-export/src/drawing/donut-chart-template2.js.map +1 -0
- package/build/treb-export/src/drawing/drawing.d.ts +49 -0
- package/build/treb-export/src/drawing/drawing.js +193 -0
- package/build/treb-export/src/drawing/drawing.js.map +1 -0
- package/build/treb-export/src/drawing/embedded-image.d.ts +12 -0
- package/build/treb-export/src/drawing/embedded-image.js +54 -0
- package/build/treb-export/src/drawing/embedded-image.js.map +1 -0
- package/build/treb-export/src/drawing/scatter-chart-template2.d.ts +520 -0
- package/build/treb-export/src/drawing/scatter-chart-template2.js +551 -0
- package/build/treb-export/src/drawing/scatter-chart-template2.js.map +1 -0
- package/build/treb-export/src/export.d.ts +72 -0
- package/build/treb-export/src/export.js +2039 -0
- package/build/treb-export/src/export.js.map +1 -0
- package/build/treb-export/src/import-export-messages.d.ts +31 -0
- package/build/treb-export/src/import-export-messages.js +22 -0
- package/build/treb-export/src/import-export-messages.js.map +1 -0
- package/build/treb-export/src/import.d.ts +33 -0
- package/build/treb-export/src/import.js +1258 -0
- package/build/treb-export/src/import.js.map +1 -0
- package/build/treb-export/src/index.worker.d.ts +1 -0
- package/build/treb-export/src/index.worker.js +93 -0
- package/build/treb-export/src/index.worker.js.map +1 -0
- package/build/treb-export/src/metadata.d.ts +51 -0
- package/build/treb-export/src/metadata.js +153 -0
- package/build/treb-export/src/metadata.js.map +1 -0
- package/build/treb-export/src/ooxml.d.ts +7 -0
- package/build/treb-export/src/ooxml.js +41 -0
- package/build/treb-export/src/ooxml.js.map +1 -0
- package/build/treb-export/src/relationship.d.ts +8 -0
- package/build/treb-export/src/relationship.js +27 -0
- package/build/treb-export/src/relationship.js.map +1 -0
- package/build/treb-export/src/shared-strings.d.ts +11 -0
- package/build/treb-export/src/shared-strings.js +105 -0
- package/build/treb-export/src/shared-strings.js.map +1 -0
- package/build/treb-export/src/template-2.d.ts +1 -0
- package/build/treb-export/src/template-2.js +22 -0
- package/build/treb-export/src/template-2.js.map +1 -0
- package/build/treb-export/src/unescape_xml.d.ts +1 -0
- package/build/treb-export/src/unescape_xml.js +61 -0
- package/build/treb-export/src/unescape_xml.js.map +1 -0
- package/build/treb-export/src/workbook-sheet.d.ts +75 -0
- package/build/treb-export/src/workbook-sheet.js +128 -0
- package/build/treb-export/src/workbook-sheet.js.map +1 -0
- package/build/treb-export/src/workbook-style.d.ts +110 -0
- package/build/treb-export/src/workbook-style.js +1134 -0
- package/build/treb-export/src/workbook-style.js.map +1 -0
- package/build/treb-export/src/workbook-theme.d.ts +13 -0
- package/build/treb-export/src/workbook-theme.js +85 -0
- package/build/treb-export/src/workbook-theme.js.map +1 -0
- package/build/treb-export/src/workbook.d.ts +123 -0
- package/build/treb-export/src/workbook.js +644 -0
- package/build/treb-export/src/workbook.js.map +1 -0
- package/build/treb-export/src/xml-test.d.ts +9 -0
- package/build/treb-export/src/xml-test.js +52 -0
- package/build/treb-export/src/xml-test.js.map +1 -0
- package/build/treb-export/src/xml-utils.d.ts +76 -0
- package/build/treb-export/src/xml-utils.js +223 -0
- package/build/treb-export/src/xml-utils.js.map +1 -0
- package/build/treb-export/src/zip-wrapper.d.ts +22 -0
- package/build/treb-export/src/zip-wrapper.js +93 -0
- package/build/treb-export/src/zip-wrapper.js.map +1 -0
- package/build/treb-format/src/format.d.ts +130 -0
- package/build/treb-format/src/format.js +805 -0
- package/build/treb-format/src/format.js.map +1 -0
- package/build/treb-format/src/format_cache.d.ts +55 -0
- package/build/treb-format/src/format_cache.js +166 -0
- package/build/treb-format/src/format_cache.js.map +1 -0
- package/build/treb-format/src/format_parser.d.ts +70 -0
- package/build/treb-format/src/format_parser.js +618 -0
- package/build/treb-format/src/format_parser.js.map +1 -0
- package/build/treb-format/src/index.d.ts +4 -0
- package/build/treb-format/src/index.js +25 -0
- package/build/treb-format/src/index.js.map +1 -0
- package/build/treb-format/src/number_format_section.d.ts +58 -0
- package/build/treb-format/src/number_format_section.js +78 -0
- package/build/treb-format/src/number_format_section.js.map +1 -0
- package/build/treb-format/src/value_parser.d.ts +48 -0
- package/build/treb-format/src/value_parser.js +244 -0
- package/build/treb-format/src/value_parser.js.map +1 -0
- package/build/treb-grid/src/editors/autocomplete.d.ts +39 -0
- package/build/treb-grid/src/editors/autocomplete.js +316 -0
- package/build/treb-grid/src/editors/autocomplete.js.map +1 -0
- package/build/treb-grid/src/editors/autocomplete_matcher.d.ts +74 -0
- package/build/treb-grid/src/editors/autocomplete_matcher.js +212 -0
- package/build/treb-grid/src/editors/autocomplete_matcher.js.map +1 -0
- package/build/treb-grid/src/editors/editor.d.ts +214 -0
- package/build/treb-grid/src/editors/editor.js +879 -0
- package/build/treb-grid/src/editors/editor.js.map +1 -0
- package/build/treb-grid/src/editors/external_editor.d.ts +11 -0
- package/build/treb-grid/src/editors/external_editor.js +118 -0
- package/build/treb-grid/src/editors/external_editor.js.map +1 -0
- package/build/treb-grid/src/editors/formula_bar.d.ts +85 -0
- package/build/treb-grid/src/editors/formula_bar.js +444 -0
- package/build/treb-grid/src/editors/formula_bar.js.map +1 -0
- package/build/treb-grid/src/editors/overlay_editor.d.ts +85 -0
- package/build/treb-grid/src/editors/overlay_editor.js +353 -0
- package/build/treb-grid/src/editors/overlay_editor.js.map +1 -0
- package/build/treb-grid/src/index.d.ts +12 -0
- package/build/treb-grid/src/index.js +28 -0
- package/build/treb-grid/src/index.js.map +1 -0
- package/build/treb-grid/src/layout/base_layout.d.ts +346 -0
- package/build/treb-grid/src/layout/base_layout.js +2050 -0
- package/build/treb-grid/src/layout/base_layout.js.map +1 -0
- package/build/treb-grid/src/layout/grid_layout.d.ts +19 -0
- package/build/treb-grid/src/layout/grid_layout.js +235 -0
- package/build/treb-grid/src/layout/grid_layout.js.map +1 -0
- package/build/treb-grid/src/layout/mock-layout.d.ts +10 -0
- package/build/treb-grid/src/layout/mock-layout.js +37 -0
- package/build/treb-grid/src/layout/mock-layout.js.map +1 -0
- package/build/treb-grid/src/render/selection-renderer.d.ts +97 -0
- package/build/treb-grid/src/render/selection-renderer.js +315 -0
- package/build/treb-grid/src/render/selection-renderer.js.map +1 -0
- package/build/treb-grid/src/render/svg_header_overlay.d.ts +20 -0
- package/build/treb-grid/src/render/svg_header_overlay.js +76 -0
- package/build/treb-grid/src/render/svg_header_overlay.js.map +1 -0
- package/build/treb-grid/src/render/svg_selection_block.d.ts +27 -0
- package/build/treb-grid/src/render/svg_selection_block.js +106 -0
- package/build/treb-grid/src/render/svg_selection_block.js.map +1 -0
- package/build/treb-grid/src/render/tile_renderer.d.ts +121 -0
- package/build/treb-grid/src/render/tile_renderer.js +1609 -0
- package/build/treb-grid/src/render/tile_renderer.js.map +1 -0
- package/build/treb-grid/src/types/border_constants.d.ts +9 -0
- package/build/treb-grid/src/types/border_constants.js +34 -0
- package/build/treb-grid/src/types/border_constants.js.map +1 -0
- package/build/treb-grid/src/types/clipboard_data.d.ts +11 -0
- package/build/treb-grid/src/types/clipboard_data.js +22 -0
- package/build/treb-grid/src/types/clipboard_data.js.map +1 -0
- package/build/treb-grid/src/types/clipboard_data2.d.ts +46 -0
- package/build/treb-grid/src/types/clipboard_data2.js +22 -0
- package/build/treb-grid/src/types/clipboard_data2.js.map +1 -0
- package/build/treb-grid/src/types/drag_mask.d.ts +10 -0
- package/build/treb-grid/src/types/drag_mask.js +78 -0
- package/build/treb-grid/src/types/drag_mask.js.map +1 -0
- package/build/treb-grid/src/types/external_editor_config.d.ts +33 -0
- package/build/treb-grid/src/types/external_editor_config.js +22 -0
- package/build/treb-grid/src/types/external_editor_config.js.map +1 -0
- package/build/treb-grid/src/types/grid.d.ts +806 -0
- package/build/treb-grid/src/types/grid.js +6410 -0
- package/build/treb-grid/src/types/grid.js.map +1 -0
- package/build/treb-grid/src/types/grid_base.d.ts +442 -0
- package/build/treb-grid/src/types/grid_base.js +3523 -0
- package/build/treb-grid/src/types/grid_base.js.map +1 -0
- package/build/treb-grid/src/types/grid_command.d.ts +408 -0
- package/build/treb-grid/src/types/grid_command.js +75 -0
- package/build/treb-grid/src/types/grid_command.js.map +1 -0
- package/build/treb-grid/src/types/grid_events.d.ts +93 -0
- package/build/treb-grid/src/types/grid_events.js +36 -0
- package/build/treb-grid/src/types/grid_events.js.map +1 -0
- package/build/treb-grid/src/types/grid_options.d.ts +50 -0
- package/build/treb-grid/src/types/grid_options.js +34 -0
- package/build/treb-grid/src/types/grid_options.js.map +1 -0
- package/build/treb-grid/src/types/scale-control.d.ts +21 -0
- package/build/treb-grid/src/types/scale-control.js +148 -0
- package/build/treb-grid/src/types/scale-control.js.map +1 -0
- package/build/treb-grid/src/types/set_range_options.d.ts +24 -0
- package/build/treb-grid/src/types/set_range_options.js +22 -0
- package/build/treb-grid/src/types/set_range_options.js.map +1 -0
- package/build/treb-grid/src/types/tab_bar.d.ts +84 -0
- package/build/treb-grid/src/types/tab_bar.js +426 -0
- package/build/treb-grid/src/types/tab_bar.js.map +1 -0
- package/build/treb-grid/src/types/tile.d.ts +29 -0
- package/build/treb-grid/src/types/tile.js +22 -0
- package/build/treb-grid/src/types/tile.js.map +1 -0
- package/build/treb-grid/src/types/update_flags.d.ts +48 -0
- package/build/treb-grid/src/types/update_flags.js +22 -0
- package/build/treb-grid/src/types/update_flags.js.map +1 -0
- package/build/treb-grid/src/util/fontmetrics.d.ts +21 -0
- package/build/treb-grid/src/util/fontmetrics.js +82 -0
- package/build/treb-grid/src/util/fontmetrics.js.map +1 -0
- package/build/treb-grid/src/util/ua.d.ts +33 -0
- package/build/treb-grid/src/util/ua.js +86 -0
- package/build/treb-grid/src/util/ua.js.map +1 -0
- package/build/treb-parser/src/csv-parser.d.ts +13 -0
- package/build/treb-parser/src/csv-parser.js +107 -0
- package/build/treb-parser/src/csv-parser.js.map +1 -0
- package/build/treb-parser/src/index.d.ts +4 -0
- package/build/treb-parser/src/index.js +25 -0
- package/build/treb-parser/src/index.js.map +1 -0
- package/build/treb-parser/src/md-parser.d.ts +97 -0
- package/build/treb-parser/src/md-parser.js +403 -0
- package/build/treb-parser/src/md-parser.js.map +1 -0
- package/build/treb-parser/src/parser-types.d.ts +345 -0
- package/build/treb-parser/src/parser-types.js +53 -0
- package/build/treb-parser/src/parser-types.js.map +1 -0
- package/build/treb-parser/src/parser.d.ts +422 -0
- package/build/treb-parser/src/parser.js +2418 -0
- package/build/treb-parser/src/parser.js.map +1 -0
- package/build/treb-utils/src/event_source.d.ts +34 -0
- package/build/treb-utils/src/event_source.js +110 -0
- package/build/treb-utils/src/event_source.js.map +1 -0
- package/build/treb-utils/src/ievent_source.d.ts +9 -0
- package/build/treb-utils/src/ievent_source.js +22 -0
- package/build/treb-utils/src/ievent_source.js.map +1 -0
- package/build/treb-utils/src/index.d.ts +6 -0
- package/build/treb-utils/src/index.js +30 -0
- package/build/treb-utils/src/index.js.map +1 -0
- package/build/treb-utils/src/measurement.d.ts +42 -0
- package/build/treb-utils/src/measurement.js +145 -0
- package/build/treb-utils/src/measurement.js.map +1 -0
- package/build/treb-utils/src/scale.d.ts +16 -0
- package/build/treb-utils/src/scale.js +106 -0
- package/build/treb-utils/src/scale.js.map +1 -0
- package/build/treb-utils/src/serialize_html.d.ts +5 -0
- package/build/treb-utils/src/serialize_html.js +128 -0
- package/build/treb-utils/src/serialize_html.js.map +1 -0
- package/build/treb-utils/src/validate_uri.d.ts +20 -0
- package/build/treb-utils/src/validate_uri.js +55 -0
- package/build/treb-utils/src/validate_uri.js.map +1 -0
- package/dist/{chunk-XD5PEZBZ.mjs → chunk-A2NJA5VB.mjs} +1 -1
- package/dist/treb-export-worker.mjs +2 -2
- package/dist/treb-spreadsheet.mjs +4 -4
- package/dist/treb.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../treb-format/src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,cAAc,yBAAyB,CAAC;AACxC,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { TextPart } from 'treb-base-types';
|
|
2
|
+
/**
|
|
3
|
+
* essentially number formats have a core section with the number
|
|
4
|
+
* (possibly scaled), and some representation before and after.
|
|
5
|
+
* exponential and percentage notation scale the number. exponential
|
|
6
|
+
* is only allowed after the number. percent can come before or after.
|
|
7
|
+
*
|
|
8
|
+
* converting to class, default values
|
|
9
|
+
*
|
|
10
|
+
* FIXME: this should be an interface, you can create a default instance
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
export declare class NumberFormatSection {
|
|
14
|
+
/** flag: this is a date format */
|
|
15
|
+
date_format: boolean;
|
|
16
|
+
/** flag: this is the string section, don't format numbers */
|
|
17
|
+
string_format: boolean;
|
|
18
|
+
/** flag: this is a fractional format */
|
|
19
|
+
fraction_format: boolean;
|
|
20
|
+
/** flag: time in 12-hour format */
|
|
21
|
+
twelve_hour: boolean;
|
|
22
|
+
/** fraction: fixed denominator */
|
|
23
|
+
fraction_denominator: number;
|
|
24
|
+
/** fraction includes integer */
|
|
25
|
+
fraction_integer: boolean;
|
|
26
|
+
/** align fraction digits (using ???) [TODO] */
|
|
27
|
+
fraction_align: number;
|
|
28
|
+
/**
|
|
29
|
+
* fraction denominator digits. we will limit to [1,4] but this can
|
|
30
|
+
* be zero if there's an explicit denominator.
|
|
31
|
+
*/
|
|
32
|
+
fraction_denominator_digits: number;
|
|
33
|
+
/** prepend zeros */
|
|
34
|
+
integer_min_digits: number;
|
|
35
|
+
/** append zeros */
|
|
36
|
+
decimal_min_digits: number;
|
|
37
|
+
/** append decimal digits, but not trailing zeros */
|
|
38
|
+
decimal_max_digits: number;
|
|
39
|
+
/** use grouping (only supports groups of 3, no matter where you put the ,) */
|
|
40
|
+
grouping: boolean;
|
|
41
|
+
/** this is a flag for switching whether we append strings to prefix or suffix */
|
|
42
|
+
has_number_format: boolean;
|
|
43
|
+
/** leading string(s) */
|
|
44
|
+
prefix: TextPart[];
|
|
45
|
+
/** trailing string(s) */
|
|
46
|
+
suffix: TextPart[];
|
|
47
|
+
/**
|
|
48
|
+
* thousands scaling (trailing commas in the number format section). we set
|
|
49
|
+
* to zero for a faster flag if no scaling.
|
|
50
|
+
*/
|
|
51
|
+
scaling: number;
|
|
52
|
+
/** flag indicating percent -- will multiply value by 100 */
|
|
53
|
+
percent: boolean;
|
|
54
|
+
/** flag indicating exponential -- turns numbers in to exp format */
|
|
55
|
+
exponential: boolean;
|
|
56
|
+
/** this is a flag for testing -- we don't support multiple * in a format */
|
|
57
|
+
has_asterisk: boolean;
|
|
58
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This file is part of TREB.
|
|
3
|
+
*
|
|
4
|
+
* TREB is free software: you can redistribute it and/or modify it under the
|
|
5
|
+
* terms of the GNU General Public License as published by the Free Software
|
|
6
|
+
* Foundation, either version 3 of the License, or (at your option) any
|
|
7
|
+
* later version.
|
|
8
|
+
*
|
|
9
|
+
* TREB is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
10
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
11
|
+
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
12
|
+
* details.
|
|
13
|
+
*
|
|
14
|
+
* You should have received a copy of the GNU General Public License along
|
|
15
|
+
* with TREB. If not, see <https://www.gnu.org/licenses/>.
|
|
16
|
+
*
|
|
17
|
+
* Copyright 2022-2026 trebco, llc.
|
|
18
|
+
* info@treb.app
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* essentially number formats have a core section with the number
|
|
23
|
+
* (possibly scaled), and some representation before and after.
|
|
24
|
+
* exponential and percentage notation scale the number. exponential
|
|
25
|
+
* is only allowed after the number. percent can come before or after.
|
|
26
|
+
*
|
|
27
|
+
* converting to class, default values
|
|
28
|
+
*
|
|
29
|
+
* FIXME: this should be an interface, you can create a default instance
|
|
30
|
+
*
|
|
31
|
+
*/
|
|
32
|
+
export class NumberFormatSection {
|
|
33
|
+
/** flag: this is a date format */
|
|
34
|
+
date_format = false;
|
|
35
|
+
/** flag: this is the string section, don't format numbers */
|
|
36
|
+
string_format = false;
|
|
37
|
+
/** flag: this is a fractional format */
|
|
38
|
+
fraction_format = false;
|
|
39
|
+
/** flag: time in 12-hour format */
|
|
40
|
+
twelve_hour = false;
|
|
41
|
+
/** fraction: fixed denominator */
|
|
42
|
+
fraction_denominator = 0;
|
|
43
|
+
/** fraction includes integer */
|
|
44
|
+
fraction_integer = true;
|
|
45
|
+
/** align fraction digits (using ???) [TODO] */
|
|
46
|
+
fraction_align = 0;
|
|
47
|
+
/**
|
|
48
|
+
* fraction denominator digits. we will limit to [1,4] but this can
|
|
49
|
+
* be zero if there's an explicit denominator.
|
|
50
|
+
*/
|
|
51
|
+
fraction_denominator_digits = 0;
|
|
52
|
+
/** prepend zeros */
|
|
53
|
+
integer_min_digits = 0;
|
|
54
|
+
/** append zeros */
|
|
55
|
+
decimal_min_digits = 0;
|
|
56
|
+
/** append decimal digits, but not trailing zeros */
|
|
57
|
+
decimal_max_digits = 0;
|
|
58
|
+
/** use grouping (only supports groups of 3, no matter where you put the ,) */
|
|
59
|
+
grouping = false;
|
|
60
|
+
/** this is a flag for switching whether we append strings to prefix or suffix */
|
|
61
|
+
has_number_format = false;
|
|
62
|
+
/** leading string(s) */
|
|
63
|
+
prefix = [{ text: '' }];
|
|
64
|
+
/** trailing string(s) */
|
|
65
|
+
suffix = [{ text: '' }];
|
|
66
|
+
/**
|
|
67
|
+
* thousands scaling (trailing commas in the number format section). we set
|
|
68
|
+
* to zero for a faster flag if no scaling.
|
|
69
|
+
*/
|
|
70
|
+
scaling = 0;
|
|
71
|
+
/** flag indicating percent -- will multiply value by 100 */
|
|
72
|
+
percent = false;
|
|
73
|
+
/** flag indicating exponential -- turns numbers in to exp format */
|
|
74
|
+
exponential = false;
|
|
75
|
+
/** this is a flag for testing -- we don't support multiple * in a format */
|
|
76
|
+
has_asterisk = false;
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=number_format_section.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"number_format_section.js","sourceRoot":"","sources":["../../../treb-format/src/number_format_section.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH;;;;;;;;;;GAUG;AACH,MAAM,OAAO,mBAAmB;IAE9B,kCAAkC;IAC3B,WAAW,GAAG,KAAK,CAAC;IAE3B,6DAA6D;IACtD,aAAa,GAAG,KAAK,CAAC;IAE7B,wCAAwC;IACjC,eAAe,GAAG,KAAK,CAAC;IAE/B,oCAAoC;IAC7B,WAAW,GAAG,KAAK,CAAC;IAE3B,kCAAkC;IAC3B,oBAAoB,GAAG,CAAC,CAAC;IAEhC,gCAAgC;IACzB,gBAAgB,GAAG,IAAI,CAAC;IAE/B,+CAA+C;IACxC,cAAc,GAAG,CAAC,CAAC;IAE1B;;;OAGG;IACI,2BAA2B,GAAG,CAAC,CAAC;IAEvC,oBAAoB;IACb,kBAAkB,GAAG,CAAC,CAAC;IAE9B,mBAAmB;IACZ,kBAAkB,GAAG,CAAC,CAAC;IAE9B,oDAAoD;IAC7C,kBAAkB,GAAG,CAAC,CAAC;IAE9B,8EAA8E;IACvE,QAAQ,GAAG,KAAK,CAAC;IAExB,iFAAiF;IAC1E,iBAAiB,GAAG,KAAK,CAAC;IAEjC,wBAAwB;IACjB,MAAM,GAAe,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;IAE3C,yBAAyB;IAClB,MAAM,GAAe,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;IAE3C;;;OAGG;IACI,OAAO,GAAG,CAAC,CAAC;IAEnB,4DAA4D;IACrD,OAAO,GAAG,KAAK,CAAC;IAEvB,oEAAoE;IAC7D,WAAW,GAAG,KAAK,CAAC;IAE3B,4EAA4E;IACrE,YAAY,GAAG,KAAK,CAAC;CAE7B"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { Complex } from 'treb-base-types';
|
|
2
|
+
import { ValueType } from 'treb-base-types';
|
|
3
|
+
/**
|
|
4
|
+
* this is code that was in the old number format class, which was superceded
|
|
5
|
+
* by the new treb-format module. we still need to do rough value parsing,
|
|
6
|
+
* which is separate from parsing and from formatting.
|
|
7
|
+
*
|
|
8
|
+
* cleaning up to remove redundant bits, move inference in here
|
|
9
|
+
*
|
|
10
|
+
* FIXME: move this somewhere else, this is the format library
|
|
11
|
+
*/
|
|
12
|
+
export interface Hints {
|
|
13
|
+
Nan?: boolean;
|
|
14
|
+
Exponential?: boolean;
|
|
15
|
+
Percent?: boolean;
|
|
16
|
+
Currency?: boolean;
|
|
17
|
+
Grouping?: boolean;
|
|
18
|
+
Parens?: boolean;
|
|
19
|
+
Date?: boolean;
|
|
20
|
+
Time?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* parse result now uses base valuetype
|
|
24
|
+
*/
|
|
25
|
+
export interface ParseResult {
|
|
26
|
+
value: number | string | boolean | undefined | Complex;
|
|
27
|
+
hints?: Hints;
|
|
28
|
+
type: ValueType;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* value parser class is a singleton, instance is exported
|
|
32
|
+
*/
|
|
33
|
+
declare class ValueParserType {
|
|
34
|
+
compare_day?: Record<string, number>;
|
|
35
|
+
compare_month?: Record<string, number>;
|
|
36
|
+
TestDate(text: string): number | false;
|
|
37
|
+
/**
|
|
38
|
+
* parse a string. if it can reasonably be converted to a number,
|
|
39
|
+
* do that and return the number; otherwise return the original
|
|
40
|
+
* string. we also return hints as to formatting, which the caller
|
|
41
|
+
* may use to select a number format.
|
|
42
|
+
*
|
|
43
|
+
* remind me why this is better than just using a parser? (...)
|
|
44
|
+
*/
|
|
45
|
+
TryParse(text?: string): ParseResult;
|
|
46
|
+
}
|
|
47
|
+
export declare const ValueParser: ValueParserType;
|
|
48
|
+
export {};
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This file is part of TREB.
|
|
3
|
+
*
|
|
4
|
+
* TREB is free software: you can redistribute it and/or modify it under the
|
|
5
|
+
* terms of the GNU General Public License as published by the Free Software
|
|
6
|
+
* Foundation, either version 3 of the License, or (at your option) any
|
|
7
|
+
* later version.
|
|
8
|
+
*
|
|
9
|
+
* TREB is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
10
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
11
|
+
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
12
|
+
* details.
|
|
13
|
+
*
|
|
14
|
+
* You should have received a copy of the GNU General Public License along
|
|
15
|
+
* with TREB. If not, see <https://www.gnu.org/licenses/>.
|
|
16
|
+
*
|
|
17
|
+
* Copyright 2022-2026 trebco, llc.
|
|
18
|
+
* info@treb.app
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
import { ValueType, Localization } from 'treb-base-types';
|
|
22
|
+
import { UnlotusDate } from './format';
|
|
23
|
+
const this_year = new Date().getUTCFullYear();
|
|
24
|
+
/**
|
|
25
|
+
* value parser class is a singleton, instance is exported
|
|
26
|
+
*/
|
|
27
|
+
class ValueParserType {
|
|
28
|
+
compare_day;
|
|
29
|
+
compare_month;
|
|
30
|
+
TestDate(text) {
|
|
31
|
+
// first check if JS can turn it into a date at all. we can
|
|
32
|
+
// use that as a baseline/initial check (in any event there's
|
|
33
|
+
// no point in doing the work otherwise)
|
|
34
|
+
const date_value = Date.parse(text);
|
|
35
|
+
if (isNaN(date_value)) {
|
|
36
|
+
// console.info('td false: is nan')
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
const date = new Date(date_value);
|
|
40
|
+
// OK so there's a date, now we can do whatever validation we want
|
|
41
|
+
// is there a regexp for accented characters? actually we can
|
|
42
|
+
// maybe go backwards... remove things that properly belong in
|
|
43
|
+
// dates: numbers, dashes and slashes (+ comma, whitespace)
|
|
44
|
+
// dots are in some l10n systems... maybe we should check first?
|
|
45
|
+
// Q: what does lowercase do for accented characters? (...)
|
|
46
|
+
// NOTE: as it turns out, Date.parse() only handles US-EN. so
|
|
47
|
+
// all this is unecessary (and unused) in other locales. to really
|
|
48
|
+
// do this properly we will probably need to write our own locale-
|
|
49
|
+
// aware date parser. which is probably a lot of work. TODO.
|
|
50
|
+
const tmp = text.replace(/[\d\-\\/,.\s]+/g, ' ').toLocaleLowerCase();
|
|
51
|
+
// then split into individual strings. trim and drop empty
|
|
52
|
+
const components = tmp.split(/\s+/).map(component => component.trim()).filter(component => !!component);
|
|
53
|
+
if (!components.length) {
|
|
54
|
+
// console.info('td true: no strings');
|
|
55
|
+
return date_value; // probably a date
|
|
56
|
+
}
|
|
57
|
+
// now we'll compare these to stuff we have in l10n. rule (WIP):
|
|
58
|
+
// should be in month or day-of-week. accept short or long, or one
|
|
59
|
+
// character. (one character introduces some ambiguity...)
|
|
60
|
+
// drop 1 character, it's ambiguous and annoying (also hard to handle)
|
|
61
|
+
// so basically, any string in here has to be a month or day; we can't
|
|
62
|
+
// have two of either; they have to match what was parsed; and you can't
|
|
63
|
+
// have a day-of-week but not a month.
|
|
64
|
+
// FIXME: cache/precalc
|
|
65
|
+
// let's do it lazily
|
|
66
|
+
// NOTE: portugeuse seems to include periods in their abbreviations...
|
|
67
|
+
if (!this.compare_month) {
|
|
68
|
+
this.compare_month = {};
|
|
69
|
+
for (let i = 0; i < 12; i++) {
|
|
70
|
+
this.compare_month[Localization.date_components.long_months[i].toLocaleLowerCase().replace(/\./, '')] = i;
|
|
71
|
+
this.compare_month[Localization.date_components.short_months[i].toLocaleLowerCase().replace(/\./, '')] = i;
|
|
72
|
+
// comparison[Localization.date_components.long_months[i][0].toLocaleLowerCase()] = i;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
if (!this.compare_day) {
|
|
76
|
+
this.compare_day = {};
|
|
77
|
+
for (let i = 0; i < 7; i++) {
|
|
78
|
+
this.compare_day[Localization.date_components.long_days[i].toLocaleLowerCase().replace(/\./, '')] = i;
|
|
79
|
+
this.compare_day[Localization.date_components.short_days[i].toLocaleLowerCase().replace(/\./, '')] = i;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
let found_month = false;
|
|
83
|
+
let found_day = false;
|
|
84
|
+
for (const component of components) {
|
|
85
|
+
let found = false;
|
|
86
|
+
for (const [month, value] of Object.entries(this.compare_month)) {
|
|
87
|
+
if (component === month) {
|
|
88
|
+
// can't have two months in a single date
|
|
89
|
+
if (found_month) {
|
|
90
|
+
// console.info('td false: two months')
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
// have a string match [FIXME: fuzzy?]
|
|
94
|
+
// check that the month matches
|
|
95
|
+
if (date.getUTCMonth() !== value) {
|
|
96
|
+
// console.info('td false: month mismatch')
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
found = true;
|
|
100
|
+
found_month = true;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
if (!found) {
|
|
104
|
+
for (const [day, value] of Object.entries(this.compare_day)) {
|
|
105
|
+
if (component === day) {
|
|
106
|
+
// can't have two days either
|
|
107
|
+
if (found_day) {
|
|
108
|
+
// console.info('td false: two days')
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
111
|
+
if (date.getUTCDay() !== value) {
|
|
112
|
+
// console.info('td false: day mismatch')
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
found = true;
|
|
116
|
+
found_day = true;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
if (!found) {
|
|
121
|
+
// whatever this string is, we don't recognize it. so this is
|
|
122
|
+
// probably not a date.
|
|
123
|
+
// console.info('td false: unmatched string')
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
// last check: no DOW without month.
|
|
128
|
+
if (found_day && !found_month) {
|
|
129
|
+
// console.info('td false: day but no month')
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
// OK, accept it
|
|
133
|
+
// console.info('td true: ran out of cases')
|
|
134
|
+
return date_value;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* parse a string. if it can reasonably be converted to a number,
|
|
138
|
+
* do that and return the number; otherwise return the original
|
|
139
|
+
* string. we also return hints as to formatting, which the caller
|
|
140
|
+
* may use to select a number format.
|
|
141
|
+
*
|
|
142
|
+
* remind me why this is better than just using a parser? (...)
|
|
143
|
+
*/
|
|
144
|
+
TryParse(text = '') {
|
|
145
|
+
let hints = {}; // Hints.None;
|
|
146
|
+
// starts with SINGLE quote mark. express string.
|
|
147
|
+
if (text[0] === '\'')
|
|
148
|
+
return { value: text, type: ValueType.string };
|
|
149
|
+
// empty string, treat as string (should be === 0 though?)
|
|
150
|
+
if (text === '')
|
|
151
|
+
return { value: text, type: ValueType.string };
|
|
152
|
+
// we test if the conversion returns NaN, which usually means
|
|
153
|
+
// it's not a number -- unless the string is actually NaN, which
|
|
154
|
+
// is something we want to preserve.
|
|
155
|
+
if (text === 'NaN')
|
|
156
|
+
return {
|
|
157
|
+
value: NaN,
|
|
158
|
+
type: ValueType.number,
|
|
159
|
+
hints: { Nan: true },
|
|
160
|
+
};
|
|
161
|
+
let x = text.trim();
|
|
162
|
+
// x = x.replace(/^[\$£€]/, '').trim();
|
|
163
|
+
const currency = x.match(/^[$](.*?)$/);
|
|
164
|
+
if (currency) {
|
|
165
|
+
x = currency[1];
|
|
166
|
+
// hints |= Hints.Currency;
|
|
167
|
+
hints.Currency = true;
|
|
168
|
+
}
|
|
169
|
+
const parens = x.match(/^\((.*?)\)$/);
|
|
170
|
+
if (parens) {
|
|
171
|
+
x = parens[1];
|
|
172
|
+
// hints |= Hints.Parens;
|
|
173
|
+
hints.Parens = true;
|
|
174
|
+
}
|
|
175
|
+
const pct = x.match(/^(.*?)%\s*$/);
|
|
176
|
+
if (pct) {
|
|
177
|
+
x = pct[1];
|
|
178
|
+
// hints |= Hints.Percent;
|
|
179
|
+
hints.Percent = true;
|
|
180
|
+
}
|
|
181
|
+
if (Localization.decimal_separator === '.') {
|
|
182
|
+
if (/,/.test(x)) {
|
|
183
|
+
x = x.replace(/,/g, '');
|
|
184
|
+
// hints |= Hints.Grouping;
|
|
185
|
+
hints.Grouping = true;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
x = x.replace(/(\d)\s+/g, '$1'); // remove spaces inside numbers
|
|
190
|
+
x = x.replace(/\./g, ''); // remove point separators
|
|
191
|
+
x = x.replace(/,/, '.'); // convert to US-style
|
|
192
|
+
}
|
|
193
|
+
let num = Number(x);
|
|
194
|
+
if (null === num || isNaN(num)) {
|
|
195
|
+
// check boolean
|
|
196
|
+
const lc = text.toLowerCase();
|
|
197
|
+
if (lc === 'false')
|
|
198
|
+
return { value: false, type: ValueType.boolean };
|
|
199
|
+
if (lc === 'true')
|
|
200
|
+
return { value: true, type: ValueType.boolean };
|
|
201
|
+
// check date, but bound on reasonable years...
|
|
202
|
+
// also maybe parameterize, make this optional
|
|
203
|
+
// this is too aggressive (at least in chrome). we need to dial it
|
|
204
|
+
// back a bit. to do that, we will validate any strings in the text
|
|
205
|
+
// and ensure they look like date components (usually months and days),
|
|
206
|
+
// within the current locale.
|
|
207
|
+
const date = this.TestDate(text);
|
|
208
|
+
if (false !== date && !isNaN(date)) {
|
|
209
|
+
// we can drop this bit, now (I think)
|
|
210
|
+
const check = new Date(date);
|
|
211
|
+
const year = check.getUTCFullYear();
|
|
212
|
+
if (year >= (this_year - 200) && year <= (this_year + 200)) {
|
|
213
|
+
hints = { Date: true };
|
|
214
|
+
if (check.getHours() || check.getMinutes() || check.getSeconds()) {
|
|
215
|
+
hints.Time = true;
|
|
216
|
+
}
|
|
217
|
+
return {
|
|
218
|
+
value: UnlotusDate(date, true),
|
|
219
|
+
type: ValueType.number,
|
|
220
|
+
hints,
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
return { value: text, type: ValueType.string };
|
|
225
|
+
}
|
|
226
|
+
if (parens) {
|
|
227
|
+
num = -num;
|
|
228
|
+
}
|
|
229
|
+
if (pct) {
|
|
230
|
+
// NOTE: this is an attempt to reduce fp errors that arise
|
|
231
|
+
// if you /100 (or if you /10 twice, which actually helps, but
|
|
232
|
+
// is not sufficient). there's probably a better way to do this...
|
|
233
|
+
const sign = num < 0 ? -1 : 1;
|
|
234
|
+
const split = (sign * num).toString().split('.');
|
|
235
|
+
split[0] = ('00' + split[0]).replace(/(\d\d)$/, '.$1');
|
|
236
|
+
num = Number(split.join('')) * sign;
|
|
237
|
+
}
|
|
238
|
+
if (/e/.test(text))
|
|
239
|
+
hints.Exponential = true;
|
|
240
|
+
return { value: num, type: ValueType.number, hints };
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
export const ValueParser = new ValueParserType();
|
|
244
|
+
//# sourceMappingURL=value_parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"value_parser.js","sourceRoot":"","sources":["../../../treb-format/src/value_parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAiDvC,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,cAAc,EAAE,CAAC;AAE9C;;GAEG;AACH,MAAM,eAAe;IAEZ,WAAW,CAA0B;IACrC,aAAa,CAA0B;IAEvC,QAAQ,CAAC,IAAY;QAE1B,2DAA2D;QAC3D,6DAA6D;QAC7D,wCAAwC;QAExC,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACpC,IAAI,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC;YACtB,mCAAmC;YACnC,OAAO,KAAK,CAAC;QACf,CAAC;QAED,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC;QAElC,kEAAkE;QAElE,6DAA6D;QAC7D,8DAA8D;QAC9D,2DAA2D;QAE3D,gEAAgE;QAEhE,2DAA2D;QAE3D,6DAA6D;QAC7D,kEAAkE;QAClE,kEAAkE;QAClE,4DAA4D;QAE5D,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,iBAAiB,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,EAAE,SAAS,CAAC,MAAM;wBACtB,KAAK;qBACN,CAAC;gBACJ,CAAC;YAEH,CAAC;YAED,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,CAAC;QACjD,CAAC;QAED,IAAI,MAAM,EAAE,CAAC;YAAC,GAAG,GAAG,CAAC,GAAG,CAAC;QAAC,CAAC;QAC3B,IAAI,GAAG,EAAE,CAAC;YAER,0DAA0D;YAC1D,8DAA8D;YAC9D,kEAAkE;YAElE,MAAM,IAAI,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC9B,MAAM,KAAK,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAEjD,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;YACvD,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC;QAEtC,CAAC;QAED,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;YAAE,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC;QAC7C,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC;IAEvD,CAAC;CAEF;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { Theme, Rectangle } from 'treb-base-types';
|
|
2
|
+
import type { AutocompleteExecResult, FunctionDescriptor } from './autocomplete_matcher';
|
|
3
|
+
export interface AutocompleteResult {
|
|
4
|
+
handled: boolean;
|
|
5
|
+
accept?: boolean;
|
|
6
|
+
data?: AutocompleteExecResult;
|
|
7
|
+
value?: string;
|
|
8
|
+
click?: boolean;
|
|
9
|
+
type?: FunctionDescriptor['type'];
|
|
10
|
+
}
|
|
11
|
+
export type AcceptCallback = (result: AutocompleteResult) => void;
|
|
12
|
+
export interface AutocompleteOptions {
|
|
13
|
+
autocomplete_prefer_top?: boolean;
|
|
14
|
+
tooltip_prefer_top?: boolean;
|
|
15
|
+
theme?: Theme;
|
|
16
|
+
container?: HTMLElement;
|
|
17
|
+
}
|
|
18
|
+
export declare class Autocomplete {
|
|
19
|
+
private options;
|
|
20
|
+
completion_list_visible: boolean;
|
|
21
|
+
tooltip_visible: boolean;
|
|
22
|
+
last_completion?: string;
|
|
23
|
+
private completion_list;
|
|
24
|
+
private tooltip;
|
|
25
|
+
private selected_index;
|
|
26
|
+
private block;
|
|
27
|
+
private autocomplete_data;
|
|
28
|
+
private callback?;
|
|
29
|
+
private active_element?;
|
|
30
|
+
private DOM;
|
|
31
|
+
constructor(options?: AutocompleteOptions);
|
|
32
|
+
Hide(): void;
|
|
33
|
+
SetBlock(): void;
|
|
34
|
+
ResetBlock(): void;
|
|
35
|
+
ListMouseMove(event: MouseEvent): void;
|
|
36
|
+
ListMouseDown(event: MouseEvent): void;
|
|
37
|
+
HandleKey(event_type: 'keydown' | 'keyup', event: KeyboardEvent): AutocompleteResult;
|
|
38
|
+
Show(callback: AcceptCallback, data: AutocompleteExecResult | undefined, position: Rectangle): void;
|
|
39
|
+
}
|