@onekeyfe/react-native-native-list 6.7.0-3 → 6.7.0-30
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/README.md +4 -0
- package/android/src/main/java/com/onekey/nativelist/HybridNativeList.kt +14 -1
- package/android/src/main/java/com/onekey/nativelist/NativeListAccessoryStack.kt +250 -9
- package/android/src/main/java/com/onekey/nativelist/NativeListActivityDetailsView.kt +35 -7
- package/android/src/main/java/com/onekey/nativelist/NativeListActivityRenderer.kt +25 -3
- package/android/src/main/java/com/onekey/nativelist/NativeListAdapter.kt +17 -1
- package/android/src/main/java/com/onekey/nativelist/NativeListButtonGroupRenderer.kt +102 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListContainerSlotAdapter.kt +12 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListDataRowRenderer.kt +102 -7
- package/android/src/main/java/com/onekey/nativelist/NativeListGeneratedIcons.kt +47 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListIdentityRenderer.kt +225 -11
- package/android/src/main/java/com/onekey/nativelist/NativeListLeadingVisual.kt +152 -33
- package/android/src/main/java/com/onekey/nativelist/NativeListMarketRenderer.kt +92 -28
- package/android/src/main/java/com/onekey/nativelist/NativeListMediaPreviewSlot.kt +66 -31
- package/android/src/main/java/com/onekey/nativelist/NativeListMediaTileRenderer.kt +1 -1
- package/android/src/main/java/com/onekey/nativelist/NativeListMessageRenderer.kt +25 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListModels.kt +149 -3
- package/android/src/main/java/com/onekey/nativelist/NativeListPrimitives.kt +120 -287
- package/android/src/main/java/com/onekey/nativelist/NativeListRendererRegistry.kt +2 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListRendererRowView.kt +7 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListResolvedText.kt +3 -2
- package/android/src/main/java/com/onekey/nativelist/NativeListSectionHeaderRenderer.kt +69 -0
- package/android/src/main/java/com/onekey/nativelist/NativeListTextView.kt +55 -1
- package/android/src/main/java/com/onekey/nativelist/NativeListView.kt +1953 -117
- package/android/src/test/java/com/margelo/nitro/nativelist/NativeListActivityHostClipPolicyTest.kt +35 -0
- package/android/src/test/java/com/margelo/nitro/nativelist/NativeListIdentityTrailingAxisTest.kt +36 -0
- package/android/src/test/java/com/margelo/nitro/nativelist/NativeListLeadingSlotFrameTest.kt +68 -0
- package/android/src/test/java/com/margelo/nitro/nativelist/NativeListLeadingVisualClipPolicyTest.kt +44 -0
- package/android/src/test/java/com/margelo/nitro/nativelist/NativeListPressPolicyTest.kt +10 -0
- package/docs/ROW_TEMPLATES.md +70 -11
- package/docs/SPEC.md +1170 -13
- package/docs/STYLE_SPEC.md +11 -0
- package/ios/HybridNativeList.swift +21 -2
- package/ios/NativeListAccessoryStack.swift +237 -51
- package/ios/NativeListActivityDetailsView.swift +30 -11
- package/ios/NativeListActivityRenderer.swift +8 -2
- package/ios/NativeListButtonGroupRenderer.swift +89 -0
- package/ios/NativeListDataRowRenderer.swift +167 -30
- package/ios/NativeListDesignAssets.swift +13 -75
- package/ios/NativeListGeneratedIcons.swift +55 -0
- package/ios/NativeListIconBinding.swift +171 -0
- package/ios/NativeListIdentityRenderer.swift +256 -39
- package/ios/NativeListLeadingVisual.swift +127 -28
- package/ios/NativeListMarketRenderer.swift +120 -31
- package/ios/NativeListMediaPreviewSlot.swift +122 -61
- package/ios/NativeListMediaTileRenderer.swift +7 -3
- package/ios/NativeListMessageRenderer.swift +34 -1
- package/ios/NativeListMetricCardRenderer.swift +4 -2
- package/ios/NativeListModels.swift +42 -2
- package/ios/NativeListRendererRegistry.swift +1 -0
- package/ios/NativeListResolvedText.swift +2 -1
- package/ios/NativeListRowHost.swift +14 -0
- package/ios/NativeListSectionHeaderRenderer.swift +100 -4
- package/ios/RNCNativeListView.swift +1052 -58
- package/ios/tests/NativeListAccessoryStackTests.swift +101 -0
- package/ios/tests/NativeListAccountSelectorLayoutTests.swift +96 -0
- package/ios/tests/NativeListActivityPresentationTests.swift +153 -0
- package/ios/tests/NativeListIdentityTitleIconLayoutTests.swift +81 -0
- package/ios/tests/NativeListLeadingVisualPairBackdropTests.swift +50 -0
- package/ios/tests/NativeListLifecycleTests.swift +2798 -3
- package/ios/tests/NativeListMarketMetricsTests.swift +117 -0
- package/ios/tests/NativeListMediaVisibilityTests.swift +26 -1
- package/ios/tests/NativeListSharedIconTests.swift +236 -0
- package/lib/module/NativeList.js +221 -36
- package/lib/module/NativeList.web.js +167 -46
- package/lib/module/index.js +1 -1
- package/lib/module/models.js +3 -0
- package/lib/module/selection.js +1 -1
- package/lib/module/validation.js +1246 -48
- package/lib/module/web/NativeListGeneratedIcons.js +31 -0
- package/lib/module/web/NativeListWebEngine.js +513 -274
- package/lib/module/web/templates/ActivityRowRenderer.js +120 -87
- package/lib/module/web/templates/ButtonGroupRowRenderer.js +47 -0
- package/lib/module/web/templates/DataRowRenderer.js +40 -5
- package/lib/module/web/templates/IdentityRowRenderer.js +158 -6
- package/lib/module/web/templates/MarketTableRowRenderer.js +37 -19
- package/lib/module/web/templates/MediaTileRowRenderer.js +4 -14
- package/lib/module/web/templates/MessageRowRenderer.js +18 -2
- package/lib/module/web/templates/RowContainerStyle.js +1 -0
- package/lib/module/web/templates/RowRendererRegistry.js +3 -0
- package/lib/module/web/templates/SectionHeaderRowRenderer.js +36 -2
- package/lib/nitrogen/generated/android/c++/JHybridNativeListSpec.cpp +26 -0
- package/lib/nitrogen/generated/android/c++/JHybridNativeListSpec.hpp +4 -0
- package/lib/nitrogen/generated/android/c++/views/JHybridNativeListStateUpdater.cpp +10 -0
- package/lib/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/HybridNativeListSpec.kt +20 -0
- package/lib/nitrogen/generated/ios/c++/HybridNativeListSpecSwift.hpp +14 -0
- package/lib/nitrogen/generated/ios/c++/views/HybridNativeListComponent.mm +12 -0
- package/lib/nitrogen/generated/ios/swift/HybridNativeListSpec.swift +2 -0
- package/lib/nitrogen/generated/ios/swift/HybridNativeListSpec_cxx.swift +43 -0
- package/lib/nitrogen/generated/shared/c++/HybridNativeListSpec.cpp +4 -0
- package/lib/nitrogen/generated/shared/c++/HybridNativeListSpec.hpp +4 -0
- package/lib/nitrogen/generated/shared/c++/views/HybridNativeListComponent.cpp +4 -0
- package/lib/nitrogen/generated/shared/c++/views/HybridNativeListComponent.hpp +6 -0
- package/lib/nitrogen/generated/shared/json/NativeListConfig.json +2 -0
- package/lib/typescript/src/NativeList.d.ts +3 -3
- package/lib/typescript/src/NativeList.nitro.d.ts +2 -0
- package/lib/typescript/src/NativeList.types.d.ts +20 -2
- package/lib/typescript/src/index.d.ts +2 -2
- package/lib/typescript/src/models.d.ts +126 -17
- package/lib/typescript/src/validation.d.ts +20 -0
- package/lib/typescript/src/web/NativeListGeneratedIcons.d.ts +2 -0
- package/lib/typescript/src/web/NativeListWebEngine.d.ts +32 -1
- package/lib/typescript/src/web/templates/ButtonGroupRowRenderer.d.ts +14 -0
- package/lib/typescript/src/web/templates/IdentityRowRenderer.d.ts +1 -1
- package/lib/typescript/src/web/templates/MessageRowRenderer.d.ts +9 -3
- package/nitrogen/generated/android/c++/JHybridNativeListSpec.cpp +26 -0
- package/nitrogen/generated/android/c++/JHybridNativeListSpec.hpp +4 -0
- package/nitrogen/generated/android/c++/views/JHybridNativeListStateUpdater.cpp +10 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nativelist/HybridNativeListSpec.kt +20 -0
- package/nitrogen/generated/ios/c++/HybridNativeListSpecSwift.hpp +14 -0
- package/nitrogen/generated/ios/c++/views/HybridNativeListComponent.mm +12 -0
- package/nitrogen/generated/ios/swift/HybridNativeListSpec.swift +2 -0
- package/nitrogen/generated/ios/swift/HybridNativeListSpec_cxx.swift +43 -0
- package/nitrogen/generated/shared/c++/HybridNativeListSpec.cpp +4 -0
- package/nitrogen/generated/shared/c++/HybridNativeListSpec.hpp +4 -0
- package/nitrogen/generated/shared/c++/views/HybridNativeListComponent.cpp +4 -0
- package/nitrogen/generated/shared/c++/views/HybridNativeListComponent.hpp +6 -0
- package/nitrogen/generated/shared/json/NativeListConfig.json +2 -0
- package/package.json +16 -10
- package/react-native-native-list.podspec +2 -6
- package/scripts/generate-icons.mjs +150 -0
- package/scripts/generate-icons.test.mjs +288 -0
- package/scripts/native-list-icons.json +260 -0
- package/src/NativeList.nitro.ts +2 -0
- package/src/NativeList.tsx +416 -89
- package/src/NativeList.types.ts +24 -2
- package/src/NativeList.web.tsx +295 -89
- package/src/index.ts +2 -0
- package/src/models.ts +263 -144
- package/src/selection.ts +1 -0
- package/src/validation.ts +3013 -152
- package/src/web/NativeListGeneratedIcons.ts +28 -0
- package/src/web/NativeListWebEngine.ts +816 -343
- package/src/web/templates/ActivityRowRenderer.ts +178 -141
- package/src/web/templates/ButtonGroupRowRenderer.ts +58 -0
- package/src/web/templates/DataRowRenderer.ts +93 -20
- package/src/web/templates/IdentityRowRenderer.ts +231 -6
- package/src/web/templates/MarketTableRowRenderer.ts +56 -33
- package/src/web/templates/MediaTileRowRenderer.ts +4 -17
- package/src/web/templates/MessageRowRenderer.ts +23 -7
- package/src/web/templates/RowContainerStyle.ts +2 -0
- package/src/web/templates/RowRendererRegistry.ts +11 -1
- package/src/web/templates/SectionHeaderRowRenderer.ts +47 -4
- package/ios/Resources/NativeListIcons.xcassets/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_arrow_bottom.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_arrow_bottom.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_arrow_top.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_arrow_top.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_badge_verified_solid.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_badge_verified_solid.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_chart_trending_up.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_chart_trending_up.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_checkbox_checked.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_checkbox_checked.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_checkbox_indeterminate.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_checkbox_indeterminate.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_bottom.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_bottom.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_grabber_ver.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_grabber_ver.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_right_small.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_right_small.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_top.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_chevron_top.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_dot_hor.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_dot_hor.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_drag.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_drag.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_error_solid.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_error_solid.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_image_square_waves.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_image_square_waves.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_info_circle.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_info_circle.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_minus_circle.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_minus_circle.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_minus_circle_solid.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_minus_circle_solid.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_pencil.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_pencil.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_plus_circle.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_plus_circle.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_plus_small.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_plus_small.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_questionmark_solid.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_questionmark_solid.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_selector_account_error_custom.imageset/Contents.json +0 -15
- package/ios/Resources/NativeListIcons.xcassets/onekey_selector_account_error_custom.imageset/icon.svg +0 -14
- package/ios/Resources/NativeListIcons.xcassets/onekey_selector_all_networks_solid.imageset/Contents.json +0 -15
- package/ios/Resources/NativeListIcons.xcassets/onekey_selector_all_networks_solid.imageset/icon.svg +0 -12
- package/ios/Resources/NativeListIcons.xcassets/onekey_selector_apple_brand.imageset/Contents.json +0 -15
- package/ios/Resources/NativeListIcons.xcassets/onekey_selector_apple_brand.imageset/icon.svg +0 -6
- package/ios/Resources/NativeListIcons.xcassets/onekey_selector_bot_illus.imageset/Contents.json +0 -15
- package/ios/Resources/NativeListIcons.xcassets/onekey_selector_bot_illus.imageset/icon.svg +0 -15
- package/ios/Resources/NativeListIcons.xcassets/onekey_selector_crossed_small_solid.imageset/Contents.json +0 -15
- package/ios/Resources/NativeListIcons.xcassets/onekey_selector_crossed_small_solid.imageset/icon.svg +0 -3
- package/ios/Resources/NativeListIcons.xcassets/onekey_selector_globus_outline.imageset/Contents.json +0 -15
- package/ios/Resources/NativeListIcons.xcassets/onekey_selector_globus_outline.imageset/icon.svg +0 -7
- package/ios/Resources/NativeListIcons.xcassets/onekey_selector_google_illus.imageset/Contents.json +0 -15
- package/ios/Resources/NativeListIcons.xcassets/onekey_selector_google_illus.imageset/icon.svg +0 -18
- package/ios/Resources/NativeListIcons.xcassets/onekey_selector_lock_solid.imageset/Contents.json +0 -15
- package/ios/Resources/NativeListIcons.xcassets/onekey_selector_lock_solid.imageset/icon.svg +0 -7
- package/ios/Resources/NativeListIcons.xcassets/onekey_shield_exclamation.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_shield_exclamation.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_speaker_promote.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_speaker_promote.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_star.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_star.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_star_solid.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_star_solid.imageset/icon.svg +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_swap_hor.imageset/Contents.json +0 -1
- package/ios/Resources/NativeListIcons.xcassets/onekey_swap_hor.imageset/icon.svg +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
import { createNamedIcon } from '@onekeyfe/react-native-image/icon/dom';
|
|
3
4
|
import { createElement, tagSlot, markActionAnchorSource } from "./RowElements.js";
|
|
4
5
|
import { RowVisualStyle } from "./RowVisual.js";
|
|
5
6
|
import { applyTextWeight, applyValueSegments } from "./RowText.js";
|
|
@@ -22,13 +23,13 @@ function bindLegacy(body, row, primitives) {
|
|
|
22
23
|
node.hidden = !row[key];
|
|
23
24
|
if (style?.[key]) primitives.textStyle(node, style[key]);
|
|
24
25
|
}
|
|
25
|
-
const visualKey = JSON.stringify([row.key, row.leading, row.secondaryLeading]);
|
|
26
|
+
const visualKey = JSON.stringify([row.key, row.hideLeading, row.leading, row.secondaryLeading]);
|
|
26
27
|
if (v.visualKey !== visualKey) {
|
|
27
28
|
v.visuals.forEach(node => {
|
|
28
29
|
primitives.dispose(node);
|
|
29
30
|
node.remove();
|
|
30
31
|
});
|
|
31
|
-
v.visuals = [row.leading, row.secondaryLeading].map(source => primitives.visual(source)).filter(node => !!node);
|
|
32
|
+
v.visuals = (row.hideLeading ? [] : [row.leading, row.secondaryLeading]).map(source => primitives.visual(source)).filter(node => !!node);
|
|
32
33
|
v.visuals.forEach(node => body.insertBefore(node, v.column));
|
|
33
34
|
v.visualStyles = v.visuals.map(node => new RowVisualStyle(node));
|
|
34
35
|
v.visualKey = visualKey;
|
|
@@ -146,27 +147,16 @@ function createHistory(body, primitives) {
|
|
|
146
147
|
actions,
|
|
147
148
|
actionButtons: new Map(),
|
|
148
149
|
visualKey: '',
|
|
150
|
+
visuals: [],
|
|
149
151
|
primitives
|
|
150
152
|
};
|
|
151
153
|
histories.set(body, v);
|
|
152
154
|
return v;
|
|
153
155
|
}
|
|
154
|
-
const
|
|
155
|
-
ArrowTopOutline: ['M19.414 10 18 11.414l-5-5V21h-2V6.414l-5 5L4.586 10 12 2.586z'],
|
|
156
|
-
ArrowBottomOutline: ['m13 17.586 5-5L19.414 14 12 21.414 4.586 14 6 12.586l5 5V3h2z'],
|
|
157
|
-
SwitchHorOutline: ['m9.414 13-3 3H21v2H6.414l3 3L8 22.414 2.586 17 8 11.586zm12-6L16 12.414 14.586 11l3-3H3V6h14.586l-3-3L16 1.586z'],
|
|
158
|
-
CoinsOutline: ['M9 3a7 7 0 0 1 6.328 4.008 7 7 0 1 1-6.657 9.983A7 7 0 0 1 9 3m5.718 6.008a5 5 0 1 0 .566 9.985 5 5 0 0 0-.566-9.985M9 5a5 5 0 0 0-.941 9.91 7 7 0 0 1 5.11-7.667A4.99 4.99 0 0 0 8.999 5Z'],
|
|
159
|
-
ShieldCheckDoneOutline: ['M15.914 9.75 11 14.664 8.086 11.75 9.5 10.336l1.5 1.5 3.5-3.5z', 'M12.325 2.055 21 5.036v6.876c0 2.807-1.149 4.83-2.813 6.404-1.615 1.53-3.745 2.66-5.712 3.722l-.475.256-.475-.256c-1.967-1.061-4.097-2.192-5.713-3.722C4.15 16.741 3 14.72 3 11.912V5.036l8.675-2.981.325-.113zM5 6.463v5.45c0 2.165.851 3.686 2.188 4.951 1.275 1.208 2.965 2.154 4.812 3.154 1.847-1 3.537-1.946 4.813-3.154C18.148 15.6 19 14.078 19 11.912v-5.45l-7-2.405z'],
|
|
160
|
-
UnlockedOutline: ['M13 18h-2v-5h2z', 'M12 2a5 5 0 0 1 5 5h-2a3 3 0 0 0-6 0v2h11v13H4V9h3V7a5 5 0 0 1 5-5M6 20h12v-9H6z'],
|
|
161
|
-
Document2Outline: ['M12 16H8v-2h4zm4-4H8v-2h8zm0-4H8V6h8z', 'M20 22H4V2h16zM6 20h12V4H6z'],
|
|
162
|
-
CryptoCoinOutline: ['M11 16.387a4.5 4.5 0 0 1 0-8.775V6h2v1.613a4.5 4.5 0 0 1 2.856 2.067l-1.712 1.032a2.5 2.5 0 1 0 0 2.576l1.712 1.032A4.5 4.5 0 0 1 13 16.386V18h-2z', 'M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10m-2 0a8 8 0 1 0-16 0 8 8 0 0 0 16 0'],
|
|
163
|
-
ImageSquareWavesOutline: ['M14.25 7a2 2 0 1 1 0 4 2 2 0 0 1 0-4', 'M21 21H3V3h18zM5 16.414V19h12.586L14 15.414l-2 2-4-4zm0-2.828 3-3 4 4 2-2 5 5V5H5z'],
|
|
164
|
-
DotHorOutline: ['M6 14H2v-4h4zm8 0h-4v-4h4zm8 0h-4v-4h4z']
|
|
165
|
-
};
|
|
156
|
+
const historyIconNames = new Set(['ArrowTopOutline', 'ArrowBottomOutline', 'SwitchHorOutline', 'CoinsOutline', 'ShieldCheckDoneOutline', 'UnlockedOutline', 'Document2Outline', 'CryptoCoinOutline', 'ImageSquareWavesOutline', 'DotHorOutline']);
|
|
166
157
|
function historyIcon(node, source, size) {
|
|
167
158
|
const name = source?.kind === 'icon' ? source.name : source?.kind === 'token' ? source.fallbackIcon?.name : undefined;
|
|
168
|
-
|
|
169
|
-
if (!paths) return;
|
|
159
|
+
if (!name || !historyIconNames.has(name)) return;
|
|
170
160
|
const placeholder = node.querySelector('.ok-native-list-visual-fallback');
|
|
171
161
|
if (!placeholder && source && 'image' in source && source.image) return;
|
|
172
162
|
const fallback = placeholder ?? node;
|
|
@@ -178,18 +168,9 @@ function historyIcon(node, source, size) {
|
|
|
178
168
|
height: '100%'
|
|
179
169
|
});
|
|
180
170
|
if (source?.kind === 'icon' && source.tintColor) fallback.style.color = source.tintColor;else if (source && 'fallbackIcon' in source && source.fallbackIcon?.tintColor) fallback.style.color = source.fallbackIcon.tintColor;
|
|
181
|
-
const svg = node.ownerDocument
|
|
182
|
-
svg.setAttribute('viewBox', '0 0 24 24');
|
|
171
|
+
const svg = createNamedIcon(node.ownerDocument, name);
|
|
183
172
|
svg.setAttribute('width', String(size));
|
|
184
173
|
svg.setAttribute('height', String(size));
|
|
185
|
-
svg.setAttribute('fill', 'currentColor');
|
|
186
|
-
svg.setAttribute('aria-hidden', 'true');
|
|
187
|
-
for (const d of paths) {
|
|
188
|
-
const path = node.ownerDocument.createElementNS('http://www.w3.org/2000/svg', 'path');
|
|
189
|
-
path.setAttribute('d', d);
|
|
190
|
-
path.setAttribute('fill-rule', 'evenodd');
|
|
191
|
-
svg.append(path);
|
|
192
|
-
}
|
|
193
174
|
fallback.replaceChildren(svg);
|
|
194
175
|
}
|
|
195
176
|
function bindHistory(body, row, primitives) {
|
|
@@ -223,87 +204,139 @@ function bindHistory(body, row, primitives) {
|
|
|
223
204
|
Object.assign(v.identity.style, {
|
|
224
205
|
display: 'flex',
|
|
225
206
|
alignItems: 'center',
|
|
226
|
-
gap: '12px',
|
|
207
|
+
gap: row.hideLeading ? '0' : '12px',
|
|
227
208
|
minWidth: '0',
|
|
228
209
|
flex: '1 1 0'
|
|
229
210
|
});
|
|
230
211
|
Object.assign(v.visual.style, {
|
|
212
|
+
display: row.hideLeading ? 'none' : '',
|
|
231
213
|
position: 'relative',
|
|
232
214
|
width: '40px',
|
|
233
215
|
height: '40px',
|
|
234
216
|
flex: '0 0 40px'
|
|
235
217
|
});
|
|
236
|
-
const visualKey = JSON.stringify([row.key, row.leading, row.secondaryLeading]);
|
|
218
|
+
const visualKey = JSON.stringify([row.key, row.hideLeading, row.leading, row.secondaryLeading]);
|
|
237
219
|
if (v.visualKey !== visualKey) {
|
|
238
220
|
Array.from(v.visual.children).forEach(n => primitives.dispose(n));
|
|
239
221
|
v.visual.replaceChildren();
|
|
240
|
-
|
|
241
|
-
sources.
|
|
222
|
+
v.visuals = [];
|
|
223
|
+
const sources = row.hideLeading ? [] : [row.leading, row.secondaryLeading].filter(Boolean);
|
|
224
|
+
sources.forEach(source => {
|
|
242
225
|
const visual = primitives.visual(source);
|
|
243
226
|
if (!visual) return;
|
|
244
|
-
const size = sources.length > 1 ? index ? 28 : 24 : 40;
|
|
245
|
-
new RowVisualStyle(visual).apply(row.style?.image, size, size, 0);
|
|
246
|
-
Object.assign(visual.style, {
|
|
247
|
-
display: 'inline-flex',
|
|
248
|
-
alignItems: 'center',
|
|
249
|
-
justifyContent: 'center'
|
|
250
|
-
});
|
|
251
|
-
if (sources.length > 1) Object.assign(visual.style, {
|
|
252
|
-
position: 'absolute',
|
|
253
|
-
left: index ? '12px' : '0',
|
|
254
|
-
top: index ? '12px' : '0',
|
|
255
|
-
border: index ? '2px solid var(--nl-row)' : '0',
|
|
256
|
-
boxSizing: 'border-box'
|
|
257
|
-
});
|
|
258
227
|
historyIcon(visual, source, table || sources.length > 1 ? 24 : 28);
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
overflow: 'hidden',
|
|
272
|
-
background: source && 'backgroundColor' in source ? source.backgroundColor ?? '' : '',
|
|
273
|
-
border: source && 'borderColor' in source && source.borderColor ? `1px solid ${source.borderColor}` : '0'
|
|
228
|
+
const retained = {
|
|
229
|
+
node: visual,
|
|
230
|
+
style: new RowVisualStyle(visual),
|
|
231
|
+
background: visual.style.background,
|
|
232
|
+
loaded: false
|
|
233
|
+
};
|
|
234
|
+
// Only placeholder-backed sources restore their frame background on load.
|
|
235
|
+
const image = source && 'image' in source ? source.image : undefined;
|
|
236
|
+
if (image?.loadingStrategy && image.loadingStrategy !== 'none') {
|
|
237
|
+
visual.querySelector('.ok-native-list-visual-main')?.addEventListener('load', () => {
|
|
238
|
+
retained.background = source && 'backgroundColor' in source && source.backgroundColor ? source.backgroundColor : 'transparent';
|
|
239
|
+
retained.loaded = true;
|
|
274
240
|
});
|
|
275
|
-
token.append(...Array.from(visual.children).filter(child => !child.classList.contains('ok-native-list-visual-corner')));
|
|
276
|
-
const fallback = token.querySelector(':scope > .ok-native-list-visual-fallback');
|
|
277
|
-
if (fallback) {
|
|
278
|
-
fallback.style.width = '24px';
|
|
279
|
-
fallback.style.height = '24px';
|
|
280
|
-
fallback.style.flexShrink = '0';
|
|
281
|
-
}
|
|
282
|
-
const mainImage = token.querySelector(':scope > .ok-native-list-visual-main');
|
|
283
|
-
if (mainImage) {
|
|
284
|
-
mainImage.style.width = '100%';
|
|
285
|
-
mainImage.style.height = '100%';
|
|
286
|
-
}
|
|
287
|
-
visual.append(token);
|
|
288
|
-
}
|
|
289
|
-
if (table) {
|
|
290
|
-
visual.style.background = source && 'backgroundColor' in source && source.backgroundColor ? source.backgroundColor : 'var(--nl-strong)';
|
|
291
|
-
const borderColor = source && 'borderColor' in source && source.borderColor ? source.borderColor : 'var(--nl-separator)';
|
|
292
|
-
visual.style.border = `1px solid ${borderColor}`;
|
|
293
|
-
visual.style.boxSizing = 'border-box';
|
|
294
|
-
} else if (sources.length === 1 && source?.kind === 'token') {
|
|
295
|
-
visual.style.border = source.borderColor ? `1px solid ${source.borderColor}` : '0';
|
|
296
|
-
visual.style.boxSizing = 'border-box';
|
|
297
|
-
const mainImage = visual.querySelector(':scope > .ok-native-list-visual-main');
|
|
298
|
-
if (mainImage) {
|
|
299
|
-
mainImage.style.width = '100%';
|
|
300
|
-
mainImage.style.height = '100%';
|
|
301
|
-
}
|
|
302
241
|
}
|
|
242
|
+
v.visuals.push(retained);
|
|
303
243
|
v.visual.append(visual);
|
|
304
244
|
});
|
|
305
245
|
v.visualKey = visualKey;
|
|
306
246
|
}
|
|
247
|
+
const sources = row.hideLeading ? [] : [row.leading, row.secondaryLeading].filter(Boolean);
|
|
248
|
+
v.visuals.forEach((retained, index) => {
|
|
249
|
+
const {
|
|
250
|
+
node: visual,
|
|
251
|
+
style,
|
|
252
|
+
background,
|
|
253
|
+
loaded
|
|
254
|
+
} = retained;
|
|
255
|
+
const source = sources[index];
|
|
256
|
+
const previousToken = visual.querySelector(':scope > .ok-native-list-history-token');
|
|
257
|
+
if (previousToken) {
|
|
258
|
+
visual.append(...Array.from(previousToken.children));
|
|
259
|
+
previousToken.remove();
|
|
260
|
+
}
|
|
261
|
+
const currentFallback = visual.querySelector(':scope > .ok-native-list-visual-fallback:not(.ok-native-list-visual-corner)');
|
|
262
|
+
if (currentFallback && retained.fallback !== currentFallback) {
|
|
263
|
+
retained.fallback = currentFallback;
|
|
264
|
+
retained.fallbackStyle = new RowVisualStyle(currentFallback);
|
|
265
|
+
}
|
|
266
|
+
// A terminal image error creates a new fallback node after the factory bind.
|
|
267
|
+
retained.fallbackStyle?.restore();
|
|
268
|
+
const size = sources.length > 1 ? index ? 28 : 24 : 40;
|
|
269
|
+
style.apply(row.style?.image, size, size, 0);
|
|
270
|
+
Object.assign(visual.style, {
|
|
271
|
+
background,
|
|
272
|
+
position: '',
|
|
273
|
+
left: '',
|
|
274
|
+
top: ''
|
|
275
|
+
});
|
|
276
|
+
const svg = visual.querySelector('.ok-native-list-visual-fallback > svg');
|
|
277
|
+
if (svg) {
|
|
278
|
+
const iconSize = String(table || sources.length > 1 ? 24 : 28);
|
|
279
|
+
svg.setAttribute('width', iconSize);
|
|
280
|
+
svg.setAttribute('height', iconSize);
|
|
281
|
+
}
|
|
282
|
+
Object.assign(visual.style, {
|
|
283
|
+
display: 'inline-flex',
|
|
284
|
+
alignItems: 'center',
|
|
285
|
+
justifyContent: 'center'
|
|
286
|
+
});
|
|
287
|
+
if (sources.length > 1) Object.assign(visual.style, {
|
|
288
|
+
position: 'absolute',
|
|
289
|
+
left: index ? '12px' : '0',
|
|
290
|
+
top: index ? '12px' : '0',
|
|
291
|
+
border: index ? '2px solid var(--nl-row)' : '0',
|
|
292
|
+
boxSizing: 'border-box'
|
|
293
|
+
});
|
|
294
|
+
if (!table && sources.length > 1) {
|
|
295
|
+
const token = visual.ownerDocument.createElement('span');
|
|
296
|
+
token.className = 'ok-native-list-history-token';
|
|
297
|
+
Object.assign(token.style, {
|
|
298
|
+
display: 'flex',
|
|
299
|
+
alignItems: 'center',
|
|
300
|
+
justifyContent: 'center',
|
|
301
|
+
position: 'relative',
|
|
302
|
+
width: '24px',
|
|
303
|
+
height: '24px',
|
|
304
|
+
flex: '0 0 24px',
|
|
305
|
+
borderRadius: 'inherit',
|
|
306
|
+
boxSizing: 'border-box',
|
|
307
|
+
overflow: 'hidden',
|
|
308
|
+
background: source && 'backgroundColor' in source ? source.backgroundColor ?? '' : '',
|
|
309
|
+
border: source && 'borderColor' in source && source.borderColor ? `1px solid ${source.borderColor}` : '0'
|
|
310
|
+
});
|
|
311
|
+
token.append(...Array.from(visual.children).filter(child => !child.classList.contains('ok-native-list-visual-corner')));
|
|
312
|
+
const fallback = token.querySelector(':scope > .ok-native-list-visual-fallback');
|
|
313
|
+
if (fallback) {
|
|
314
|
+
fallback.style.width = '24px';
|
|
315
|
+
fallback.style.height = '24px';
|
|
316
|
+
fallback.style.flexShrink = '0';
|
|
317
|
+
}
|
|
318
|
+
const mainImage = token.querySelector(':scope > .ok-native-list-visual-main');
|
|
319
|
+
if (mainImage) {
|
|
320
|
+
mainImage.style.width = '100%';
|
|
321
|
+
mainImage.style.height = '100%';
|
|
322
|
+
}
|
|
323
|
+
visual.append(token);
|
|
324
|
+
}
|
|
325
|
+
if (table) {
|
|
326
|
+
visual.style.background = loaded ? background : source && 'backgroundColor' in source && source.backgroundColor ? source.backgroundColor : 'var(--nl-strong)';
|
|
327
|
+
const borderColor = source && 'borderColor' in source && source.borderColor ? source.borderColor : 'var(--nl-separator)';
|
|
328
|
+
visual.style.border = `1px solid ${borderColor}`;
|
|
329
|
+
visual.style.boxSizing = 'border-box';
|
|
330
|
+
} else if (sources.length === 1 && source?.kind === 'token') {
|
|
331
|
+
visual.style.border = source.borderColor ? `1px solid ${source.borderColor}` : '0';
|
|
332
|
+
visual.style.boxSizing = 'border-box';
|
|
333
|
+
const mainImage = visual.querySelector(':scope > .ok-native-list-visual-main');
|
|
334
|
+
if (mainImage) {
|
|
335
|
+
mainImage.style.width = '100%';
|
|
336
|
+
mainImage.style.height = '100%';
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
});
|
|
307
340
|
Object.assign(v.text.style, {
|
|
308
341
|
minWidth: '0',
|
|
309
342
|
flex: '1 1 auto',
|
|
@@ -441,7 +474,7 @@ function bindHistory(body, row, primitives) {
|
|
|
441
474
|
v.feeSecondary.style.cssText = ellipsis + 'font-size:14px;line-height:20px;font-weight:400;color:var(--nl-secondary);';
|
|
442
475
|
valueText(v.feePrimary, row.fee?.primary, row.fee?.primaryTextSegments, 14, 20, 400);
|
|
443
476
|
valueText(v.feeSecondary, row.fee?.secondary, row.fee?.secondaryTextSegments, 14, 20, 400);
|
|
444
|
-
v.actions.style.cssText =
|
|
477
|
+
v.actions.style.cssText = `display:flex;gap:12px;padding-left:${row.hideLeading ? 0 : 52}px;padding-bottom:4px;`;
|
|
445
478
|
v.actions.style.display = footer ? 'flex' : 'none';
|
|
446
479
|
const actionKeys = new Set();
|
|
447
480
|
for (const [index, action] of (row.footerActions ?? []).entries()) {
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { markActionAnchorSource } from "./RowElements.js";
|
|
4
|
+
function bind(body, row) {
|
|
5
|
+
body.replaceChildren();
|
|
6
|
+
body.className = 'ok-native-list-row ok-native-list-button-group';
|
|
7
|
+
body.removeAttribute('data-nl-container-background');
|
|
8
|
+
body.removeAttribute('data-nl-container-border');
|
|
9
|
+
row.buttons.forEach((descriptor, index) => {
|
|
10
|
+
const button = body.ownerDocument.createElement('button');
|
|
11
|
+
button.type = 'button';
|
|
12
|
+
button.className = 'ok-native-list-block-button';
|
|
13
|
+
button.dataset.nativeListAction = descriptor.actionKey;
|
|
14
|
+
button.dataset.nlButtonKey = descriptor.key;
|
|
15
|
+
button.dataset.nlSlot = `button-${index}`;
|
|
16
|
+
if (descriptor.testID) button.dataset.testid = descriptor.testID;
|
|
17
|
+
button.setAttribute('aria-label', descriptor.accessibilityLabel ?? descriptor.label);
|
|
18
|
+
button.disabled = Boolean(row.disabled || descriptor.disabled || descriptor.loading);
|
|
19
|
+
button.setAttribute('aria-busy', descriptor.loading ? 'true' : 'false');
|
|
20
|
+
markActionAnchorSource(button, 'buttonGroup', index);
|
|
21
|
+
const label = body.ownerDocument.createElement('span');
|
|
22
|
+
label.textContent = descriptor.label;
|
|
23
|
+
if (descriptor.loading) {
|
|
24
|
+
const spinner = body.ownerDocument.createElement('span');
|
|
25
|
+
spinner.className = 'ok-native-list-spinner';
|
|
26
|
+
spinner.setAttribute('role', 'progressbar');
|
|
27
|
+
button.appendChild(spinner);
|
|
28
|
+
}
|
|
29
|
+
button.appendChild(label);
|
|
30
|
+
body.appendChild(button);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
function create(document, row, _primitives) {
|
|
34
|
+
const body = document.createElement('div');
|
|
35
|
+
body.dataset.nlRenderer = 'buttonGroup';
|
|
36
|
+
bind(body, row);
|
|
37
|
+
return body;
|
|
38
|
+
}
|
|
39
|
+
export const buttonGroupRowRenderer = {
|
|
40
|
+
key: 'buttonGroup',
|
|
41
|
+
create,
|
|
42
|
+
bind,
|
|
43
|
+
recycle: body => body.replaceChildren(),
|
|
44
|
+
measure: (_row, _width) => 64,
|
|
45
|
+
measureRendered: body => body.scrollHeight
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=ButtonGroupRowRenderer.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { createElement, tagSlot } from "./RowElements.js";
|
|
3
|
+
import { createElement, markActionAnchorSource, setData, tagSlot } from "./RowElements.js";
|
|
4
|
+
import { applyValueSegments, fontWeight } from "./RowText.js";
|
|
4
5
|
import { RowVisualStyle } from "./RowVisual.js";
|
|
5
6
|
const views = new WeakMap();
|
|
6
7
|
const tone = (value, fallback) => value === 'positive' ? 'var(--nl-positive)' : value === 'negative' ? 'var(--nl-negative)' : value === 'secondary' ? 'var(--nl-secondary)' : `var(--nl-${fallback})`;
|
|
@@ -16,6 +17,9 @@ function bind(body, row, primitives) {
|
|
|
16
17
|
v.controls.replaceChildren();
|
|
17
18
|
if (row.checkbox) v.controls.appendChild(primitives.accessory(row.key, row.checkbox, 0));
|
|
18
19
|
v.controls.style.display = 'contents';
|
|
20
|
+
v.trailing.replaceChildren();
|
|
21
|
+
row.trailing?.forEach((accessory, index) => v.trailing.appendChild(primitives.accessory(row.key, accessory, index)));
|
|
22
|
+
v.trailing.hidden = !row.trailing?.length;
|
|
19
23
|
v.index.style.cssText = '';
|
|
20
24
|
v.index.hidden = row.index === undefined;
|
|
21
25
|
v.index.textContent = String(row.index ?? '');
|
|
@@ -54,7 +58,26 @@ function bind(body, row, primitives) {
|
|
|
54
58
|
if (style?.titleBadgeGap !== undefined) cell.primaryLine.style.gap = `${style.titleBadgeGap}px`;
|
|
55
59
|
cell.primary.style.cssText = '';
|
|
56
60
|
cell.primary.textContent = column.text;
|
|
61
|
+
applyValueSegments(cell.primary, column.textSegments, style?.columns?.fontSize ?? 14, style?.columns?.lineHeight ?? 20, fontWeight(style?.columns?.fontWeight, 500));
|
|
57
62
|
if (style?.columns) primitives.textStyle(cell.primary, style.columns);
|
|
63
|
+
cell.titleIcons.replaceChildren();
|
|
64
|
+
if (column.titleIcon || column.secondaryTitleIcon) {
|
|
65
|
+
cell.primary.style.minWidth = '0';
|
|
66
|
+
cell.primary.style.overflow = 'hidden';
|
|
67
|
+
cell.primary.style.textOverflow = 'ellipsis';
|
|
68
|
+
cell.primary.style.whiteSpace = 'nowrap';
|
|
69
|
+
[column.titleIcon, column.secondaryTitleIcon].filter(icon => icon !== undefined).forEach(descriptor => {
|
|
70
|
+
const icon = primitives.iconAction(descriptor.name, undefined, undefined, descriptor.tintColor);
|
|
71
|
+
icon.className = 'ok-native-list-identity-title-icon';
|
|
72
|
+
if (descriptor.hoverActionKey) {
|
|
73
|
+
setData(icon, 'nativeListHoverAction', descriptor.hoverActionKey);
|
|
74
|
+
setData(icon, 'nativeListIconHelp', true);
|
|
75
|
+
markActionAnchorSource(icon, 'leadingAction');
|
|
76
|
+
}
|
|
77
|
+
if (descriptor.accessibilityLabel) icon.setAttribute('aria-label', descriptor.accessibilityLabel);else icon.setAttribute('aria-hidden', 'true');
|
|
78
|
+
cell.titleIcons.appendChild(icon);
|
|
79
|
+
});
|
|
80
|
+
}
|
|
58
81
|
cell.badges.replaceChildren();
|
|
59
82
|
cell.badges.style.display = 'contents';
|
|
60
83
|
if (column.key === 'asset') row.badges?.forEach(badge => {
|
|
@@ -64,17 +87,22 @@ function bind(body, row, primitives) {
|
|
|
64
87
|
});
|
|
65
88
|
// Legacy Web layout: secondary leading text sits inline before the primary
|
|
66
89
|
// text; secondary text is a direct line below it, toned by secondaryTone.
|
|
67
|
-
|
|
68
|
-
|
|
90
|
+
const secondaryText = column.secondaryTextSegments?.length ? column.secondaryTextSegments.map(segment => segment.text).join('') : column.secondaryText;
|
|
91
|
+
cell.secondaryLine.style.display = secondaryText ? 'contents' : 'none';
|
|
92
|
+
[column.secondaryLeadingText, secondaryText].forEach((text, slot) => {
|
|
69
93
|
const label = cell.secondary[slot];
|
|
70
94
|
label.hidden = !text;
|
|
71
95
|
if (!text) label.remove();else if (slot === 0) cell.primaryLine.insertBefore(label, cell.primary);else cell.secondaryLine.appendChild(label);
|
|
72
96
|
label.style.cssText = '';
|
|
73
97
|
label.textContent = text ?? '';
|
|
98
|
+
if (slot === 1) {
|
|
99
|
+
applyValueSegments(label, column.secondaryTextSegments, style?.columnSecondary?.fontSize ?? 12, style?.columnSecondary?.lineHeight ?? 16, fontWeight(style?.columnSecondary?.fontWeight, 400));
|
|
100
|
+
}
|
|
74
101
|
if (slot === 1) label.style.color = tone(column.secondaryTone, 'secondary');
|
|
75
102
|
if (style?.columnSecondary) primitives.textStyle(label, style.columnSecondary);
|
|
76
103
|
});
|
|
77
104
|
});
|
|
105
|
+
body.appendChild(v.trailing);
|
|
78
106
|
}
|
|
79
107
|
function create(document, row, primitives) {
|
|
80
108
|
const body = createElement(document, 'div', 'ok-native-list-row ok-native-list-data');
|
|
@@ -82,6 +110,7 @@ function create(document, row, primitives) {
|
|
|
82
110
|
const index = tagSlot(createElement(document, 'span', 'ok-native-list-index'), 'index');
|
|
83
111
|
const favorite = createElement(document, 'span', 'ok-native-list-favorite');
|
|
84
112
|
const controls = createElement(document, 'span');
|
|
113
|
+
const trailing = createElement(document, 'span', 'ok-native-list-accessories');
|
|
85
114
|
body.append(controls, index, favorite);
|
|
86
115
|
const columns = Array.from({
|
|
87
116
|
length: 4
|
|
@@ -89,8 +118,10 @@ function create(document, row, primitives) {
|
|
|
89
118
|
const cell = createElement(document, 'span', 'ok-native-list-data-cell');
|
|
90
119
|
const primaryLine = createElement(document, 'span', 'ok-native-list-data-primary');
|
|
91
120
|
const primary = tagSlot(createElement(document, 'span'), 'columns');
|
|
121
|
+
const titleIcons = createElement(document, 'span');
|
|
122
|
+
titleIcons.style.display = 'contents';
|
|
92
123
|
const badges = createElement(document, 'span');
|
|
93
|
-
primaryLine.append(primary, badges);
|
|
124
|
+
primaryLine.append(primary, titleIcons, badges);
|
|
94
125
|
const secondaryLine = createElement(document, 'span', 'ok-native-list-data-secondary-line');
|
|
95
126
|
const secondary = Array.from({
|
|
96
127
|
length: 2
|
|
@@ -102,15 +133,18 @@ function create(document, row, primitives) {
|
|
|
102
133
|
body: cell,
|
|
103
134
|
primaryLine,
|
|
104
135
|
primary,
|
|
136
|
+
titleIcons,
|
|
105
137
|
badges,
|
|
106
138
|
secondaryLine,
|
|
107
139
|
secondary
|
|
108
140
|
};
|
|
109
141
|
});
|
|
142
|
+
body.appendChild(trailing);
|
|
110
143
|
views.set(body, {
|
|
111
144
|
favorite,
|
|
112
145
|
index,
|
|
113
146
|
controls,
|
|
147
|
+
trailing,
|
|
114
148
|
columns,
|
|
115
149
|
visualKey: '',
|
|
116
150
|
primitives
|
|
@@ -129,6 +163,7 @@ function recycle(body) {
|
|
|
129
163
|
v.visualStyle = undefined;
|
|
130
164
|
v.visualKey = '';
|
|
131
165
|
v.controls.replaceChildren();
|
|
166
|
+
v.trailing.replaceChildren();
|
|
132
167
|
}
|
|
133
168
|
export const dataRowRenderer = {
|
|
134
169
|
key: 'dataRow',
|
|
@@ -137,7 +172,7 @@ export const dataRowRenderer = {
|
|
|
137
172
|
recycle,
|
|
138
173
|
// Legacy presets: table rows without secondary text are 8 units shorter.
|
|
139
174
|
measure: (row, _width, layout) => {
|
|
140
|
-
const secondary = row.columns.some(column => column.secondaryText);
|
|
175
|
+
const secondary = row.columns.some(column => column.secondaryTextSegments?.length ? column.secondaryTextSegments.some(segment => segment.text.length > 0) : !!column.secondaryText);
|
|
141
176
|
return (secondary ? 60 : 56) + (layout === 'table' && !secondary ? -8 : 0);
|
|
142
177
|
},
|
|
143
178
|
measureRendered: (_body, _row) => undefined
|