@kudzujs/core 0.6.18 → 0.6.19
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/framework/core.mjs +1 -1
- package/framework/list-runtime.js +6 -0
- package/package.json +1 -1
package/framework/core.mjs
CHANGED
|
@@ -675,7 +675,7 @@ async function renderNode(node, namespace, selectValue = noSelectValue) {
|
|
|
675
675
|
continue
|
|
676
676
|
}
|
|
677
677
|
|
|
678
|
-
const name = rawName === "className" ? "class" : rawName === "htmlFor" ? "for" : svg ? svgAttributeAliases[rawName] ?? rawName : rawName
|
|
678
|
+
const name = rawName === "className" ? "class" : rawName === "htmlFor" ? "for" : rawName === "defaultValue" && tag === "input" ? "value" : svg ? svgAttributeAliases[rawName] ?? rawName : rawName
|
|
679
679
|
const propertyTarget = name === "class" || name === "disabled" || name === "value" || name === "checked" || name === "style"
|
|
680
680
|
if (value?.[listFieldMarker]) {
|
|
681
681
|
attributes += renderAttribute(name, value.value)
|
|
@@ -6,6 +6,7 @@ const mountedLists = new WeakSet()
|
|
|
6
6
|
const imports = __KUDZU_LIST_ASYNC_PARTS__ ? new Map() : undefined
|
|
7
7
|
const revisions = __KUDZU_LIST_ASYNC_PARTS__ ? new WeakMap() : undefined
|
|
8
8
|
const itemParts = new WeakMap()
|
|
9
|
+
const listItems = new WeakMap()
|
|
9
10
|
const conditionOwners = __KUDZU_LIST_CONDITIONS__ ? new WeakMap() : undefined
|
|
10
11
|
const itemPartsSelector = `[data-k-list-text]${__KUDZU_LIST_ATTRIBUTES__ ? ",[data-k-list-attrs]" : ""}${__KUDZU_LIST_EVENTS__ ? ",[data-k-list-events]" : ""}${__KUDZU_LIST_EXPRESSIONS__ ? ",[data-k-list-expression]" : ""}${__KUDZU_LIST_EXPRESSION_ATTRIBUTES__ ? ",[data-k-list-expression-attrs]" : ""}${__KUDZU_LIST_CONDITIONS__ ? ",[data-k-list-condition]" : ""}${__KUDZU_LIST_EFFECTS__ ? ",[data-k-effects]" : ""}`
|
|
11
12
|
|
|
@@ -25,6 +26,9 @@ registerUnmountHook(unmountLists)
|
|
|
25
26
|
if (typeof document !== "undefined") mountDom(document)
|
|
26
27
|
|
|
27
28
|
function mountLists(root) {
|
|
29
|
+
let owner = root.nodeType === Node.ELEMENT_NODE ? root : root.parentElement
|
|
30
|
+
while (owner && !listItems.has(owner)) owner = owner.parentElement
|
|
31
|
+
if (owner) fillListParts(root, listItemParts(root), listItems.get(owner), 0)
|
|
28
32
|
for (const start of matching(root, "template[data-k-list]")) {
|
|
29
33
|
if (mountedLists.has(start)) continue
|
|
30
34
|
mountedLists.add(start)
|
|
@@ -136,6 +140,7 @@ function updateList(list) {
|
|
|
136
140
|
fillListItem(node, item)
|
|
137
141
|
if (__KUDZU_LIST_ITEM_HOOKS__) notifyListItem(list.descriptor.state, node)
|
|
138
142
|
}
|
|
143
|
+
listItems.set(node, item)
|
|
139
144
|
next.push([token, node])
|
|
140
145
|
values.set(token, value)
|
|
141
146
|
}
|
|
@@ -234,6 +239,7 @@ function addListRoot(list, { item, key, token, value }) {
|
|
|
234
239
|
if (__KUDZU_LIST_ROW_STATES__ && list.descriptor.rowStates) initializeRowStates(list.descriptor, key, node)
|
|
235
240
|
mapListItemParts(list.parts, node)
|
|
236
241
|
fillListItem(node, item)
|
|
242
|
+
listItems.set(node, item)
|
|
237
243
|
const parent = list.container ?? list.start.parentNode
|
|
238
244
|
parent.insertBefore(node, list.boundary)
|
|
239
245
|
if (__KUDZU_LIST_MOUNTS__ && list.descriptor.mount) mountDom(node)
|