typecomposer 0.1.43 → 0.1.45
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/core/components/AlertPanel.d.ts +7 -6
- package/core/components/AlertPanel.js +3 -2
- package/core/components/AlertPanel.js.map +1 -1
- package/core/components/AvatarPanel.d.ts +3 -2
- package/core/components/AvatarPanel.js +2 -2
- package/core/components/AvatarPanel.js.map +1 -1
- package/core/components/BorderPanel.d.ts +3 -2
- package/core/components/BorderPanel.js +2 -1
- package/core/components/BorderPanel.js.map +1 -1
- package/core/components/CardPanel.d.ts +3 -2
- package/core/components/CardPanel.js +2 -1
- package/core/components/CardPanel.js.map +1 -1
- package/core/components/CheckBox.d.ts +4 -2
- package/core/components/CheckBox.js +7 -5
- package/core/components/CheckBox.js.map +1 -1
- package/core/components/ColorPicker.d.ts +3 -2
- package/core/components/ColorPicker.js +11 -8
- package/core/components/ColorPicker.js.map +1 -1
- package/core/components/ContextMenu.d.ts +5 -3
- package/core/components/ContextMenu.js +5 -3
- package/core/components/ContextMenu.js.map +1 -1
- package/core/components/DialogPanel.d.ts +5 -4
- package/core/components/DialogPanel.js +8 -8
- package/core/components/DialogPanel.js.map +1 -1
- package/core/components/DropDown.d.ts +5 -3
- package/core/components/DropDown.js +5 -3
- package/core/components/DropDown.js.map +1 -1
- package/core/components/FlowPanel.d.ts +3 -2
- package/core/components/FlowPanel.js +3 -2
- package/core/components/FlowPanel.js.map +1 -1
- package/core/components/ForEach.d.ts +3 -2
- package/core/components/ForEach.js +2 -1
- package/core/components/ForEach.js.map +1 -1
- package/core/components/GridPanel.d.ts +3 -2
- package/core/components/GridPanel.js +2 -1
- package/core/components/GridPanel.js.map +1 -1
- package/core/components/HBox.d.ts +3 -2
- package/core/components/HBox.js +2 -1
- package/core/components/HBox.js.map +1 -1
- package/core/components/LazyLoading.d.ts +3 -2
- package/core/components/LazyLoading.js +3 -2
- package/core/components/LazyLoading.js.map +1 -1
- package/core/components/ListPanel.d.ts +3 -2
- package/core/components/ListPanel.js +2 -1
- package/core/components/ListPanel.js.map +1 -1
- package/core/components/PopUpButton.d.ts +3 -2
- package/core/components/PopUpButton.js +6 -3
- package/core/components/PopUpButton.js.map +1 -1
- package/core/components/ScrollPanel.d.ts +3 -2
- package/core/components/ScrollPanel.js +2 -1
- package/core/components/ScrollPanel.js.map +1 -1
- package/core/components/SliderPanel.d.ts +3 -2
- package/core/components/SliderPanel.js +4 -5
- package/core/components/SliderPanel.js.map +1 -1
- package/core/components/StackPanel.d.ts +3 -2
- package/core/components/StackPanel.js +2 -1
- package/core/components/StackPanel.js.map +1 -1
- package/core/components/TabItem.d.ts +1 -0
- package/core/components/TabItem.js +7 -4
- package/core/components/TabItem.js.map +1 -1
- package/core/components/TabPanel.d.ts +3 -2
- package/core/components/TabPanel.js +2 -1
- package/core/components/TabPanel.js.map +1 -1
- package/core/components/TablePanel.d.ts +6 -4
- package/core/components/TablePanel.js +4 -2
- package/core/components/TablePanel.js.map +1 -1
- package/core/components/TextEdit.d.ts +1 -0
- package/core/components/TextEdit.js +4 -2
- package/core/components/TextEdit.js.map +1 -1
- package/core/components/TextField.d.ts +1 -0
- package/core/components/TextField.js +3 -2
- package/core/components/TextField.js.map +1 -1
- package/core/components/ToggleButton.d.ts +3 -2
- package/core/components/ToggleButton.js +2 -1
- package/core/components/ToggleButton.js.map +1 -1
- package/core/components/Tooltip.d.ts +3 -2
- package/core/components/Tooltip.js +2 -1
- package/core/components/Tooltip.js.map +1 -1
- package/core/components/VBox.d.ts +3 -2
- package/core/components/VBox.js +2 -1
- package/core/components/VBox.js.map +1 -1
- package/core/components/VirtualScroll copy 2.d.ts +2 -2
- package/core/components/VirtualScroll copy 2.js +2 -8
- package/core/components/VirtualScroll copy 2.js.map +1 -1
- package/core/components/VirtualScroll.d.ts +3 -2
- package/core/components/VirtualScroll.js +3 -2
- package/core/components/VirtualScroll.js.map +1 -1
- package/core/element/AbbreviationElement.d.ts +3 -2
- package/core/element/AbbreviationElement.js +2 -3
- package/core/element/AbbreviationElement.js.map +1 -1
- package/core/element/AnchorElement.d.ts +4 -3
- package/core/element/AnchorElement.js +2 -1
- package/core/element/AnchorElement.js.map +1 -1
- package/core/element/AreaElement.d.ts +3 -2
- package/core/element/AreaElement.js +2 -1
- package/core/element/AreaElement.js.map +1 -1
- package/core/element/ArticleElement.d.ts +3 -2
- package/core/element/ArticleElement.js +2 -1
- package/core/element/ArticleElement.js.map +1 -1
- package/core/element/AudioElement.d.ts +3 -2
- package/core/element/AudioElement.js +2 -1
- package/core/element/AudioElement.js.map +1 -1
- package/core/element/BaseElement.d.ts +3 -2
- package/core/element/BaseElement.js +2 -1
- package/core/element/BaseElement.js.map +1 -1
- package/core/element/BodyElement.d.ts +3 -2
- package/core/element/BodyElement.js +2 -1
- package/core/element/BodyElement.js.map +1 -1
- package/core/element/BoldElement.d.ts +3 -2
- package/core/element/BoldElement.js +2 -1
- package/core/element/BoldElement.js.map +1 -1
- package/core/element/BreakElement.d.ts +3 -2
- package/core/element/BreakElement.js +2 -1
- package/core/element/BreakElement.js.map +1 -1
- package/core/element/ButtonElement.d.ts +3 -2
- package/core/element/ButtonElement.js +2 -1
- package/core/element/ButtonElement.js.map +1 -1
- package/core/element/CanvasElement.d.ts +3 -2
- package/core/element/CanvasElement.js +2 -1
- package/core/element/CanvasElement.js.map +1 -1
- package/core/element/CaptionElement.d.ts +3 -2
- package/core/element/CaptionElement.js +2 -1
- package/core/element/CaptionElement.js.map +1 -1
- package/core/element/CiteElement.d.ts +3 -2
- package/core/element/CiteElement.js +2 -1
- package/core/element/CiteElement.js.map +1 -1
- package/core/element/CodeElement.d.ts +3 -2
- package/core/element/CodeElement.js +2 -1
- package/core/element/CodeElement.js.map +1 -1
- package/core/element/DataListElement.d.ts +3 -2
- package/core/element/DataListElement.js +2 -1
- package/core/element/DataListElement.js.map +1 -1
- package/core/element/DefinitionDescriptionElement.d.ts +3 -2
- package/core/element/DefinitionDescriptionElement.js +2 -1
- package/core/element/DefinitionDescriptionElement.js.map +1 -1
- package/core/element/DefinitionElement.d.ts +3 -2
- package/core/element/DefinitionElement.js +2 -1
- package/core/element/DefinitionElement.js.map +1 -1
- package/core/element/DeletedTextElement.d.ts +3 -2
- package/core/element/DeletedTextElement.js +2 -1
- package/core/element/DeletedTextElement.js.map +1 -1
- package/core/element/DetailsElement.d.ts +3 -2
- package/core/element/DetailsElement.js +2 -1
- package/core/element/DetailsElement.js.map +1 -1
- package/core/element/DialogElement.d.ts +3 -2
- package/core/element/DialogElement.js +2 -1
- package/core/element/DialogElement.js.map +1 -1
- package/core/element/DivElement.d.ts +3 -2
- package/core/element/DivElement.js +2 -1
- package/core/element/DivElement.js.map +1 -1
- package/core/element/EmElement.d.ts +3 -2
- package/core/element/EmElement.js +2 -1
- package/core/element/EmElement.js.map +1 -1
- package/core/element/EmbedElement.d.ts +3 -2
- package/core/element/EmbedElement.js +2 -1
- package/core/element/EmbedElement.js.map +1 -1
- package/core/element/FieldSetElement.d.ts +3 -2
- package/core/element/FieldSetElement.js +2 -1
- package/core/element/FieldSetElement.js.map +1 -1
- package/core/element/FooterElement.d.ts +3 -2
- package/core/element/FooterElement.js +2 -1
- package/core/element/FooterElement.js.map +1 -1
- package/core/element/FormElement.d.ts +3 -2
- package/core/element/FormElement.js +2 -1
- package/core/element/FormElement.js.map +1 -1
- package/core/element/Fragment.d.ts +0 -1
- package/core/element/Fragment.js +6 -50
- package/core/element/Fragment.js.map +1 -1
- package/core/element/H1Element.d.ts +3 -2
- package/core/element/H1Element.js +2 -1
- package/core/element/H1Element.js.map +1 -1
- package/core/element/H2Element.d.ts +3 -2
- package/core/element/H2Element.js +2 -1
- package/core/element/H2Element.js.map +1 -1
- package/core/element/H3Element.d.ts +3 -2
- package/core/element/H3Element.js +2 -1
- package/core/element/H3Element.js.map +1 -1
- package/core/element/H4Element.d.ts +3 -2
- package/core/element/H4Element.js +2 -1
- package/core/element/H4Element.js.map +1 -1
- package/core/element/H5Element.d.ts +3 -2
- package/core/element/H5Element.js +2 -1
- package/core/element/H5Element.js.map +1 -1
- package/core/element/H6Element.d.ts +3 -2
- package/core/element/H6Element.js +2 -1
- package/core/element/H6Element.js.map +1 -1
- package/core/element/HeadElement.d.ts +3 -2
- package/core/element/HeadElement.js +2 -1
- package/core/element/HeadElement.js.map +1 -1
- package/core/element/HeaderElement.d.ts +3 -2
- package/core/element/HeaderElement.js +2 -1
- package/core/element/HeaderElement.js.map +1 -1
- package/core/element/HorizontalRuleElement.d.ts +3 -2
- package/core/element/HorizontalRuleElement.js +2 -1
- package/core/element/HorizontalRuleElement.js.map +1 -1
- package/core/element/HtmlElement.d.ts +3 -2
- package/core/element/HtmlElement.js +2 -1
- package/core/element/HtmlElement.js.map +1 -1
- package/core/element/IFrameElement.d.ts +3 -2
- package/core/element/IFrameElement.js +2 -1
- package/core/element/IFrameElement.js.map +1 -1
- package/core/element/ILayout.d.ts +3 -2
- package/core/element/ILayout.js +2 -1
- package/core/element/ILayout.js.map +1 -1
- package/core/element/IconElement.d.ts +3 -2
- package/core/element/IconElement.js +2 -1
- package/core/element/IconElement.js.map +1 -1
- package/core/element/IdiomaticElement.d.ts +1 -0
- package/core/element/IdiomaticElement.js +2 -1
- package/core/element/IdiomaticElement.js.map +1 -1
- package/core/element/ImageElement.d.ts +3 -2
- package/core/element/ImageElement.js +2 -1
- package/core/element/ImageElement.js.map +1 -1
- package/core/element/InputElement.d.ts +3 -2
- package/core/element/InputElement.js +2 -1
- package/core/element/InputElement.js.map +1 -1
- package/core/element/LabelElement.d.ts +3 -2
- package/core/element/LabelElement.js +2 -1
- package/core/element/LabelElement.js.map +1 -1
- package/core/element/LegendElement.d.ts +3 -2
- package/core/element/LegendElement.js +2 -1
- package/core/element/LegendElement.js.map +1 -1
- package/core/element/ListItemElement.d.ts +3 -2
- package/core/element/ListItemElement.js +2 -1
- package/core/element/ListItemElement.js.map +1 -1
- package/core/element/MainElement.d.ts +3 -2
- package/core/element/MainElement.js +2 -1
- package/core/element/MainElement.js.map +1 -1
- package/core/element/NavElement.d.ts +3 -2
- package/core/element/NavElement.js +2 -1
- package/core/element/NavElement.js.map +1 -1
- package/core/element/OrderedListElement.d.ts +3 -2
- package/core/element/OrderedListElement.js +2 -1
- package/core/element/OrderedListElement.js.map +1 -1
- package/core/element/ParagraphElement.d.ts +3 -2
- package/core/element/ParagraphElement.js +2 -1
- package/core/element/ParagraphElement.js.map +1 -1
- package/core/element/PreElement.d.ts +3 -2
- package/core/element/PreElement.js +2 -1
- package/core/element/PreElement.js.map +1 -1
- package/core/element/SectionElement.d.ts +3 -2
- package/core/element/SectionElement.js +2 -1
- package/core/element/SectionElement.js.map +1 -1
- package/core/element/SelectElement.d.ts +3 -2
- package/core/element/SelectElement.js +2 -1
- package/core/element/SelectElement.js.map +1 -1
- package/core/element/SourceElement.d.ts +3 -2
- package/core/element/SourceElement.js +2 -1
- package/core/element/SourceElement.js.map +1 -1
- package/core/element/SpanElement.d.ts +3 -2
- package/core/element/SpanElement.js +2 -1
- package/core/element/SpanElement.js.map +1 -1
- package/core/element/StrongElement.d.ts +3 -2
- package/core/element/StrongElement.js +2 -1
- package/core/element/StrongElement.js.map +1 -1
- package/core/element/StyleElement.d.ts +3 -2
- package/core/element/StyleElement.js +2 -1
- package/core/element/StyleElement.js.map +1 -1
- package/core/element/SummaryElement.d.ts +3 -2
- package/core/element/SummaryElement.js +2 -1
- package/core/element/SummaryElement.js.map +1 -1
- package/core/element/SvgElement.d.ts +4 -3
- package/core/element/SvgElement.js +1 -0
- package/core/element/SvgElement.js.map +1 -1
- package/core/element/TableBodyElement.d.ts +3 -2
- package/core/element/TableBodyElement.js +2 -1
- package/core/element/TableBodyElement.js.map +1 -1
- package/core/element/TableCellElement.d.ts +3 -2
- package/core/element/TableCellElement.js +2 -1
- package/core/element/TableCellElement.js.map +1 -1
- package/core/element/TableColElement.d.ts +3 -2
- package/core/element/TableColElement.js +2 -1
- package/core/element/TableColElement.js.map +1 -1
- package/core/element/TableColGroupElement.d.ts +3 -2
- package/core/element/TableColGroupElement.js +2 -1
- package/core/element/TableColGroupElement.js.map +1 -1
- package/core/element/TableElement.d.ts +3 -2
- package/core/element/TableElement.js +2 -1
- package/core/element/TableElement.js.map +1 -1
- package/core/element/TableFootElement.d.ts +3 -2
- package/core/element/TableFootElement.js +2 -1
- package/core/element/TableFootElement.js.map +1 -1
- package/core/element/TableFootRowElement.d.ts +3 -2
- package/core/element/TableFootRowElement.js +2 -1
- package/core/element/TableFootRowElement.js.map +1 -1
- package/core/element/TableHeadCellElement.d.ts +3 -2
- package/core/element/TableHeadCellElement.js +2 -1
- package/core/element/TableHeadCellElement.js.map +1 -1
- package/core/element/TableHeadElement.d.ts +3 -2
- package/core/element/TableHeadElement.js +2 -1
- package/core/element/TableHeadElement.js.map +1 -1
- package/core/element/TableHeadRowElement.d.ts +3 -2
- package/core/element/TableHeadRowElement.js +2 -1
- package/core/element/TableHeadRowElement.js.map +1 -1
- package/core/element/TableRowElement.d.ts +3 -2
- package/core/element/TableRowElement.js +2 -1
- package/core/element/TableRowElement.js.map +1 -1
- package/core/element/TextAreaElement.d.ts +3 -2
- package/core/element/TextAreaElement.js +2 -1
- package/core/element/TextAreaElement.js.map +1 -1
- package/core/element/UListElement.d.ts +3 -2
- package/core/element/UListElement.js +2 -1
- package/core/element/UListElement.js.map +1 -1
- package/core/element/VideoElement.d.ts +3 -2
- package/core/element/VideoElement.js +2 -1
- package/core/element/VideoElement.js.map +1 -1
- package/core/ref/Computed.d.ts +3 -0
- package/core/ref/Computed.js +75 -0
- package/core/ref/Computed.js.map +1 -0
- package/core/ref/RefBoolean.d.ts +72 -7
- package/core/ref/RefBoolean.js +68 -7
- package/core/ref/RefBoolean.js.map +1 -1
- package/core/ref/RefContainer.d.ts +5 -2
- package/core/ref/RefContainer.js +14 -6
- package/core/ref/RefContainer.js.map +1 -1
- package/core/ref/RefList.d.ts +84 -16
- package/core/ref/RefList.js +112 -32
- package/core/ref/RefList.js.map +1 -1
- package/core/ref/RefMap.d.ts +82 -7
- package/core/ref/RefMap.js +88 -10
- package/core/ref/RefMap.js.map +1 -1
- package/core/ref/RefNumber.d.ts +103 -15
- package/core/ref/RefNumber.js +117 -29
- package/core/ref/RefNumber.js.map +1 -1
- package/core/ref/RefObject copy.d.ts +124 -0
- package/core/ref/RefObject copy.js +271 -0
- package/core/ref/RefObject copy.js.map +1 -0
- package/core/ref/RefObject.d.ts +94 -8
- package/core/ref/RefObject.js +56 -51
- package/core/ref/RefObject.js.map +1 -1
- package/core/ref/RefSet.d.ts +78 -4
- package/core/ref/RefSet.js +86 -10
- package/core/ref/RefSet.js.map +1 -1
- package/core/ref/RefState.d.ts +1 -0
- package/core/ref/RefState.js +3 -0
- package/core/ref/RefState.js.map +1 -1
- package/core/ref/RefString.d.ts +114 -41
- package/core/ref/RefString.js +141 -164
- package/core/ref/RefString.js.map +1 -1
- package/core/ref/index.d.ts +1 -1
- package/core/ref/index.js +1 -2
- package/core/ref/index.js.map +1 -1
- package/core/router/RouteView.d.ts +3 -2
- package/core/router/RouteView.js +2 -1
- package/core/router/RouteView.js.map +1 -1
- package/core/styles/index.d.ts +2 -2
- package/core/styles/index.js.map +1 -1
- package/global/index.d.ts +5 -4
- package/global/index.js +395 -225
- package/global/index.js.map +1 -1
- package/package.json +3 -3
- package/typings/index.d.ts +11 -2
package/core/ref/RefBoolean.js
CHANGED
|
@@ -1,56 +1,117 @@
|
|
|
1
1
|
import { Ref } from ".";
|
|
2
2
|
import { RefContainer } from "./RefContainer";
|
|
3
|
+
/**
|
|
4
|
+
* Creates a new reactive boolean reference.
|
|
5
|
+
*
|
|
6
|
+
* @param value - The initial boolean value.
|
|
7
|
+
* @returns A new instance of RefBoolean.
|
|
8
|
+
*/
|
|
3
9
|
export function refBoolean(value) {
|
|
4
10
|
return new RefBoolean(value);
|
|
5
11
|
}
|
|
12
|
+
// Customizes instanceof behavior for type checking
|
|
6
13
|
Object.defineProperty(refBoolean, Symbol.hasInstance, {
|
|
7
14
|
value: function (instance) {
|
|
8
15
|
return !!instance && instance instanceof RefBoolean;
|
|
9
16
|
},
|
|
10
17
|
});
|
|
18
|
+
/**
|
|
19
|
+
* Reactive wrapper for a boolean value, supporting subscriptions and reactivity.
|
|
20
|
+
*/
|
|
11
21
|
export class RefBoolean {
|
|
22
|
+
/**
|
|
23
|
+
* Internal container that manages subscribers and the current value.
|
|
24
|
+
*/
|
|
12
25
|
container;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
26
|
+
id;
|
|
27
|
+
/**
|
|
28
|
+
* Constructs a reactive boolean wrapper.
|
|
29
|
+
*
|
|
30
|
+
* @param value - The initial boolean value.
|
|
31
|
+
* @param refKey - Optional key used for registration in a central Ref registry.
|
|
32
|
+
*/
|
|
33
|
+
constructor(value) {
|
|
16
34
|
this.container = new RefContainer(value);
|
|
17
|
-
|
|
18
|
-
|
|
35
|
+
this.id = this.container.id;
|
|
36
|
+
// Registers in Ref registry if key is provided
|
|
37
|
+
Ref.set(this.id, this);
|
|
19
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Emits a change if the new value differs from the current value.
|
|
41
|
+
*
|
|
42
|
+
* @param propertyName - The property being updated (typically "value").
|
|
43
|
+
* @param value - The new value being set.
|
|
44
|
+
*/
|
|
20
45
|
// @ts-ignore
|
|
21
46
|
emit(propertyName, value) {
|
|
22
47
|
if (this.value === value)
|
|
23
48
|
return;
|
|
24
|
-
|
|
49
|
+
const oldValue = this.valueOf();
|
|
50
|
+
this.container.emitAll(propertyName, (this.container.value = value.valueOf()), oldValue);
|
|
25
51
|
}
|
|
26
52
|
subscribe(target, propertyName, onUnsubscribe) {
|
|
27
|
-
return this.container.emit(this.container.subscribe(target, propertyName, onUnsubscribe), this.value);
|
|
53
|
+
return this.container.emit(this.container.subscribe(target, propertyName, onUnsubscribe), this.value, this.value);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Subscribes to value changes without emitting the current value.
|
|
57
|
+
*
|
|
58
|
+
* @param target - Callback function to be invoked on future value changes.
|
|
59
|
+
* @param onUnsubscribe - Optional callback to be invoked when unsubscribed.
|
|
60
|
+
* @returns true if subscription was successful.
|
|
61
|
+
*/
|
|
62
|
+
listen(target, onUnsubscribe) {
|
|
63
|
+
return this.container.subscribe(target, onUnsubscribe) !== undefined;
|
|
28
64
|
}
|
|
29
65
|
unsubscribe(targe, propertyName = "") {
|
|
30
66
|
return this.container.unsubscribe(targe, propertyName);
|
|
31
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* Provides primitive conversion support for the boolean wrapper.
|
|
70
|
+
*
|
|
71
|
+
* @param hint - The conversion context ("default", "number", "string", etc.)
|
|
72
|
+
* @returns The primitive boolean value.
|
|
73
|
+
*/
|
|
32
74
|
[Symbol.toPrimitive](hint) {
|
|
33
75
|
if (hint === "boolean" || hint === "default") {
|
|
34
76
|
return this.value;
|
|
35
77
|
}
|
|
36
78
|
return this.valueOf();
|
|
37
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* Specifies the primitive type associated with this object.
|
|
82
|
+
*/
|
|
38
83
|
static get [Symbol.species]() {
|
|
39
84
|
return Boolean;
|
|
40
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* Gets the current boolean value.
|
|
88
|
+
*/
|
|
41
89
|
get value() {
|
|
42
90
|
return this.container.value.valueOf();
|
|
43
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* Sets a new boolean value and notifies subscribers if changed.
|
|
94
|
+
*/
|
|
44
95
|
set value(value) {
|
|
45
96
|
this.emit("value", value);
|
|
46
97
|
}
|
|
98
|
+
/**
|
|
99
|
+
* Returns the primitive boolean value.
|
|
100
|
+
*/
|
|
47
101
|
valueOf() {
|
|
48
102
|
return this.value.valueOf();
|
|
49
103
|
}
|
|
104
|
+
/**
|
|
105
|
+
* Returns a JSON-serializable representation of this boolean.
|
|
106
|
+
* If this is a root ref, only the value is returned. Otherwise, a wrapped object is returned.
|
|
107
|
+
*/
|
|
50
108
|
// @ts-ignore
|
|
51
109
|
toJSON() {
|
|
52
110
|
return this.container.root ? this.value : { value: this.value };
|
|
53
111
|
}
|
|
112
|
+
/**
|
|
113
|
+
* Returns a string representation of the current value.
|
|
114
|
+
*/
|
|
54
115
|
toString() {
|
|
55
116
|
return this.container.toString();
|
|
56
117
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RefBoolean.js","sourceRoot":"","sources":["../../../src/core/ref/RefBoolean.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAO,MAAM,GAAG,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,UAAU,UAAU,CAAC,KAAc;IACvC,OAAO,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC;AAED,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,WAAW,EAAE;IACpD,KAAK,EAAE,UAAU,QAAa;QAC5B,OAAO,CAAC,CAAC,QAAQ,IAAI,QAAQ,YAAY,UAAU,CAAC;IACtD,CAAC;CACF,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"RefBoolean.js","sourceRoot":"","sources":["../../../src/core/ref/RefBoolean.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAO,MAAM,GAAG,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,KAAc;IACvC,OAAO,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC;AAED,mDAAmD;AACnD,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,WAAW,EAAE;IACpD,KAAK,EAAE,UAAU,QAAa;QAC5B,OAAO,CAAC,CAAC,QAAQ,IAAI,QAAQ,YAAY,UAAU,CAAC;IACtD,CAAC;CACF,CAAC,CAAC;AAOH;;GAEG;AACH,MAAM,OAAO,UAAU;IACrB;;OAEG;IACc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;QAC/B,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YAC7C,OAAO,IAAI,CAAC,KAAK,CAAC;QACpB,CAAC;QACD,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;IACxB,CAAC;IAED;;OAEG;IACH,MAAM,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC;QACzB,OAAO,OAAO,CAAC;IACjB,CAAC;IAED;;OAEG;IACH,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;IACxC,CAAC;IAED;;OAEG;IACH,IAAI,KAAK,CAAC,KAAc;QACtB,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,OAAO;QACL,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;IAC9B,CAAC;IAED;;;OAGG;IACH,aAAa;IACb,MAAM;QACJ,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;IAClE,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;IACnC,CAAC;CACF"}
|
|
@@ -9,14 +9,17 @@ export declare class RefContainer {
|
|
|
9
9
|
#private;
|
|
10
10
|
value?: any;
|
|
11
11
|
readonly root?: RefContainer;
|
|
12
|
+
readonly id: string;
|
|
12
13
|
constructor(value?: any, root?: RefContainer);
|
|
13
|
-
emit(subscriber: IRefSubscriber, value: any): boolean;
|
|
14
|
-
|
|
14
|
+
emit(subscriber: IRefSubscriber, value: any, oldValue: any): boolean;
|
|
15
|
+
info(): void;
|
|
16
|
+
emitAll(propertyName: string | symbol, value: any, oldValue: any): any;
|
|
15
17
|
getSubscriber(target: object | Function, propertyName: string | symbol | Function): {
|
|
16
18
|
subscriber?: IRefSubscriber;
|
|
17
19
|
index: number;
|
|
18
20
|
};
|
|
19
21
|
subscribe(target: any, propertyName: any, onUnsubscribe?: any): IRefSubscriber;
|
|
22
|
+
listen(target: (arg: any) => void, onUnsubscribe?: Function): IRefSubscriber;
|
|
20
23
|
unsubscribe(target: object | Function, propertyName: string | symbol): boolean;
|
|
21
24
|
[Symbol.toPrimitive](hint: string): string;
|
|
22
25
|
toString(): string;
|
package/core/ref/RefContainer.js
CHANGED
|
@@ -3,14 +3,16 @@ const refSubscriber = Symbol("refSubscriber");
|
|
|
3
3
|
export class RefContainer {
|
|
4
4
|
value;
|
|
5
5
|
root;
|
|
6
|
+
static #index = 0;
|
|
6
7
|
#subscribers = [];
|
|
8
|
+
id = `${Math.random().toString(36).substring(2, 4)}${RefContainer.#index++}`;
|
|
7
9
|
constructor(value, root) {
|
|
8
10
|
this.value = value;
|
|
9
11
|
this.root = root;
|
|
10
12
|
}
|
|
11
|
-
emit(subscriber, value) {
|
|
13
|
+
emit(subscriber, value, oldValue) {
|
|
12
14
|
if (subscriber.target instanceof Function) {
|
|
13
|
-
subscriber.target(value);
|
|
15
|
+
subscriber.target(value, oldValue);
|
|
14
16
|
}
|
|
15
17
|
else {
|
|
16
18
|
const target = subscriber.target.deref();
|
|
@@ -19,18 +21,21 @@ export class RefContainer {
|
|
|
19
21
|
return false;
|
|
20
22
|
}
|
|
21
23
|
if (typeof target[subscriber.propertyName] === "function")
|
|
22
|
-
target[subscriber.propertyName](value);
|
|
24
|
+
target[subscriber.propertyName](value, oldValue);
|
|
23
25
|
else if (target[subscriber.propertyName] !== value) {
|
|
24
26
|
target[subscriber.propertyName] = value;
|
|
25
27
|
}
|
|
26
28
|
}
|
|
27
29
|
return true;
|
|
28
30
|
}
|
|
31
|
+
info() {
|
|
32
|
+
console.log("RefContainer info: ", this.value, "subscribers: ", this.#subscribers);
|
|
33
|
+
}
|
|
29
34
|
// @ts-ignore
|
|
30
|
-
emitAll(propertyName, value) {
|
|
31
|
-
this.#subscribers.forEach((s) => this.emit(s, value));
|
|
35
|
+
emitAll(propertyName, value, oldValue) {
|
|
36
|
+
this.#subscribers.forEach((s) => this.emit(s, value, oldValue));
|
|
32
37
|
if (this.root && this.root.emitAll)
|
|
33
|
-
this.root.emitAll("value", this.root["instance"] ? this.root["instance"]["value"] : this.root.value);
|
|
38
|
+
this.root.emitAll("value", this.root["instance"] ? this.root["instance"]["value"] : this.root.value, oldValue);
|
|
34
39
|
return value;
|
|
35
40
|
}
|
|
36
41
|
getSubscriber(target, propertyName) {
|
|
@@ -68,6 +73,9 @@ export class RefContainer {
|
|
|
68
73
|
Ref.subscribe(target, typeof propertyName === "string" ? propertyName : "", this);
|
|
69
74
|
return subscriber;
|
|
70
75
|
}
|
|
76
|
+
listen(target, onUnsubscribe) {
|
|
77
|
+
return this.subscribe(target, onUnsubscribe);
|
|
78
|
+
}
|
|
71
79
|
unsubscribe(target, propertyName) {
|
|
72
80
|
const resutl = this.getSubscriber(target, propertyName);
|
|
73
81
|
if (resutl.subscriber === undefined)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RefContainer.js","sourceRoot":"","sources":["../../../src/core/ref/RefContainer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC;AAExB,MAAM,aAAa,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;AAS9C,MAAM,OAAO,YAAY;
|
|
1
|
+
{"version":3,"file":"RefContainer.js","sourceRoot":"","sources":["../../../src/core/ref/RefContainer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC;AAExB,MAAM,aAAa,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;AAS9C,MAAM,OAAO,YAAY;IAOd;IACS;IAPlB,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;IAElB,YAAY,GAAqB,EAAE,CAAC;IAC3B,EAAE,GAAG,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+1,55 @@
|
|
|
1
1
|
import { ref } from ".";
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Creates a new reactive list wrapper around a standard array.
|
|
4
|
+
*
|
|
5
|
+
* @param items - The initial array of items.
|
|
6
|
+
* @returns A new instance of RefList.
|
|
7
|
+
*/
|
|
3
8
|
export declare function refList<T>(items: T[]): RefList<T>;
|
|
9
|
+
/**
|
|
10
|
+
* Type alias representing a reactive list of items of type T.
|
|
11
|
+
*/
|
|
4
12
|
export type refList<T> = RefList<T>;
|
|
13
|
+
/**
|
|
14
|
+
* A reactive wrapper for arrays that notifies subscribers on mutation.
|
|
15
|
+
* Inherits from Array and intercepts mutations like push, pop, splice, etc.
|
|
16
|
+
*/
|
|
5
17
|
export declare class RefList<T = any> extends Array<T> implements ref<T[]> {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Internal container that manages the reactive value and its subscribers.
|
|
20
|
+
*/
|
|
21
|
+
private readonly container;
|
|
22
|
+
readonly id: string;
|
|
23
|
+
/**
|
|
24
|
+
* Constructs a new RefList instance with the given items.
|
|
25
|
+
*
|
|
26
|
+
* @param items - The initial items for the list.
|
|
27
|
+
* @param refKey - Optional key used for registration in a central Ref registry.
|
|
28
|
+
*/
|
|
29
|
+
constructor(items: T[]);
|
|
30
|
+
/**
|
|
31
|
+
* Emits a change event to all subscribers for a specific mutation.
|
|
32
|
+
*
|
|
33
|
+
* @param propertyName - The type of mutation (e.g., "push", "splice", "value").
|
|
34
|
+
* @param value - The new list value.
|
|
35
|
+
*/
|
|
9
36
|
private emit;
|
|
10
|
-
|
|
11
|
-
subscribe(target: (
|
|
37
|
+
/** Reactive subscription methods **/
|
|
38
|
+
subscribe(target: (value: T[], oldValue: T[]) => void): boolean;
|
|
39
|
+
subscribe(target: (value: T[], oldValue: T[]) => void, onUnsubscribe: Function): boolean;
|
|
12
40
|
subscribe(target: object, propertyName: string | symbol): boolean;
|
|
13
41
|
subscribe(target: object, propertyName: string | symbol, onUnsubscribe: Function): boolean;
|
|
14
|
-
subscribe(target: object | ((
|
|
42
|
+
subscribe(target: object | ((value: T[], oldValue: T[]) => void), propertyName: string | symbol | Function, onUnsubscribe?: Function): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Subscribes to future changes without emitting the current value.
|
|
45
|
+
*/
|
|
46
|
+
listen(target: (value: T[], oldValue: T[]) => void, onUnsubscribe?: Function): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Unsubscribes a function or object-property pair from list updates.
|
|
49
|
+
*/
|
|
15
50
|
unsubscribe(target: (arg: T[]) => void): boolean;
|
|
16
51
|
unsubscribe(target: object, propertyName: string | symbol): boolean;
|
|
52
|
+
/** Reactive mutation overrides **/
|
|
17
53
|
push(...items: T[]): number;
|
|
18
54
|
pop(): T | undefined;
|
|
19
55
|
shift(): T | undefined;
|
|
@@ -24,29 +60,61 @@ export declare class RefList<T = any> extends Array<T> implements ref<T[]> {
|
|
|
24
60
|
reverse(): T[];
|
|
25
61
|
fill(value: T, start?: number, end?: number): this;
|
|
26
62
|
copyWithin(target: number, start: number, end?: number): this;
|
|
63
|
+
/**
|
|
64
|
+
* Changes the length of the array and emits a change.
|
|
65
|
+
*/
|
|
27
66
|
set length(value: number);
|
|
67
|
+
/**
|
|
68
|
+
* Clears all elements in the list.
|
|
69
|
+
*/
|
|
28
70
|
clear(): void;
|
|
71
|
+
/**
|
|
72
|
+
* Inserts items at a specific index.
|
|
73
|
+
*/
|
|
29
74
|
insert(index: number, ...items: T[]): number;
|
|
75
|
+
/**
|
|
76
|
+
* Removes a specific item from the list.
|
|
77
|
+
*/
|
|
30
78
|
removeItem(value: T): T;
|
|
79
|
+
/**
|
|
80
|
+
* Removes elements starting from an index.
|
|
81
|
+
*/
|
|
31
82
|
remove(index: number, count?: number): number;
|
|
83
|
+
/**
|
|
84
|
+
* Returns a shallow copy of the current list.
|
|
85
|
+
*/
|
|
32
86
|
valueOf(): T[];
|
|
33
87
|
get length(): number;
|
|
34
88
|
/**
|
|
35
|
-
* Synchronizes the children of an HTML element
|
|
36
|
-
* Ensures that the `element` contains the same elements as in the `list`, in the same order.
|
|
37
|
-
*
|
|
38
|
-
* Behavior:
|
|
39
|
-
* 1. Removes children from `element` that are not in `list`.
|
|
40
|
-
* 2. Appends elements from `list` to `element` that are not already present.
|
|
41
|
-
* 3. Reorders children of `element` to match the order in `list`.
|
|
89
|
+
* Synchronizes the children of an HTML element with a list of HTMLElements.
|
|
42
90
|
*
|
|
43
|
-
* @param list -
|
|
44
|
-
* @param element - The
|
|
91
|
+
* @param list - The list of elements to reflect in the container.
|
|
92
|
+
* @param element - The container element whose children will be updated.
|
|
45
93
|
*/
|
|
46
94
|
static syncComponentWithList(list: Element[], element: HTMLElement): void;
|
|
95
|
+
/**
|
|
96
|
+
* Identifies this object as a custom reactive list in `Object.prototype.toString`.
|
|
97
|
+
*/
|
|
47
98
|
get [Symbol.toStringTag](): string;
|
|
99
|
+
/**
|
|
100
|
+
* Ensures Array is returned when using methods like `slice()` or `map()`.
|
|
101
|
+
*/
|
|
48
102
|
static get [Symbol.species](): ArrayConstructor;
|
|
103
|
+
/**
|
|
104
|
+
* Gets the current value of the reactive list.
|
|
105
|
+
* Returns a shallow copy of the internal array to prevent direct mutation.
|
|
106
|
+
*/
|
|
49
107
|
get value(): T[];
|
|
108
|
+
/**
|
|
109
|
+
* Replaces the entire contents of the list with a new array of items.
|
|
110
|
+
* If the same array reference is passed, no update or notification occurs.
|
|
111
|
+
*
|
|
112
|
+
* @param value - The new array of items to assign.
|
|
113
|
+
*/
|
|
50
114
|
set value(value: T[]);
|
|
115
|
+
/**
|
|
116
|
+
* Serializes the current list value for JSON output.
|
|
117
|
+
* This ensures only the raw array contents are emitted.
|
|
118
|
+
*/
|
|
51
119
|
toJSON(): T[];
|
|
52
120
|
}
|
package/core/ref/RefList.js
CHANGED
|
@@ -1,102 +1,171 @@
|
|
|
1
1
|
import { Ref } from ".";
|
|
2
2
|
import { RefContainer } from "./RefContainer";
|
|
3
|
+
/**
|
|
4
|
+
* Creates a new reactive list wrapper around a standard array.
|
|
5
|
+
*
|
|
6
|
+
* @param items - The initial array of items.
|
|
7
|
+
* @returns A new instance of RefList.
|
|
8
|
+
*/
|
|
3
9
|
export function refList(items) {
|
|
4
10
|
return new RefList(items);
|
|
5
11
|
}
|
|
12
|
+
// Enables `instanceof refList` to work correctly
|
|
6
13
|
Object.defineProperty(refList, Symbol.hasInstance, {
|
|
7
14
|
value: function (instance) {
|
|
8
15
|
return !!instance && instance instanceof RefList;
|
|
9
16
|
},
|
|
10
17
|
});
|
|
18
|
+
/**
|
|
19
|
+
* A reactive wrapper for arrays that notifies subscribers on mutation.
|
|
20
|
+
* Inherits from Array and intercepts mutations like push, pop, splice, etc.
|
|
21
|
+
*/
|
|
11
22
|
export class RefList extends Array {
|
|
23
|
+
/**
|
|
24
|
+
* Internal container that manages the reactive value and its subscribers.
|
|
25
|
+
*/
|
|
12
26
|
container;
|
|
13
|
-
|
|
14
|
-
|
|
27
|
+
id;
|
|
28
|
+
/**
|
|
29
|
+
* Constructs a new RefList instance with the given items.
|
|
30
|
+
*
|
|
31
|
+
* @param items - The initial items for the list.
|
|
32
|
+
* @param refKey - Optional key used for registration in a central Ref registry.
|
|
33
|
+
*/
|
|
34
|
+
constructor(items) {
|
|
15
35
|
super(...items);
|
|
16
|
-
this.refKey = refKey;
|
|
17
36
|
this.container = new RefContainer(this);
|
|
18
|
-
|
|
37
|
+
this.id = this.container.id;
|
|
38
|
+
Ref.set(this.id, this);
|
|
19
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Emits a change event to all subscribers for a specific mutation.
|
|
42
|
+
*
|
|
43
|
+
* @param propertyName - The type of mutation (e.g., "push", "splice", "value").
|
|
44
|
+
* @param value - The new list value.
|
|
45
|
+
*/
|
|
20
46
|
emit(propertyName, value) {
|
|
21
|
-
this.
|
|
47
|
+
const oldValue = this.valueOf();
|
|
48
|
+
this.container.emitAll(propertyName, value, oldValue);
|
|
22
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* Subscribes to list changes and immediately emits the current value.
|
|
52
|
+
*/
|
|
23
53
|
subscribe(target, propertyName, onUnsubscribe) {
|
|
24
|
-
return this.container.emit(this.container.subscribe(target, propertyName, onUnsubscribe), this);
|
|
54
|
+
return this.container.emit(this.container.subscribe(target, propertyName, onUnsubscribe), this, this.valueOf());
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Subscribes to future changes without emitting the current value.
|
|
58
|
+
*/
|
|
59
|
+
listen(target, onUnsubscribe) {
|
|
60
|
+
return this.container.subscribe(target, onUnsubscribe) !== undefined;
|
|
25
61
|
}
|
|
26
62
|
unsubscribe(targe, propertyName = "") {
|
|
27
63
|
return this.container.unsubscribe(targe, propertyName);
|
|
28
64
|
}
|
|
65
|
+
/** Reactive mutation overrides **/
|
|
29
66
|
push(...items) {
|
|
67
|
+
const oldValue = this.valueOf();
|
|
30
68
|
const n = super.push(...items);
|
|
31
|
-
this.container.emitAll("push", this);
|
|
69
|
+
this.container.emitAll("push", this, oldValue);
|
|
32
70
|
return n;
|
|
33
71
|
}
|
|
34
72
|
pop() {
|
|
73
|
+
const oldValue = this.valueOf();
|
|
35
74
|
const item = super.pop();
|
|
36
|
-
this.container.emitAll("pop", this);
|
|
75
|
+
this.container.emitAll("pop", this, oldValue);
|
|
37
76
|
return item;
|
|
38
77
|
}
|
|
39
78
|
shift() {
|
|
79
|
+
const oldValue = this.valueOf();
|
|
40
80
|
const item = super.shift();
|
|
41
|
-
this.container.emitAll("shift", this);
|
|
81
|
+
this.container.emitAll("shift", this, oldValue);
|
|
42
82
|
return item;
|
|
43
83
|
}
|
|
44
84
|
unshift(...items) {
|
|
85
|
+
const oldValue = this.valueOf();
|
|
45
86
|
const n = super.unshift(...items);
|
|
46
|
-
this.container.emitAll("unshift", this);
|
|
87
|
+
this.container.emitAll("unshift", this, oldValue);
|
|
47
88
|
return n;
|
|
48
89
|
}
|
|
49
90
|
splice(start, deleteCount = 0, ...items) {
|
|
91
|
+
const oldValue = this.valueOf();
|
|
50
92
|
const deleted = super.splice(start, deleteCount, ...items);
|
|
51
|
-
this.container.emitAll("splice", this);
|
|
93
|
+
this.container.emitAll("splice", this, oldValue);
|
|
52
94
|
return deleted;
|
|
53
95
|
}
|
|
54
96
|
sort(compareFn) {
|
|
97
|
+
const oldValue = this.valueOf();
|
|
55
98
|
super.sort(compareFn);
|
|
56
|
-
this.container.emitAll("sort", this);
|
|
99
|
+
this.container.emitAll("sort", this, oldValue);
|
|
57
100
|
return this;
|
|
58
101
|
}
|
|
59
102
|
reverse() {
|
|
103
|
+
const oldValue = this.valueOf();
|
|
60
104
|
const reversed = super.reverse();
|
|
61
|
-
this.container.emitAll("reverse", this);
|
|
105
|
+
this.container.emitAll("reverse", this, oldValue);
|
|
62
106
|
return reversed;
|
|
63
107
|
}
|
|
64
108
|
fill(value, start, end) {
|
|
109
|
+
const oldValue = this.valueOf();
|
|
65
110
|
super.fill(value, start, end);
|
|
66
|
-
this.container.emitAll("fill", this);
|
|
111
|
+
this.container.emitAll("fill", this, oldValue);
|
|
67
112
|
return this;
|
|
68
113
|
}
|
|
69
114
|
copyWithin(target, start, end) {
|
|
115
|
+
const oldValue = this.valueOf();
|
|
70
116
|
super.copyWithin(target, start, end);
|
|
71
|
-
this.container.emitAll("copyWithin", this);
|
|
117
|
+
this.container.emitAll("copyWithin", this, oldValue);
|
|
72
118
|
return this;
|
|
73
119
|
}
|
|
120
|
+
/**
|
|
121
|
+
* Changes the length of the array and emits a change.
|
|
122
|
+
*/
|
|
74
123
|
set length(value) {
|
|
124
|
+
const oldValue = this.length;
|
|
75
125
|
super.length = value;
|
|
76
|
-
this.container.emitAll("length", this);
|
|
126
|
+
this.container.emitAll("length", this, oldValue);
|
|
77
127
|
}
|
|
128
|
+
/**
|
|
129
|
+
* Clears all elements in the list.
|
|
130
|
+
*/
|
|
78
131
|
clear() {
|
|
132
|
+
const oldValue = this.length;
|
|
79
133
|
super.length = 0;
|
|
80
|
-
this.container.emitAll("clear", this);
|
|
134
|
+
this.container.emitAll("clear", this, oldValue);
|
|
81
135
|
}
|
|
136
|
+
/**
|
|
137
|
+
* Inserts items at a specific index.
|
|
138
|
+
*/
|
|
82
139
|
insert(index, ...items) {
|
|
140
|
+
const oldValue = this.valueOf();
|
|
83
141
|
super.splice(index, 0, ...items);
|
|
84
|
-
this.container.emitAll("insert", this);
|
|
142
|
+
this.container.emitAll("insert", this, oldValue);
|
|
85
143
|
return this.length;
|
|
86
144
|
}
|
|
145
|
+
/**
|
|
146
|
+
* Removes a specific item from the list.
|
|
147
|
+
*/
|
|
87
148
|
removeItem(value) {
|
|
88
149
|
const index = super.indexOf(value);
|
|
89
150
|
if (index === -1)
|
|
90
151
|
return value;
|
|
152
|
+
const oldValue = this.valueOf();
|
|
91
153
|
super.splice(index, 1);
|
|
92
|
-
this.container.emitAll("removeValue", this);
|
|
154
|
+
this.container.emitAll("removeValue", this, oldValue);
|
|
93
155
|
return value;
|
|
94
156
|
}
|
|
157
|
+
/**
|
|
158
|
+
* Removes elements starting from an index.
|
|
159
|
+
*/
|
|
95
160
|
remove(index, count = 1) {
|
|
161
|
+
const oldValue = this.valueOf();
|
|
96
162
|
super.splice(index, count);
|
|
97
|
-
this.container.emitAll("remove", this);
|
|
163
|
+
this.container.emitAll("remove", this, oldValue);
|
|
98
164
|
return this.length;
|
|
99
165
|
}
|
|
166
|
+
/**
|
|
167
|
+
* Returns a shallow copy of the current list.
|
|
168
|
+
*/
|
|
100
169
|
valueOf() {
|
|
101
170
|
return Array.from(this);
|
|
102
171
|
}
|
|
@@ -104,16 +173,10 @@ export class RefList extends Array {
|
|
|
104
173
|
return super.length;
|
|
105
174
|
}
|
|
106
175
|
/**
|
|
107
|
-
* Synchronizes the children of an HTML element
|
|
108
|
-
* Ensures that the `element` contains the same elements as in the `list`, in the same order.
|
|
176
|
+
* Synchronizes the children of an HTML element with a list of HTMLElements.
|
|
109
177
|
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
* 2. Appends elements from `list` to `element` that are not already present.
|
|
113
|
-
* 3. Reorders children of `element` to match the order in `list`.
|
|
114
|
-
*
|
|
115
|
-
* @param list - An array of `HTMLElement`s that should be reflected as the children of `element`.
|
|
116
|
-
* @param element - The parent `HTMLElement` whose children will be synchronized with `list`.
|
|
178
|
+
* @param list - The list of elements to reflect in the container.
|
|
179
|
+
* @param element - The container element whose children will be updated.
|
|
117
180
|
*/
|
|
118
181
|
static syncComponentWithList(list, element) {
|
|
119
182
|
const currentChildren = Array.from(element.children);
|
|
@@ -134,17 +197,31 @@ export class RefList extends Array {
|
|
|
134
197
|
}
|
|
135
198
|
});
|
|
136
199
|
}
|
|
200
|
+
/**
|
|
201
|
+
* Identifies this object as a custom reactive list in `Object.prototype.toString`.
|
|
202
|
+
*/
|
|
137
203
|
get [Symbol.toStringTag]() {
|
|
138
204
|
return "refList";
|
|
139
205
|
}
|
|
206
|
+
/**
|
|
207
|
+
* Ensures Array is returned when using methods like `slice()` or `map()`.
|
|
208
|
+
*/
|
|
140
209
|
static get [Symbol.species]() {
|
|
141
210
|
return Array;
|
|
142
211
|
}
|
|
143
|
-
|
|
212
|
+
/**
|
|
213
|
+
* Gets the current value of the reactive list.
|
|
214
|
+
* Returns a shallow copy of the internal array to prevent direct mutation.
|
|
215
|
+
*/
|
|
144
216
|
get value() {
|
|
145
217
|
return this.container.value.valueOf();
|
|
146
218
|
}
|
|
147
|
-
|
|
219
|
+
/**
|
|
220
|
+
* Replaces the entire contents of the list with a new array of items.
|
|
221
|
+
* If the same array reference is passed, no update or notification occurs.
|
|
222
|
+
*
|
|
223
|
+
* @param value - The new array of items to assign.
|
|
224
|
+
*/
|
|
148
225
|
set value(value) {
|
|
149
226
|
// @ts-ignore
|
|
150
227
|
if (this === value)
|
|
@@ -152,7 +229,10 @@ export class RefList extends Array {
|
|
|
152
229
|
super.splice(0, this.length, ...value);
|
|
153
230
|
this.emit("value", value);
|
|
154
231
|
}
|
|
155
|
-
|
|
232
|
+
/**
|
|
233
|
+
* Serializes the current list value for JSON output.
|
|
234
|
+
* This ensures only the raw array contents are emitted.
|
|
235
|
+
*/
|
|
156
236
|
toJSON() {
|
|
157
237
|
return this.value;
|
|
158
238
|
}
|
package/core/ref/RefList.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RefList.js","sourceRoot":"","sources":["../../../src/core/ref/RefList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAO,MAAM,GAAG,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,UAAU,OAAO,CAAI,KAAU;IACnC,OAAO,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC;AAC5B,CAAC;AAED,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,WAAW,EAAE;IACjD,KAAK,EAAE,UAAU,QAAa;QAC5B,OAAO,CAAC,CAAC,QAAQ,IAAI,QAAQ,YAAY,OAAO,CAAC;IACnD,CAAC;CACF,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"RefList.js","sourceRoot":"","sources":["../../../src/core/ref/RefList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAO,MAAM,GAAG,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,UAAU,OAAO,CAAI,KAAU;IACnC,OAAO,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC;AAC5B,CAAC;AAED,iDAAiD;AACjD,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,WAAW,EAAE;IACjD,KAAK,EAAE,UAAU,QAAa;QAC5B,OAAO,CAAC,CAAC,QAAQ,IAAI,QAAQ,YAAY,OAAO,CAAC;IACnD,CAAC;CACF,CAAC,CAAC;AAOH;;;GAGG;AACH,MAAM,OAAO,OAAiB,SAAQ,KAAQ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