@mlightcad/cad-simple-viewer 1.2.4 → 1.2.5
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/dist/index.js +11406 -8892
- package/dist/index.umd.cjs +314 -24
- package/dist/libredwg-parser-worker.js +7267 -7238
- package/dist/mtext-renderer-worker.js +32 -9
- package/lib/app/AcApDocManager.d.ts +20 -3
- package/lib/app/AcApDocManager.d.ts.map +1 -1
- package/lib/app/AcApDocManager.js +66 -11
- package/lib/app/AcApDocManager.js.map +1 -1
- package/lib/app/AcApProgress.d.ts +133 -0
- package/lib/app/AcApProgress.d.ts.map +1 -0
- package/lib/app/AcApProgress.js +148 -0
- package/lib/app/AcApProgress.js.map +1 -0
- package/lib/app/AcApSettingManager.d.ts +42 -0
- package/lib/app/AcApSettingManager.d.ts.map +1 -1
- package/lib/app/AcApSettingManager.js +63 -0
- package/lib/app/AcApSettingManager.js.map +1 -1
- package/lib/app/index.d.ts +0 -1
- package/lib/app/index.d.ts.map +1 -1
- package/lib/app/index.js +0 -1
- package/lib/app/index.js.map +1 -1
- package/lib/command/AcApCircleCmd.d.ts +21 -0
- package/lib/command/AcApCircleCmd.d.ts.map +1 -0
- package/lib/command/AcApCircleCmd.js +115 -0
- package/lib/command/AcApCircleCmd.js.map +1 -0
- package/lib/command/AcApDimCmd.d.ts +57 -0
- package/lib/command/AcApDimCmd.d.ts.map +1 -0
- package/lib/command/AcApDimCmd.js +228 -0
- package/lib/command/AcApDimCmd.js.map +1 -0
- package/lib/command/AcApLogCmd.d.ts +13 -0
- package/lib/command/AcApLogCmd.d.ts.map +1 -0
- package/lib/command/AcApLogCmd.js +97 -0
- package/lib/command/AcApLogCmd.js.map +1 -0
- package/lib/command/AcApSysVarCmd.d.ts +15 -0
- package/lib/command/AcApSysVarCmd.d.ts.map +1 -0
- package/lib/command/AcApSysVarCmd.js +94 -0
- package/lib/command/AcApSysVarCmd.js.map +1 -0
- package/lib/command/AcApZoomToBoxCmd.d.ts +0 -36
- package/lib/command/AcApZoomToBoxCmd.d.ts.map +1 -1
- package/lib/command/AcApZoomToBoxCmd.js +4 -61
- package/lib/command/AcApZoomToBoxCmd.js.map +1 -1
- package/lib/command/index.d.ts +4 -0
- package/lib/command/index.d.ts.map +1 -1
- package/lib/command/index.js +4 -0
- package/lib/command/index.js.map +1 -1
- package/lib/editor/command/AcEdCommandStack.d.ts +19 -1
- package/lib/editor/command/AcEdCommandStack.d.ts.map +1 -1
- package/lib/editor/command/AcEdCommandStack.js +40 -0
- package/lib/editor/command/AcEdCommandStack.js.map +1 -1
- package/lib/editor/input/AcEdCursorManager.d.ts +14 -30
- package/lib/editor/input/AcEdCursorManager.d.ts.map +1 -1
- package/lib/editor/input/AcEdCursorManager.js +32 -31
- package/lib/editor/input/AcEdCursorManager.js.map +1 -1
- package/lib/editor/input/AcEdPreviewJig.d.ts +103 -0
- package/lib/editor/input/AcEdPreviewJig.d.ts.map +1 -0
- package/lib/editor/input/AcEdPreviewJig.js +82 -0
- package/lib/editor/input/AcEdPreviewJig.js.map +1 -0
- package/lib/editor/input/AcEditor.d.ts +58 -11
- package/lib/editor/input/AcEditor.d.ts.map +1 -1
- package/lib/editor/input/AcEditor.js +86 -22
- package/lib/editor/input/AcEditor.js.map +1 -1
- package/lib/editor/input/handler/AcEdAngleHandler.d.ts +12 -0
- package/lib/editor/input/handler/AcEdAngleHandler.d.ts.map +1 -0
- package/lib/editor/input/handler/AcEdAngleHandler.js +25 -0
- package/lib/editor/input/handler/AcEdAngleHandler.js.map +1 -0
- package/lib/editor/input/handler/AcEdDistanceHandler.d.ts +8 -0
- package/lib/editor/input/handler/AcEdDistanceHandler.d.ts.map +1 -0
- package/lib/editor/input/handler/AcEdDistanceHandler.js +29 -0
- package/lib/editor/input/handler/AcEdDistanceHandler.js.map +1 -0
- package/lib/editor/input/handler/AcEdDoubleHandler.d.ts +7 -0
- package/lib/editor/input/handler/AcEdDoubleHandler.d.ts.map +1 -0
- package/lib/editor/input/handler/AcEdDoubleHandler.js +28 -0
- package/lib/editor/input/handler/AcEdDoubleHandler.js.map +1 -0
- package/lib/editor/input/handler/AcEdInputHandler.d.ts +14 -0
- package/lib/editor/input/handler/AcEdInputHandler.d.ts.map +1 -0
- package/lib/editor/input/handler/AcEdInputHandler.js +2 -0
- package/lib/editor/input/handler/AcEdInputHandler.js.map +1 -0
- package/lib/editor/input/handler/AcEdIntegerHandler.d.ts +11 -0
- package/lib/editor/input/handler/AcEdIntegerHandler.d.ts.map +1 -0
- package/lib/editor/input/handler/AcEdIntegerHandler.js +44 -0
- package/lib/editor/input/handler/AcEdIntegerHandler.js.map +1 -0
- package/lib/editor/input/handler/AcEdNumericalHandler.d.ts +11 -0
- package/lib/editor/input/handler/AcEdNumericalHandler.d.ts.map +1 -0
- package/lib/editor/input/handler/AcEdNumericalHandler.js +24 -0
- package/lib/editor/input/handler/AcEdNumericalHandler.js.map +1 -0
- package/lib/editor/input/handler/AcEdPointHandler.d.ts +16 -0
- package/lib/editor/input/handler/AcEdPointHandler.d.ts.map +1 -0
- package/lib/editor/input/handler/AcEdPointHandler.js +19 -0
- package/lib/editor/input/handler/AcEdPointHandler.js.map +1 -0
- package/lib/editor/input/handler/AcEdStringHandler.d.ts +12 -0
- package/lib/editor/input/handler/AcEdStringHandler.d.ts.map +1 -0
- package/lib/editor/input/handler/AcEdStringHandler.js +24 -0
- package/lib/editor/input/handler/AcEdStringHandler.js.map +1 -0
- package/lib/editor/input/handler/index.d.ts +9 -0
- package/lib/editor/input/handler/index.d.ts.map +1 -0
- package/lib/editor/input/handler/index.js +9 -0
- package/lib/editor/input/handler/index.js.map +1 -0
- package/lib/editor/input/index.d.ts +4 -1
- package/lib/editor/input/index.d.ts.map +1 -1
- package/lib/editor/input/index.js +4 -1
- package/lib/editor/input/index.js.map +1 -1
- package/lib/editor/input/marker/AcEdMarker.d.ts +72 -0
- package/lib/editor/input/marker/AcEdMarker.d.ts.map +1 -0
- package/lib/editor/input/marker/AcEdMarker.js +124 -0
- package/lib/editor/input/marker/AcEdMarker.js.map +1 -0
- package/lib/editor/input/marker/AcEdOSnapMarkerManager.d.ts +52 -0
- package/lib/editor/input/marker/AcEdOSnapMarkerManager.d.ts.map +1 -0
- package/lib/editor/input/marker/AcEdOSnapMarkerManager.js +91 -0
- package/lib/editor/input/marker/AcEdOSnapMarkerManager.js.map +1 -0
- package/lib/editor/input/marker/index.d.ts +3 -0
- package/lib/editor/input/marker/index.d.ts.map +1 -0
- package/lib/editor/input/marker/index.js +3 -0
- package/lib/editor/input/marker/index.js.map +1 -0
- package/lib/editor/input/prompt/AcEdKeyword.d.ts +63 -0
- package/lib/editor/input/prompt/AcEdKeyword.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdKeyword.js +120 -0
- package/lib/editor/input/prompt/AcEdKeyword.js.map +1 -0
- package/lib/editor/input/prompt/AcEdKeywordCollection.d.ts +52 -0
- package/lib/editor/input/prompt/AcEdKeywordCollection.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdKeywordCollection.js +103 -0
- package/lib/editor/input/prompt/AcEdKeywordCollection.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptAngleOptions.d.ts +75 -0
- package/lib/editor/input/prompt/AcEdPromptAngleOptions.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptAngleOptions.js +182 -0
- package/lib/editor/input/prompt/AcEdPromptAngleOptions.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptDistanceOptions.d.ts +46 -0
- package/lib/editor/input/prompt/AcEdPromptDistanceOptions.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptDistanceOptions.js +114 -0
- package/lib/editor/input/prompt/AcEdPromptDistanceOptions.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptDoubleOptions.d.ts +10 -0
- package/lib/editor/input/prompt/AcEdPromptDoubleOptions.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptDoubleOptions.js +31 -0
- package/lib/editor/input/prompt/AcEdPromptDoubleOptions.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptIntegerOptions.d.ts +39 -0
- package/lib/editor/input/prompt/AcEdPromptIntegerOptions.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptIntegerOptions.js +84 -0
- package/lib/editor/input/prompt/AcEdPromptIntegerOptions.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptNumericalOptions.d.ts +59 -0
- package/lib/editor/input/prompt/AcEdPromptNumericalOptions.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptNumericalOptions.js +140 -0
- package/lib/editor/input/prompt/AcEdPromptNumericalOptions.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptNumericalResult.d.ts +19 -0
- package/lib/editor/input/prompt/AcEdPromptNumericalResult.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptNumericalResult.js +36 -0
- package/lib/editor/input/prompt/AcEdPromptNumericalResult.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptOptions.d.ts +61 -0
- package/lib/editor/input/prompt/AcEdPromptOptions.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptOptions.js +179 -0
- package/lib/editor/input/prompt/AcEdPromptOptions.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptPointOptions.d.ts +46 -0
- package/lib/editor/input/prompt/AcEdPromptPointOptions.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptPointOptions.js +113 -0
- package/lib/editor/input/prompt/AcEdPromptPointOptions.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptPointResult.d.ts +25 -0
- package/lib/editor/input/prompt/AcEdPromptPointResult.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptPointResult.js +38 -0
- package/lib/editor/input/prompt/AcEdPromptPointResult.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptResult.d.ts +27 -0
- package/lib/editor/input/prompt/AcEdPromptResult.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptResult.js +19 -0
- package/lib/editor/input/prompt/AcEdPromptResult.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptStatus.d.ts +22 -0
- package/lib/editor/input/prompt/AcEdPromptStatus.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptStatus.js +23 -0
- package/lib/editor/input/prompt/AcEdPromptStatus.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptStringOptions.d.ts +54 -0
- package/lib/editor/input/prompt/AcEdPromptStringOptions.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptStringOptions.js +124 -0
- package/lib/editor/input/prompt/AcEdPromptStringOptions.js.map +1 -0
- package/lib/editor/input/prompt/index.d.ts +11 -0
- package/lib/editor/input/prompt/index.d.ts.map +1 -0
- package/lib/editor/input/prompt/index.js +11 -0
- package/lib/editor/input/prompt/index.js.map +1 -0
- package/lib/editor/input/ui/AcEdCommandLine.d.ts +114 -0
- package/lib/editor/input/ui/AcEdCommandLine.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdCommandLine.js +453 -0
- package/lib/editor/input/ui/AcEdCommandLine.js.map +1 -0
- package/lib/editor/input/ui/AcEdFloatingInput.d.ts +151 -0
- package/lib/editor/input/ui/AcEdFloatingInput.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdFloatingInput.js +239 -0
- package/lib/editor/input/ui/AcEdFloatingInput.js.map +1 -0
- package/lib/editor/input/ui/AcEdFloatingInputBox.d.ts +60 -0
- package/lib/editor/input/ui/AcEdFloatingInputBox.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdFloatingInputBox.js +113 -0
- package/lib/editor/input/ui/AcEdFloatingInputBox.js.map +1 -0
- package/lib/editor/input/ui/AcEdFloatingInputBoxes.d.ts +104 -0
- package/lib/editor/input/ui/AcEdFloatingInputBoxes.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdFloatingInputBoxes.js +154 -0
- package/lib/editor/input/ui/AcEdFloatingInputBoxes.js.map +1 -0
- package/lib/editor/input/ui/AcEdFloatingInputTypes.d.ts +113 -0
- package/lib/editor/input/ui/AcEdFloatingInputTypes.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdFloatingInputTypes.js +2 -0
- package/lib/editor/input/ui/AcEdFloatingInputTypes.js.map +1 -0
- package/lib/editor/input/ui/AcEdInputManager.d.ts +132 -0
- package/lib/editor/input/ui/AcEdInputManager.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdInputManager.js +477 -0
- package/lib/editor/input/ui/AcEdInputManager.js.map +1 -0
- package/lib/editor/input/ui/AcEdRubberBand.d.ts +66 -0
- package/lib/editor/input/ui/AcEdRubberBand.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdRubberBand.js +276 -0
- package/lib/editor/input/ui/AcEdRubberBand.js.map +1 -0
- package/lib/editor/input/ui/index.d.ts +3 -0
- package/lib/editor/input/ui/index.d.ts.map +1 -0
- package/lib/editor/input/ui/index.js +3 -0
- package/lib/editor/input/ui/index.js.map +1 -0
- package/lib/editor/view/AcEdBaseView.d.ts +35 -11
- package/lib/editor/view/AcEdBaseView.d.ts.map +1 -1
- package/lib/editor/view/AcEdBaseView.js +14 -11
- package/lib/editor/view/AcEdBaseView.js.map +1 -1
- package/lib/i18n/AcApI18n.d.ts +135 -0
- package/lib/i18n/AcApI18n.d.ts.map +1 -0
- package/lib/i18n/AcApI18n.js +208 -0
- package/lib/i18n/AcApI18n.js.map +1 -0
- package/lib/i18n/en/command.d.ts +18 -0
- package/lib/i18n/en/command.d.ts.map +1 -0
- package/lib/i18n/en/command.js +17 -0
- package/lib/i18n/en/command.js.map +1 -0
- package/lib/i18n/en/jig.d.ts +11 -0
- package/lib/i18n/en/jig.d.ts.map +1 -0
- package/lib/i18n/en/jig.js +10 -0
- package/lib/i18n/en/jig.js.map +1 -0
- package/lib/i18n/en/main.d.ts +37 -0
- package/lib/i18n/en/main.d.ts.map +1 -0
- package/lib/i18n/en/main.js +36 -0
- package/lib/i18n/en/main.js.map +1 -0
- package/lib/i18n/index.d.ts +6 -0
- package/lib/i18n/index.d.ts.map +1 -0
- package/lib/i18n/index.js +31 -0
- package/lib/i18n/index.js.map +1 -0
- package/lib/i18n/zh/command.d.ts +18 -0
- package/lib/i18n/zh/command.d.ts.map +1 -0
- package/lib/i18n/zh/command.js +17 -0
- package/lib/i18n/zh/command.js.map +1 -0
- package/lib/i18n/zh/jig.d.ts +11 -0
- package/lib/i18n/zh/jig.d.ts.map +1 -0
- package/lib/i18n/zh/jig.js +10 -0
- package/lib/i18n/zh/jig.js.map +1 -0
- package/lib/i18n/zh/main.d.ts +37 -0
- package/lib/i18n/zh/main.d.ts.map +1 -0
- package/lib/i18n/zh/main.js +36 -0
- package/lib/i18n/zh/main.js.map +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/view/AcTrScene.d.ts +19 -6
- package/lib/view/AcTrScene.d.ts.map +1 -1
- package/lib/view/AcTrScene.js +25 -6
- package/lib/view/AcTrScene.js.map +1 -1
- package/lib/view/AcTrView2d.d.ts +11 -1
- package/lib/view/AcTrView2d.d.ts.map +1 -1
- package/lib/view/AcTrView2d.js +73 -35
- package/lib/view/AcTrView2d.js.map +1 -1
- package/package.json +7 -7
- package/lib/editor/input/AcEdBaseInput.d.ts +0 -89
- package/lib/editor/input/AcEdBaseInput.d.ts.map +0 -1
- package/lib/editor/input/AcEdBaseInput.js +0 -166
- package/lib/editor/input/AcEdBaseInput.js.map +0 -1
- package/lib/editor/input/AcEdBoxSelector.d.ts +0 -108
- package/lib/editor/input/AcEdBoxSelector.d.ts.map +0 -1
- package/lib/editor/input/AcEdBoxSelector.js +0 -220
- package/lib/editor/input/AcEdBoxSelector.js.map +0 -1
- package/lib/editor/input/AcEdInputPoint.d.ts +0 -51
- package/lib/editor/input/AcEdInputPoint.d.ts.map +0 -1
- package/lib/editor/input/AcEdInputPoint.js +0 -78
- package/lib/editor/input/AcEdInputPoint.js.map +0 -1
- package/lib/editor/input/AcEdJig.d.ts +0 -180
- package/lib/editor/input/AcEdJig.d.ts.map +0 -1
- package/lib/editor/input/AcEdJig.js +0 -256
- package/lib/editor/input/AcEdJig.js.map +0 -1
- package/lib/editor/input/AcEdJigLoop.d.ts +0 -63
- package/lib/editor/input/AcEdJigLoop.d.ts.map +0 -1
- package/lib/editor/input/AcEdJigLoop.js +0 -91
- package/lib/editor/input/AcEdJigLoop.js.map +0 -1
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
var __values = (this && this.__values) || function(o) {
|
|
2
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
3
|
+
if (m) return m.call(o);
|
|
4
|
+
if (o && typeof o.length === "number") return {
|
|
5
|
+
next: function () {
|
|
6
|
+
if (o && i >= o.length) o = void 0;
|
|
7
|
+
return { value: o && o[i++], done: !o };
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
11
|
+
};
|
|
12
|
+
import { AcEdMarker } from './AcEdMarker';
|
|
13
|
+
/**
|
|
14
|
+
* Manages a stack of markers using a singleton pattern.
|
|
15
|
+
*
|
|
16
|
+
* - `getInstance()` returns the global instance.
|
|
17
|
+
* - `showMarker()` pushes a new marker onto the stack.
|
|
18
|
+
* - `hideMarker()` pops the last marker.
|
|
19
|
+
* - `clear()` removes all markers.
|
|
20
|
+
*
|
|
21
|
+
* Typical usage is to show temporary marker that appear and disappear
|
|
22
|
+
* based on user cursor movement or snapping events.
|
|
23
|
+
*/
|
|
24
|
+
var AcEdMarkerManager = /** @class */ (function () {
|
|
25
|
+
function AcEdMarkerManager(view) {
|
|
26
|
+
/** Internal stack of active markers */
|
|
27
|
+
this.stack = [];
|
|
28
|
+
this.view = view;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Creates and shows a new OSNAP marker at the specified position in world coordinate
|
|
32
|
+
* system. The marker is added to the top of the internal stack.
|
|
33
|
+
*
|
|
34
|
+
* @param pos - Position in world coordinate system
|
|
35
|
+
* @param type - Marker shape type
|
|
36
|
+
* @param size - Marker size in pixels
|
|
37
|
+
* @param color - Marker color (CSS string)
|
|
38
|
+
*/
|
|
39
|
+
AcEdMarkerManager.prototype.showMarker = function (pos, type, size, color) {
|
|
40
|
+
var winPos = this.view.wcs2Cwcs(pos);
|
|
41
|
+
var marker = new AcEdMarker(type, size, color);
|
|
42
|
+
marker.setPosition(winPos);
|
|
43
|
+
this.stack.push(marker);
|
|
44
|
+
return marker;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Hides the most recently shown marker (LIFO).
|
|
48
|
+
* If no marker exists, nothing happens.
|
|
49
|
+
*/
|
|
50
|
+
AcEdMarkerManager.prototype.hideMarker = function () {
|
|
51
|
+
var marker = this.stack.pop();
|
|
52
|
+
if (marker)
|
|
53
|
+
marker.destroy();
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Removes all active markers and clears the stack.
|
|
57
|
+
* Should be called when OSNAP indicators need to be fully reset.
|
|
58
|
+
*/
|
|
59
|
+
AcEdMarkerManager.prototype.clear = function () {
|
|
60
|
+
var e_1, _a;
|
|
61
|
+
try {
|
|
62
|
+
for (var _b = __values(this.stack), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
63
|
+
var marker = _c.value;
|
|
64
|
+
marker.destroy();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
68
|
+
finally {
|
|
69
|
+
try {
|
|
70
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
71
|
+
}
|
|
72
|
+
finally { if (e_1) throw e_1.error; }
|
|
73
|
+
}
|
|
74
|
+
this.stack = [];
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Returns the marker at the top of the marker stack without removing it.
|
|
78
|
+
*
|
|
79
|
+
* This method is safe to call even when the stack is empty. In that case,
|
|
80
|
+
* it returns `undefined`.
|
|
81
|
+
*
|
|
82
|
+
* @returns The top marker of the internal stack, or `undefined` if the
|
|
83
|
+
* stack contains no marker.
|
|
84
|
+
*/
|
|
85
|
+
AcEdMarkerManager.prototype.top = function () {
|
|
86
|
+
return this.stack[this.stack.length - 1];
|
|
87
|
+
};
|
|
88
|
+
return AcEdMarkerManager;
|
|
89
|
+
}());
|
|
90
|
+
export { AcEdMarkerManager };
|
|
91
|
+
//# sourceMappingURL=AcEdOSnapMarkerManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcEdOSnapMarkerManager.js","sourceRoot":"","sources":["../../../../src/editor/input/marker/AcEdOSnapMarkerManager.ts"],"names":[],"mappings":";;;;;;;;;;;AAGA,OAAO,EAAE,UAAU,EAAkB,MAAM,cAAc,CAAA;AAEzD;;;;;;;;;;GAUG;AACH;IAOE,2BAAY,IAAkB;QAH9B,uCAAuC;QAC/B,UAAK,GAAiB,EAAE,CAAA;QAG9B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;IAED;;;;;;;;OAQG;IACI,sCAAU,GAAjB,UACE,GAAoB,EACpB,IAAqB,EACrB,IAAa,EACb,KAAc;QAEd,IAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;QACtC,IAAM,MAAM,GAAG,IAAI,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAA;QAChD,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;QAC1B,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACvB,OAAO,MAAM,CAAA;IACf,CAAC;IAED;;;OAGG;IACI,sCAAU,GAAjB;QACE,IAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAA;QAC/B,IAAI,MAAM;YAAE,MAAM,CAAC,OAAO,EAAE,CAAA;IAC9B,CAAC;IAED;;;OAGG;IACI,iCAAK,GAAZ;;;YACE,KAAqB,IAAA,KAAA,SAAA,IAAI,CAAC,KAAK,CAAA,gBAAA;gBAA1B,IAAM,MAAM,WAAA;gBAAgB,MAAM,CAAC,OAAO,EAAE,CAAA;aAAA;;;;;;;;;QACjD,IAAI,CAAC,KAAK,GAAG,EAAE,CAAA;IACjB,CAAC;IAED;;;;;;;;OAQG;IACI,+BAAG,GAAV;QACE,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;IAC1C,CAAC;IACH,wBAAC;AAAD,CAAC,AA/DD,IA+DC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/editor/input/marker/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,0BAA0B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/editor/input/marker/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,0BAA0B,CAAA"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a single keyword option in a prompt, similar to Autodesk.AutoCAD.EditorInput.Keyword.
|
|
3
|
+
* Keywords can be shown to the user, used internally as global identifiers, and can be enabled/disabled or visible/hidden.
|
|
4
|
+
*/
|
|
5
|
+
export declare class AcEdKeyword {
|
|
6
|
+
private _displayName;
|
|
7
|
+
private _enabled;
|
|
8
|
+
private _globalName;
|
|
9
|
+
private _isReadOnly;
|
|
10
|
+
private _localName;
|
|
11
|
+
private _visible;
|
|
12
|
+
/**
|
|
13
|
+
* Creates a new Keyword.
|
|
14
|
+
* @param displayName - The text displayed to the user for this keyword.
|
|
15
|
+
* @param globalName - The internal global name (never shown to user). Defaults to `displayName`.
|
|
16
|
+
* @param localName - Internal local name (usually same as global name). Defaults to `globalName`.
|
|
17
|
+
* @param enabled - Whether the keyword is currently enabled. Default is `true`.
|
|
18
|
+
* @param isReadOnly - If `true`, the keyword properties cannot be modified. Default is `false`.
|
|
19
|
+
* @param visible - Whether the keyword is visible to the user. Default is `true`.
|
|
20
|
+
*/
|
|
21
|
+
constructor(displayName: string, globalName?: string, localName?: string, enabled?: boolean, isReadOnly?: boolean, visible?: boolean);
|
|
22
|
+
/**
|
|
23
|
+
* Gets or sets the display name of the keyword.
|
|
24
|
+
* This is the name shown to the user in prompts.
|
|
25
|
+
* Setting has no effect if `isReadOnly` is true.
|
|
26
|
+
*/
|
|
27
|
+
get displayName(): string;
|
|
28
|
+
set displayName(name: string);
|
|
29
|
+
/**
|
|
30
|
+
* Gets or sets whether the keyword is currently enabled.
|
|
31
|
+
* Disabled keywords cannot be selected by the user.
|
|
32
|
+
* Setting has no effect if `isReadOnly` is true.
|
|
33
|
+
*/
|
|
34
|
+
get enabled(): boolean;
|
|
35
|
+
set enabled(flag: boolean);
|
|
36
|
+
/**
|
|
37
|
+
* Gets or sets the global name of the keyword.
|
|
38
|
+
* The global name is used internally by programs and is never displayed to the user.
|
|
39
|
+
* Setting has no effect if `isReadOnly` is true.
|
|
40
|
+
*/
|
|
41
|
+
get globalName(): string;
|
|
42
|
+
set globalName(name: string);
|
|
43
|
+
/**
|
|
44
|
+
* Gets a value indicating whether the keyword is read-only.
|
|
45
|
+
* True if the keyword is read-only; otherwise, false.
|
|
46
|
+
*/
|
|
47
|
+
get isReadOnly(): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Gets or sets the local name of the keyword.
|
|
50
|
+
* Usually the same as the global name; not displayed to the user.
|
|
51
|
+
* Setting has no effect if `isReadOnly` is true.
|
|
52
|
+
*/
|
|
53
|
+
get localName(): string;
|
|
54
|
+
set localName(name: string);
|
|
55
|
+
/**
|
|
56
|
+
* Gets or sets whether the keyword is visible to the user.
|
|
57
|
+
* Hidden keywords cannot be selected by typing, but can be used programmatically.
|
|
58
|
+
* Setting has no effect if `isReadOnly` is true.
|
|
59
|
+
*/
|
|
60
|
+
get visible(): boolean;
|
|
61
|
+
set visible(flag: boolean);
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=AcEdKeyword.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcEdKeyword.d.ts","sourceRoot":"","sources":["../../../../src/editor/input/prompt/AcEdKeyword.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,qBAAa,WAAW;IAEtB,OAAO,CAAC,YAAY,CAAQ;IAC5B,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,WAAW,CAAQ;IAC3B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,UAAU,CAAQ;IAC1B,OAAO,CAAC,QAAQ,CAAS;IAEzB;;;;;;;;OAQG;gBAED,WAAW,EAAE,MAAM,EACnB,UAAU,CAAC,EAAE,MAAM,EACnB,SAAS,CAAC,EAAE,MAAM,EAClB,OAAO,GAAE,OAAc,EACvB,UAAU,GAAE,OAAe,EAC3B,OAAO,GAAE,OAAc;IAUzB;;;;OAIG;IACH,IAAI,WAAW,IAAI,MAAM,CAExB;IACD,IAAI,WAAW,CAAC,IAAI,EAAE,MAAM,EAE3B;IAED;;;;OAIG;IACH,IAAI,OAAO,IAAI,OAAO,CAErB;IACD,IAAI,OAAO,CAAC,IAAI,EAAE,OAAO,EAExB;IAED;;;;OAIG;IACH,IAAI,UAAU,IAAI,MAAM,CAEvB;IACD,IAAI,UAAU,CAAC,IAAI,EAAE,MAAM,EAE1B;IAED;;;OAGG;IACH,IAAI,UAAU,IAAI,OAAO,CAExB;IAED;;;;OAIG;IACH,IAAI,SAAS,IAAI,MAAM,CAEtB;IACD,IAAI,SAAS,CAAC,IAAI,EAAE,MAAM,EAEzB;IAED;;;;OAIG;IACH,IAAI,OAAO,IAAI,OAAO,CAErB;IACD,IAAI,OAAO,CAAC,IAAI,EAAE,OAAO,EAExB;CACF"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a single keyword option in a prompt, similar to Autodesk.AutoCAD.EditorInput.Keyword.
|
|
3
|
+
* Keywords can be shown to the user, used internally as global identifiers, and can be enabled/disabled or visible/hidden.
|
|
4
|
+
*/
|
|
5
|
+
var AcEdKeyword = /** @class */ (function () {
|
|
6
|
+
/**
|
|
7
|
+
* Creates a new Keyword.
|
|
8
|
+
* @param displayName - The text displayed to the user for this keyword.
|
|
9
|
+
* @param globalName - The internal global name (never shown to user). Defaults to `displayName`.
|
|
10
|
+
* @param localName - Internal local name (usually same as global name). Defaults to `globalName`.
|
|
11
|
+
* @param enabled - Whether the keyword is currently enabled. Default is `true`.
|
|
12
|
+
* @param isReadOnly - If `true`, the keyword properties cannot be modified. Default is `false`.
|
|
13
|
+
* @param visible - Whether the keyword is visible to the user. Default is `true`.
|
|
14
|
+
*/
|
|
15
|
+
function AcEdKeyword(displayName, globalName, localName, enabled, isReadOnly, visible) {
|
|
16
|
+
if (enabled === void 0) { enabled = true; }
|
|
17
|
+
if (isReadOnly === void 0) { isReadOnly = false; }
|
|
18
|
+
if (visible === void 0) { visible = true; }
|
|
19
|
+
this._displayName = displayName;
|
|
20
|
+
this._globalName = globalName !== null && globalName !== void 0 ? globalName : displayName;
|
|
21
|
+
this._localName = localName !== null && localName !== void 0 ? localName : this._globalName;
|
|
22
|
+
this._enabled = enabled;
|
|
23
|
+
this._isReadOnly = isReadOnly;
|
|
24
|
+
this._visible = visible;
|
|
25
|
+
}
|
|
26
|
+
Object.defineProperty(AcEdKeyword.prototype, "displayName", {
|
|
27
|
+
/**
|
|
28
|
+
* Gets or sets the display name of the keyword.
|
|
29
|
+
* This is the name shown to the user in prompts.
|
|
30
|
+
* Setting has no effect if `isReadOnly` is true.
|
|
31
|
+
*/
|
|
32
|
+
get: function () {
|
|
33
|
+
return this._displayName;
|
|
34
|
+
},
|
|
35
|
+
set: function (name) {
|
|
36
|
+
if (!this._isReadOnly)
|
|
37
|
+
this._displayName = name;
|
|
38
|
+
},
|
|
39
|
+
enumerable: false,
|
|
40
|
+
configurable: true
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(AcEdKeyword.prototype, "enabled", {
|
|
43
|
+
/**
|
|
44
|
+
* Gets or sets whether the keyword is currently enabled.
|
|
45
|
+
* Disabled keywords cannot be selected by the user.
|
|
46
|
+
* Setting has no effect if `isReadOnly` is true.
|
|
47
|
+
*/
|
|
48
|
+
get: function () {
|
|
49
|
+
return this._enabled;
|
|
50
|
+
},
|
|
51
|
+
set: function (flag) {
|
|
52
|
+
if (!this._isReadOnly)
|
|
53
|
+
this._enabled = flag;
|
|
54
|
+
},
|
|
55
|
+
enumerable: false,
|
|
56
|
+
configurable: true
|
|
57
|
+
});
|
|
58
|
+
Object.defineProperty(AcEdKeyword.prototype, "globalName", {
|
|
59
|
+
/**
|
|
60
|
+
* Gets or sets the global name of the keyword.
|
|
61
|
+
* The global name is used internally by programs and is never displayed to the user.
|
|
62
|
+
* Setting has no effect if `isReadOnly` is true.
|
|
63
|
+
*/
|
|
64
|
+
get: function () {
|
|
65
|
+
return this._globalName;
|
|
66
|
+
},
|
|
67
|
+
set: function (name) {
|
|
68
|
+
if (!this._isReadOnly)
|
|
69
|
+
this._globalName = name;
|
|
70
|
+
},
|
|
71
|
+
enumerable: false,
|
|
72
|
+
configurable: true
|
|
73
|
+
});
|
|
74
|
+
Object.defineProperty(AcEdKeyword.prototype, "isReadOnly", {
|
|
75
|
+
/**
|
|
76
|
+
* Gets a value indicating whether the keyword is read-only.
|
|
77
|
+
* True if the keyword is read-only; otherwise, false.
|
|
78
|
+
*/
|
|
79
|
+
get: function () {
|
|
80
|
+
return this._isReadOnly;
|
|
81
|
+
},
|
|
82
|
+
enumerable: false,
|
|
83
|
+
configurable: true
|
|
84
|
+
});
|
|
85
|
+
Object.defineProperty(AcEdKeyword.prototype, "localName", {
|
|
86
|
+
/**
|
|
87
|
+
* Gets or sets the local name of the keyword.
|
|
88
|
+
* Usually the same as the global name; not displayed to the user.
|
|
89
|
+
* Setting has no effect if `isReadOnly` is true.
|
|
90
|
+
*/
|
|
91
|
+
get: function () {
|
|
92
|
+
return this._localName;
|
|
93
|
+
},
|
|
94
|
+
set: function (name) {
|
|
95
|
+
if (!this._isReadOnly)
|
|
96
|
+
this._localName = name;
|
|
97
|
+
},
|
|
98
|
+
enumerable: false,
|
|
99
|
+
configurable: true
|
|
100
|
+
});
|
|
101
|
+
Object.defineProperty(AcEdKeyword.prototype, "visible", {
|
|
102
|
+
/**
|
|
103
|
+
* Gets or sets whether the keyword is visible to the user.
|
|
104
|
+
* Hidden keywords cannot be selected by typing, but can be used programmatically.
|
|
105
|
+
* Setting has no effect if `isReadOnly` is true.
|
|
106
|
+
*/
|
|
107
|
+
get: function () {
|
|
108
|
+
return this._visible;
|
|
109
|
+
},
|
|
110
|
+
set: function (flag) {
|
|
111
|
+
if (!this._isReadOnly)
|
|
112
|
+
this._visible = flag;
|
|
113
|
+
},
|
|
114
|
+
enumerable: false,
|
|
115
|
+
configurable: true
|
|
116
|
+
});
|
|
117
|
+
return AcEdKeyword;
|
|
118
|
+
}());
|
|
119
|
+
export { AcEdKeyword };
|
|
120
|
+
//# sourceMappingURL=AcEdKeyword.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcEdKeyword.js","sourceRoot":"","sources":["../../../../src/editor/input/prompt/AcEdKeyword.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH;IASE;;;;;;;;OAQG;IACH,qBACE,WAAmB,EACnB,UAAmB,EACnB,SAAkB,EAClB,OAAuB,EACvB,UAA2B,EAC3B,OAAuB;QAFvB,wBAAA,EAAA,cAAuB;QACvB,2BAAA,EAAA,kBAA2B;QAC3B,wBAAA,EAAA,cAAuB;QAEvB,IAAI,CAAC,YAAY,GAAG,WAAW,CAAA;QAC/B,IAAI,CAAC,WAAW,GAAG,UAAU,aAAV,UAAU,cAAV,U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AC,QAAQ,CAAA;QACtB,CAAC;aACD,UAAY,IAAa;YACvB,IAAI,CAAC,IAAI,CAAC,WAAW;gBAAE,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAA;QAC7C,CAAC;;;OAHA;IAIH,kBAAC;AAAD,CAAC,AArGD,IAqGC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { AcEdKeyword } from './AcEdKeyword';
|
|
2
|
+
/**
|
|
3
|
+
* A collection of `AcEdKeyword` objects, mirroring `Autodesk.AutoCAD.EditorInput.KeywordCollection`.
|
|
4
|
+
* Represents the set of valid keywords for a prompt.
|
|
5
|
+
*/
|
|
6
|
+
export declare class AcEdKeywordCollection {
|
|
7
|
+
private _keywords;
|
|
8
|
+
private _defaultKeyword?;
|
|
9
|
+
/** Constructs a new, empty `AcEdKeywordCollection`. */
|
|
10
|
+
constructor();
|
|
11
|
+
/**
|
|
12
|
+
* Adds a new keyword (displayName only).
|
|
13
|
+
* @param displayName - The text shown to the user for this keyword.
|
|
14
|
+
* @returns The newly created `AcEdKeyword`.
|
|
15
|
+
*/
|
|
16
|
+
add(displayName: string): AcEdKeyword;
|
|
17
|
+
/**
|
|
18
|
+
* Adds a new keyword with globalName and localName.
|
|
19
|
+
* @param globalName - The internal, non-display name.
|
|
20
|
+
* @param localName - The name that the user types to select the keyword.
|
|
21
|
+
* @returns The newly created `AcEdKeyword`.
|
|
22
|
+
*/
|
|
23
|
+
add(globalName: string, localName: string): AcEdKeyword;
|
|
24
|
+
/**
|
|
25
|
+
* Adds a new keyword with displayName, globalName, localName, enabled, visible.
|
|
26
|
+
* @param displayName - The text shown to the user.
|
|
27
|
+
* @param globalName - Internal identifier for the keyword.
|
|
28
|
+
* @param localName - The name used by the user to type the keyword.
|
|
29
|
+
* @param enabled - If false, the keyword cannot be selected.
|
|
30
|
+
* @param visible - If false, the keyword is hidden from display.
|
|
31
|
+
* @returns The newly created `AcEdKeyword`.
|
|
32
|
+
*/
|
|
33
|
+
add(displayName: string, globalName: string, localName: string, enabled?: boolean, visible?: boolean): AcEdKeyword;
|
|
34
|
+
/** Removes all keywords from the collection. */
|
|
35
|
+
clear(): void;
|
|
36
|
+
/** Copies the keywords of this collection into a plain array. */
|
|
37
|
+
toArray(): AcEdKeyword[];
|
|
38
|
+
/** Gets or sets the default keyword for this collection. */
|
|
39
|
+
get default(): AcEdKeyword | undefined;
|
|
40
|
+
set default(kw: AcEdKeyword | undefined);
|
|
41
|
+
/** Returns a string representing the visible, enabled keywords for display. */
|
|
42
|
+
getDisplayString(showNoDefault?: boolean): string;
|
|
43
|
+
/** Returns an iterator over the `AcEdKeyword` objects in this collection. */
|
|
44
|
+
[Symbol.iterator](): Iterator<AcEdKeyword>;
|
|
45
|
+
/** Finds a keyword by its display name (case-insensitive). */
|
|
46
|
+
findByDisplayName(displayName: string): AcEdKeyword | undefined;
|
|
47
|
+
/** Finds a keyword by its global name (case-insensitive). */
|
|
48
|
+
findByGlobalName(globalName: string): AcEdKeyword | undefined;
|
|
49
|
+
/** Gets the number of keywords in this collection. */
|
|
50
|
+
get count(): number;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=AcEdKeywordCollection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcEdKeywordCollection.d.ts","sourceRoot":"","sources":["../../../../src/editor/input/prompt/AcEdKeywordCollection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C;;;GAGG;AACH,qBAAa,qBAAqB;IAChC,OAAO,CAAC,SAAS,CAAoB;IACrC,OAAO,CAAC,eAAe,CAAC,CAAa;IAErC,uDAAuD;;IAGvD;;;;OAIG;IACH,GAAG,CAAC,WAAW,EAAE,MAAM,GAAG,WAAW;IACrC;;;;;OAKG;IACH,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,WAAW;IACvD;;;;;;;;OAQG;IACH,GAAG,CACD,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,OAAO,EACjB,OAAO,CAAC,EAAE,OAAO,GAChB,WAAW;IAqCd,gDAAgD;IAChD,KAAK,IAAI,IAAI;IAKb,iEAAiE;IACjE,OAAO,IAAI,WAAW,EAAE;IAIxB,4DAA4D;IAC5D,IAAI,OAAO,IAAI,WAAW,GAAG,SAAS,CAErC;IACD,IAAI,OAAO,CAAC,EAAE,EAAE,WAAW,GAAG,SAAS,EAOtC;IAED,+EAA+E;IAC/E,gBAAgB,CAAC,aAAa,GAAE,OAAe,GAAG,MAAM;IAaxD,6EAA6E;IAC7E,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,WAAW,CAAC;IAW1C,8DAA8D;IAC9D,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS;IAM/D,6DAA6D;IAC7D,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS;IAM7D,sDAAsD;IACtD,IAAI,KAAK,IAAI,MAAM,CAElB;CACF"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { AcEdKeyword } from './AcEdKeyword';
|
|
2
|
+
/**
|
|
3
|
+
* A collection of `AcEdKeyword` objects, mirroring `Autodesk.AutoCAD.EditorInput.KeywordCollection`.
|
|
4
|
+
* Represents the set of valid keywords for a prompt.
|
|
5
|
+
*/
|
|
6
|
+
var AcEdKeywordCollection = /** @class */ (function () {
|
|
7
|
+
/** Constructs a new, empty `AcEdKeywordCollection`. */
|
|
8
|
+
function AcEdKeywordCollection() {
|
|
9
|
+
this._keywords = [];
|
|
10
|
+
}
|
|
11
|
+
AcEdKeywordCollection.prototype.add = function (a, b, c, enabled, visible) {
|
|
12
|
+
if (enabled === void 0) { enabled = true; }
|
|
13
|
+
if (visible === void 0) { visible = true; }
|
|
14
|
+
var displayName, globalName, localName;
|
|
15
|
+
if (b === undefined) {
|
|
16
|
+
displayName = a;
|
|
17
|
+
globalName = a;
|
|
18
|
+
localName = a;
|
|
19
|
+
}
|
|
20
|
+
else if (c === undefined) {
|
|
21
|
+
displayName = b;
|
|
22
|
+
globalName = a;
|
|
23
|
+
localName = b;
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
displayName = a;
|
|
27
|
+
globalName = b;
|
|
28
|
+
localName = c;
|
|
29
|
+
}
|
|
30
|
+
var kw = new AcEdKeyword(displayName, globalName, localName, enabled, false, visible);
|
|
31
|
+
this._keywords.push(kw);
|
|
32
|
+
return kw;
|
|
33
|
+
};
|
|
34
|
+
/** Removes all keywords from the collection. */
|
|
35
|
+
AcEdKeywordCollection.prototype.clear = function () {
|
|
36
|
+
this._keywords = [];
|
|
37
|
+
this._defaultKeyword = undefined;
|
|
38
|
+
};
|
|
39
|
+
/** Copies the keywords of this collection into a plain array. */
|
|
40
|
+
AcEdKeywordCollection.prototype.toArray = function () {
|
|
41
|
+
return this._keywords.slice();
|
|
42
|
+
};
|
|
43
|
+
Object.defineProperty(AcEdKeywordCollection.prototype, "default", {
|
|
44
|
+
/** Gets or sets the default keyword for this collection. */
|
|
45
|
+
get: function () {
|
|
46
|
+
return this._defaultKeyword;
|
|
47
|
+
},
|
|
48
|
+
set: function (kw) {
|
|
49
|
+
if (kw && !this._keywords.includes(kw)) {
|
|
50
|
+
throw new Error('Default keyword must be one of the collection\'s keywords');
|
|
51
|
+
}
|
|
52
|
+
this._defaultKeyword = kw;
|
|
53
|
+
},
|
|
54
|
+
enumerable: false,
|
|
55
|
+
configurable: true
|
|
56
|
+
});
|
|
57
|
+
/** Returns a string representing the visible, enabled keywords for display. */
|
|
58
|
+
AcEdKeywordCollection.prototype.getDisplayString = function (showNoDefault) {
|
|
59
|
+
var _this = this;
|
|
60
|
+
if (showNoDefault === void 0) { showNoDefault = false; }
|
|
61
|
+
var parts = this._keywords
|
|
62
|
+
.filter(function (kw) { return kw.visible && kw.enabled; })
|
|
63
|
+
.map(function (kw) {
|
|
64
|
+
if (!showNoDefault && _this._defaultKeyword === kw) {
|
|
65
|
+
return kw.displayName;
|
|
66
|
+
}
|
|
67
|
+
return kw.displayName;
|
|
68
|
+
});
|
|
69
|
+
return parts.join('/');
|
|
70
|
+
};
|
|
71
|
+
/** Returns an iterator over the `AcEdKeyword` objects in this collection. */
|
|
72
|
+
AcEdKeywordCollection.prototype[Symbol.iterator] = function () {
|
|
73
|
+
var index = 0;
|
|
74
|
+
var arr = this._keywords;
|
|
75
|
+
return {
|
|
76
|
+
next: function () {
|
|
77
|
+
if (index < arr.length)
|
|
78
|
+
return { done: false, value: arr[index++] };
|
|
79
|
+
else
|
|
80
|
+
return { done: true, value: undefined };
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
/** Finds a keyword by its display name (case-insensitive). */
|
|
85
|
+
AcEdKeywordCollection.prototype.findByDisplayName = function (displayName) {
|
|
86
|
+
return this._keywords.find(function (kw) { return kw.displayName.toLowerCase() === displayName.toLowerCase(); });
|
|
87
|
+
};
|
|
88
|
+
/** Finds a keyword by its global name (case-insensitive). */
|
|
89
|
+
AcEdKeywordCollection.prototype.findByGlobalName = function (globalName) {
|
|
90
|
+
return this._keywords.find(function (kw) { return kw.globalName.toLowerCase() === globalName.toLowerCase(); });
|
|
91
|
+
};
|
|
92
|
+
Object.defineProperty(AcEdKeywordCollection.prototype, "count", {
|
|
93
|
+
/** Gets the number of keywords in this collection. */
|
|
94
|
+
get: function () {
|
|
95
|
+
return this._keywords.length;
|
|
96
|
+
},
|
|
97
|
+
enumerable: false,
|
|
98
|
+
configurable: true
|
|
99
|
+
});
|
|
100
|
+
return AcEdKeywordCollection;
|
|
101
|
+
}());
|
|
102
|
+
export { AcEdKeywordCollection };
|
|
103
|
+
//# sourceMappingURL=AcEdKeywordCollection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcEdKeywordCollection.js","sourceRoot":"","sources":["../../../../src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D,iDAAiB,GAAjB,UAAkB,WAAmB;QACnC,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CACxB,UAAA,EAAE,IAAI,OAAA,EAAE,CAAC,WAAW,CAAC,WAAW,EAAE,KAAK,WAAW,CAAC,WAAW,EAAE,EAA1D,CAA0D,CACjE,CAAA;IACH,CAAC;IAED,6DAA6D;IAC7D,gDAAgB,GAAhB,UAAiB,UAAkB;QACjC,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CACxB,UAAA,EAAE,IAAI,OAAA,EAAE,CAAC,UAAU,CAAC,WAAW,EAAE,KAAK,UAAU,CAAC,WAAW,EAAE,EAAxD,CAAwD,CAC/D,CAAA;IACH,CAAC;IAGD,sBAAI,wCAAK;QADT,sDAAsD;aACtD;YACE,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAA;QAC9B,CAAC;;;OAAA;IACH,4BAAC;AAAD,CAAC,AA5ID,IA4IC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { AcGePoint3d } from '@mlightcad/data-model';
|
|
2
|
+
import { AcEdPromptOptions } from './AcEdPromptOptions';
|
|
3
|
+
/**
|
|
4
|
+
* Options for prompting the user to enter an angle, similar to
|
|
5
|
+
* AutoCAD .NET `PromptAngleOptions`.
|
|
6
|
+
*
|
|
7
|
+
* Supports a base point, default angle, keywords, and various validation flags.
|
|
8
|
+
*/
|
|
9
|
+
export declare class AcEdPromptAngleOptions extends AcEdPromptOptions<number> {
|
|
10
|
+
private _basePoint?;
|
|
11
|
+
private _useBasePoint;
|
|
12
|
+
private _useDashedLine;
|
|
13
|
+
private _useAngleBase;
|
|
14
|
+
private _defaultValue;
|
|
15
|
+
private _useDefaultValue;
|
|
16
|
+
private _allowZero;
|
|
17
|
+
private _allowNegative;
|
|
18
|
+
/**
|
|
19
|
+
* Constructs a new `AcEdPromptAngleOptions` with a given prompt message.
|
|
20
|
+
* @param message - The prompt message shown to the user.
|
|
21
|
+
*/
|
|
22
|
+
constructor(message: string);
|
|
23
|
+
/**
|
|
24
|
+
* Gets or sets the base point for the angle prompt.
|
|
25
|
+
* Corresponds to `PromptAngleOptions.BasePoint`.
|
|
26
|
+
*/
|
|
27
|
+
get basePoint(): AcGePoint3d | undefined;
|
|
28
|
+
set basePoint(point: AcGePoint3d | undefined);
|
|
29
|
+
/**
|
|
30
|
+
* Gets or sets whether to use the base point for the prompt.
|
|
31
|
+
* When true, the prompt may render a dashed line from the base point to the cursor.
|
|
32
|
+
* Corresponds to `PromptAngleOptions.UseBasePoint`.
|
|
33
|
+
*/
|
|
34
|
+
get useBasePoint(): boolean;
|
|
35
|
+
set useBasePoint(flag: boolean);
|
|
36
|
+
/**
|
|
37
|
+
* Gets or sets whether a dashed line should indicate the base point.
|
|
38
|
+
* Corresponds to `PromptAngleOptions.UseDashedLine`.
|
|
39
|
+
*/
|
|
40
|
+
get useDashedLine(): boolean;
|
|
41
|
+
set useDashedLine(flag: boolean);
|
|
42
|
+
/**
|
|
43
|
+
* Gets or sets whether the base "angle base" should be used.
|
|
44
|
+
* Corresponds to `PromptAngleOptions.UseAngleBase`.
|
|
45
|
+
*/
|
|
46
|
+
get useAngleBase(): boolean;
|
|
47
|
+
set useAngleBase(flag: boolean);
|
|
48
|
+
/**
|
|
49
|
+
* Gets or sets the default angle value (in degrees or radians, depending on your implementation).
|
|
50
|
+
* This is used when the user presses ENTER, if `useDefaultValue` is true.
|
|
51
|
+
* Corresponds to `PromptAngleOptions.DefaultValue`.
|
|
52
|
+
*/
|
|
53
|
+
get defaultValue(): number;
|
|
54
|
+
set defaultValue(val: number);
|
|
55
|
+
/**
|
|
56
|
+
* Gets or sets whether the default value is used when the user presses ENTER.
|
|
57
|
+
* Corresponds to `PromptAngleOptions.UseDefaultValue`.
|
|
58
|
+
*/
|
|
59
|
+
get useDefaultValue(): boolean;
|
|
60
|
+
set useDefaultValue(flag: boolean);
|
|
61
|
+
/**
|
|
62
|
+
* Gets or sets whether zero-valued angles are accepted.
|
|
63
|
+
* Corresponds to `PromptAngleOptions.AllowZero`.
|
|
64
|
+
*/
|
|
65
|
+
get allowZero(): boolean;
|
|
66
|
+
set allowZero(flag: boolean);
|
|
67
|
+
/**
|
|
68
|
+
* Gets or sets whether negative-valued angles are accepted.
|
|
69
|
+
* While not always documented directly on `PromptAngleOptions`, numerical prompts in AutoCAD
|
|
70
|
+
* often support negative input via a similar property. (Analogous to PromptNumericalOptions)
|
|
71
|
+
*/
|
|
72
|
+
get allowNegative(): boolean;
|
|
73
|
+
set allowNegative(flag: boolean);
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=AcEdPromptAngleOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcEdPromptAngleOptions.d.ts","sourceRoot":"","sources":["../../../../src/editor/input/prompt/AcEdPromptAngleOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAEnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAEvD;;;;;GAKG;AACH,qBAAa,sBAAuB,SAAQ,iBAAiB,CAAC,MAAM,CAAC;IACnE,OAAO,CAAC,UAAU,CAAC,CAAa;IAChC,OAAO,CAAC,aAAa,CAAiB;IACtC,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,aAAa,CAAiB;IACtC,OAAO,CAAC,aAAa,CAAY;IACjC,OAAO,CAAC,gBAAgB,CAAiB;IACzC,OAAO,CAAC,UAAU,CAAgB;IAClC,OAAO,CAAC,cAAc,CAAiB;IAEvC;;;OAGG;gBACS,OAAO,EAAE,MAAM;IAI3B;;;OAGG;IACH,IAAI,SAAS,IAAI,WAAW,GAAG,SAAS,CAEvC;IACD,IAAI,SAAS,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,EAU3C;IAED;;;;OAIG;IACH,IAAI,YAAY,IAAI,OAAO,CAE1B;IACD,IAAI,YAAY,CAAC,IAAI,EAAE,OAAO,EAI7B;IA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