UNPKG

2.05 kBJavaScriptView Raw
1import Core from "./core.mjs";
2import { rootInstanceSymbol } from "./utils/rootInstance.mjs";
3import { metaSchemaFactory } from "./dataMap/index.mjs";
4import Hooks from "./pluginHooks.mjs"; // FIXME: Bug in eslint-plugin-import: https://github.com/benmosher/eslint-plugin-import/issues/1883
5/* eslint-disable import/named */
6import { dictionaryKeys, getTranslatedPhrase, registerLanguageDictionary, getLanguagesDictionaries, getLanguageDictionary } from "./i18n/registry.mjs";
7/* eslint-enable import/named */
8import { registerCellType } from "./cellTypes/registry.mjs";
9import { TextCellType } from "./cellTypes/textType/index.mjs";
10import { BaseEditor } from "./editors/baseEditor/index.mjs";
11import { CellCoords, CellRange } from "./3rdparty/walkontable/src/index.mjs"; // register default mandatory cell type for the Base package
12registerCellType(TextCellType);
13
14// export the `BaseEditor` class to the Handsontable global namespace
15Handsontable.editors = {
16 BaseEditor
17};
18
19/**
20 * @param {HTMLElement} rootElement The element to which the Handsontable instance is injected.
21 * @param {object} userSettings The user defined options.
22 * @returns {Core}
23 */
24function Handsontable(rootElement, userSettings) {
25 const instance = new Core(rootElement, userSettings || {}, rootInstanceSymbol);
26 instance.init();
27 return instance;
28}
29Handsontable.Core = function (rootElement) {
30 let userSettings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
31 return new Core(rootElement, userSettings, rootInstanceSymbol);
32};
33Handsontable.DefaultSettings = metaSchemaFactory();
34Handsontable.hooks = Hooks.getSingleton();
35Handsontable.CellCoords = CellCoords;
36Handsontable.CellRange = CellRange;
37Handsontable.packageName = 'handsontable';
38Handsontable.buildDate = "17/10/2024 09:16:16";
39Handsontable.version = "14.6.1";
40Handsontable.languages = {
41 dictionaryKeys,
42 getLanguageDictionary,
43 getLanguagesDictionaries,
44 registerLanguageDictionary,
45 getTranslatedPhrase
46};
47export { CellCoords, CellRange };
48export default Handsontable;
\No newline at end of file