jqtree 1.6.2 → 1.6.3
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/.eslintrc +3 -12
- package/.github/workflows/ci.yml +48 -23
- package/.github/workflows/codeql-analysis.yml +9 -5
- package/.prettier +3 -0
- package/README.md +11 -8
- package/bower.json +1 -1
- package/{.postcssrc → config/.postcssrc} +0 -0
- package/{babel.config.json → config/babel.config.json} +0 -0
- package/{babel.coverage.config.json → config/babel.coverage.config.json} +0 -0
- package/{jest-jsdom.config.js → config/jest.config.js} +8 -3
- package/config/playwright.config.js +18 -0
- package/config/production +4 -0
- package/{rollup.config.js → config/rollup.config.js} +3 -3
- package/{jqtree.postcss → css/jqtree.postcss} +0 -0
- package/devserver/index.html +1 -9
- package/docs/Gemfile +2 -0
- package/docs/Gemfile.lock +263 -0
- package/{_config.yml → docs/_config.yml} +8 -1
- package/{_entries → docs/_entries}/01_general.md +0 -0
- package/{_entries → docs/_entries}/02_introduction.md +0 -0
- package/{_entries → docs/_entries}/03_features.md +1 -1
- package/{_entries → docs/_entries}/04_demo.html +1 -7
- package/{_entries → docs/_entries}/05_requirements.md +0 -0
- package/{_entries → docs/_entries}/06_downloads.md +0 -0
- package/{_entries → docs/_entries}/07_tutorial.md +0 -0
- package/{_entries → docs/_entries}/08_examples.md +0 -0
- package/{_entries → docs/_entries}/09_usecases.md +0 -0
- package/{_entries → docs/_entries}/10_changelog.md +4 -0
- package/{_entries → docs/_entries}/11_options.md +0 -0
- package/{_entries → docs/_entries}/12_animationspeed.md +0 -0
- package/{_entries → docs/_entries}/13_autoescape.md +0 -0
- package/{_entries → docs/_entries}/14_autoopen.md +0 -0
- package/{_entries → docs/_entries}/15_buttonleft.md +0 -0
- package/{_entries → docs/_entries}/16_closedicon.md +0 -0
- package/{_entries → docs/_entries}/17_data.md +0 -0
- package/{_entries → docs/_entries}/18_datafilter.md +0 -0
- package/{_entries → docs/_entries}/19_data-url.md +0 -0
- package/{_entries → docs/_entries}/20_draganddrop.md +0 -0
- package/{_entries → docs/_entries}/21_keyboardsupport.md +0 -0
- package/{_entries → docs/_entries}/22_oncanmove.md +0 -0
- package/{_entries → docs/_entries}/23_oncanmoveto.md +2 -2
- package/{_entries → docs/_entries}/24_oncanselectnode.md +0 -0
- package/{_entries → docs/_entries}/25_oncreateli.md +2 -2
- package/{_entries → docs/_entries}/26_ondragmove.md +0 -0
- package/{_entries → docs/_entries}/27_ondragstop.md +0 -0
- package/{_entries → docs/_entries}/28_onismovehandle.md +0 -0
- package/{_entries → docs/_entries}/29_onloadfailed.md +0 -0
- package/{_entries → docs/_entries}/30_onloading.md +2 -2
- package/{_entries → docs/_entries}/31_openedicon.md +0 -0
- package/{_entries → docs/_entries}/32_openfolderdelay.md +2 -0
- package/{_entries → docs/_entries}/33_rtl.md +0 -0
- package/{_entries → docs/_entries}/34_savestate.md +0 -0
- package/{_entries → docs/_entries}/35_selectable.md +0 -0
- package/{_entries → docs/_entries}/36_showemptyfolder.md +0 -0
- package/{_entries → docs/_entries}/37_slide.md +0 -0
- package/{_entries → docs/_entries}/38_start_dnd_delay.md +0 -0
- package/{_entries → docs/_entries}/39_tabindex.md +0 -0
- package/{_entries → docs/_entries}/40_usecontextmenu.md +0 -0
- package/{_entries → docs/_entries}/41_functions.md +0 -0
- package/{_entries → docs/_entries}/42_addparentnode.md +1 -1
- package/{_entries → docs/_entries}/43_addnodeafter.md +1 -1
- package/{_entries → docs/_entries}/44_addnodebefore.md +1 -1
- package/{_entries → docs/_entries}/45_appendnode.md +5 -5
- package/{_entries → docs/_entries}/46_closenode.md +0 -0
- package/{_entries → docs/_entries}/47_destroy.md +0 -0
- package/{_entries → docs/_entries}/48_getnodebycallback.md +0 -0
- package/{_entries → docs/_entries}/49_getnodebyid.md +0 -0
- package/{_entries → docs/_entries}/50_getnodebyhtmlelement.md +2 -2
- package/{_entries → docs/_entries}/51_getselectednode.md +0 -0
- package/{_entries → docs/_entries}/52_getstate.md +0 -0
- package/{_entries → docs/_entries}/53_gettree.md +1 -1
- package/{_entries → docs/_entries}/54_isdragging.md +1 -1
- package/{_entries → docs/_entries}/55_loaddata.md +3 -3
- package/{_entries → docs/_entries}/56_loaddatafromurl.md +4 -4
- package/{_entries → docs/_entries}/57_movedown.md +0 -0
- package/{_entries → docs/_entries}/58_movenode.md +3 -3
- package/{_entries → docs/_entries}/59_moveup.md +0 -0
- package/{_entries → docs/_entries}/60_opennode.md +3 -3
- package/docs/_entries/61_prependnode.md +21 -0
- package/{_entries → docs/_entries}/62_refresh.md +0 -0
- package/{_entries → docs/_entries}/63_reload.md +2 -2
- package/{_entries → docs/_entries}/64_removenode.md +0 -0
- package/{_entries → docs/_entries}/65_selectnode.md +0 -0
- package/{_entries → docs/_entries}/66_scrolltonode.md +0 -0
- package/{_entries → docs/_entries}/67_setoption.md +0 -0
- package/{_entries → docs/_entries}/68_setstate.md +0 -0
- package/{_entries → docs/_entries}/69_toggle.md +0 -0
- package/{_entries → docs/_entries}/70_tojson.md +0 -0
- package/{_entries → docs/_entries}/71_updatenode.md +1 -1
- package/{_entries → docs/_entries}/72_events.md +0 -0
- package/{_entries → docs/_entries}/73_tree-click.md +0 -0
- package/{_entries → docs/_entries}/74_tree-close.md +0 -0
- package/{_entries → docs/_entries}/75_tree-contextmenu.md +0 -0
- package/{_entries → docs/_entries}/76_tree-dblclick.md +0 -0
- package/{_entries → docs/_entries}/77_tree-init.md +0 -0
- package/{_entries → docs/_entries}/78_tree-load-data.md +0 -0
- package/{_entries → docs/_entries}/79_tree-loading-data.md +0 -0
- package/{_entries → docs/_entries}/80_tree-move.md +0 -0
- package/{_entries → docs/_entries}/81_tree-refresh.md +0 -0
- package/{_entries → docs/_entries}/82_tree-open.md +0 -0
- package/{_entries → docs/_entries}/83_tree-select.md +0 -0
- package/{_entries → docs/_entries}/84_multiple-selection.md +0 -0
- package/{_entries → docs/_entries}/85_add-to-selection.md +0 -0
- package/{_entries → docs/_entries}/86_get-selected-nodes.md +0 -0
- package/{_entries → docs/_entries}/87_is-node-selected.md +1 -1
- package/{_entries → docs/_entries}/88_remove-from-selection.md +0 -0
- package/{_entries → docs/_entries}/89_node-functions.md +0 -0
- package/{_entries → docs/_entries}/90_children.md +0 -0
- package/{_entries → docs/_entries}/91_getdata.md +2 -2
- package/{_entries → docs/_entries}/92_getlevel.md +0 -0
- package/{_entries → docs/_entries}/93_getnextnode.md +0 -0
- package/{_entries → docs/_entries}/94_getnextsibling.md +0 -0
- package/{_entries → docs/_entries}/95_getpreviousnode.md +0 -0
- package/{_entries → docs/_entries}/96_getprevioussibling.md +0 -0
- package/{_entries → docs/_entries}/97_parent.md +1 -1
- package/{_entries → docs/_entries}/insert.py +0 -0
- package/{_entries → docs/_entries}/renumber.py +0 -0
- package/{_examples → docs/_examples}/01_load_json_data.html +3 -5
- package/{_examples → docs/_examples}/02_load_json_data_from_server.html +3 -5
- package/{_examples → docs/_examples}/03_drag_and_drop.html +3 -5
- package/{_examples → docs/_examples}/04_save_state.html +3 -5
- package/{_examples → docs/_examples}/05_load_on_demand.html +3 -5
- package/{_examples → docs/_examples}/06_autoescape.html +3 -5
- package/{_examples → docs/_examples}/07_autoscroll.html +3 -5
- package/{_examples → docs/_examples}/08_multiple_select.html +3 -5
- package/{_examples → docs/_examples}/09_custom_html.html +3 -5
- package/{_examples → docs/_examples}/10_icon_buttons.html +3 -5
- package/{_examples → docs/_examples}/11_right-to-left.html +3 -5
- package/{_examples → docs/_examples}/12_button_on_right.html +3 -5
- package/docs/_examples/13_drag_outside.html +48 -0
- package/{_examples → docs/_examples}/14_filter.html +7 -9
- package/docs/_layouts/example.html +7 -0
- package/{_layouts/base.html → docs/_layouts/page.html} +4 -11
- package/docs/documentation.css +3 -0
- package/docs/index.html +65 -0
- package/docs/jqtree.css +189 -0
- package/docs/package.json +22 -0
- package/docs/pnpm-lock.yaml +768 -0
- package/docs/postcss.config.js +7 -0
- package/{static → docs/static}/bower.json +0 -1
- package/{static → docs/static}/bower_components/fontawesome/css/all.min.css +0 -0
- package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-brands-400.eot +0 -0
- package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-brands-400.svg +0 -0
- package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-brands-400.ttf +0 -0
- package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-brands-400.woff +0 -0
- package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-brands-400.woff2 +0 -0
- package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-regular-400.eot +0 -0
- package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-regular-400.svg +0 -0
- package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-regular-400.ttf +0 -0
- package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-regular-400.woff +0 -0
- package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-regular-400.woff2 +0 -0
- package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-solid-900.eot +0 -0
- package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-solid-900.svg +0 -0
- package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-solid-900.ttf +0 -0
- package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-solid-900.woff +0 -0
- package/{static → docs/static}/bower_components/fontawesome/webfonts/fa-solid-900.woff2 +0 -0
- package/{static → docs/static}/bower_components/jquery/dist/jquery.js +0 -0
- package/{static → docs/static}/bower_components/jquery/dist/jquery.min.js +0 -0
- package/{static → docs/static}/bower_components/jquery-mockjax/dist/jquery.mockjax.js +0 -0
- package/docs/static/documentation.css +1313 -0
- package/docs/static/documentation.js +26 -0
- package/{static → docs/static}/example.css +5 -37
- package/{static → docs/static}/example.postcss +5 -35
- package/{static → docs/static}/example_data.js +0 -0
- package/{static → docs/static}/examples/autoescape.js +0 -0
- package/{static → docs/static}/examples/autoscroll.js +0 -0
- package/{static → docs/static}/examples/button-on-right.js +0 -0
- package/{static → docs/static}/examples/custom_html.js +5 -9
- package/{static → docs/static}/examples/drag-outside.js +0 -0
- package/{static → docs/static}/examples/drag_and_drop.js +0 -0
- package/{static → docs/static}/examples/filter.js +2 -2
- package/{static → docs/static}/examples/icon_buttons.js +0 -0
- package/{static → docs/static}/examples/load_json_data.js +0 -0
- package/{static → docs/static}/examples/load_json_data_from_server.js +0 -0
- package/{static → docs/static}/examples/load_on_demand.js +0 -0
- package/{static → docs/static}/examples/multiple_select.js +0 -0
- package/{static → docs/static}/examples/right-to-left.js +0 -0
- package/{static → docs/static}/examples/save_state.js +0 -0
- package/{static → docs/static}/monokai.css +0 -0
- package/{static → docs/static}/spinner.gif +0 -0
- package/docs/tailwind.config.js +16 -0
- package/docs/tree.jquery.js +21 -0
- package/lib/dragAndDropHandler.js +8 -4
- package/lib/mouse.widget.js +3 -3
- package/lib/nodeElement.js +3 -3
- package/lib/playwright/coverage.js +140 -0
- package/lib/playwright/playwright.test.js +293 -201
- package/lib/playwright/testUtils.js +267 -0
- package/lib/test/jqTree/events.test.js +10 -9
- package/lib/test/jqTree/loadOnDemand.test.js +26 -21
- package/lib/test/jqTree/methods.test.js +84 -64
- package/lib/test/jqTree/options.test.js +41 -29
- package/lib/tree.jquery.js +4 -4
- package/package.json +48 -49
- package/src/dragAndDropHandler.ts +8 -4
- package/src/jqtreeOptions.ts +1 -1
- package/src/playwright/.eslintrc +2 -2
- package/src/playwright/coverage.ts +41 -0
- package/src/playwright/playwright.test.ts +50 -52
- package/src/playwright/playwright.test.ts-snapshots/with-dragAndDrop-moves-a-node-1-Chromium-darwin.png +0 -0
- package/src/playwright/playwright.test.ts-snapshots/with-dragAndDrop-moves-a-node-1-Chromium-linux.png +0 -0
- package/src/playwright/playwright.test.ts-snapshots/without-dragAndDrop-displays-a-tree-1-Chromium-darwin.png +0 -0
- package/src/playwright/playwright.test.ts-snapshots/without-dragAndDrop-displays-a-tree-1-Chromium-linux.png +0 -0
- package/src/playwright/playwright.test.ts-snapshots/without-dragAndDrop-selects-a-node-1-Chromium-darwin.png +0 -0
- package/src/playwright/playwright.test.ts-snapshots/without-dragAndDrop-selects-a-node-1-Chromium-linux.png +0 -0
- package/src/playwright/testUtils.ts +122 -0
- package/src/test/.eslintrc +13 -3
- package/src/test/jqTree/events.test.ts +10 -9
- package/src/test/jqTree/loadOnDemand.test.ts +10 -10
- package/src/test/jqTree/methods.test.ts +37 -45
- package/src/test/jqTree/options.test.ts +26 -28
- package/src/tree.jquery.d.ts +1 -1
- package/tree.jquery.debug.js +17 -14
- package/tree.jquery.debug.js.map +1 -1
- package/tree.jquery.js +3 -3
- package/tree.jquery.js.map +1 -1
- package/_entries/61_prependnode.md +0 -21
- package/_examples/13_drag_outside.html +0 -26
- package/_layouts/frontpage.html +0 -20
- package/_layouts/page.html +0 -7
- package/index.html +0 -48
- package/jest-browser.config.js +0 -15
- package/jest-playwright.config.js +0 -21
- package/jest.config.js +0 -8
- package/lib/playwright/testUtil.js +0 -459
- package/lib/playwright/visualRegression.js +0 -193
- package/production +0 -5
- package/src/playwright/screenshots/displays_a_tree_Desktop.png +0 -0
- package/src/playwright/screenshots/displays_a_tree_iPhone 6.png +0 -0
- package/src/playwright/screenshots/moves_a_node_Desktop.png +0 -0
- package/src/playwright/screenshots/moves_a_node_iPhone 6.png +0 -0
- package/src/playwright/screenshots/opens_a_node_Desktop.png +0 -0
- package/src/playwright/screenshots/opens_a_node_iPhone 6.png +0 -0
- package/src/playwright/screenshots/selects_a_node_Desktop.png +0 -0
- package/src/playwright/screenshots/selects_a_node_iPhone 6.png +0 -0
- package/src/playwright/testUtil.ts +0 -170
- package/src/playwright/visualRegression.ts +0 -88
- package/static/bower_components/bootstrap/dist/css/bootstrap-theme.min.css +0 -6
- package/static/bower_components/bootstrap/dist/css/bootstrap.min.css +0 -6
- package/static/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.eot +0 -0
- package/static/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.svg +0 -288
- package/static/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf +0 -0
- package/static/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.woff +0 -0
- package/static/bower_components/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2 +0 -0
- package/static/bower_components/bootstrap/dist/js/bootstrap.min.js +0 -6
- package/static/documentation.css +0 -171
- package/static/documentation.js +0 -48
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
3
5
|
var _givens = _interopRequireDefault(require("givens"));
|
|
4
6
|
|
|
5
7
|
var _dom = require("@testing-library/dom");
|
|
@@ -18,20 +20,30 @@ var _version = _interopRequireDefault(require("../../version"));
|
|
|
18
20
|
|
|
19
21
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
20
22
|
|
|
23
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
24
|
+
|
|
21
25
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
22
26
|
|
|
23
27
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
24
28
|
|
|
25
29
|
var context = describe;
|
|
30
|
+
var server = (0, _node.setupServer)();
|
|
31
|
+
beforeAll(function () {
|
|
32
|
+
return server.listen();
|
|
33
|
+
});
|
|
26
34
|
beforeEach(function () {
|
|
27
35
|
$("body").append('<div id="tree1"></div>');
|
|
28
36
|
});
|
|
29
37
|
afterEach(function () {
|
|
38
|
+
server.resetHandlers();
|
|
30
39
|
var $tree = $("#tree1");
|
|
31
40
|
$tree.tree("destroy");
|
|
32
41
|
$tree.remove();
|
|
33
42
|
localStorage.clear();
|
|
34
43
|
});
|
|
44
|
+
afterAll(function () {
|
|
45
|
+
return server.close();
|
|
46
|
+
});
|
|
35
47
|
describe("addNodeAfter", function () {
|
|
36
48
|
var given = (0, _givens["default"])();
|
|
37
49
|
given("$tree", function () {
|
|
@@ -640,26 +652,17 @@ describe("loadDataFromUrl", function () {
|
|
|
640
652
|
given("$tree", function () {
|
|
641
653
|
return $("#tree1");
|
|
642
654
|
});
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
server = (0, _node.setupServer)(_msw.rest.get("/tree/", function (_request, response, ctx) {
|
|
655
|
+
beforeEach(function () {
|
|
656
|
+
server.use(_msw.rest.get("/tree/", function (_request, response, ctx) {
|
|
646
657
|
return response(ctx.status(200), ctx.json(given.serverData));
|
|
647
658
|
}));
|
|
648
|
-
server.listen();
|
|
649
|
-
});
|
|
650
|
-
afterAll(function () {
|
|
651
|
-
var _server;
|
|
652
|
-
|
|
653
|
-
(_server = server) === null || _server === void 0 ? void 0 : _server.close();
|
|
654
|
-
});
|
|
655
|
-
beforeEach(function () {
|
|
656
659
|
given.$tree.tree({
|
|
657
660
|
data: given.initialData
|
|
658
661
|
});
|
|
659
662
|
});
|
|
660
663
|
context("with url parameter", function () {
|
|
661
|
-
it("loads the tree", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/
|
|
662
|
-
return
|
|
664
|
+
it("loads the tree", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
665
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
663
666
|
while (1) {
|
|
664
667
|
switch (_context.prev = _context.next) {
|
|
665
668
|
case 0:
|
|
@@ -688,9 +691,9 @@ describe("loadDataFromUrl", function () {
|
|
|
688
691
|
given("serverData", function () {
|
|
689
692
|
return ["new1", "new2"];
|
|
690
693
|
});
|
|
691
|
-
it("loads a subtree", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/
|
|
694
|
+
it("loads a subtree", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
692
695
|
var parentNode;
|
|
693
|
-
return
|
|
696
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
694
697
|
while (1) {
|
|
695
698
|
switch (_context2.prev = _context2.next) {
|
|
696
699
|
case 0:
|
|
@@ -721,8 +724,8 @@ describe("loadDataFromUrl", function () {
|
|
|
721
724
|
});
|
|
722
725
|
});
|
|
723
726
|
context("without url parameter", function () {
|
|
724
|
-
it("loads the data from dataUrl", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/
|
|
725
|
-
return
|
|
727
|
+
it("loads the data from dataUrl", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
728
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
726
729
|
while (1) {
|
|
727
730
|
switch (_context3.prev = _context3.next) {
|
|
728
731
|
case 0:
|
|
@@ -839,13 +842,26 @@ describe("openNode", function () {
|
|
|
839
842
|
expect(given.node1.element).toBeOpen();
|
|
840
843
|
});
|
|
841
844
|
context("with onFinished parameter", function () {
|
|
842
|
-
it("calls the function", function () {
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
845
|
+
it("calls the function", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
846
|
+
var onFinished;
|
|
847
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
848
|
+
while (1) {
|
|
849
|
+
switch (_context4.prev = _context4.next) {
|
|
850
|
+
case 0:
|
|
851
|
+
onFinished = jest.fn();
|
|
852
|
+
given.$tree.tree("openNode", given.node1, onFinished);
|
|
853
|
+
_context4.next = 4;
|
|
854
|
+
return (0, _dom.waitFor)(function () {
|
|
855
|
+
expect(onFinished).toHaveBeenCalledWith(given.node1);
|
|
856
|
+
});
|
|
857
|
+
|
|
858
|
+
case 4:
|
|
859
|
+
case "end":
|
|
860
|
+
return _context4.stop();
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
}, _callee4);
|
|
864
|
+
})));
|
|
849
865
|
});
|
|
850
866
|
});
|
|
851
867
|
describe("prependNode", function () {
|
|
@@ -927,49 +943,40 @@ describe("reload", function () {
|
|
|
927
943
|
given("$tree", function () {
|
|
928
944
|
return $("#tree1");
|
|
929
945
|
});
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
server = (0, _node.setupServer)(_msw.rest.get("/tree/", function (_request, response, ctx) {
|
|
933
|
-
return response(ctx.status(200), ctx.json(_exampleData["default"]));
|
|
934
|
-
}));
|
|
935
|
-
server.listen();
|
|
936
|
-
});
|
|
937
|
-
afterAll(function () {
|
|
938
|
-
var _server2;
|
|
939
|
-
|
|
940
|
-
(_server2 = server) === null || _server2 === void 0 ? void 0 : _server2.close();
|
|
941
|
-
});
|
|
942
|
-
beforeEach( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4() {
|
|
943
|
-
return regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
946
|
+
beforeEach( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
947
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
944
948
|
while (1) {
|
|
945
|
-
switch (
|
|
949
|
+
switch (_context5.prev = _context5.next) {
|
|
946
950
|
case 0:
|
|
951
|
+
server.use(_msw.rest.get("/tree2/", function (_request, response, ctx) {
|
|
952
|
+
return response(ctx.status(200), ctx.json(_exampleData["default"]));
|
|
953
|
+
}));
|
|
947
954
|
given.$tree.tree({
|
|
948
|
-
dataUrl: "/
|
|
955
|
+
dataUrl: "/tree2/"
|
|
949
956
|
});
|
|
950
|
-
|
|
957
|
+
_context5.next = 4;
|
|
951
958
|
return _dom.screen.findByText("node1");
|
|
952
959
|
|
|
953
|
-
case
|
|
960
|
+
case 4:
|
|
954
961
|
given.$tree.tree("removeNode", given.node1);
|
|
955
962
|
|
|
956
|
-
case
|
|
963
|
+
case 5:
|
|
957
964
|
case "end":
|
|
958
|
-
return
|
|
965
|
+
return _context5.stop();
|
|
959
966
|
}
|
|
960
967
|
}
|
|
961
|
-
},
|
|
968
|
+
}, _callee5);
|
|
962
969
|
})));
|
|
963
|
-
it("reloads the data from the server", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/
|
|
964
|
-
return
|
|
970
|
+
it("reloads the data from the server", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
971
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
965
972
|
while (1) {
|
|
966
|
-
switch (
|
|
973
|
+
switch (_context6.prev = _context6.next) {
|
|
967
974
|
case 0:
|
|
968
975
|
expect(given.$tree).toHaveTreeStructure([expect.objectContaining({
|
|
969
976
|
name: "node2"
|
|
970
977
|
})]);
|
|
971
978
|
given.$tree.tree("reload");
|
|
972
|
-
|
|
979
|
+
_context6.next = 4;
|
|
973
980
|
return _dom.screen.findByText("node1");
|
|
974
981
|
|
|
975
982
|
case 4:
|
|
@@ -981,26 +988,39 @@ describe("reload", function () {
|
|
|
981
988
|
|
|
982
989
|
case 5:
|
|
983
990
|
case "end":
|
|
984
|
-
return
|
|
991
|
+
return _context6.stop();
|
|
985
992
|
}
|
|
986
993
|
}
|
|
987
|
-
},
|
|
994
|
+
}, _callee6);
|
|
988
995
|
})));
|
|
989
996
|
context("with a onFinished parameter", function () {
|
|
990
|
-
it("calls onFinished", function () {
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
997
|
+
it("calls onFinished", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
|
|
998
|
+
var handleFinished;
|
|
999
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
1000
|
+
while (1) {
|
|
1001
|
+
switch (_context7.prev = _context7.next) {
|
|
1002
|
+
case 0:
|
|
1003
|
+
handleFinished = jest.fn();
|
|
1004
|
+
given.$tree.tree("reload", handleFinished);
|
|
1005
|
+
_context7.next = 4;
|
|
1006
|
+
return (0, _dom.waitFor)(function () {
|
|
1007
|
+
return expect(handleFinished).toHaveBeenCalledWith();
|
|
1008
|
+
});
|
|
1000
1009
|
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1010
|
+
case 4:
|
|
1011
|
+
expect(given.$tree).toHaveTreeStructure([expect.objectContaining({
|
|
1012
|
+
name: "node1"
|
|
1013
|
+
}), expect.objectContaining({
|
|
1014
|
+
name: "node2"
|
|
1015
|
+
})]);
|
|
1016
|
+
|
|
1017
|
+
case 5:
|
|
1018
|
+
case "end":
|
|
1019
|
+
return _context7.stop();
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
}, _callee7);
|
|
1023
|
+
})));
|
|
1004
1024
|
});
|
|
1005
1025
|
});
|
|
1006
1026
|
describe("removeNode", function () {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
3
5
|
var _givens = _interopRequireDefault(require("givens"));
|
|
4
6
|
|
|
5
7
|
var _dom = require("@testing-library/dom");
|
|
@@ -16,20 +18,30 @@ var _testUtil = require("../support/testUtil");
|
|
|
16
18
|
|
|
17
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
18
20
|
|
|
21
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
22
|
+
|
|
19
23
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
20
24
|
|
|
21
25
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
22
26
|
|
|
23
27
|
var context = describe;
|
|
28
|
+
var server = (0, _node.setupServer)();
|
|
29
|
+
beforeAll(function () {
|
|
30
|
+
return server.listen();
|
|
31
|
+
});
|
|
24
32
|
beforeEach(function () {
|
|
25
33
|
$("body").append('<div id="tree1"></div>');
|
|
26
34
|
});
|
|
27
35
|
afterEach(function () {
|
|
36
|
+
server.resetHandlers();
|
|
28
37
|
var $tree = $("#tree1");
|
|
29
38
|
$tree.tree("destroy");
|
|
30
39
|
$tree.remove();
|
|
31
40
|
localStorage.clear();
|
|
32
41
|
});
|
|
42
|
+
afterAll(function () {
|
|
43
|
+
return server.close();
|
|
44
|
+
});
|
|
33
45
|
describe("autoEscape", function () {
|
|
34
46
|
var given = (0, _givens["default"])();
|
|
35
47
|
given("$tree", function () {
|
|
@@ -193,19 +205,12 @@ describe("dataUrl", function () {
|
|
|
193
205
|
expectedNode: "node1",
|
|
194
206
|
expectedStructure: exampleStructure
|
|
195
207
|
}];
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
server = (0, _node.setupServer)(_msw.rest.get("/tree/", function (request, response, ctx) {
|
|
208
|
+
beforeEach(function () {
|
|
209
|
+
server.use(_msw.rest.get("/tree/", function (request, response, ctx) {
|
|
199
210
|
var nodeName = request.headers.get("node");
|
|
200
211
|
var data = nodeName ? [nodeName] : _exampleData["default"];
|
|
201
212
|
return response(ctx.status(200), ctx.json(data));
|
|
202
213
|
}));
|
|
203
|
-
server.listen();
|
|
204
|
-
});
|
|
205
|
-
afterAll(function () {
|
|
206
|
-
var _server;
|
|
207
|
-
|
|
208
|
-
(_server = server) === null || _server === void 0 ? void 0 : _server.close();
|
|
209
214
|
});
|
|
210
215
|
var given = (0, _givens["default"])();
|
|
211
216
|
given("$tree", function () {
|
|
@@ -217,8 +222,8 @@ describe("dataUrl", function () {
|
|
|
217
222
|
expectedStructure = _ref.expectedStructure,
|
|
218
223
|
name = _ref.name;
|
|
219
224
|
context("with ".concat(name), function () {
|
|
220
|
-
it("loads the data from the url", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/
|
|
221
|
-
return
|
|
225
|
+
it("loads the data from the url", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
226
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
222
227
|
while (1) {
|
|
223
228
|
switch (_context.prev = _context.next) {
|
|
224
229
|
case 0:
|
|
@@ -351,29 +356,36 @@ describe("onLoadFailed", function () {
|
|
|
351
356
|
return $("#tree1");
|
|
352
357
|
});
|
|
353
358
|
context("when the loading fails", function () {
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
server = (0, _node.setupServer)(_msw.rest.get("/tree/", function (_request, response, ctx) {
|
|
359
|
+
beforeEach(function () {
|
|
360
|
+
server.use(_msw.rest.get("/tree/", function (_request, response, ctx) {
|
|
357
361
|
return response(ctx.status(500), ctx.body("Internal server error"));
|
|
358
362
|
}));
|
|
359
|
-
server.listen();
|
|
360
363
|
});
|
|
361
|
-
|
|
362
|
-
var
|
|
364
|
+
it("calls onLoadFailed", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
365
|
+
var onLoadFailed;
|
|
366
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
367
|
+
while (1) {
|
|
368
|
+
switch (_context2.prev = _context2.next) {
|
|
369
|
+
case 0:
|
|
370
|
+
onLoadFailed = jest.fn();
|
|
371
|
+
given.$tree.tree({
|
|
372
|
+
dataUrl: "/tree/",
|
|
373
|
+
onLoadFailed: onLoadFailed
|
|
374
|
+
});
|
|
375
|
+
_context2.next = 4;
|
|
376
|
+
return (0, _dom.waitFor)(function () {
|
|
377
|
+
expect(onLoadFailed).toHaveBeenCalledWith(expect.objectContaining({
|
|
378
|
+
status: 500
|
|
379
|
+
}));
|
|
380
|
+
});
|
|
363
381
|
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
return new Promise(function (done) {
|
|
368
|
-
given.$tree.tree({
|
|
369
|
-
dataUrl: "/tree/",
|
|
370
|
-
onLoadFailed: function onLoadFailed(jqXHR) {
|
|
371
|
-
expect(jqXHR.status).toBe(500);
|
|
372
|
-
done();
|
|
382
|
+
case 4:
|
|
383
|
+
case "end":
|
|
384
|
+
return _context2.stop();
|
|
373
385
|
}
|
|
374
|
-
}
|
|
375
|
-
});
|
|
376
|
-
});
|
|
386
|
+
}
|
|
387
|
+
}, _callee2);
|
|
388
|
+
})));
|
|
377
389
|
});
|
|
378
390
|
});
|
|
379
391
|
describe("rtl", function () {
|
package/lib/tree.jquery.js
CHANGED
|
@@ -59,13 +59,13 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
|
59
59
|
|
|
60
60
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
61
61
|
|
|
62
|
-
function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
|
|
62
|
+
function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
|
|
63
63
|
|
|
64
64
|
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
|
|
65
65
|
|
|
66
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); }
|
|
66
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
67
67
|
|
|
68
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf
|
|
68
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
69
69
|
|
|
70
70
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
71
71
|
|
|
@@ -75,7 +75,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
|
75
75
|
|
|
76
76
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
77
77
|
|
|
78
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
78
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
79
79
|
|
|
80
80
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
81
81
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jqtree",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.3",
|
|
4
4
|
"description": "Tree widget for jQuery",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jquery-plugin",
|
|
@@ -14,69 +14,68 @@
|
|
|
14
14
|
"url": "https://github.com/mbraak/jqtree"
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
|
-
"ci": "pnpm
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"test-watch": "jest --watch",
|
|
17
|
+
"ci": "pnpm lint && pnpm tsc && pnpm test",
|
|
18
|
+
"jest": "jest --coverage --no-cache --verbose --config ./config/jest.config.js",
|
|
19
|
+
"jest-watch": "jest --watch",
|
|
21
20
|
"lint": "eslint src/ --ext .ts,.tsx",
|
|
22
|
-
"production": "./production",
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"prettier": "prettier src/*.ts src_test/*.ts --write --tab-width 4",
|
|
21
|
+
"production": "./config/production",
|
|
22
|
+
"devserver": "SERVE=true rollup --config config/rollup.config.js --watch",
|
|
23
|
+
"devserver-with-coverage": "COVERAGE=true SERVE=true rollup --config config/rollup.config.js",
|
|
24
|
+
"build-with-coverage": "COVERAGE=true rollup --config config/rollup.config.js",
|
|
25
|
+
"prettier": "prettier src/*.ts --write --tab-width 4",
|
|
28
26
|
"coveralls": "nyc report --reporter=text-lcov | coveralls",
|
|
29
27
|
"tsc": "tsc --noEmit --project tsconfig.json",
|
|
30
28
|
"merge-coverage": "cp jest-coverage/coverage-final.json .nyc_output/coverage_jsdom.json",
|
|
31
|
-
"clean-coverage": "rm -rf
|
|
32
|
-
"print-coverage": "nyc report"
|
|
29
|
+
"clean-coverage": "rm -rf .nyc_output && jest --clearCache",
|
|
30
|
+
"print-coverage": "nyc report",
|
|
31
|
+
"playwright": "pnpm build-with-coverage && playwright test --config config/playwright.config.js",
|
|
32
|
+
"test": "pnpm jest && pnpm playwright"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"jquery": "^3.6.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@babel/cli": "^7.
|
|
39
|
-
"@babel/core": "^7.
|
|
40
|
-
"@babel/preset-env": "^7.
|
|
41
|
-
"@babel/preset-typescript": "^7.
|
|
42
|
-
"@
|
|
43
|
-
"@rollup/plugin-
|
|
44
|
-
"@
|
|
45
|
-
"@
|
|
46
|
-
"@types/
|
|
47
|
-
"@types/
|
|
48
|
-
"@
|
|
49
|
-
"@typescript-eslint/
|
|
50
|
-
"
|
|
51
|
-
"
|
|
38
|
+
"@babel/cli": "^7.18.10",
|
|
39
|
+
"@babel/core": "^7.18.10",
|
|
40
|
+
"@babel/preset-env": "^7.18.10",
|
|
41
|
+
"@babel/preset-typescript": "^7.18.6",
|
|
42
|
+
"@playwright/test": "^1.24.2",
|
|
43
|
+
"@rollup/plugin-babel": "^5.3.1",
|
|
44
|
+
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
45
|
+
"@testing-library/dom": "^8.16.1",
|
|
46
|
+
"@types/debug": "^4.1.7",
|
|
47
|
+
"@types/jest": "^28.1.6",
|
|
48
|
+
"@types/jquery": "^3.5.14",
|
|
49
|
+
"@typescript-eslint/eslint-plugin": "^5.32.0",
|
|
50
|
+
"@typescript-eslint/parser": "^5.32.0",
|
|
51
|
+
"autoprefixer": "^10.4.8",
|
|
52
|
+
"babel-jest": "^28.1.3",
|
|
52
53
|
"babel-plugin-istanbul": "^6.1.1",
|
|
53
54
|
"coveralls": "^3.1.1",
|
|
54
|
-
"eslint": "^8.
|
|
55
|
-
"eslint-plugin-import": "^2.
|
|
56
|
-
"eslint-plugin-jest": "^
|
|
57
|
-
"eslint-plugin-playwright": "^0.
|
|
58
|
-
"eslint-plugin-testing-library": "^5.0
|
|
59
|
-
"expect-playwright": "^0.8.0",
|
|
55
|
+
"eslint": "^8.21.0",
|
|
56
|
+
"eslint-plugin-import": "^2.26.0",
|
|
57
|
+
"eslint-plugin-jest": "^26.7.0",
|
|
58
|
+
"eslint-plugin-playwright": "^0.10.0",
|
|
59
|
+
"eslint-plugin-testing-library": "^5.6.0",
|
|
60
60
|
"givens": "^1.3.9",
|
|
61
|
-
"jest": "^
|
|
62
|
-
"jest-
|
|
63
|
-
"jest-
|
|
61
|
+
"jest": "^28.1.3",
|
|
62
|
+
"jest-environment-jsdom": "^28.1.3",
|
|
63
|
+
"jest-extended": "^3.0.2",
|
|
64
64
|
"jsonfile": "^6.1.0",
|
|
65
65
|
"lodash.template": "^4.5.0",
|
|
66
|
-
"msw": "^0.
|
|
67
|
-
"
|
|
68
|
-
"playwright": "^1.
|
|
69
|
-
"
|
|
70
|
-
"postcss": "^
|
|
71
|
-
"postcss-
|
|
72
|
-
"postcss-load-config": "^
|
|
66
|
+
"msw": "^0.44.2",
|
|
67
|
+
"nyc": "^15.1.0",
|
|
68
|
+
"playwright": "^1.24.2",
|
|
69
|
+
"postcss": "^8.4.16",
|
|
70
|
+
"postcss-cli": "^10.0.0",
|
|
71
|
+
"postcss-import": "^14.1.0",
|
|
72
|
+
"postcss-load-config": "^4.0.1",
|
|
73
73
|
"postcss-nested": "^5.0.6",
|
|
74
|
-
"prettier": "^2.
|
|
75
|
-
"rollup": "^2.
|
|
76
|
-
"rollup-plugin-serve": "^
|
|
74
|
+
"prettier": "^2.7.1",
|
|
75
|
+
"rollup": "^2.77.2",
|
|
76
|
+
"rollup-plugin-serve": "^2.0.0",
|
|
77
77
|
"rollup-plugin-terser": "^7.0.2",
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"typescript": "^4.5.4"
|
|
78
|
+
"tslib": "^2.4.0",
|
|
79
|
+
"typescript": "^4.7.4"
|
|
81
80
|
}
|
|
82
81
|
}
|
|
@@ -312,10 +312,14 @@ export class DragAndDropHandler {
|
|
|
312
312
|
|
|
313
313
|
this.stopOpenFolderTimer();
|
|
314
314
|
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
315
|
+
const openFolderDelay = this.treeWidget.options.openFolderDelay;
|
|
316
|
+
|
|
317
|
+
if (openFolderDelay !== false) {
|
|
318
|
+
this.openFolderTimer = window.setTimeout(
|
|
319
|
+
openFolder,
|
|
320
|
+
openFolderDelay
|
|
321
|
+
);
|
|
322
|
+
}
|
|
319
323
|
}
|
|
320
324
|
|
|
321
325
|
private stopOpenFolderTimer(): void {
|
package/src/jqtreeOptions.ts
CHANGED
|
@@ -40,7 +40,7 @@ export interface JQTreeOptions {
|
|
|
40
40
|
onLoading: HandleLoadingMethod | undefined;
|
|
41
41
|
onSetStateFromStorage: ((data: string) => void) | undefined;
|
|
42
42
|
openedIcon: string | Element;
|
|
43
|
-
openFolderDelay: number;
|
|
43
|
+
openFolderDelay: number | false;
|
|
44
44
|
rtl: boolean | undefined;
|
|
45
45
|
selectable: boolean;
|
|
46
46
|
saveState: boolean | string;
|
package/src/playwright/.eslintrc
CHANGED