diff --git a/src/tracker.ts b/src/tracker.ts index a594c3c..f0ea101 100644 --- a/src/tracker.ts +++ b/src/tracker.ts @@ -282,7 +282,6 @@ class EditableField { this.label = this.cell.createEl("span", { text: value }); this.label.style.marginLeft = `${indent}em`; this.box = new TextComponent(this.cell).setValue(value); - this.box.inputEl.width = 10; this.box.inputEl.classList.add('simple-time-tracker-input'); this.box.inputEl.hide(); } diff --git a/test-vault/.obsidian/plugins/simple-time-tracker/main b/test-vault/.obsidian/plugins/simple-time-tracker/main index 050bdaf..467ba4d 100644 --- a/test-vault/.obsidian/plugins/simple-time-tracker/main +++ b/test-vault/.obsidian/plugins/simple-time-tracker/main @@ -337,7 +337,6 @@ var EditableField = class { this.label = this.cell.createEl("span", { text: value }); this.label.style.marginLeft = `${indent}em`; this.box = new import_obsidian2.TextComponent(this.cell).setValue(value); - this.box.inputEl.width = 10; this.box.inputEl.classList.add("simple-time-tracker-input"); this.box.inputEl.hide(); } @@ -427,4 +426,4 @@ var SimpleTimeTrackerPlugin = class extends import_obsidian3.Plugin { }); } }; -//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsic3JjL21haW4udHMiLCAic3JjL3NldHRpbmdzLnRzIiwgInNyYy9zZXR0aW5ncy10YWIudHMiLCAic3JjL3RyYWNrZXIudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImltcG9ydCB7IFBsdWdpbiB9IGZyb20gXCJvYnNpZGlhblwiO1xuaW1wb3J0IHsgZGVmYXVsdFNldHRpbmdzLCBTaW1wbGVUaW1lVHJhY2tlclNldHRpbmdzIH0gZnJvbSBcIi4vc2V0dGluZ3NcIjtcbmltcG9ydCB7IFNpbXBsZVRpbWVUcmFja2VyU2V0dGluZ3NUYWIgfSBmcm9tIFwiLi9zZXR0aW5ncy10YWJcIjtcbmltcG9ydCB7IGRpc3BsYXlUcmFja2VyLCBsb2FkVHJhY2tlciwgVHJhY2tlciB9IGZyb20gXCIuL3RyYWNr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iBcInNpbXBsZS10aW1lLXRyYWNrZXItdGFibGVcIn0pO1xuICAgICAgICB0YWJsZS5jcmVhdGVFbChcInRyXCIpLmFwcGVuZChcbiAgICAgICAgICAgIGNyZWF0ZUVsKFwidGhcIiwge3RleHQ6IFwiU2VnbWVudFwifSksXG4gICAgICAgICAgICBjcmVhdGVFbChcInRoXCIsIHt0ZXh0OiBcIlN0YXJ0IHRpbWVcIn0pLFxuICAgICAgICAgICAgY3JlYXRlRWwoXCJ0aFwiLCB7dGV4dDogXCJFbmQgdGltZVwifSksXG4gICAgICAgICAgICBjcmVhdGVFbChcInRoXCIsIHt0ZXh0OiBcIkR1cmF0aW9uXCJ9KSxcbiAgICAgICAgICAgIGNyZWF0ZUVsKFwidGhcIikpO1xuXG4gICAgICAgIGZvciAobGV0IGVudHJ5IG9mIHRyYWNrZXIuZW50cmllcylcbiAgICAgICAgICAgIGFkZEVkaXRhYmxlVGFibGVSb3codHJhY2tlciwgZW50cnksIHRhYmxlLCBuZXdTZWdtZW50TmFtZUJveCwgcnVubmluZywgZmlsZSwgZ2V0U2VjdGlvbkluZm8sIHNldHRpbmdzLCAwKTtcblxuICAgICAgICAvLyBhZGQgY29weSBidXR0b25zXG4gICAgICAgIGxldCBidXR0b25zID0gZWxlbWVudC5jcmVhdGVFbChcImRpdlwiLCB7Y2xzOiBcInNpbXBsZS10aW1lLXRyYWNrZXItYm90dG9tXCJ9KTtcbiAgICAgICAgbmV3IEJ1dHRvbkNvbXBvbmVudChidXR0b25zKVxuICAgICAgICAgICAgLnNldEJ1dHRvblRleHQoXCJDb3B5IGFzIHRhYmxlXCIpXG4gICAgICAgICAgICAub25DbGljaygoKSA9PiBuYXZpZ2F0b3IuY2xpcGJvYXJkLndyaXRlVGV4dChjcmVhdGVNYXJrZG93blRhYmxlKHRyYWNrZXIsIHNldHRpbmdzKSkpO1xuICAgICAgICBuZXcgQnV0dG9uQ29tcG9uZW50KGJ1dHRvbnMpXG4gICAgICAgICAgICAuc2V0QnV0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RvbkNvbXBvbmVudChlbnRyeUJ1dHRvbnMpXG4gICAgICAgICAgICAuc2V0Q2xhc3MoXCJjbGlja2FibGUtaWNvblwiKVxuICAgICAgICAgICAgLnNldEljb24oYGx1Y2lkZS1wbGF5YClcbiAgICAgICAgICAgIC5zZXRUb29sdGlwKFwiQ29udGludWVcIilcbiAgICAgICAgICAgIC5vbkNsaWNrKGFzeW5jICgpID0+IHtcbiAgICAgICAgICAgICAgICBzdGFydFN1YkVudHJ5KGVudHJ5LCBuZXdTZWdtZW50TmFtZUJveC5nZXRWYWx1ZSgpKTtcbiAgICAgICAgICAgICAgICBhd2FpdCBzYXZlVHJhY2tlcih0cmFja2VyLCB0aGlzLmFwcCwgZmlsZSwgZ2V0U2VjdGlvbkluZm8oKSk7XG4gICAgICAgICAgICB9KTtcbiAgICB9XG4gICAgbGV0IGVkaXRCdXR0b24gPSBuZXcgQnV0dG9uQ29tcG9uZW50KGVudHJ5QnV0dG9ucylcbiAgICAgICAgLnNldENsYXNzKFwiY2xpY2thYmxlLWljb25cIilcbiAgICAgICAgLnNldFRvb2x0aXAoXCJFZGl0XCIpXG4gICAgICAgIC5zZXRJY29uKFwibHVjaWRlLXBlbmNpbFwiKVxuICAgICAgICAub25DbGljayhhc3luYyAoKSA9PiB7XG4gICAgICAgICAgICBpZiAobmFtZUZpZWxkLmVkaXRpbmcoKSkge1xuICAgICAgICAgICAgICAgIGVudHJ5Lm5hbWUgPSBuYW1lRmllbGQuZW5kRWRpdCgpO1xuICAgICAgICAgICAgICAgIGVudHJ5LnN0YXJ0VGltZSA9IHVuRm9ybWF0VGltZXN0YW1wKHN0YXJ0RmllbGQuZW5kRWRpdCgpLCBzZXR0aW5ncyk7XG4gICAgICAgICAgICAgICAgZW50cnkuZW5kVGltZSA9IHVuRm9ybWF0VGltZXN0YW1wKGVuZEZpZWxkLmVuZEVkaXQoKSwgc2V0dGluZ3MpO1xuICAgICAgICAgICAgICAgIGF3YWl0IHNhdmVUcmFja2VyKHRyYW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oVzFILDRDQUFxRCx3QkFBTztBQUFBLEVBSWxELFNBQXdCO0FBQUE7QUFDMUIsWUFBTSxLQUFLO0FBRVgsV0FBSyxjQUFjLElBQUksNkJBQTZCLEtBQUssS0FBSztBQUU5RCxXQUFLLG1DQUFtQyx1QkFBdUIsQ0FBQyxHQUFHLEdBQUcsTUFBTTtBQUN4RSxZQUFJLFVBQW1CLFlBQVk7QUFDbkMsVUFBRTtBQUNGLHVCQUFlLFNBQVMsR0FBRyxFQUFFLFlBQVksTUFBTSxFQUFFLGVBQWUsSUFBSSxLQUFLO0FBQUE7QUFHN0UsV0FBSyxXQUFXO0FBQUEsUUFDWixJQUFJO0FBQUEsUUFDSixNQUFNO0FBQUEsUUFDTixnQkFBZ0IsQ0FBQyxHQUFHLE1BQU07QUFDdEIsWUFBRSxpQkFBaUI7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBLEVBS3pCLGVBQThCO0FBQUE7QUFDaEMsV0FBSyxXQUFXLE9BQU8sT0FBTyxJQUFJLGlCQUFpQixNQUFNLEtBQUs7QUFBQTtBQUFBO0FBQUEsRUFHNUQsZUFBOEI7QUFBQTtBQUNoQyxZQUFNLEtBQUssU0FBUyxLQUFLO0FBQUE7QUFBQTtBQUFBOyIsCiAgIm5hbWVzIjogW10KfQo= diff --git a/test-vault/.obsidian/plugins/simple-time-tracker/main.js b/test-vault/.obsidian/plugins/simple-time-tracker/main.js index 050bdaf..467ba4d 100644 --- a/test-vault/.obsidian/plugins/simple-time-tracker/main.js +++ b/test-vault/.obsidian/plugins/simple-time-tracker/main.js @@ -337,7 +337,6 @@ var EditableField = class { this.label = this.cell.createEl("span", { text: value }); this.label.style.marginLeft = `${indent}em`; this.box = new import_obsidian2.TextComponent(this.cell).setValue(value); - this.box.inputEl.width = 10; this.box.inputEl.classList.add("simple-time-tracker-input"); this.box.inputEl.hide(); } @@ -427,4 +426,4 @@ var SimpleTimeTrackerPlugin = class extends import_obsidian3.Plugin { }); } }; -//# sourceMappingURL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vcm1hdER1cmF0aW9uKHRvdGFsVGltZTogbnVtYmVyLCBzZXR0aW5nczogU2ltcGxlVGltZVRyYWNrZXJTZXR0aW5ncyk6IHN0cmluZyB7XG4gICAgbGV0IHJldCA9IFwiXCI7XG4gICAgbGV0IGR1cmF0aW9uID0gbW9tZW50LmR1cmF0aW9uKHRvdGFsVGltZSk7XG4gICAgbGV0IGhvdXJzOiBudW1iZXI7XG4gICAgaWYgKHNldHRpbmdzLmZpbmVHcmFpbmVkRHVyYXRpb25zKSB7XG4gICAgICAgIGlmIChkdXJhdGlvbi55ZWFycygpID4gMClcbiAgICAgICAgICAgIHJldCArPSBkdXJhdGlvbi55ZWFycygpICsgXCJ5IFwiO1xuICAgICAgICBpZiAoZHVyYXRpb24ubW9udGhzKCkgPiAwKVxuICAgICAgICAgICAgcmV0ICs9IGR1cmF0aW9uLm1vbnRocygpICsgXCJNIFwiO1xuICAgICAgICBpZiAoZHVyYXRpb24uZGF5cygpID4gMClcbiAgICAgICAgICAgIHJldCArPSBkdXJhdGlvbi5kYXlzKCkgKyBcImQgXCI7XG4gICAgICAgIGhvdXJzID0gZHVyYXRpb24uaG91cnMoKTtcbiAgICB9IGVsc2Uge1xuICAgICAgICBob3VycyA9IE1hdGguZmxvb3IoZHVyYXRpb24uYXNIb3VycygpKTtcbiAgICB9XG4gICAgaWYgKGhvdXJzID4gMClcbiAgICAgICAgcmV0ICs9IGhvdXJzICsgXCJoIFwiO1xuICAgIGlmIChkdXJhdGlvbi5taW51dGVzKCkgPiAwKVxuICAgICAgICByZXQgKz0gZHVyYXRpb24ubWludXRlcygpICsgXCJtIFwiO1xuICAgIHJldCArPSBkdXJhdGlvbi5zZWNvbmRzKCkgKyBcInNcIjtcbiAgICByZXR1cm4gcmV0O1xufVxuXG5mdW5jdGlvbiBjcmVhdGVNYXJrZG93blRhYmxlKHRyYWNrZXI6IFRyYWNrZXIsIHNldHRpbmdzOiBTaW1wbGVUaW1lVHJhY2tlclNldHRpbmdzKTogc3Ry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