@g9tm/lynxcontrols 2.3.0 → 2.4.0
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 +1 -0
- package/bin/g9lynx.mjs +103 -0
- package/bin/g9lynx.test.mjs +80 -0
- package/catalog/cards/DateTimeSheetBody.md +17 -0
- package/catalog/cards/G9ActionRow.md +11 -0
- package/catalog/cards/G9ActionSheet.md +14 -0
- package/catalog/cards/G9Activity.md +11 -0
- package/catalog/cards/G9ActivityIndicator.md +14 -0
- package/catalog/cards/G9AllocationInput.md +17 -0
- package/catalog/cards/G9Anchor.md +17 -0
- package/catalog/cards/G9AnimatedCheck.md +13 -0
- package/catalog/cards/G9AppBar.md +17 -0
- package/catalog/cards/G9AppShell.md +17 -0
- package/catalog/cards/G9Art.md +13 -0
- package/catalog/cards/G9Avatar.md +16 -0
- package/catalog/cards/G9Badge.md +15 -0
- package/catalog/cards/G9Bento.md +13 -0
- package/catalog/cards/G9Button.md +17 -0
- package/catalog/cards/G9CameFromMark.md +9 -0
- package/catalog/cards/G9Card.md +17 -0
- package/catalog/cards/G9CascadePanel.md +17 -0
- package/catalog/cards/G9CheckBox.md +17 -0
- package/catalog/cards/G9Chip.md +17 -0
- package/catalog/cards/G9ChipGroup.md +17 -0
- package/catalog/cards/G9ChoiceList.md +17 -0
- package/catalog/cards/G9Columns.md +13 -0
- package/catalog/cards/G9ComboBox.md +17 -0
- package/catalog/cards/G9CommandPalette.md +15 -0
- package/catalog/cards/G9Confetti.md +15 -0
- package/catalog/cards/G9ConnectionBanner.md +15 -0
- package/catalog/cards/G9ContextMenu.md +15 -0
- package/catalog/cards/G9CornerBadge.md +15 -0
- package/catalog/cards/G9CultureDateTimeLabel.md +16 -0
- package/catalog/cards/G9DateTimePicker.md +17 -0
- package/catalog/cards/G9DayStepper.md +17 -0
- package/catalog/cards/G9DeferredContent.md +17 -0
- package/catalog/cards/G9Delta.md +17 -0
- package/catalog/cards/G9DesignNode.md +13 -0
- package/catalog/cards/G9DesignScope.md +11 -0
- package/catalog/cards/G9DragList.md +15 -0
- package/catalog/cards/G9EdgePanel.md +17 -0
- package/catalog/cards/G9Editor.md +17 -0
- package/catalog/cards/G9EmptyState.md +17 -0
- package/catalog/cards/G9ErrorBoundary.md +13 -0
- package/catalog/cards/G9Expander.md +17 -0
- package/catalog/cards/G9FloatingOrb.md +17 -0
- package/catalog/cards/G9FormField.md +15 -0
- package/catalog/cards/G9HScroll.md +16 -0
- package/catalog/cards/G9HeaderActionButton.md +17 -0
- package/catalog/cards/G9HoldButton.md +17 -0
- package/catalog/cards/G9Host.md +17 -0
- package/catalog/cards/G9Icon.md +16 -0
- package/catalog/cards/G9IconButton.md +17 -0
- package/catalog/cards/G9IconRail.md +15 -0
- package/catalog/cards/G9IconSlot.md +17 -0
- package/catalog/cards/G9Image.md +17 -0
- package/catalog/cards/G9InlineMessage.md +16 -0
- package/catalog/cards/G9KeepAlive.md +11 -0
- package/catalog/cards/G9Keycap.md +13 -0
- package/catalog/cards/G9Kpi.md +17 -0
- package/catalog/cards/G9KpiGrid.md +12 -0
- package/catalog/cards/G9ListRow.md +17 -0
- package/catalog/cards/G9LiveBadge.md +11 -0
- package/catalog/cards/G9LiveDot.md +12 -0
- package/catalog/cards/G9LoadState.md +13 -0
- package/catalog/cards/G9LoadableSheetContent.md +17 -0
- package/catalog/cards/G9LockOverlay.md +15 -0
- package/catalog/cards/G9Menu.md +17 -0
- package/catalog/cards/G9MenuList.md +12 -0
- package/catalog/cards/G9NavCard.md +17 -0
- package/catalog/cards/G9NumPad.md +13 -0
- package/catalog/cards/G9NumberEntry.md +17 -0
- package/catalog/cards/G9OutlinedField.md +17 -0
- package/catalog/cards/G9OverlayRoot.md +12 -0
- package/catalog/cards/G9Page.md +17 -0
- package/catalog/cards/G9PageLoadingOverlay.md +12 -0
- package/catalog/cards/G9Pager.md +16 -0
- package/catalog/cards/G9Photo.md +17 -0
- package/catalog/cards/G9Picker.md +17 -0
- package/catalog/cards/G9PinEntry.md +17 -0
- package/catalog/cards/G9Place.md +17 -0
- package/catalog/cards/G9PlaceScroll.md +13 -0
- package/catalog/cards/G9PlusButton.md +17 -0
- package/catalog/cards/G9Popover.md +17 -0
- package/catalog/cards/G9PopupDragHandle.md +10 -0
- package/catalog/cards/G9PopupView.md +15 -0
- package/catalog/cards/G9Pressable.md +17 -0
- package/catalog/cards/G9ProcessingSheetContent.md +13 -0
- package/catalog/cards/G9ProgressBar.md +17 -0
- package/catalog/cards/G9ProgressRing.md +17 -0
- package/catalog/cards/G9Provider.md +17 -0
- package/catalog/cards/G9PullToRefresh.md +13 -0
- package/catalog/cards/G9RadioGroup.md +17 -0
- package/catalog/cards/G9RangeSlider.md +17 -0
- package/catalog/cards/G9RatingInput.md +17 -0
- package/catalog/cards/G9RevealText.md +15 -0
- package/catalog/cards/G9SafeButton.md +17 -0
- package/catalog/cards/G9SafeIconButton.md +17 -0
- package/catalog/cards/G9SaveBar.md +16 -0
- package/catalog/cards/G9ScaleInput.md +17 -0
- package/catalog/cards/G9ScrollSpyBar.md +12 -0
- package/catalog/cards/G9ScrollerScope.md +10 -0
- package/catalog/cards/G9SearchEntry.md +17 -0
- package/catalog/cards/G9Section.md +16 -0
- package/catalog/cards/G9SectionHeader.md +14 -0
- package/catalog/cards/G9Segmented.md +17 -0
- package/catalog/cards/G9Separator.md +17 -0
- package/catalog/cards/G9SettingsGroup.md +13 -0
- package/catalog/cards/G9Sheet.md +13 -0
- package/catalog/cards/G9SheetBackdropScope.md +10 -0
- package/catalog/cards/G9SheetFooter.md +10 -0
- package/catalog/cards/G9SheetFooterBar.md +11 -0
- package/catalog/cards/G9SheetFrame.md +17 -0
- package/catalog/cards/G9SheetHeader.md +11 -0
- package/catalog/cards/G9SheetScrollIndicator.md +10 -0
- package/catalog/cards/G9SheetScrollRegion.md +11 -0
- package/catalog/cards/G9SheetSkeleton.md +13 -0
- package/catalog/cards/G9ShimmerBand.md +10 -0
- package/catalog/cards/G9ShortcutList.md +11 -0
- package/catalog/cards/G9ShortcutsSheet.md +15 -0
- package/catalog/cards/G9SideNav.md +16 -0
- package/catalog/cards/G9Skeleton.md +13 -0
- package/catalog/cards/G9SkeletonPage.md +13 -0
- package/catalog/cards/G9SkeletonRows.md +13 -0
- package/catalog/cards/G9SplitPane.md +17 -0
- package/catalog/cards/G9StatusPill.md +17 -0
- package/catalog/cards/G9StepSlider.md +16 -0
- package/catalog/cards/G9StepTracker.md +13 -0
- package/catalog/cards/G9Stepper.md +17 -0
- package/catalog/cards/G9SuccessHeader.md +14 -0
- package/catalog/cards/G9Swatch.md +13 -0
- package/catalog/cards/G9SwipeGroup.md +11 -0
- package/catalog/cards/G9SwipeView.md +17 -0
- package/catalog/cards/G9Switch.md +17 -0
- package/catalog/cards/G9SwitchGroup.md +15 -0
- package/catalog/cards/G9SwitchRow.md +17 -0
- package/catalog/cards/G9TabBar.md +17 -0
- package/catalog/cards/G9TabView.md +17 -0
- package/catalog/cards/G9Tag.md +14 -0
- package/catalog/cards/G9TagEntry.md +16 -0
- package/catalog/cards/G9TextEntry.md +17 -0
- package/catalog/cards/G9ThemePreviewCard.md +15 -0
- package/catalog/cards/G9TimeEntry.md +17 -0
- package/catalog/cards/G9TimeSpanPicker.md +17 -0
- package/catalog/cards/G9TitleWithLine.md +13 -0
- package/catalog/cards/G9TopBar.md +13 -0
- package/catalog/cards/G9UnsavedBar.md +16 -0
- package/catalog/cards/G9UpdateBar.md +15 -0
- package/catalog/cards/G9VerticalIconTextButton.md +15 -0
- package/catalog/cards/G9VirtualList.md +17 -0
- package/catalog/cards/G9Wave.md +15 -0
- package/catalog/cards/G9WheelColumn.md +17 -0
- package/catalog/cards/PickerField.md +14 -0
- package/catalog/cards/PickerSheetHeader.md +12 -0
- package/catalog/cards/PopupFrame.md +15 -0
- package/catalog/cards/PopupInputForm.md +11 -0
- package/catalog/cards/SelectionValueIcon.md +12 -0
- package/catalog/cards/TimeSpanSheetBody.md +16 -0
- package/catalog/catalog.json +47916 -0
- package/catalog/index.md +159 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/anchor/index.d.ts +1 -1
- package/dist/anchor/index.d.ts.map +1 -1
- package/dist/anchor/registry.d.ts +5 -0
- package/dist/anchor/registry.d.ts.map +1 -1
- package/dist/base/base.css +1 -0
- package/dist/base/base.css.map +1 -1
- package/dist/button/button-variants.css +4 -0
- package/dist/button/button-variants.css.map +1 -1
- package/dist/button/button.css +12 -5
- package/dist/button/button.css.map +1 -1
- package/dist/button/variant-css.d.ts.map +1 -1
- package/dist/button/variant-css.jsx +2 -1
- package/dist/cascade/cascade.css +2 -1
- package/dist/cascade/cascade.css.map +1 -1
- package/dist/commands/commands.css +12 -6
- package/dist/commands/commands.css.map +1 -1
- package/dist/design/design.d.ts +39 -0
- package/dist/design/design.d.ts.map +1 -0
- package/dist/design/design.jsx +54 -0
- package/dist/design/index.d.ts +3 -0
- package/dist/design/index.d.ts.map +1 -0
- package/dist/design/index.jsx +2 -0
- package/dist/design/probe.d.ts +62 -0
- package/dist/design/probe.d.ts.map +1 -0
- package/dist/design/probe.jsx +141 -0
- package/dist/display/data-uri.d.ts +9 -0
- package/dist/display/data-uri.d.ts.map +1 -0
- package/dist/display/data-uri.jsx +56 -0
- package/dist/display/display.css +10 -3
- package/dist/display/display.css.map +1 -1
- package/dist/display/extras.css +8 -2
- package/dist/display/extras.css.map +1 -1
- package/dist/display/figures.css +28 -7
- package/dist/display/figures.css.map +1 -1
- package/dist/display/figures.d.ts +10 -0
- package/dist/display/figures.d.ts.map +1 -1
- package/dist/display/figures.jsx +28 -5
- package/dist/display/image.d.ts +9 -2
- package/dist/display/image.d.ts.map +1 -1
- package/dist/display/image.jsx +20 -6
- package/dist/display/keycap.css +1 -0
- package/dist/display/keycap.css.map +1 -1
- package/dist/display/motion-figures.css +4 -1
- package/dist/display/motion-figures.css.map +1 -1
- package/dist/display/separator.d.ts.map +1 -1
- package/dist/display/separator.jsx +1 -1
- package/dist/display/status.css +5 -0
- package/dist/display/status.css.map +1 -1
- package/dist/display/theme-preview.css +6 -3
- package/dist/display/theme-preview.css.map +1 -1
- package/dist/edge-panel/edge-panel.css +6 -3
- package/dist/edge-panel/edge-panel.css.map +1 -1
- package/dist/effects/effects.css +4 -2
- package/dist/effects/effects.css.map +1 -1
- package/dist/expander/expander.css +2 -1
- package/dist/expander/expander.css.map +1 -1
- package/dist/fields/extra-entries.css +14 -6
- package/dist/fields/extra-entries.css.map +1 -1
- package/dist/fields/fields.css +21 -10
- package/dist/fields/fields.css.map +1 -1
- package/dist/fields/text-entry.d.ts.map +1 -1
- package/dist/fields/text-entry.jsx +3 -0
- package/dist/guide/guide.css +17 -5
- package/dist/guide/guide.css.map +1 -1
- package/dist/header/header.css +6 -2
- package/dist/header/header.css.map +1 -1
- package/dist/icon/icon.d.ts +9 -2
- package/dist/icon/icon.d.ts.map +1 -1
- package/dist/icon/icon.jsx +26 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/layout/layout.css +15 -5
- package/dist/layout/layout.css.map +1 -1
- package/dist/layout/scrollers.d.ts +6 -0
- package/dist/layout/scrollers.d.ts.map +1 -1
- package/dist/layout/scrollers.jsx +5 -1
- package/dist/list/list.css +18 -8
- package/dist/list/list.css.map +1 -1
- package/dist/orb/orb.css +2 -1
- package/dist/orb/orb.css.map +1 -1
- package/dist/pickers/day-stepper.css +2 -1
- package/dist/pickers/day-stepper.css.map +1 -1
- package/dist/pickers/pickers.css +19 -9
- package/dist/pickers/pickers.css.map +1 -1
- package/dist/plus-button/plus-button.css +2 -1
- package/dist/plus-button/plus-button.css.map +1 -1
- package/dist/popover/popover.css +9 -4
- package/dist/popover/popover.css.map +1 -1
- package/dist/popup/popup.css +11 -5
- package/dist/popup/popup.css.map +1 -1
- package/dist/popup/service.d.ts.map +1 -1
- package/dist/popup/service.jsx +5 -1
- package/dist/provider/index.d.ts +1 -1
- package/dist/provider/index.d.ts.map +1 -1
- package/dist/provider/provider.css.map +1 -1
- package/dist/provider/provider.d.ts +25 -1
- package/dist/provider/provider.d.ts.map +1 -1
- package/dist/provider/provider.jsx +48 -12
- package/dist/range-slider/range-slider.css +9 -4
- package/dist/range-slider/range-slider.css.map +1 -1
- package/dist/selection/selection.css +10 -5
- package/dist/selection/selection.css.map +1 -1
- package/dist/sheet/frame.d.ts +6 -0
- package/dist/sheet/frame.d.ts.map +1 -1
- package/dist/sheet/frame.jsx +5 -1
- package/dist/sheet/header.d.ts.map +1 -1
- package/dist/sheet/header.jsx +5 -2
- package/dist/sheet/service.d.ts +5 -0
- package/dist/sheet/service.d.ts.map +1 -1
- package/dist/sheet/service.jsx +9 -6
- package/dist/sheet/sheet.css +1 -0
- package/dist/sheet/sheet.css.map +1 -1
- package/dist/shell/shell.css +19 -8
- package/dist/shell/shell.css.map +1 -1
- package/dist/survey/survey.css +15 -7
- package/dist/survey/survey.css.map +1 -1
- package/dist/swipe/swipe.css +1 -0
- package/dist/swipe/swipe.css.map +1 -1
- package/dist/tab-bar/index.d.ts +1 -1
- package/dist/tab-bar/index.d.ts.map +1 -1
- package/dist/tab-bar/index.jsx +1 -1
- package/dist/tab-bar/model.d.ts +14 -0
- package/dist/tab-bar/model.d.ts.map +1 -1
- package/dist/tab-bar/model.jsx +19 -1
- package/dist/tab-bar/tab-bar.css +4 -1
- package/dist/tab-bar/tab-bar.css.map +1 -1
- package/dist/tab-bar/tab-bar.d.ts.map +1 -1
- package/dist/tab-bar/tab-bar.jsx +12 -8
- package/dist/tabs/tabs.css +3 -1
- package/dist/tabs/tabs.css.map +1 -1
- package/dist/toast/toast.css +9 -4
- package/dist/toast/toast.css.map +1 -1
- package/dist/toggle/choice.css +15 -6
- package/dist/toggle/choice.css.map +1 -1
- package/dist/toggle/toggle.css +12 -6
- package/dist/toggle/toggle.css.map +1 -1
- package/package.json +16 -4
- package/skills/g9-lynx-app/SKILL.md +42 -0
- package/skills/g9-lynx-app/references/adaptive-layout.md +10 -0
- package/skills/g9-lynx-app/references/anchors-guide.md +9 -0
- package/skills/g9-lynx-app/references/catalog-index.md +80 -0
- package/skills/g9-lynx-app/references/common-mistakes.md +12 -0
- package/skills/g9-lynx-app/references/components/anchor.md +30 -0
- package/skills/g9-lynx-app/references/components/barcode-qr.md +19 -0
- package/skills/g9-lynx-app/references/components/barcode.md +37 -0
- package/skills/g9-lynx-app/references/components/base.md +35 -0
- package/skills/g9-lynx-app/references/components/button.md +125 -0
- package/skills/g9-lynx-app/references/components/calendar.md +128 -0
- package/skills/g9-lynx-app/references/components/cascade.md +19 -0
- package/skills/g9-lynx-app/references/components/charts.md +193 -0
- package/skills/g9-lynx-app/references/components/chat.md +98 -0
- package/skills/g9-lynx-app/references/components/commands.md +45 -0
- package/skills/g9-lynx-app/references/components/commerce.md +69 -0
- package/skills/g9-lynx-app/references/components/datagrid.md +19 -0
- package/skills/g9-lynx-app/references/components/deferred.md +19 -0
- package/skills/g9-lynx-app/references/components/design.md +27 -0
- package/skills/g9-lynx-app/references/components/display-1.md +193 -0
- package/skills/g9-lynx-app/references/components/display-2.md +196 -0
- package/skills/g9-lynx-app/references/components/display-3.md +122 -0
- package/skills/g9-lynx-app/references/components/edge-panel.md +19 -0
- package/skills/g9-lynx-app/references/components/effects.md +46 -0
- package/skills/g9-lynx-app/references/components/expander.md +19 -0
- package/skills/g9-lynx-app/references/components/fields.md +174 -0
- package/skills/g9-lynx-app/references/components/header.md +19 -0
- package/skills/g9-lynx-app/references/components/host.md +32 -0
- package/skills/g9-lynx-app/references/components/icon.md +64 -0
- package/skills/g9-lynx-app/references/components/intro-carousel.md +19 -0
- package/skills/g9-lynx-app/references/components/layout-1.md +188 -0
- package/skills/g9-lynx-app/references/components/layout-2.md +18 -0
- package/skills/g9-lynx-app/references/components/list.md +116 -0
- package/skills/g9-lynx-app/references/components/map.md +19 -0
- package/skills/g9-lynx-app/references/components/media.md +115 -0
- package/skills/g9-lynx-app/references/components/orb.md +37 -0
- package/skills/g9-lynx-app/references/components/pickers.md +185 -0
- package/skills/g9-lynx-app/references/components/pilot.md +40 -0
- package/skills/g9-lynx-app/references/components/plus-button.md +19 -0
- package/skills/g9-lynx-app/references/components/popover.md +94 -0
- package/skills/g9-lynx-app/references/components/popup.md +56 -0
- package/skills/g9-lynx-app/references/components/provider.md +43 -0
- package/skills/g9-lynx-app/references/components/range-slider.md +36 -0
- package/skills/g9-lynx-app/references/components/route.md +19 -0
- package/skills/g9-lynx-app/references/components/sheet.md +134 -0
- package/skills/g9-lynx-app/references/components/shell.md +98 -0
- package/skills/g9-lynx-app/references/components/survey.md +55 -0
- package/skills/g9-lynx-app/references/components/swipe.md +31 -0
- package/skills/g9-lynx-app/references/components/tab-bar.md +19 -0
- package/skills/g9-lynx-app/references/components/tabs.md +19 -0
- package/skills/g9-lynx-app/references/components/toggle.md +161 -0
- package/skills/g9-lynx-app/references/lists.md +13 -0
- package/skills/g9-lynx-app/references/localization-rtl.md +13 -0
- package/skills/g9-lynx-app/references/navigation-route.md +21 -0
- package/skills/g9-lynx-app/references/overlays.md +27 -0
- package/skills/g9-lynx-app/references/pilot.md +10 -0
- package/skills/g9-lynx-app/references/platform-rules.md +42 -0
- package/skills/g9-lynx-app/references/provider-and-host.md +37 -0
- package/skills/g9-lynx-app/references/theming.md +18 -0
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { g9RuntimeTimers } from "@g9tm/lynxcontrols-foundation";
|
|
2
|
+
import { anchorRect, visibleFraction, windowRect } from "../anchor/measure.jsx";
|
|
3
|
+
const LAYER_ORDER = {
|
|
4
|
+
page: 0,
|
|
5
|
+
sheet: 1,
|
|
6
|
+
popup: 2,
|
|
7
|
+
floating: 3
|
|
8
|
+
};
|
|
9
|
+
function quietly(read, fallback) {
|
|
10
|
+
try {
|
|
11
|
+
return read();
|
|
12
|
+
} catch {
|
|
13
|
+
return fallback;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
function describe(entry, view, rect) {
|
|
17
|
+
const info = quietly(()=>entry.info(), {
|
|
18
|
+
kind: 'view'
|
|
19
|
+
});
|
|
20
|
+
const label = quietly(()=>{
|
|
21
|
+
var _ref;
|
|
22
|
+
var _info_label;
|
|
23
|
+
return null != (_ref = null == (_info_label = info.label) ? void 0 : _info_label.call(info)) ? _ref : null;
|
|
24
|
+
}, null);
|
|
25
|
+
return Object.freeze({
|
|
26
|
+
id: entry.id,
|
|
27
|
+
kind: info.kind,
|
|
28
|
+
layer: entry.binding.layer,
|
|
29
|
+
...void 0 !== entry.binding.sheetId ? {
|
|
30
|
+
sheetId: entry.binding.sheetId
|
|
31
|
+
} : {},
|
|
32
|
+
rect,
|
|
33
|
+
visible: rect ? visibleFraction(rect, view) : 0,
|
|
34
|
+
scroller: entry.binding.scrollerId,
|
|
35
|
+
enabled: quietly(()=>{
|
|
36
|
+
var _ref;
|
|
37
|
+
var _info_enabled;
|
|
38
|
+
return null != (_ref = null == (_info_enabled = info.enabled) ? void 0 : _info_enabled.call(info)) ? _ref : true;
|
|
39
|
+
}, true),
|
|
40
|
+
shown: quietly(()=>{
|
|
41
|
+
var _ref;
|
|
42
|
+
var _entry_binding_shown, _entry_binding;
|
|
43
|
+
return null != (_ref = null == (_entry_binding_shown = (_entry_binding = entry.binding).shown) ? void 0 : _entry_binding_shown.call(_entry_binding)) ? _ref : true;
|
|
44
|
+
}, true),
|
|
45
|
+
label: 'string' == typeof label ? label : null,
|
|
46
|
+
virtual: entry.virtual
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
const holds = (r, x, y)=>x >= r.x && y >= r.y && x < r.x + r.width && y < r.y + r.height;
|
|
50
|
+
const probe_area = (r)=>r.width * r.height;
|
|
51
|
+
const contains = (outer, inner)=>outer.x <= inner.x && outer.y <= inner.y && outer.x + outer.width >= inner.x + inner.width && outer.y + outer.height >= inner.y + inner.height;
|
|
52
|
+
function hitTestAnchors(anchors, x, y) {
|
|
53
|
+
const under = anchors.map((a, order)=>({
|
|
54
|
+
a,
|
|
55
|
+
order
|
|
56
|
+
})).filter(({ a })=>a.shown && null !== a.rect && holds(a.rect, x, y));
|
|
57
|
+
if (0 === under.length) return null;
|
|
58
|
+
under.sort((p, q)=>LAYER_ORDER[q.a.layer] - LAYER_ORDER[p.a.layer] || probe_area(p.a.rect) - probe_area(q.a.rect) || q.order - p.order);
|
|
59
|
+
const top = under[0].a;
|
|
60
|
+
const topRect = top.rect;
|
|
61
|
+
const ancestors = under.map(({ a })=>a).filter((a)=>a !== top && LAYER_ORDER[a.layer] <= LAYER_ORDER[top.layer] && contains(a.rect, topRect)).sort((p, q)=>probe_area(p.rect) - probe_area(q.rect));
|
|
62
|
+
return Object.freeze({
|
|
63
|
+
anchor: top,
|
|
64
|
+
ancestors: Object.freeze(ancestors)
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
const round = (n)=>Math.round(2 * n) / 2;
|
|
68
|
+
const signature = (anchors)=>anchors.map((a)=>`${a.id}|${a.layer}|${a.shown ? 1 : 0}|${a.enabled ? 1 : 0}|${a.rect ? `${round(a.rect.x)},${round(a.rect.y)},${round(a.rect.width)},${round(a.rect.height)}` : '-'}`).join(';');
|
|
69
|
+
function defaultNextFrame(run) {
|
|
70
|
+
const host = quietly(()=>"u" > typeof lynx ? lynx : void 0, void 0);
|
|
71
|
+
if ('function' == typeof (null == host ? void 0 : host.requestAnimationFrame)) host.requestAnimationFrame(run);
|
|
72
|
+
else g9RuntimeTimers.setTimeout(run, 16);
|
|
73
|
+
}
|
|
74
|
+
function createG9DesignProbe(registry, options = {}) {
|
|
75
|
+
var _options_nextFrame;
|
|
76
|
+
const nextFrame = null != (_options_nextFrame = options.nextFrame) ? _options_nextFrame : defaultNextFrame;
|
|
77
|
+
const listeners = new Set();
|
|
78
|
+
let scheduled = false;
|
|
79
|
+
let last = null;
|
|
80
|
+
let stopRegistry = null;
|
|
81
|
+
let poll = null;
|
|
82
|
+
const snapshot = async ()=>{
|
|
83
|
+
const view = windowRect();
|
|
84
|
+
const entries = registry.all();
|
|
85
|
+
const rects = await Promise.all(entries.map((entry)=>anchorRect(entry)));
|
|
86
|
+
const anchors = entries.map((entry, i)=>{
|
|
87
|
+
var _rects_i;
|
|
88
|
+
return describe(entry, view, null != (_rects_i = rects[i]) ? _rects_i : null);
|
|
89
|
+
});
|
|
90
|
+
return Object.freeze(anchors);
|
|
91
|
+
};
|
|
92
|
+
const measureAndTell = async ()=>{
|
|
93
|
+
const anchors = await snapshot();
|
|
94
|
+
const next = signature(anchors);
|
|
95
|
+
if (next === last || 0 === listeners.size) return;
|
|
96
|
+
last = next;
|
|
97
|
+
for (const listener of [
|
|
98
|
+
...listeners
|
|
99
|
+
])listener(anchors);
|
|
100
|
+
};
|
|
101
|
+
const schedule = ()=>{
|
|
102
|
+
if (scheduled || 0 === listeners.size) return;
|
|
103
|
+
scheduled = true;
|
|
104
|
+
nextFrame(()=>{
|
|
105
|
+
scheduled = false;
|
|
106
|
+
measureAndTell();
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
const startPolling = ()=>{
|
|
110
|
+
if (!options.pollMs || options.pollMs <= 0) return;
|
|
111
|
+
const tick = ()=>{
|
|
112
|
+
schedule();
|
|
113
|
+
poll = g9RuntimeTimers.setTimeout(tick, options.pollMs);
|
|
114
|
+
};
|
|
115
|
+
poll = g9RuntimeTimers.setTimeout(tick, options.pollMs);
|
|
116
|
+
};
|
|
117
|
+
return {
|
|
118
|
+
snapshot,
|
|
119
|
+
async hitTest (x, y) {
|
|
120
|
+
return hitTestAnchors(await snapshot(), x, y);
|
|
121
|
+
},
|
|
122
|
+
subscribe (listener) {
|
|
123
|
+
listeners.add(listener);
|
|
124
|
+
if (1 === listeners.size) {
|
|
125
|
+
last = null;
|
|
126
|
+
stopRegistry = registry.subscribe(schedule);
|
|
127
|
+
startPolling();
|
|
128
|
+
}
|
|
129
|
+
schedule();
|
|
130
|
+
return ()=>{
|
|
131
|
+
if (!listeners.delete(listener) || listeners.size > 0) return;
|
|
132
|
+
null == stopRegistry || stopRegistry();
|
|
133
|
+
stopRegistry = null;
|
|
134
|
+
if (null !== poll) g9RuntimeTimers.clearTimeout(poll);
|
|
135
|
+
poll = null;
|
|
136
|
+
};
|
|
137
|
+
},
|
|
138
|
+
invalidate: schedule
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
export { createG9DesignProbe, hitTestAnchors };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** The bytes of a base64 text (standard or URL alphabet; padding and whitespace ignored). */
|
|
2
|
+
export declare function base64Bytes(text: string): number[];
|
|
3
|
+
/** UTF-8 bytes to text (a malformed sequence becomes U+FFFD). */
|
|
4
|
+
export declare function utf8Text(bytes: readonly number[]): string;
|
|
5
|
+
/** The SVG document an address carries (`data:image/svg+xml[;charset=…][;base64],…`), or null for any other address. */
|
|
6
|
+
export declare function svgFromDataUri(src: string | null | undefined): string | null;
|
|
7
|
+
/** Whether a picture's address carries the picture itself (`data:`): nothing to load, nothing to wait for. */
|
|
8
|
+
export declare const isDataUri: (src: string | null | undefined) => boolean;
|
|
9
|
+
//# sourceMappingURL=data-uri.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-uri.d.ts","sourceRoot":"","sources":["../../src/display/data-uri.ts"],"names":[],"mappings":"AAMA,6FAA6F;AAC7F,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAgBlD;AAED,iEAAiE;AACjE,wBAAgB,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAqBzD;AAED,wHAAwH;AACxH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAW5E;AAED,8GAA8G;AAC9G,eAAO,MAAM,SAAS,GAAI,KAAK,MAAM,GAAG,IAAI,GAAG,SAAS,KAAG,OAA8C,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
const B64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
|
2
|
+
function base64Bytes(text) {
|
|
3
|
+
const out = [];
|
|
4
|
+
let buffer = 0;
|
|
5
|
+
let bits = 0;
|
|
6
|
+
for (const ch of text){
|
|
7
|
+
const c = '-' === ch ? '+' : '_' === ch ? '/' : ch;
|
|
8
|
+
const v = B64.indexOf(c);
|
|
9
|
+
if (!(v < 0)) {
|
|
10
|
+
buffer = buffer << 6 | v;
|
|
11
|
+
bits += 6;
|
|
12
|
+
if (bits >= 8) {
|
|
13
|
+
bits -= 8;
|
|
14
|
+
out.push(buffer >> bits & 0xff);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return out;
|
|
19
|
+
}
|
|
20
|
+
function utf8Text(bytes) {
|
|
21
|
+
let out = '';
|
|
22
|
+
for(let i = 0; i < bytes.length;){
|
|
23
|
+
const b = bytes[i];
|
|
24
|
+
const need = b < 0x80 ? 0 : b >= 0xf0 ? 3 : b >= 0xe0 ? 2 : b >= 0xc0 ? 1 : -1;
|
|
25
|
+
if (need < 0 || i + need >= bytes.length) {
|
|
26
|
+
out += '�';
|
|
27
|
+
i++;
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
let cp = 0 === need ? b : b & 0xff >> need + 2;
|
|
31
|
+
let ok = true;
|
|
32
|
+
for(let k = 1; k <= need; k++){
|
|
33
|
+
const c = bytes[i + k];
|
|
34
|
+
if ((0xc0 & c) !== 0x80) ok = false;
|
|
35
|
+
cp = cp << 6 | 0x3f & c;
|
|
36
|
+
}
|
|
37
|
+
out += ok ? String.fromCodePoint(cp) : '�';
|
|
38
|
+
i += ok ? need + 1 : 1;
|
|
39
|
+
}
|
|
40
|
+
return out;
|
|
41
|
+
}
|
|
42
|
+
function svgFromDataUri(src) {
|
|
43
|
+
var _m_;
|
|
44
|
+
if (!src) return null;
|
|
45
|
+
const m = /^data:image\/svg\+xml((?:;[^,;]*)*?),/i.exec(src.trim());
|
|
46
|
+
if (!m) return null;
|
|
47
|
+
const body = src.trim().slice(m[0].length);
|
|
48
|
+
if (/;base64$/i.test(null != (_m_ = m[1]) ? _m_ : '')) return utf8Text(base64Bytes(body));
|
|
49
|
+
try {
|
|
50
|
+
return decodeURIComponent(body);
|
|
51
|
+
} catch {
|
|
52
|
+
return body;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
const isDataUri = (src)=>!!src && /^data:/i.test(src.trim());
|
|
56
|
+
export { base64Bytes, isDataUri, svgFromDataUri, utf8Text };
|
package/dist/display/display.css
CHANGED
|
@@ -22,9 +22,10 @@
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
.g9-progress__label {
|
|
25
|
+
font-size: 11px;
|
|
26
|
+
font-family: var(--g9-font-text);
|
|
25
27
|
align-self: flex-end;
|
|
26
28
|
margin-bottom: 6px;
|
|
27
|
-
font-size: 11px;
|
|
28
29
|
font-weight: bold;
|
|
29
30
|
}
|
|
30
31
|
|
|
@@ -110,20 +111,26 @@
|
|
|
110
111
|
}
|
|
111
112
|
|
|
112
113
|
.g9-separator__text {
|
|
114
|
+
font-size: 10px;
|
|
115
|
+
font-family: var(--g9-font-text);
|
|
113
116
|
letter-spacing: 1.2px;
|
|
114
117
|
white-space: nowrap;
|
|
115
|
-
font-size: 10px;
|
|
116
118
|
font-weight: bold;
|
|
117
119
|
}
|
|
118
120
|
|
|
121
|
+
.g9-separator__text--rtl {
|
|
122
|
+
letter-spacing: 0;
|
|
123
|
+
}
|
|
124
|
+
|
|
119
125
|
.g9-title-line {
|
|
120
126
|
flex-direction: column;
|
|
121
127
|
display: flex;
|
|
122
128
|
}
|
|
123
129
|
|
|
124
130
|
.g9-title-line__text {
|
|
125
|
-
color: var(--g9-text-primary);
|
|
126
131
|
font-size: 16px;
|
|
132
|
+
font-family: var(--g9-font-text);
|
|
133
|
+
color: var(--g9-text-primary);
|
|
127
134
|
}
|
|
128
135
|
|
|
129
136
|
.g9-title-line__line {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack://./src/display/display.css"],"names":[],"mappings":"AACA;EAAE,mBAAmB;AACrB;;AAGA;EAAE,+CAA+C;AACjD;;AAGA;EAAE;IACE,oBAAoB;EACtB;;EAEA;IACE,yBAAyB;EAC3B;AACF;;AAEA;EACE,sBAAsB;EACtB,aAAa;AACf;;AAEA;EACE,oBAAoB;EACpB,kBAAkB;EAClB,
|
|
1
|
+
{"version":3,"sources":["webpack://./src/display/display.css"],"names":[],"mappings":"AACA;EAAE,mBAAmB;AACrB;;AAGA;EAAE,+CAA+C;AACjD;;AAGA;EAAE;IACE,oBAAoB;EACtB;;EAEA;IACE,yBAAyB;EAC3B;AACF;;AAEA;EACE,sBAAsB;EACtB,aAAa;AACf;;AAEA;EACE,eAAe;EACf,gCAAgC;EAChC,oBAAoB;EACpB,kBAAkB;EAClB,iBAAiB;AACnB;;AAEA;EACE,kBAAkB;EAClB,gBAAgB;AAClB;;AAEA;EACE,YAAY;EACZ,sDAAsD;EACtD,kBAAkB;EAClB,gBAAgB;AAClB;;AAEA;EACE,gBAAgB;AAClB;;AAEA;EACE,mDAAmD;AACrD;;AAEA;EACE;IACE,yBAAyB;EAC3B;;EAEA;IACE,2BAA2B;EAC7B;AACF;;AACA;EAEE,gGAAgG;EAChG,kDAAkD;EAClD,kBAAkB;EAClB,MAAM;EACN,SAAS;EACT,WAAW;EACX,QAAQ;AACV;;AAOA;EAJE;IACE,wBAAwB;EAC1B;;EAEA;IACE,2BAA2B;EAC7B;AACF;;AAMA;EAHE,2BAA2B;EAC3B,oBAAoB;EACpB,UAAU;EACV,WAAW;EACX,kBAAkB;EAClB,mBAAmB;EACnB,kBAAkB;EAClB,QAAQ;AACV;;AAMA;EAHE,mBAAmB;EACnB,mBAAmB;EACnB,gBAAgB;EAChB,iBAAiB;EACjB,mBAAmB;EACnB,aAAa;AACf;;AAMA;EAHE,OAAO;AACT;;AAMA;EAHE,mBAAmB;EACnB,mBAAmB;EACnB,eAAe;EACf,aAAa;AACf;;AAMA;EAHE,eAAe;EACf,gCAAgC;EAChC,qBAAqB;EACrB,mBAAmB;EACnB,iBAAiB;AACnB;;AAOA;EAJE,iBAAiB;AACnB;;AAOA;EAJE,sBAAsB;EACtB,aAAa;AACf;;AAOA;EAJE,eAAe;EACf,gCAAgC;EAChC,6BAA6B;AAC/B;;AAOA;EAJE,2CAA2C;EAC3C,WAAW;EACX,eAAe;AACjB;;AAOA;EAJE,oBAAoB;EACpB,kBAAkB;EAClB,MAAM;EACN,SAAS;EACT,OAAO;EACP,QAAQ;EACR,gBAAgB;AAClB;;AAOA;EAJE,WAAW;EACX,YAAY;EACZ,gDAAgD;AAClD;;AAOA;EAJE;IACE,4BAA4B;EAC9B;;EAEA;IACE,2BAA2B;EAC7B;AACF;;AAMA;EAHE,oBAAoB;EACpB,kBAAkB;EAClB,MAAM;EACN,SAAS;EACT,OAAO;EACP,QAAQ;EACR,gBAAgB;AAClB;;AAMA;EAHE,sBAAsB;EACtB,YAAY;EACZ,oBAAoB;EACpB,aAAa;AACf;;AAMA;EAHE,aAAa;AACf;;AAMA;EAHE,kDAAkD;AACpD;;AAMA;EAHE,mBAAmB;EACnB,YAAY;AACd;;AAMA;EAHE,mBAAmB;EACnB,mBAAmB;EACnB,eAAe;EACf,YAAY;EACZ,aAAa;AACf;;AAMA;EAHE,kDAAkD;EAClD,mBAAmB;EACnB,WAAW;EACX,YAAY;AACd;;AAMA;EAHE,kBAAkB;EAClB,OAAO;EACP,YAAY;AACd;;AAMA;EAHE,6BAA6B;AAC/B","sourcesContent":["/* Display controls (MAUI G9ActivityIndicator, G9ProgressBar, G9Separator, G9TitleWithLine, G9Shimmer). */\n.g9-activity {\n border-style: solid;\n}\n\n.g9-activity--running {\n animation: g9-activity-spin 800ms linear infinite;\n}\n\n@keyframes g9-activity-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n\n.g9-progress {\n display: flex;\n flex-direction: column;\n}\n\n.g9-progress__label {\n align-self: flex-end;\n margin-bottom: 6px;\n font-size: 11px;\n font-family: var(--g9-font-text);\n font-weight: bold;\n}\n\n.g9-progress__track {\n position: relative;\n overflow: hidden;\n}\n\n.g9-progress__fill {\n position: relative;\n height: 100%;\n overflow: hidden;\n transition: width 300ms cubic-bezier(0.215, 0.61, 0.355, 1);\n}\n\n.g9-progress__fill--indeterminate {\n transition: none;\n}\n\n.g9-progress__fill--sweep {\n animation: g9-progress-sweep 1333ms linear infinite;\n}\n\n@keyframes g9-progress-sweep {\n from {\n transform: translateX(0%);\n }\n to {\n transform: translateX(400%);\n }\n}\n\n.g9-progress__stripes {\n position: absolute;\n top: 0;\n bottom: 0;\n left: -16px;\n right: 0;\n background: repeating-linear-gradient(\n -60deg,\n rgba(255, 255, 255, 0.16) 0px,\n rgba(255, 255, 255, 0.16) 5px,\n transparent 5px,\n transparent 16px\n );\n animation: g9-progress-stripes 700ms linear infinite;\n}\n\n@keyframes g9-progress-stripes {\n from {\n transform: translateX(0px);\n }\n to {\n transform: translateX(16px);\n }\n}\n\n.g9-progress__segment {\n position: absolute;\n top: 50%;\n width: 3px;\n height: 3px;\n margin-top: -1.5px;\n margin-left: -1.5px;\n border-radius: 1.5px;\n background-color: rgba(255, 255, 255, 0.5);\n}\n\n.g9-separator {\n display: flex;\n flex-direction: row;\n align-items: center;\n column-gap: 10px;\n padding-top: 14px;\n padding-bottom: 8px;\n}\n\n.g9-separator__line {\n flex: 1;\n}\n\n.g9-separator__title {\n display: flex;\n flex-direction: row;\n align-items: center;\n column-gap: 4px;\n}\n\n.g9-separator__text {\n font-size: 10px;\n font-family: var(--g9-font-text);\n font-weight: bold;\n letter-spacing: 1.2px;\n white-space: nowrap;\n}\n\n/* Arabic script is joined: spacing its letters breaks the words apart (LC-07: no letter-spacing on it) */\n.g9-separator__text--rtl {\n letter-spacing: 0;\n}\n\n.g9-title-line {\n display: flex;\n flex-direction: column;\n}\n\n.g9-title-line__text {\n font-size: 16px;\n font-family: var(--g9-font-text);\n color: var(--g9-text-primary);\n}\n\n.g9-title-line__line {\n height: 1px;\n margin-top: 6px;\n background-color: var(--g9-outline-variant);\n}\n\n.g9-shimmer__band-host {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n overflow: hidden;\n pointer-events: none;\n}\n\n.g9-shimmer__band {\n width: 100%;\n height: 100%;\n animation: g9-shimmer-sweep 1100ms linear infinite;\n}\n\n@keyframes g9-shimmer-sweep {\n from {\n transform: translateX(-100%);\n }\n to {\n transform: translateX(100%);\n }\n}\n\n.g9-skeleton {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n overflow: hidden;\n pointer-events: none;\n}\n\n.g9-skeleton__rows {\n display: flex;\n flex-direction: column;\n row-gap: 8px;\n padding: 0px 10px 10px 10px;\n}\n\n.g9-skeleton__rows--form {\n row-gap: 12px;\n}\n\n.g9-skeleton__bar {\n background-color: var(--g9-surface-container-high);\n}\n\n.g9-skeleton__field {\n height: 48px;\n border-radius: 12px;\n}\n\n.g9-skeleton__row {\n display: flex;\n flex-direction: row;\n align-items: center;\n column-gap: 8px;\n height: 52px;\n}\n\n.g9-skeleton__circle {\n width: 28px;\n height: 28px;\n border-radius: 14px;\n background-color: var(--g9-surface-container-high);\n}\n\n.g9-skeleton__line {\n flex: 1;\n height: 16px;\n border-radius: 8px;\n}\n\n.g9-date-label {\n color: var(--g9-text-primary);\n}\n"],"sourceRoot":""}
|
package/dist/display/extras.css
CHANGED
|
@@ -11,10 +11,12 @@
|
|
|
11
11
|
|
|
12
12
|
.g9-tag__emoji {
|
|
13
13
|
font-size: 11px;
|
|
14
|
+
font-family: var(--g9-font-text);
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
.g9-tag__text {
|
|
17
18
|
font-size: 11px;
|
|
19
|
+
font-family: var(--g9-font-text);
|
|
18
20
|
font-weight: 700;
|
|
19
21
|
}
|
|
20
22
|
|
|
@@ -29,6 +31,7 @@
|
|
|
29
31
|
|
|
30
32
|
.g9-live-badge__text {
|
|
31
33
|
font-size: 12px;
|
|
34
|
+
font-family: var(--g9-font-text);
|
|
32
35
|
font-weight: 800;
|
|
33
36
|
}
|
|
34
37
|
|
|
@@ -73,19 +76,22 @@
|
|
|
73
76
|
|
|
74
77
|
.g9-lock__glyph {
|
|
75
78
|
font-size: 22px;
|
|
79
|
+
font-family: var(--g9-font-text);
|
|
76
80
|
}
|
|
77
81
|
|
|
78
82
|
.g9-lock__title {
|
|
83
|
+
font-size: 15px;
|
|
84
|
+
font-family: var(--g9-font-text);
|
|
79
85
|
text-align: center;
|
|
80
86
|
color: var(--g9-text-primary);
|
|
81
|
-
font-size: 15px;
|
|
82
87
|
font-weight: 800;
|
|
83
88
|
}
|
|
84
89
|
|
|
85
90
|
.g9-lock__message {
|
|
91
|
+
font-size: 13px;
|
|
92
|
+
font-family: var(--g9-font-text);
|
|
86
93
|
text-align: center;
|
|
87
94
|
color: var(--g9-text-secondary);
|
|
88
|
-
font-size: 13px;
|
|
89
95
|
}
|
|
90
96
|
|
|
91
97
|
.g9-came-from {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack://./src/display/extras.css"],"names":[],"mappings":"AACA;EAAE,mBAAmB;EACnB,iBAAiB;EACjB,kBAAkB;EAClB,sBAAsB;EACtB,mBAAmB;EACnB,eAAe;EACf,gBAAgB;EAChB,aAAa;AACf;;AAGA;EAAE,eAAe;
|
|
1
|
+
{"version":3,"sources":["webpack://./src/display/extras.css"],"names":[],"mappings":"AACA;EAAE,mBAAmB;EACnB,iBAAiB;EACjB,kBAAkB;EAClB,sBAAsB;EACtB,mBAAmB;EACnB,eAAe;EACf,gBAAgB;EAChB,aAAa;AACf;;AAGA;EAAE,eAAe;EACf,gCAAgC;AAClC;;AAGA;EAAE,eAAe;EACf,gCAAgC;EAChC,gBAAgB;AAClB;;AAGA;EAAE,mBAAmB;EACnB,sBAAsB;EACtB,mBAAmB;EACnB,eAAe;EACf,iBAAiB;EACjB,aAAa;AACf;;AAGA;EAAE,eAAe;EACf,gCAAgC;EAChC,gBAAgB;AAClB;;AAGA;EAAE,sBAAsB;EACtB,aAAa;EACb,kBAAkB;AACpB;;AAGA;EAAE,sBAAsB;EACtB,aAAa;AACf;;AAGA;EAAE,YAAY;AACd;;AAGA;EAAE,sBAAsB;EACtB,uBAAuB;EACvB,mBAAmB;EACnB,YAAY;EACZ,aAAa;EACb,aAAa;EACb,kBAAkB;EAClB,MAAM;EACN,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;AAGA;EAAE,kDAAkD;EAClD,mBAAmB;EACnB,uBAAuB;EACvB,mBAAmB;EACnB,WAAW;EACX,YAAY;EACZ,aAAa;AACf;;AAGA;EAAE,eAAe;EACf,gCAAgC;AAClC;;AAGA;EAAE,eAAe;EACf,gCAAgC;EAChC,kBAAkB;EAClB,6BAA6B;EAC7B,gBAAgB;AAClB;;AAGA;EAAE,eAAe;EACf,gCAAgC;EAChC,kBAAkB;EAClB,+BAA+B;AACjC;;AAIA;EADE,mCAAmC;EACnC,UAAU;EACV,0CAA0C;EAC1C,kBAAkB;EAClB,MAAM;EACN,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;AAIA;EADE;IACE,WAAW;EACb;;EAEA;IACE,YAAY;EACd;;EAEA;IACE,UAAU;EACZ;AACF","sourcesContent":["/* Display extras. One class per selector. */\n.g9-tag {\n display: flex;\n align-items: center;\n align-self: flex-start;\n column-gap: 4px;\n padding: 2px 8px;\n border-radius: 8px;\n border-width: 1px;\n border-style: solid;\n}\n\n.g9-tag__emoji {\n font-size: 11px;\n font-family: var(--g9-font-text);\n}\n\n.g9-tag__text {\n font-size: 11px;\n font-family: var(--g9-font-text);\n font-weight: 700;\n}\n\n.g9-live-badge {\n display: flex;\n align-items: center;\n align-self: flex-start;\n column-gap: 6px;\n padding: 3px 10px;\n border-radius: 12px;\n}\n\n.g9-live-badge__text {\n font-size: 12px;\n font-family: var(--g9-font-text);\n font-weight: 800;\n}\n\n.g9-lock {\n position: relative;\n display: flex;\n flex-direction: column;\n}\n\n.g9-lock__content {\n display: flex;\n flex-direction: column;\n}\n\n.g9-lock__content--locked {\n opacity: 0.18;\n}\n\n.g9-lock__cover {\n position: absolute;\n left: 0px;\n top: 0px;\n right: 0px;\n bottom: 0px;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n row-gap: 8px;\n padding: 16px;\n}\n\n.g9-lock__badge {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 48px;\n height: 48px;\n border-radius: 24px;\n background-color: var(--g9-surface-container-high);\n}\n\n.g9-lock__glyph {\n font-size: 22px;\n font-family: var(--g9-font-text);\n}\n\n.g9-lock__title {\n font-size: 15px;\n font-family: var(--g9-font-text);\n font-weight: 800;\n text-align: center;\n color: var(--g9-text-primary);\n}\n\n.g9-lock__message {\n font-size: 13px;\n font-family: var(--g9-font-text);\n text-align: center;\n color: var(--g9-text-secondary);\n}\n\n/* G9CameFromMark: the row you came back from, fading out by itself */\n.g9-came-from {\n position: absolute;\n left: 0px;\n top: 0px;\n right: 0px;\n bottom: 0px;\n background-color: var(--g9-primary);\n opacity: 0;\n animation: g9-came-from 2200ms ease-out both;\n}\n\n@keyframes g9-came-from {\n 0% {\n opacity: 0.2;\n }\n 45% {\n opacity: 0.14;\n }\n 100% {\n opacity: 0;\n }\n}\n"],"sourceRoot":""}
|
package/dist/display/figures.css
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
.g9-avatar__text {
|
|
18
18
|
font-weight: 700;
|
|
19
|
+
font-family: var(--g9-font-text);
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
.g9-avatar__image {
|
|
@@ -56,8 +57,9 @@
|
|
|
56
57
|
}
|
|
57
58
|
|
|
58
59
|
.g9-delta__text {
|
|
59
|
-
white-space: nowrap;
|
|
60
60
|
font-size: 12px;
|
|
61
|
+
font-family: var(--g9-font-text);
|
|
62
|
+
white-space: nowrap;
|
|
61
63
|
font-weight: 700;
|
|
62
64
|
}
|
|
63
65
|
|
|
@@ -83,9 +85,14 @@
|
|
|
83
85
|
}
|
|
84
86
|
|
|
85
87
|
.g9-kpi__label {
|
|
88
|
+
font-size: 12px;
|
|
89
|
+
font-family: var(--g9-font-text);
|
|
86
90
|
color: var(--g9-text-secondary);
|
|
91
|
+
text-overflow: ellipsis;
|
|
92
|
+
white-space: nowrap;
|
|
87
93
|
flex: 1;
|
|
88
|
-
|
|
94
|
+
min-width: 0;
|
|
95
|
+
overflow: hidden;
|
|
89
96
|
}
|
|
90
97
|
|
|
91
98
|
.g9-kpi__icon {
|
|
@@ -98,10 +105,14 @@
|
|
|
98
105
|
}
|
|
99
106
|
|
|
100
107
|
.g9-kpi__value {
|
|
101
|
-
color: var(--g9-text-primary);
|
|
102
108
|
font-size: 22px;
|
|
109
|
+
font-family: var(--g9-font-text);
|
|
110
|
+
color: var(--g9-text-primary);
|
|
111
|
+
text-overflow: ellipsis;
|
|
112
|
+
white-space: nowrap;
|
|
103
113
|
font-weight: 800;
|
|
104
114
|
line-height: 32px;
|
|
115
|
+
overflow: hidden;
|
|
105
116
|
}
|
|
106
117
|
|
|
107
118
|
.g9-kpi__value-skeleton {
|
|
@@ -119,9 +130,14 @@
|
|
|
119
130
|
}
|
|
120
131
|
|
|
121
132
|
.g9-kpi__sub {
|
|
133
|
+
font-size: 11px;
|
|
134
|
+
font-family: var(--g9-font-text);
|
|
122
135
|
color: var(--g9-text-tertiary);
|
|
136
|
+
text-overflow: ellipsis;
|
|
137
|
+
white-space: nowrap;
|
|
123
138
|
flex: 1;
|
|
124
|
-
|
|
139
|
+
min-width: 0;
|
|
140
|
+
overflow: hidden;
|
|
125
141
|
}
|
|
126
142
|
|
|
127
143
|
.g9-kpi__trend {
|
|
@@ -164,24 +180,27 @@
|
|
|
164
180
|
}
|
|
165
181
|
|
|
166
182
|
.g9-empty__title {
|
|
183
|
+
font-size: 16px;
|
|
184
|
+
font-family: var(--g9-font-text);
|
|
167
185
|
text-align: center;
|
|
168
186
|
color: var(--g9-text-primary);
|
|
169
187
|
margin-top: 14px;
|
|
170
|
-
font-size: 16px;
|
|
171
188
|
font-weight: 700;
|
|
172
189
|
line-height: 26px;
|
|
173
190
|
}
|
|
174
191
|
|
|
175
192
|
.g9-empty__title--compact {
|
|
176
193
|
font-size: 14px;
|
|
194
|
+
font-family: var(--g9-font-text);
|
|
177
195
|
line-height: 22px;
|
|
178
196
|
}
|
|
179
197
|
|
|
180
198
|
.g9-empty__message {
|
|
199
|
+
font-size: 13px;
|
|
200
|
+
font-family: var(--g9-font-text);
|
|
181
201
|
text-align: center;
|
|
182
202
|
color: var(--g9-text-secondary);
|
|
183
203
|
margin-top: 4px;
|
|
184
|
-
font-size: 13px;
|
|
185
204
|
line-height: 22px;
|
|
186
205
|
}
|
|
187
206
|
|
|
@@ -197,8 +216,9 @@
|
|
|
197
216
|
}
|
|
198
217
|
|
|
199
218
|
.g9-empty__action-text {
|
|
200
|
-
color: var(--g9-on-primary-container);
|
|
201
219
|
font-size: 14px;
|
|
220
|
+
font-family: var(--g9-font-text);
|
|
221
|
+
color: var(--g9-on-primary-container);
|
|
202
222
|
font-weight: 700;
|
|
203
223
|
}
|
|
204
224
|
|
|
@@ -232,6 +252,7 @@
|
|
|
232
252
|
}
|
|
233
253
|
|
|
234
254
|
.g9-fade-in {
|
|
255
|
+
font-family: var(--g9-font-text);
|
|
235
256
|
animation: .26s ease-out g9-fade-in;
|
|
236
257
|
}
|
|
237
258
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack://./src/display/figures.css"],"names":[],"mappings":"AACA;EAAE,cAAc;EACd,aAAa;EACb,kBAAkB;AACpB;;AAGA;EAAE,mBAAmB;EACnB,eAAe;EACf,uBAAuB;EACvB,mBAAmB;EACnB,aAAa;EACb,kBAAkB;EAClB,gBAAgB;AAClB;;AAGA;EAAE,gBAAgB;
|
|
1
|
+
{"version":3,"sources":["webpack://./src/display/figures.css"],"names":[],"mappings":"AACA;EAAE,cAAc;E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IACE,UAAU;EACZ;AACF","sourcesContent":["/* G9Avatar, G9Delta, G9Kpi, G9KpiGrid, G9EmptyState, G9LoadState. */\n.g9-avatar {\n display: flex;\n position: relative;\n flex-shrink: 0;\n}\n\n.g9-avatar__disc {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n border-style: solid;\n border-width: 0px;\n position: relative;\n}\n\n.g9-avatar__text {\n font-weight: 700;\n font-family: var(--g9-font-text);\n}\n\n.g9-avatar__image {\n position: absolute;\n left: 0px;\n top: 0px;\n right: 0px;\n bottom: 0px;\n}\n\n.g9-avatar__status {\n position: absolute;\n bottom: 0px;\n border-style: solid;\n border-width: 2px;\n border-color: var(--g9-surface);\n}\n\n/* the reading direction, explicit: Lynx does not inherit `direction`, so a logical property inside a page reads LTR */\n.g9-avatar__status--ltr {\n right: 0px;\n}\n\n.g9-avatar__status--rtl {\n left: 0px;\n}\n\n.g9-delta {\n display: flex;\n flex-direction: row;\n align-items: center;\n align-self: flex-start;\n}\n\n.g9-delta--pill {\n height: 22px;\n padding: 0px 8px;\n border-radius: 11px;\n}\n\n.g9-delta__text {\n font-size: 12px;\n font-family: var(--g9-font-text);\n font-weight: 700;\n white-space: nowrap;\n}\n\n.g9-kpi {\n display: flex;\n flex-direction: column;\n padding: 14px 16px;\n border-radius: var(--g9-radius-card);\n background-color: var(--g9-card-background);\n border-style: solid;\n border-width: 1px;\n border-color: var(--g9-card-border);\n row-gap: 6px;\n min-width: 0px;\n}\n\n.g9-kpi__head {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n column-gap: 8px;\n}\n\n.g9-kpi__label {\n flex: 1;\n font-size: 12px;\n font-family: var(--g9-font-text);\n color: var(--g9-text-secondary);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n min-width: 0px;\n}\n\n.g9-kpi__icon {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n border-radius: 9px;\n}\n\n.g9-kpi__value {\n font-size: 22px;\n font-family: var(--g9-font-text);\n line-height: 32px;\n font-weight: 800;\n color: var(--g9-text-primary);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.g9-kpi__value-skeleton {\n width: 70%;\n height: 22px;\n margin: 5px 0px;\n border-radius: 8px;\n}\n\n.g9-kpi__foot {\n display: flex;\n flex-direction: row;\n align-items: center;\n column-gap: 6px;\n}\n\n.g9-kpi__sub {\n flex: 1;\n font-size: 11px;\n font-family: var(--g9-font-text);\n color: var(--g9-text-tertiary);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n min-width: 0px;\n}\n\n.g9-kpi__trend {\n display: flex;\n margin-top: 4px;\n}\n\n.g9-kpi-grid {\n display: flex;\n flex-direction: column;\n}\n\n.g9-kpi-grid__row {\n display: flex;\n flex-direction: row;\n}\n\n.g9-kpi-grid__cell {\n display: flex;\n flex-direction: column;\n flex: 1;\n min-width: 0px;\n}\n\n.g9-empty {\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 40px 24px;\n}\n\n.g9-empty--compact {\n padding: 20px 16px;\n}\n\n.g9-empty__disc {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.g9-empty__title {\n margin-top: 14px;\n font-size: 16px;\n font-family: var(--g9-font-text);\n line-height: 26px;\n font-weight: 700;\n text-align: center;\n color: var(--g9-text-primary);\n}\n\n.g9-empty__title--compact {\n font-size: 14px;\n font-family: var(--g9-font-text);\n line-height: 22px;\n}\n\n.g9-empty__message {\n margin-top: 4px;\n font-size: 13px;\n font-family: var(--g9-font-text);\n line-height: 22px;\n text-align: center;\n color: var(--g9-text-secondary);\n}\n\n.g9-empty__action {\n display: flex;\n align-items: center;\n justify-content: center;\n margin-top: 14px;\n min-height: 40px;\n padding: 0px 16px;\n border-radius: var(--g9-radius-control);\n background-color: var(--g9-primary-container);\n}\n\n.g9-empty__action-text {\n font-size: 14px;\n font-family: var(--g9-font-text);\n font-weight: 700;\n color: var(--g9-on-primary-container);\n}\n\n.g9-load {\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 48px 24px;\n row-gap: 12px;\n}\n\n.g9-load__spinner {\n width: 26px;\n height: 26px;\n border-radius: 13px;\n border-style: solid;\n border-width: 2.5px;\n border-color: var(--g9-outline-variant);\n border-top-color: var(--g9-primary);\n animation: g9-load-spin 800ms linear infinite;\n}\n\n@keyframes g9-load-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n\n.g9-fade-in {\n animation: g9-fade-in 260ms ease-out;\n font-family: var(--g9-font-text);\n}\n\n@keyframes g9-fade-in {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n"],"sourceRoot":""}
|
|
@@ -83,6 +83,16 @@ export interface G9KpiProps extends Common {
|
|
|
83
83
|
* a trend. The value's key fades a fresh number in (no counting animation: it costs frames on a phone).
|
|
84
84
|
*/
|
|
85
85
|
export declare const G9Kpi: import("react").NamedExoticComponent<G9KpiProps>;
|
|
86
|
+
/** A KPI value's size in a tile with room for it (`.g9-kpi__value`). */
|
|
87
|
+
export declare const KPI_VALUE_FONT_SIZE = 22;
|
|
88
|
+
/** The smallest a KPI value is drawn before it is cut with «…» (a figure must stay readable at a glance). */
|
|
89
|
+
export declare const KPI_VALUE_MIN_FONT_SIZE = 14;
|
|
90
|
+
/**
|
|
91
|
+
* The font size of a KPI value in a tile [tileWidth] dp wide (0 = not measured yet: the full size): the full 22 when it
|
|
92
|
+
* fits the tile's inner width (16 padding and 1 border each side), else proportionally smaller, never below
|
|
93
|
+
* {@link KPI_VALUE_MIN_FONT_SIZE}.
|
|
94
|
+
*/
|
|
95
|
+
export declare function kpiValueFontSize(value: string, tileWidth: number): number;
|
|
86
96
|
/** Props of {@link G9KpiGrid}. */
|
|
87
97
|
export interface G9KpiGridProps extends Common {
|
|
88
98
|
/** Columns by layout. Default `{ phone: 2, tablet: 3, desktop: 4 }`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"figures.d.ts","sourceRoot":"","sources":["../../src/display/figures.tsx"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAC;AACvB,OAAO,gBAAgB,CAAC;AAExB,OAAO,EAAkB,KAAK,SAAS,
|
|
1
|
+
{"version":3,"file":"figures.d.ts","sourceRoot":"","sources":["../../src/display/figures.tsx"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAC;AACvB,OAAO,gBAAgB,CAAC;AAExB,OAAO,EAAkB,KAAK,SAAS,EAAqB,MAAM,gBAAgB,CAAC;AACnF,OAAO,EAAE,KAAK,WAAW,EAAyB,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EAAa,KAAK,MAAM,EAAc,MAAM,cAAc,CAAC;AAClE,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAKxD,UAAU,MAAM;IACd,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC;CAC9B;AAID,8HAA8H;AAC9H,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,GAAG,SAAI,GAAG,MAAM,CAS3E;AAED,QAAA,MAAM,WAAW;;;;;;CAAsD,CAAC;AAGxE,gFAAgF;AAChF,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAI/C;AAED,iCAAiC;AACjC,MAAM,WAAW,aAAc,SAAQ,MAAM;IAC3C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,qEAAqE;IACrE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,2BAA2B;IAC3B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,OAAO,WAAW,GAAG,MAAM,CAAC;IAClD,4CAA4C;IAC5C,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;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AC;IAC1B,0BAA0B;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC;IAC5B,sGAAsG;IACtG,QAAQ,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,kCAAkC;IAClC,QAAQ,CAAC,MAAM,CAAC,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC;IAC1E,8DAA8D;IAC9D,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;CAC/B;AAED,+GAA+G;AAC/G,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,SAAS,CAuChE;AAED,oCAAoC;AACpC,MAAM,WAAW,gBAAiB,SAAQ,MAAM;IAC9C,2CAA2C;IAC3C,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,qCAAqC;IACrC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,iFAAiF;AACjF,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,SAAS,CAuB9D"}
|
package/dist/display/figures.jsx
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import "./figures.css";
|
|
2
2
|
import "./skeleton.css";
|
|
3
3
|
import { formatNumber, formatSignedPercent, isolateLtr } from "@g9tm/lynxcontrols-foundation";
|
|
4
|
-
import { Children, memo } from "@lynx-js/react";
|
|
4
|
+
import { Children, memo, useMemo, useState } from "@lynx-js/react";
|
|
5
5
|
import { g9IdProps, mergeStyle } from "../base/control.jsx";
|
|
6
6
|
import { deltaTone, toneColors } from "../base/tone.jsx";
|
|
7
7
|
import { G9Icon } from "../icon/icon.jsx";
|
|
8
8
|
import { useG9Culture, useG9Direction, useG9Layout } from "../provider/hooks.jsx";
|
|
9
|
+
import { fitLabelFontSize } from "../tab-bar/model.jsx";
|
|
10
|
+
import { svgFromDataUri } from "./data-uri.jsx";
|
|
9
11
|
function g9Initials(name, max = 2) {
|
|
10
12
|
var _Array_from_, _Array_from_1;
|
|
11
13
|
const words = (null != name ? name : '').trim().split(/\s+/).filter(Boolean);
|
|
@@ -48,6 +50,9 @@ const G9Avatar = memo(function(props) {
|
|
|
48
50
|
const tone = null != (_props_tone = props.tone) ? _props_tone : avatarTone(props.name);
|
|
49
51
|
const c = toneColors(tone, props.gradient ? 'solid' : 'soft');
|
|
50
52
|
const fill = props.gradient ? `linear-gradient(135deg, ${c.background}, ${toneColors('accent' === tone ? 'primary' : 'accent', 'solid').background})` : c.background;
|
|
53
|
+
const svgImage = useMemo(()=>svgFromDataUri(props.image), [
|
|
54
|
+
props.image
|
|
55
|
+
]);
|
|
51
56
|
const ring = props.ring ? {
|
|
52
57
|
borderWidth: `${Math.max(2, Math.round(size / 22))}px`,
|
|
53
58
|
borderColor: props.ring
|
|
@@ -69,7 +74,9 @@ const G9Avatar = memo(function(props) {
|
|
|
69
74
|
}}>
|
|
70
75
|
{g9Initials(props.name)}
|
|
71
76
|
</text>
|
|
72
|
-
{props.image ? <
|
|
77
|
+
{props.image ? null !== svgImage ? <svg className="g9-avatar__image" content={svgImage} style={{
|
|
78
|
+
borderRadius: `${size / 2}px`
|
|
79
|
+
}}/> : <image className="g9-avatar__image" src={props.image} mode="aspectFill" style={{
|
|
73
80
|
borderRadius: `${size / 2}px`
|
|
74
81
|
}}/> : null}
|
|
75
82
|
</view>
|
|
@@ -125,7 +132,13 @@ function G9Delta(props) {
|
|
|
125
132
|
const G9Kpi = memo(function(props) {
|
|
126
133
|
var _props_tone;
|
|
127
134
|
const iconColors = toneColors(null != (_props_tone = props.tone) ? _props_tone : 'primary', 'soft');
|
|
128
|
-
|
|
135
|
+
const [width, setWidth] = useState(0);
|
|
136
|
+
const valueSize = props.loading ? KPI_VALUE_FONT_SIZE : kpiValueFontSize(props.value, width);
|
|
137
|
+
return <view className={`g9-kpi${props.onPress ? ' g9-kpi--pressable' : ''}${props.className ? ` ${props.className}` : ''}`} bindlayoutchange={(e)=>{
|
|
138
|
+
var _e_detail;
|
|
139
|
+
const w = Number(null == (_e_detail = e.detail) ? void 0 : _e_detail.width);
|
|
140
|
+
if (Number.isFinite(w) && w > 0 && Math.abs(w - width) >= 1) setWidth(w);
|
|
141
|
+
}} {...g9IdProps(props.id)} accessibility-element={true} accessibility-label={`${props.label}: ${props.loading ? '…' : props.value}`} {...props.onPress ? {
|
|
129
142
|
bindtap: props.onPress,
|
|
130
143
|
'accessibility-traits': 'button'
|
|
131
144
|
} : {}} style={mergeStyle(void 0, props.style)}>
|
|
@@ -139,7 +152,11 @@ const G9Kpi = memo(function(props) {
|
|
|
139
152
|
<G9Icon icon={props.icon} size={16} color={iconColors.foreground}/>
|
|
140
153
|
</view> : null}
|
|
141
154
|
</view>
|
|
142
|
-
{props.loading ? <view className="g9-kpi__value-skeleton g9-skeleton"/> : <text key={props.value} className="g9-kpi__value g9-fade-in" text-maxline="1"
|
|
155
|
+
{props.loading ? <view className="g9-kpi__value-skeleton g9-skeleton"/> : <text key={props.value} className="g9-kpi__value g9-fade-in" text-maxline="1" {...valueSize !== KPI_VALUE_FONT_SIZE ? {
|
|
156
|
+
style: {
|
|
157
|
+
fontSize: `${valueSize}px`
|
|
158
|
+
}
|
|
159
|
+
} : {}}>
|
|
143
160
|
{props.value}
|
|
144
161
|
</text>}
|
|
145
162
|
{props.delta || props.sub ? <view className="g9-kpi__foot">
|
|
@@ -151,6 +168,12 @@ const G9Kpi = memo(function(props) {
|
|
|
151
168
|
{props.trend ? <view className="g9-kpi__trend">{props.trend}</view> : null}
|
|
152
169
|
</view>;
|
|
153
170
|
});
|
|
171
|
+
const KPI_VALUE_FONT_SIZE = 22;
|
|
172
|
+
const KPI_VALUE_MIN_FONT_SIZE = 14;
|
|
173
|
+
function kpiValueFontSize(value, tileWidth) {
|
|
174
|
+
if (tileWidth <= 0) return KPI_VALUE_FONT_SIZE;
|
|
175
|
+
return Math.max(KPI_VALUE_MIN_FONT_SIZE, fitLabelFontSize(value, KPI_VALUE_FONT_SIZE, tileWidth - 34, true));
|
|
176
|
+
}
|
|
154
177
|
function G9KpiGrid(props) {
|
|
155
178
|
var _props_columns, _ref, _cols_desktop, _cols_tablet, _props_gap;
|
|
156
179
|
const { layout } = useG9Layout();
|
|
@@ -220,4 +243,4 @@ function G9LoadState(props) {
|
|
|
220
243
|
{props.message ? <text className="g9-empty__message">{props.message}</text> : null}
|
|
221
244
|
</view>;
|
|
222
245
|
}
|
|
223
|
-
export { G9Avatar, G9Delta, G9EmptyState, G9Kpi, G9KpiGrid, G9LoadState, avatarTone, g9Initials };
|
|
246
|
+
export { G9Avatar, G9Delta, G9EmptyState, G9Kpi, G9KpiGrid, G9LoadState, KPI_VALUE_FONT_SIZE, KPI_VALUE_MIN_FONT_SIZE, avatarTone, g9Initials, kpiValueFontSize };
|
package/dist/display/image.d.ts
CHANGED
|
@@ -11,14 +11,21 @@ export interface G9ImageProps {
|
|
|
11
11
|
readonly width?: number | string;
|
|
12
12
|
/** px or a CSS length; or give `aspectRatio` with a width. */
|
|
13
13
|
readonly height?: number | string;
|
|
14
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* width ÷ height (1 for a square menu photo) when no height is given: a width in px gives the height in px; any other
|
|
16
|
+
* width (the default `100%`, a percentage, `auto`) gives the box a CSS `aspect-ratio`, so it is as tall as its width
|
|
17
|
+
* says wherever it is laid out.
|
|
18
|
+
*/
|
|
15
19
|
readonly aspectRatio?: number;
|
|
16
20
|
/** `cover` (default: fills, cropped), `contain` (all of it, letterboxed) or `stretch`. */
|
|
17
21
|
readonly fit?: 'cover' | 'contain' | 'stretch';
|
|
18
22
|
readonly radius?: number;
|
|
19
23
|
/** The fallback's icon (a category's icon). Default a drawn picture. */
|
|
20
24
|
readonly fallbackIcon?: G9IconInput;
|
|
21
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* Fades the picture in once it is decoded (CSS, 180 ms). Default true. A `data:` address carries the picture itself
|
|
27
|
+
* and is shown at once (Lynx for Web sends no load event for one, so it would wait forever).
|
|
28
|
+
*/
|
|
22
29
|
readonly fadeIn?: boolean;
|
|
23
30
|
/** Spoken description; without it the image is decorative (skipped by screen readers). */
|
|
24
31
|
readonly alt?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../src/display/image.tsx"],"names":[],"mappings":"AAGA,OAAO,aAAa,CAAC;AACrB,OAAO,EAAE,KAAK,SAAS,
|
|
1
|
+
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../src/display/image.tsx"],"names":[],"mappings":"AAGA,OAAO,aAAa,CAAC;AACrB,OAAO,EAAE,KAAK,SAAS,EAAgC,MAAM,gBAAgB,CAAC;AAC9E,OAAO,EAAE,KAAK,WAAW,EAAyB,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAO/D,gCAAgC;AAChC,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB,oDAAoD;IACpD,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,wCAAwC;IACxC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACjC,8DAA8D;IAC9D,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAClC;;;;OAIG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,0FAA0F;IAC1F,QAAQ,CAAC,GAAG,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