@g9tm/lynxcontrols 1.4.5 → 1.4.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.tsbuildinfo +1 -1
- package/dist/base/index.d.ts +1 -1
- package/dist/base/index.d.ts.map +1 -1
- package/dist/base/index.jsx +1 -1
- package/dist/base/pressable.d.ts.map +1 -1
- package/dist/base/pressable.jsx +2 -1
- package/dist/base/pressable.jsx.map +1 -1
- package/dist/base/selection-item.d.ts +9 -1
- package/dist/base/selection-item.d.ts.map +1 -1
- package/dist/base/selection-item.jsx +10 -1
- package/dist/base/selection-item.jsx.map +1 -1
- package/dist/button/button.css +20 -0
- package/dist/button/button.css.map +1 -1
- package/dist/button/header-action-button.d.ts +5 -0
- package/dist/button/header-action-button.d.ts.map +1 -1
- package/dist/button/header-action-button.jsx +6 -1
- package/dist/button/header-action-button.jsx.map +1 -1
- package/dist/button/visuals.d.ts.map +1 -1
- package/dist/button/visuals.jsx +1 -1
- package/dist/button/visuals.jsx.map +1 -1
- package/dist/cascade/cascade-panel.d.ts.map +1 -1
- package/dist/cascade/cascade-panel.jsx +2 -2
- package/dist/cascade/cascade-panel.jsx.map +1 -1
- package/dist/edge-panel/edge-panel.jsx +5 -5
- package/dist/edge-panel/edge-panel.jsx.map +1 -1
- package/dist/expander/expander.d.ts.map +1 -1
- package/dist/expander/expander.jsx +2 -1
- package/dist/expander/expander.jsx.map +1 -1
- package/dist/fields/editor.d.ts.map +1 -1
- package/dist/fields/editor.jsx +2 -2
- package/dist/fields/editor.jsx.map +1 -1
- package/dist/fields/fields.css +21 -0
- package/dist/fields/fields.css.map +1 -1
- package/dist/fields/index.d.ts +1 -1
- package/dist/fields/index.d.ts.map +1 -1
- package/dist/fields/index.jsx +1 -1
- package/dist/fields/outlined-field.d.ts +27 -1
- package/dist/fields/outlined-field.d.ts.map +1 -1
- package/dist/fields/outlined-field.jsx +29 -2
- package/dist/fields/outlined-field.jsx.map +1 -1
- package/dist/fields/text-entry.d.ts.map +1 -1
- package/dist/fields/text-entry.jsx +2 -2
- package/dist/fields/text-entry.jsx.map +1 -1
- package/dist/host/host.css.map +1 -1
- package/dist/host/host.d.ts +3 -2
- package/dist/host/host.d.ts.map +1 -1
- package/dist/host/host.jsx +2 -2
- package/dist/host/host.jsx.map +1 -1
- package/dist/pickers/combo-box.d.ts +8 -0
- package/dist/pickers/combo-box.d.ts.map +1 -1
- package/dist/pickers/combo-box.jsx +51 -9
- package/dist/pickers/combo-box.jsx.map +1 -1
- package/dist/pickers/date-time-picker.d.ts +2 -2
- package/dist/pickers/date-time-picker.d.ts.map +1 -1
- package/dist/pickers/date-time-picker.jsx +4 -3
- package/dist/pickers/date-time-picker.jsx.map +1 -1
- package/dist/pickers/date-time.d.ts +5 -2
- package/dist/pickers/date-time.d.ts.map +1 -1
- package/dist/pickers/date-time.jsx +1 -1
- package/dist/pickers/date-time.jsx.map +1 -1
- package/dist/pickers/picker-sheet.d.ts +6 -2
- package/dist/pickers/picker-sheet.d.ts.map +1 -1
- package/dist/pickers/picker-sheet.jsx +2 -3
- package/dist/pickers/picker-sheet.jsx.map +1 -1
- package/dist/pickers/picker.d.ts.map +1 -1
- package/dist/pickers/picker.jsx +3 -2
- package/dist/pickers/picker.jsx.map +1 -1
- package/dist/pickers/pickers.css +27 -0
- package/dist/pickers/pickers.css.map +1 -1
- package/dist/pickers/timespan-picker.d.ts.map +1 -1
- package/dist/pickers/timespan-picker.jsx +3 -2
- package/dist/pickers/timespan-picker.jsx.map +1 -1
- package/dist/pickers/trigger.d.ts +3 -1
- package/dist/pickers/trigger.d.ts.map +1 -1
- package/dist/pickers/trigger.jsx +6 -1
- package/dist/pickers/trigger.jsx.map +1 -1
- package/dist/plus-button/model.d.ts.map +1 -1
- package/dist/plus-button/model.jsx +5 -1
- package/dist/plus-button/model.jsx.map +1 -1
- package/dist/popup/frame.jsx +2 -2
- package/dist/popup/frame.jsx.map +1 -1
- package/dist/popup/service.d.ts.map +1 -1
- package/dist/popup/service.jsx +2 -2
- package/dist/popup/service.jsx.map +1 -1
- package/dist/provider/provider.css +4 -0
- package/dist/provider/provider.css.map +1 -1
- package/dist/provider/provider.d.ts.map +1 -1
- package/dist/provider/provider.jsx +4 -2
- package/dist/provider/provider.jsx.map +1 -1
- package/dist/provider/settings.d.ts +12 -0
- package/dist/provider/settings.d.ts.map +1 -1
- package/dist/provider/settings.jsx +6 -3
- package/dist/provider/settings.jsx.map +1 -1
- package/dist/provider/theme.css +4 -0
- package/dist/provider/theme.css.map +1 -1
- package/dist/range-slider/math.d.ts +14 -4
- package/dist/range-slider/math.d.ts.map +1 -1
- package/dist/range-slider/math.jsx +16 -4
- package/dist/range-slider/math.jsx.map +1 -1
- package/dist/range-slider/range-slider.css +17 -0
- package/dist/range-slider/range-slider.css.map +1 -1
- package/dist/range-slider/range-slider.d.ts +11 -0
- package/dist/range-slider/range-slider.d.ts.map +1 -1
- package/dist/range-slider/range-slider.jsx +35 -13
- package/dist/range-slider/range-slider.jsx.map +1 -1
- package/dist/selection/index.d.ts +2 -1
- package/dist/selection/index.d.ts.map +1 -1
- package/dist/selection/index.jsx +2 -1
- package/dist/selection/selection-sheet.d.ts +8 -1
- package/dist/selection/selection-sheet.d.ts.map +1 -1
- package/dist/selection/selection-sheet.jsx +64 -11
- package/dist/selection/selection-sheet.jsx.map +1 -1
- package/dist/selection/selection.css +7 -0
- package/dist/selection/selection.css.map +1 -1
- package/dist/selection/window.d.ts +29 -0
- package/dist/selection/window.d.ts.map +1 -0
- package/dist/selection/window.jsx +24 -0
- package/dist/selection/window.jsx.map +1 -0
- package/dist/sheet/frame.d.ts.map +1 -1
- package/dist/sheet/frame.jsx +35 -9
- package/dist/sheet/frame.jsx.map +1 -1
- package/dist/sheet/header.d.ts.map +1 -1
- package/dist/sheet/header.jsx +3 -1
- package/dist/sheet/header.jsx.map +1 -1
- package/dist/sheet/index.d.ts +2 -1
- package/dist/sheet/index.d.ts.map +1 -1
- package/dist/sheet/index.jsx +2 -1
- package/dist/sheet/motion.d.ts.map +1 -1
- package/dist/sheet/motion.jsx +14 -0
- package/dist/sheet/motion.jsx.map +1 -1
- package/dist/sheet/options.d.ts +26 -0
- package/dist/sheet/options.d.ts.map +1 -1
- package/dist/sheet/options.jsx +2 -1
- package/dist/sheet/options.jsx.map +1 -1
- package/dist/sheet/scroll-indicator.d.ts +33 -0
- package/dist/sheet/scroll-indicator.d.ts.map +1 -0
- package/dist/sheet/scroll-indicator.jsx +84 -0
- package/dist/sheet/scroll-indicator.jsx.map +1 -0
- package/dist/sheet/service.d.ts +8 -0
- package/dist/sheet/service.d.ts.map +1 -1
- package/dist/sheet/service.jsx +15 -4
- package/dist/sheet/service.jsx.map +1 -1
- package/dist/sheet/sheet.css +14 -0
- package/dist/sheet/sheet.css.map +1 -1
- package/dist/sheet/sizing.d.ts +2 -0
- package/dist/sheet/sizing.d.ts.map +1 -1
- package/dist/sheet/sizing.jsx +2 -1
- package/dist/sheet/sizing.jsx.map +1 -1
- package/dist/tab-bar/tab-bar.d.ts.map +1 -1
- package/dist/tab-bar/tab-bar.jsx +11 -6
- package/dist/tab-bar/tab-bar.jsx.map +1 -1
- package/dist/toast/service.jsx +3 -3
- package/dist/toast/service.jsx.map +1 -1
- package/dist/toast/store.d.ts.map +1 -1
- package/dist/toast/store.jsx +3 -2
- package/dist/toast/store.jsx.map +1 -1
- package/dist/toggle/chip-group.d.ts +9 -1
- package/dist/toggle/chip-group.d.ts.map +1 -1
- package/dist/toggle/chip-group.jsx +51 -12
- package/dist/toggle/chip-group.jsx.map +1 -1
- package/dist/toggle/switch.d.ts +1 -1
- package/dist/toggle/switch.d.ts.map +1 -1
- package/dist/toggle/switch.jsx +3 -2
- package/dist/toggle/switch.jsx.map +1 -1
- package/dist/toggle/toggle.css +20 -0
- package/dist/toggle/toggle.css.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edge-panel/edge-panel.jsx","sources":["../../src/edge-panel/edge-panel.tsx"],"sourcesContent":["import './edge-panel.css';\nimport { G9StringKey } from '@g9tm/lynxcontrols-foundation';\nimport { type ReactNode, useEffect, useMemo, useRef, useState } from '@lynx-js/react';\nimport { g9RowStyle, g9TextStart } from '../base/control';\nimport { startTimer, stopTimer } from '../base/timers';\nimport { useControllableState } from '../base/use-controllable-state';\nimport { useG9Back, useG9LayerItem } from '../host/hooks';\nimport type { G9IconInput } from '../icon/icon';\nimport { G9IconSlot } from '../icon/slot';\nimport {\n useG9Core,\n useG9Diagnostics,\n useG9Direction,\n useG9Settings,\n useG9Strings,\n useG9Window,\n} from '../provider/hooks';\nimport {\n type G9EdgeCloseButtonPlacement,\n type G9EdgeMenuHeader,\n type G9EdgeMenuHeaderAlignment,\n type G9EdgeMenuItem,\n G9EdgeMenuNavigator,\n type G9EdgePanelContentDirection,\n type G9EdgeSide,\n isEdgeMenuHeaderEmpty,\n g9EdgePanelMetrics as M,\n resolveEdgePanelMaxHeight,\n} from './types';\n\n/** Imperative handle of an edge panel (MAUI `G9EdgePanel` methods), from {@link useEdgePanel} or the helper. */\nexport interface G9EdgePanelController {\n open(): void;\n close(): void;\n toggle(): void;\n readonly isOpen: boolean;\n /** Closes an open panel and reports whether the press was consumed (MAUI `HandleHardwareBackPressed`). */\n handleHardwareBackPressed(): boolean;\n navigateToSubList(items: readonly G9EdgeMenuItem[], header?: G9EdgeMenuHeader | null): void;\n navigateToRoot(): void;\n refreshMenuItems(): void;\n /** `true` while a panel is mounted on this controller. */\n readonly isMounted: boolean;\n /** @internal set by the mounted panel */\n bind(target: G9EdgePanelTarget): () => void;\n}\n\ninterface G9EdgePanelTarget {\n setOpen(open: boolean): void;\n isOpen(): boolean;\n navigator: G9EdgeMenuNavigator;\n renderNav(): void;\n}\n\n/** Creates a controller outside React. */\nexport function createEdgePanelController(): G9EdgePanelController {\n let target: G9EdgePanelTarget | null = null;\n return {\n open: () => target?.setOpen(true),\n close: () => target?.setOpen(false),\n toggle: () => target?.setOpen(!target.isOpen()),\n get isOpen() {\n return target ? target.isOpen() : false;\n },\n get isMounted() {\n return target !== null;\n },\n handleHardwareBackPressed() {\n if (!target?.isOpen()) return false;\n target.setOpen(false);\n return true;\n },\n navigateToSubList(items, header = null) {\n if (!target) return;\n target.navigator.navigateToSubList(items, header);\n target.renderNav();\n },\n navigateToRoot() {\n if (!target) return;\n target.navigator.navigateToRoot();\n target.renderNav();\n },\n refreshMenuItems() {\n if (!target) return;\n target.navigator.refresh();\n target.renderNav();\n },\n bind(next) {\n target = next;\n return () => {\n if (target === next) target = null;\n };\n },\n };\n}\n\n/** A stable controller for a `G9EdgePanel`. */\nexport function useEdgePanel(): G9EdgePanelController {\n const ref = useRef<G9EdgePanelController | null>(null);\n if (ref.current === null) ref.current = createEdgePanelController();\n return ref.current;\n}\n\n/** Props of {@link G9EdgePanel} (MAUI bindable properties and events). */\nexport interface G9EdgePanelProps {\n /** Absolute edge (MAUI `Side`). Default `'left'`. */\n readonly side?: G9EdgeSide;\n /** Panel width as a share of the host width (MAUI `WidthRatio`). Default 0.35. */\n readonly widthRatio?: number;\n /** Distance from the top (MAUI `TopGap`). Default 112. */\n readonly topGap?: number;\n /** Absolute height cap; 0 = none (MAUI `MaxPanelHeight`). */\n readonly maxPanelHeight?: number;\n /** Height cap as a share of the host height (MAUI `MaxPanelHeightRatio`). Default 0.69. */\n readonly maxPanelHeightRatio?: number;\n /** Controlled open state (MAUI `IsOpen`, two-way). */\n readonly open?: boolean;\n readonly defaultOpen?: boolean;\n readonly onOpenChange?: (open: boolean) => void;\n /** Custom content (MAUI `PanelContent`); wins over `menuItems`. */\n readonly panelContent?: ReactNode;\n /** A navigable list menu (MAUI `MenuItems`). */\n readonly menuItems?: readonly G9EdgeMenuItem[] | null;\n readonly panelBackgroundColor?: string | null;\n readonly tabBackgroundColor?: string | null;\n /** Icon of the collapsed tab. Default: a chevron pointing into the screen. */\n readonly collapsedTabIcon?: G9IconInput;\n /** Sets both durations (MAUI `AnimationDuration`); the specific ones win. */\n readonly animationDuration?: number;\n /** Slide-in duration (MAUI `OpenAnimationDuration`). Default 450. */\n readonly openAnimationDuration?: number;\n /** Slide-out duration (MAUI `CloseAnimationDuration`). Default 450. */\n readonly closeAnimationDuration?: number;\n /** A backdrop tap closes the panel (needs `useBackdrop`). Default true. */\n readonly enableOutsideTapToClose?: boolean;\n /** Modal: a dimmed backdrop takes every tap outside the panel. Default true. Off = non-modal: only the panel and its tab take touches. */\n readonly useBackdrop?: boolean;\n /** Show the peek tab while closed. Default false. */\n readonly showCollapsedTab?: boolean;\n readonly contentFlowDirection?: G9EdgePanelContentDirection;\n readonly menuHeader?: G9EdgeMenuHeader | null;\n readonly menuHeaderAlignment?: G9EdgeMenuHeaderAlignment;\n readonly closeButtonPlacement?: G9EdgeCloseButtonPlacement;\n /** After the open slide (MAUI `Opened`). */\n readonly onOpened?: () => void;\n /** When the close slide starts (MAUI `Closing`). */\n readonly onClosing?: () => void;\n /** After the close slide (MAUI `Closed`). */\n readonly onClosed?: () => void;\n readonly controller?: G9EdgePanelController;\n}\n\nlet panelSequence = 0;\n\ntype Phase = 'closed' | 'entering' | 'opening' | 'open' | 'closing';\n\n/**\n * A panel that slides in from a screen edge (MAUI `G9EdgePanel`), mounted in the host's `edgePanel` layer whatever\n * its place in the tree. Modal by default (a dimmed backdrop that closes on tap); with `useBackdrop={false}` it is\n * non-modal: the page stays interactive and only the panel and its tab receive touches. Content is a custom view or a\n * list menu with nested levels (Back row, per-level header). Hardware back closes it.\n */\nexport function G9EdgePanel(props: G9EdgePanelProps): ReactNode {\n const keyRef = useRef<string | null>(null);\n if (keyRef.current === null) {\n panelSequence += 1;\n keyRef.current = `g9-edge-panel-${panelSequence}`;\n }\n const key = keyRef.current;\n const [isOpen, setOpen] = useControllableState<boolean>({\n value: props.open,\n defaultValue: props.defaultOpen ?? false,\n onChange: props.onOpenChange,\n name: 'G9EdgePanel.open',\n });\n const openMs = props.openAnimationDuration ?? props.animationDuration ?? M.defaultOpenAnimationDurationMs;\n const closeMs = props.closeAnimationDuration ?? props.animationDuration ?? M.defaultCloseAnimationDurationMs;\n const [phase, setPhase] = useState<Phase>(isOpen ? 'entering' : 'closed');\n const latest = useRef(props);\n latest.current = props;\n const openRef = useRef(isOpen);\n openRef.current = isOpen;\n\n useEffect(() => {\n if (isOpen) {\n setPhase((p) => (p === 'closed' ? 'entering' : 'opening'));\n const enter = startTimer(() => setPhase('opening'), 16);\n const done = startTimer(() => {\n setPhase('open');\n latest.current.onOpened?.();\n }, openMs + 16);\n return () => {\n stopTimer(enter);\n stopTimer(done);\n };\n }\n if (phase === 'closed') return;\n latest.current.onClosing?.();\n setPhase('closing');\n const done = startTimer(() => {\n setPhase('closed');\n latest.current.onClosed?.();\n }, closeMs);\n return () => stopTimer(done);\n }, [isOpen]);\n\n // List navigation: a new menuItems list or header resets to the root level.\n const navigator = useMemo(() => new G9EdgeMenuNavigator(), []);\n const [, setNavVersion] = useState(0);\n const renderNav = () => setNavVersion(navigator.version);\n const rootHeader = props.menuHeader ?? null;\n useMemo(() => navigator.setRoot(props.menuItems, rootHeader), [props.menuItems, rootHeader]);\n useEffect(\n () =>\n props.controller?.bind({\n setOpen: (open) => setOpen(open),\n isOpen: () => openRef.current,\n navigator,\n renderNav,\n }),\n [props.controller],\n );\n\n useG9Back(\n () => {\n setOpen(false);\n return true;\n },\n { enabled: isOpen, layer: 'edgePanel' },\n );\n\n // Shared debounce for tab and backdrop taps (MAUI InteractionDebounceMs: one physical tap can reach both).\n const core = useG9Core();\n const lastInteraction = useRef(Number.NEGATIVE_INFINITY);\n const accept = () => {\n const now = core.services.clock.monotonicNow();\n if (now - lastInteraction.current < M.interactionDebounceMs) return false;\n lastInteraction.current = now;\n return true;\n };\n const animating = phase === 'entering' || phase === 'opening' || phase === 'closing';\n const onTab = () => {\n if (animating || !accept()) return;\n setOpen(!openRef.current);\n };\n const useBackdrop = props.useBackdrop ?? true;\n const onBackdrop = () => {\n if (!accept()) return;\n if (useBackdrop && (props.enableOutsideTapToClose ?? true) && openRef.current) setOpen(false);\n };\n\n const overlay = (\n <EdgePanelOverlay\n props={props}\n phase={phase}\n openMs={openMs}\n closeMs={closeMs}\n navigator={navigator}\n navVersion={navigator.version}\n onTab={onTab}\n onBackdrop={onBackdrop}\n onNavigate={renderNav}\n onClose={() => setOpen(false)}\n />\n );\n const visible = phase !== 'closed' || props.showCollapsedTab === true;\n useG9LayerItem('edgePanel', key, overlay, { enabled: visible });\n return null;\n}\n\ninterface OverlayProps {\n readonly props: G9EdgePanelProps;\n readonly phase: Phase;\n readonly openMs: number;\n readonly closeMs: number;\n readonly navigator: G9EdgeMenuNavigator;\n readonly navVersion: number;\n readonly onTab: () => void;\n readonly onBackdrop: () => void;\n readonly onNavigate: () => void;\n readonly onClose: () => void;\n}\n\nfunction EdgePanelOverlay(o: OverlayProps): ReactNode {\n const p = o.props;\n const win = useG9Window();\n const appRtl = useG9Direction() === 'rtl';\n const glyphs = useG9Settings().glyphs;\n const left = (p.side ?? 'left') === 'left';\n const direction = p.contentFlowDirection ?? 'matchApplication';\n const contentRtl = direction === 'matchApplication' ? appRtl : direction === 'rightToLeft';\n const width = Math.max(win.width * (p.widthRatio ?? M.defaultWidthRatio), 0);\n const topGap = p.topGap ?? M.defaultTopGap;\n const maxHeight = resolveEdgePanelMaxHeight(\n win.height,\n topGap,\n p.maxPanelHeight ?? 0,\n p.maxPanelHeightRatio ?? M.defaultMaxPanelHeightRatio,\n );\n const shown = o.phase === 'opening' || o.phase === 'open';\n const cardRendered = o.phase !== 'closed';\n const hiddenOffset = (width + M.collapsedExtraOffset) * (left ? -1 : 1);\n const edge = left ? 'left' : 'right';\n const far = left ? 'right' : 'left';\n const useBackdrop = p.useBackdrop ?? true;\n const placement = p.closeButtonPlacement ?? 'inset';\n\n const closeStyle =\n placement === 'onCorner'\n ? { top: `${topGap - M.tabExpandedSize / 2}px`, [edge]: `${width - M.tabExpandedSize / 2}px` }\n : { top: `${topGap + M.tabTopInset}px`, [edge]: `${width - M.tabTopInset - M.tabExpandedSize}px` };\n const tabIcon = p.collapsedTabIcon ?? (left ? glyphs.chevronForward : glyphs.chevronBack);\n\n return (\n <view className=\"g9-edge-panel\">\n {useBackdrop && cardRendered ? (\n <view\n className=\"g9-edge-panel__backdrop\"\n style={{\n opacity: shown ? 1 : 0,\n transition: `opacity ${shown ? o.openMs : o.closeMs}ms ease-out`,\n backgroundColor: `rgba(0, 0, 0, ${M.backdropAlpha})`,\n }}\n bindtap={o.onBackdrop}\n />\n ) : null}\n {cardRendered ? (\n <view\n className={`g9-edge-panel__card g9-edge-panel__card--${edge}`}\n style={{\n [edge]: `${-M.wallOverlap}px`,\n top: `${topGap}px`,\n width: `${width + M.wallOverlap}px`,\n maxHeight: `${maxHeight}px`,\n backgroundColor: p.panelBackgroundColor ?? 'var(--g9-surface-container-high)',\n transform: `translateX(${shown ? 0 : hiddenOffset}px)`,\n transition:\n o.phase === 'entering'\n ? 'none'\n : `transform ${shown ? o.openMs : o.closeMs}ms ${shown ? 'cubic-bezier(0.215, 0.61, 0.355, 1)' : 'cubic-bezier(0.55, 0.055, 0.675, 0.19)'}`,\n }}\n >\n <PanelBody o={o} contentRtl={contentRtl} closeOnFar={far} />\n </view>\n ) : null}\n {cardRendered ? (\n <view\n className={`g9-edge-panel__close g9-edge-panel__close--${placement}`}\n style={{\n ...closeStyle,\n opacity: shown ? 1 : 0,\n transition: `opacity ${M.tabEntranceDurationMs}ms ease-out`,\n backgroundColor: p.tabBackgroundColor ?? 'var(--g9-surface-container-highest)',\n }}\n accessibility-element\n accessibility-traits=\"button\"\n bindtap={o.onTab}\n >\n <G9IconSlot icon={glyphs.clear} size={M.tabIconSize} color=\"var(--g9-on-surface)\" />\n </view>\n ) : p.showCollapsedTab ? (\n <view\n className={`g9-edge-panel__tab g9-edge-panel__tab--${edge}`}\n style={{\n [edge]: '0px',\n top: `${topGap + M.tabTopInset}px`,\n backgroundColor: p.tabBackgroundColor ?? 'var(--g9-surface-container-highest)',\n }}\n accessibility-element\n accessibility-traits=\"button\"\n bindtap={o.onTab}\n >\n <G9IconSlot icon={tabIcon} size={M.tabIconSize} color=\"var(--g9-on-surface)\" />\n </view>\n ) : null}\n </view>\n );\n}\n\nfunction headerText(header: G9EdgeMenuHeader, resolve: (key: string) => string | null): string {\n if (header.text) return header.text;\n const key = header.localizationKey as string;\n return resolve(key) ?? key;\n}\n\nfunction PanelBody(props: {\n readonly o: OverlayProps;\n readonly contentRtl: boolean;\n readonly closeOnFar: string;\n}): ReactNode {\n const { o, contentRtl } = props;\n const p = o.props;\n const strings = useG9Strings();\n const diagnostics = useG9Diagnostics();\n const glyphs = useG9Settings().glyphs;\n const resolve = (key: string) => strings.resolve(key);\n const nav = o.navigator;\n const frame = nav.frame;\n const header = p.panelContent != null ? (p.menuHeader ?? null) : (frame?.header ?? null);\n const alignment = p.menuHeaderAlignment ?? 'auto';\n const textAlign =\n alignment === 'center'\n ? 'center'\n : alignment === 'leftToRight'\n ? 'left'\n : alignment === 'rightToLeft'\n ? 'right'\n : contentRtl\n ? 'right'\n : 'left';\n const footprint = M.tabExpandedSize + M.tabTopInset;\n const headerPadding =\n alignment === 'center'\n ? { paddingLeft: `${footprint}px`, paddingRight: `${footprint}px` }\n : { [props.closeOnFar === 'right' ? 'paddingRight' : 'paddingLeft']: `${footprint}px` };\n\n // Directional entry of a new menu level (MAUI menu content slide, 220 ms).\n const [entered, setEntered] = useState(true);\n const version = o.navVersion;\n useEffect(() => {\n if (nav.transition === 'none') return;\n setEntered(false);\n const t = startTimer(() => setEntered(true), 16);\n return () => stopTimer(t);\n }, [version]);\n const sign = (nav.transition === 'forward' ? 1 : -1) * (contentRtl ? -1 : 1);\n\n const onRow = (item: G9EdgeMenuItem) => {\n if (item.isEnabled === false) return;\n try {\n item.onClick?.(item);\n item.command?.(item.commandParameter);\n } catch (error) {\n diagnostics.log({\n level: 'error',\n message: 'G9EdgePanel: menu item handler failed.',\n source: 'G9EdgePanel',\n error,\n });\n }\n if (item.nextList && item.nextList.length > 0) {\n nav.navigateToSubList(item.nextList, item.subMenuHeader ?? null);\n o.onNavigate();\n } else if (item.closeAfterClick) {\n o.onClose();\n }\n };\n\n const content =\n p.panelContent != null ? (\n p.panelContent\n ) : frame ? (\n <view\n key={`level-${version}`}\n className=\"g9-edge-panel__menu\"\n style={{\n transform: `translateX(${entered ? 0 : 24 * sign}px)`,\n opacity: entered ? 1 : 0,\n transition: entered\n ? `transform ${M.menuTransitionDurationMs}ms ease-out, opacity ${M.menuTransitionDurationMs}ms ease-out`\n : 'none',\n }}\n >\n {nav.isRoot ? null : (\n <view\n className=\"g9-edge-panel__back\"\n style={g9RowStyle(contentRtl ? 'rtl' : 'ltr')}\n accessibility-element\n accessibility-traits=\"button\"\n bindtap={() => {\n nav.back();\n o.onNavigate();\n }}\n >\n <G9IconSlot\n icon={contentRtl ? glyphs.chevronForward : glyphs.chevronBack}\n size={M.menuItemIconSize}\n color=\"var(--g9-on-surface)\"\n />\n <text className=\"g9-edge-panel__back-text\">{strings.get(G9StringKey.Back)}</text>\n </view>\n )}\n {frame.items.map((item, i) => (\n <view key={`${version}-${i}`} className=\"g9-edge-panel__row-wrap\">\n <view\n className={`g9-edge-panel__row${item.isEnabled === false ? ' g9-edge-panel__row--disabled' : ''}`}\n {...(item.automationId ? { id: item.automationId } : {})}\n style={{\n ...g9RowStyle(contentRtl ? 'rtl' : 'ltr'),\n backgroundColor: item.backgroundColor ?? 'transparent',\n opacity: item.isEnabled === false ? 0.5 : 1,\n }}\n accessibility-element\n accessibility-traits=\"button\"\n bindtap={item.isEnabled === false ? undefined : () => onRow(item)}\n >\n <G9IconSlot\n emoji={item.emoji}\n icon={item.icon}\n imagePath={item.imageSource}\n image={item.image}\n size={item.icon ? M.menuItemIconSize : item.emoji ? M.menuItemEmojiSize : M.menuItemImageSize}\n color={item.iconColor ?? 'var(--g9-on-surface-variant)'}\n />\n <text\n className=\"g9-edge-panel__row-text\"\n text-maxline=\"1\"\n style={{ color: item.textColor ?? 'var(--g9-on-surface)', ...g9TextStart(contentRtl ? 'rtl' : 'ltr') }}\n >\n {item.text ?? (item.localizedTextKey ? (resolve(item.localizedTextKey) ?? item.localizedTextKey) : '')}\n </text>\n {item.nextList && item.nextList.length > 0 ? (\n <G9IconSlot\n icon={contentRtl ? glyphs.chevronBack : glyphs.chevronForward}\n size={18}\n color=\"var(--g9-on-surface-variant)\"\n />\n ) : null}\n </view>\n {item.showDividerBelow ? <view className=\"g9-edge-panel__divider\" /> : null}\n </view>\n ))}\n </view>\n ) : null;\n\n return (\n <view className=\"g9-edge-panel__body\" style={{ direction: contentRtl ? 'rtl' : 'ltr' }}>\n {!isEdgeMenuHeaderEmpty(header) ? (\n <view className=\"g9-edge-panel__header\" style={headerPadding}>\n {(header as G9EdgeMenuHeader).view != null ? (\n (header as G9EdgeMenuHeader).view\n ) : (\n <text className=\"g9-edge-panel__title\" style={{ textAlign }}>\n {headerText(header as G9EdgeMenuHeader, resolve)}\n </text>\n )}\n </view>\n ) : null}\n <scroll-view className=\"g9-edge-panel__scroll\" scroll-orientation=\"vertical\">\n {content}\n </scroll-view>\n </view>\n );\n}\n"],"names":["createEdgePanelController","target","items","header","next","useEdgePanel","ref","useRef","panelSequence","G9EdgePanel","props","_props_defaultOpen","_ref","_ref1","_props_menuHeader","_props_useBackdrop","keyRef","key","isOpen","setOpen","useControllableState","openMs","M","closeMs","phase","setPhase","useState","latest","openRef","useEffect","_latest_current","p","enter","startTimer","done","stopTimer","navigator","useMemo","G9EdgeMenuNavigator","setNavVersion","renderNav","rootHeader","_props_controller","open","useG9Back","core","useG9Core","lastInteraction","Number","accept","now","animating","onTab","useBackdrop","onBackdrop","_props_enableOutsideTapToClose","overlay","EdgePanelOverlay","visible","useG9LayerItem","o","_p_side","_p_contentFlowDirection","_p_widthRatio","_p_topGap","_p_maxPanelHeight","_p_maxPanelHeightRatio","_p_useBackdrop","_p_closeButtonPlacement","_p_collapsedTabIcon","_p_panelBackgroundColor","_p_tabBackgroundColor","_p_tabBackgroundColor1","win","useG9Window","appRtl","useG9Direction","glyphs","useG9Settings","left","direction","contentRtl","width","Math","topGap","maxHeight","resolveEdgePanelMaxHeight","shown","cardRendered","hiddenOffset","edge","far","placement","closeStyle","tabIcon","view","PanelBody","G9IconSlot","headerText","resolve","_resolve","_p_menuHeader","_p_menuHeaderAlignment","strings","useG9Strings","diagnostics","useG9Diagnostics","nav","frame","alignment","textAlign","footprint","headerPadding","entered","setEntered","version","t","sign","onRow","item","error","_item_subMenuHeader","content","g9RowStyle","text","G9StringKey","i","_item_backgroundColor","_item_iconColor","_item_textColor","_item_text","undefined","g9TextStart","isEdgeMenuHeaderEmpty","scroll-view"],"mappings":";;;;;;;;;;AAuDO,SAASA;IACd,IAAIC,SAAmC;IACvC,OAAO;QACL,MAAM,IAAMA,QAAAA,SAAAA,KAAAA,IAAAA,OAAQ,OAAO,CAAC;QAC5B,OAAO,IAAMA,QAAAA,SAAAA,KAAAA,IAAAA,OAAQ,OAAO,CAAC;QAC7B,QAAQ,IAAMA,QAAAA,SAAAA,KAAAA,IAAAA,OAAQ,OAAO,CAAC,CAACA,OAAO,MAAM;QAC5C,IAAI;YACF,OAAOA,SAASA,OAAO,MAAM,KAAK;QACpC;QACA,IAAI;YACF,OAAOA,AAAW,SAAXA;QACT;QACA;YACE,IAAI,CAACA,CAAAA,QAAAA,SAAAA,KAAAA,IAAAA,OAAQ,MAAM,EAAC,GAAG,OAAO;YAC9BA,OAAO,OAAO,CAAC;YACf,OAAO;QACT;QACA,mBAAkBC,KAAK,EAAEC,SAAS,IAAI;YACpC,IAAI,CAACF,QAAQ;YACbA,OAAO,SAAS,CAAC,iBAAiB,CAACC,OAAOC;YAC1CF,OAAO,SAAS;QAClB;QACA;YACE,IAAI,CAACA,QAAQ;YACbA,OAAO,SAAS,CAAC,cAAc;YAC/BA,OAAO,SAAS;QAClB;QACA;YACE,IAAI,CAACA,QAAQ;YACbA,OAAO,SAAS,CAAC,OAAO;YACxBA,OAAO,SAAS;QAClB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/edge-panel.jsx","sources":["../../src/edge-panel/edge-panel.tsx"],"sourcesContent":["import './edge-panel.css';\nimport { G9StringKey, g9Ms } from '@g9tm/lynxcontrols-foundation';\nimport { type ReactNode, useEffect, useMemo, useRef, useState } from '@lynx-js/react';\nimport { g9RowStyle, g9TextStart } from '../base/control';\nimport { startTimer, stopTimer } from '../base/timers';\nimport { useControllableState } from '../base/use-controllable-state';\nimport { useG9Back, useG9LayerItem } from '../host/hooks';\nimport type { G9IconInput } from '../icon/icon';\nimport { G9IconSlot } from '../icon/slot';\nimport {\n useG9Core,\n useG9Diagnostics,\n useG9Direction,\n useG9Settings,\n useG9Strings,\n useG9Window,\n} from '../provider/hooks';\nimport {\n type G9EdgeCloseButtonPlacement,\n type G9EdgeMenuHeader,\n type G9EdgeMenuHeaderAlignment,\n type G9EdgeMenuItem,\n G9EdgeMenuNavigator,\n type G9EdgePanelContentDirection,\n type G9EdgeSide,\n isEdgeMenuHeaderEmpty,\n g9EdgePanelMetrics as M,\n resolveEdgePanelMaxHeight,\n} from './types';\n\n/** Imperative handle of an edge panel (MAUI `G9EdgePanel` methods), from {@link useEdgePanel} or the helper. */\nexport interface G9EdgePanelController {\n open(): void;\n close(): void;\n toggle(): void;\n readonly isOpen: boolean;\n /** Closes an open panel and reports whether the press was consumed (MAUI `HandleHardwareBackPressed`). */\n handleHardwareBackPressed(): boolean;\n navigateToSubList(items: readonly G9EdgeMenuItem[], header?: G9EdgeMenuHeader | null): void;\n navigateToRoot(): void;\n refreshMenuItems(): void;\n /** `true` while a panel is mounted on this controller. */\n readonly isMounted: boolean;\n /** @internal set by the mounted panel */\n bind(target: G9EdgePanelTarget): () => void;\n}\n\ninterface G9EdgePanelTarget {\n setOpen(open: boolean): void;\n isOpen(): boolean;\n navigator: G9EdgeMenuNavigator;\n renderNav(): void;\n}\n\n/** Creates a controller outside React. */\nexport function createEdgePanelController(): G9EdgePanelController {\n let target: G9EdgePanelTarget | null = null;\n return {\n open: () => target?.setOpen(true),\n close: () => target?.setOpen(false),\n toggle: () => target?.setOpen(!target.isOpen()),\n get isOpen() {\n return target ? target.isOpen() : false;\n },\n get isMounted() {\n return target !== null;\n },\n handleHardwareBackPressed() {\n if (!target?.isOpen()) return false;\n target.setOpen(false);\n return true;\n },\n navigateToSubList(items, header = null) {\n if (!target) return;\n target.navigator.navigateToSubList(items, header);\n target.renderNav();\n },\n navigateToRoot() {\n if (!target) return;\n target.navigator.navigateToRoot();\n target.renderNav();\n },\n refreshMenuItems() {\n if (!target) return;\n target.navigator.refresh();\n target.renderNav();\n },\n bind(next) {\n target = next;\n return () => {\n if (target === next) target = null;\n };\n },\n };\n}\n\n/** A stable controller for a `G9EdgePanel`. */\nexport function useEdgePanel(): G9EdgePanelController {\n const ref = useRef<G9EdgePanelController | null>(null);\n if (ref.current === null) ref.current = createEdgePanelController();\n return ref.current;\n}\n\n/** Props of {@link G9EdgePanel} (MAUI bindable properties and events). */\nexport interface G9EdgePanelProps {\n /** Absolute edge (MAUI `Side`). Default `'left'`. */\n readonly side?: G9EdgeSide;\n /** Panel width as a share of the host width (MAUI `WidthRatio`). Default 0.35. */\n readonly widthRatio?: number;\n /** Distance from the top (MAUI `TopGap`). Default 112. */\n readonly topGap?: number;\n /** Absolute height cap; 0 = none (MAUI `MaxPanelHeight`). */\n readonly maxPanelHeight?: number;\n /** Height cap as a share of the host height (MAUI `MaxPanelHeightRatio`). Default 0.69. */\n readonly maxPanelHeightRatio?: number;\n /** Controlled open state (MAUI `IsOpen`, two-way). */\n readonly open?: boolean;\n readonly defaultOpen?: boolean;\n readonly onOpenChange?: (open: boolean) => void;\n /** Custom content (MAUI `PanelContent`); wins over `menuItems`. */\n readonly panelContent?: ReactNode;\n /** A navigable list menu (MAUI `MenuItems`). */\n readonly menuItems?: readonly G9EdgeMenuItem[] | null;\n readonly panelBackgroundColor?: string | null;\n readonly tabBackgroundColor?: string | null;\n /** Icon of the collapsed tab. Default: a chevron pointing into the screen. */\n readonly collapsedTabIcon?: G9IconInput;\n /** Sets both durations (MAUI `AnimationDuration`); the specific ones win. */\n readonly animationDuration?: number;\n /** Slide-in duration (MAUI `OpenAnimationDuration`). Default 450. */\n readonly openAnimationDuration?: number;\n /** Slide-out duration (MAUI `CloseAnimationDuration`). Default 450. */\n readonly closeAnimationDuration?: number;\n /** A backdrop tap closes the panel (needs `useBackdrop`). Default true. */\n readonly enableOutsideTapToClose?: boolean;\n /** Modal: a dimmed backdrop takes every tap outside the panel. Default true. Off = non-modal: only the panel and its tab take touches. */\n readonly useBackdrop?: boolean;\n /** Show the peek tab while closed. Default false. */\n readonly showCollapsedTab?: boolean;\n readonly contentFlowDirection?: G9EdgePanelContentDirection;\n readonly menuHeader?: G9EdgeMenuHeader | null;\n readonly menuHeaderAlignment?: G9EdgeMenuHeaderAlignment;\n readonly closeButtonPlacement?: G9EdgeCloseButtonPlacement;\n /** After the open slide (MAUI `Opened`). */\n readonly onOpened?: () => void;\n /** When the close slide starts (MAUI `Closing`). */\n readonly onClosing?: () => void;\n /** After the close slide (MAUI `Closed`). */\n readonly onClosed?: () => void;\n readonly controller?: G9EdgePanelController;\n}\n\nlet panelSequence = 0;\n\ntype Phase = 'closed' | 'entering' | 'opening' | 'open' | 'closing';\n\n/**\n * A panel that slides in from a screen edge (MAUI `G9EdgePanel`), mounted in the host's `edgePanel` layer whatever\n * its place in the tree. Modal by default (a dimmed backdrop that closes on tap); with `useBackdrop={false}` it is\n * non-modal: the page stays interactive and only the panel and its tab receive touches. Content is a custom view or a\n * list menu with nested levels (Back row, per-level header). Hardware back closes it.\n */\nexport function G9EdgePanel(props: G9EdgePanelProps): ReactNode {\n const keyRef = useRef<string | null>(null);\n if (keyRef.current === null) {\n panelSequence += 1;\n keyRef.current = `g9-edge-panel-${panelSequence}`;\n }\n const key = keyRef.current;\n const [isOpen, setOpen] = useControllableState<boolean>({\n value: props.open,\n defaultValue: props.defaultOpen ?? false,\n onChange: props.onOpenChange,\n name: 'G9EdgePanel.open',\n });\n const openMs = g9Ms(props.openAnimationDuration ?? props.animationDuration ?? M.defaultOpenAnimationDurationMs);\n const closeMs = g9Ms(props.closeAnimationDuration ?? props.animationDuration ?? M.defaultCloseAnimationDurationMs);\n const [phase, setPhase] = useState<Phase>(isOpen ? 'entering' : 'closed');\n const latest = useRef(props);\n latest.current = props;\n const openRef = useRef(isOpen);\n openRef.current = isOpen;\n\n useEffect(() => {\n if (isOpen) {\n setPhase((p) => (p === 'closed' ? 'entering' : 'opening'));\n const enter = startTimer(() => setPhase('opening'), 16);\n const done = startTimer(() => {\n setPhase('open');\n latest.current.onOpened?.();\n }, openMs + 16);\n return () => {\n stopTimer(enter);\n stopTimer(done);\n };\n }\n if (phase === 'closed') return;\n latest.current.onClosing?.();\n setPhase('closing');\n const done = startTimer(() => {\n setPhase('closed');\n latest.current.onClosed?.();\n }, closeMs);\n return () => stopTimer(done);\n }, [isOpen]);\n\n // List navigation: a new menuItems list or header resets to the root level.\n const navigator = useMemo(() => new G9EdgeMenuNavigator(), []);\n const [, setNavVersion] = useState(0);\n const renderNav = () => setNavVersion(navigator.version);\n const rootHeader = props.menuHeader ?? null;\n useMemo(() => navigator.setRoot(props.menuItems, rootHeader), [props.menuItems, rootHeader]);\n useEffect(\n () =>\n props.controller?.bind({\n setOpen: (open) => setOpen(open),\n isOpen: () => openRef.current,\n navigator,\n renderNav,\n }),\n [props.controller],\n );\n\n useG9Back(\n () => {\n setOpen(false);\n return true;\n },\n { enabled: isOpen, layer: 'edgePanel' },\n );\n\n // Shared debounce for tab and backdrop taps (MAUI InteractionDebounceMs: one physical tap can reach both).\n const core = useG9Core();\n const lastInteraction = useRef(Number.NEGATIVE_INFINITY);\n const accept = () => {\n const now = core.services.clock.monotonicNow();\n if (now - lastInteraction.current < M.interactionDebounceMs) return false;\n lastInteraction.current = now;\n return true;\n };\n const animating = phase === 'entering' || phase === 'opening' || phase === 'closing';\n const onTab = () => {\n if (animating || !accept()) return;\n setOpen(!openRef.current);\n };\n const useBackdrop = props.useBackdrop ?? true;\n const onBackdrop = () => {\n if (!accept()) return;\n if (useBackdrop && (props.enableOutsideTapToClose ?? true) && openRef.current) setOpen(false);\n };\n\n const overlay = (\n <EdgePanelOverlay\n props={props}\n phase={phase}\n openMs={openMs}\n closeMs={closeMs}\n navigator={navigator}\n navVersion={navigator.version}\n onTab={onTab}\n onBackdrop={onBackdrop}\n onNavigate={renderNav}\n onClose={() => setOpen(false)}\n />\n );\n const visible = phase !== 'closed' || props.showCollapsedTab === true;\n useG9LayerItem('edgePanel', key, overlay, { enabled: visible });\n return null;\n}\n\ninterface OverlayProps {\n readonly props: G9EdgePanelProps;\n readonly phase: Phase;\n readonly openMs: number;\n readonly closeMs: number;\n readonly navigator: G9EdgeMenuNavigator;\n readonly navVersion: number;\n readonly onTab: () => void;\n readonly onBackdrop: () => void;\n readonly onNavigate: () => void;\n readonly onClose: () => void;\n}\n\nfunction EdgePanelOverlay(o: OverlayProps): ReactNode {\n const p = o.props;\n const win = useG9Window();\n const appRtl = useG9Direction() === 'rtl';\n const glyphs = useG9Settings().glyphs;\n const left = (p.side ?? 'left') === 'left';\n const direction = p.contentFlowDirection ?? 'matchApplication';\n const contentRtl = direction === 'matchApplication' ? appRtl : direction === 'rightToLeft';\n const width = Math.max(win.width * (p.widthRatio ?? M.defaultWidthRatio), 0);\n const topGap = p.topGap ?? M.defaultTopGap;\n const maxHeight = resolveEdgePanelMaxHeight(\n win.height,\n topGap,\n p.maxPanelHeight ?? 0,\n p.maxPanelHeightRatio ?? M.defaultMaxPanelHeightRatio,\n );\n const shown = o.phase === 'opening' || o.phase === 'open';\n const cardRendered = o.phase !== 'closed';\n const hiddenOffset = (width + M.collapsedExtraOffset) * (left ? -1 : 1);\n const edge = left ? 'left' : 'right';\n const far = left ? 'right' : 'left';\n const useBackdrop = p.useBackdrop ?? true;\n const placement = p.closeButtonPlacement ?? 'inset';\n\n const closeStyle =\n placement === 'onCorner'\n ? { top: `${topGap - M.tabExpandedSize / 2}px`, [edge]: `${width - M.tabExpandedSize / 2}px` }\n : { top: `${topGap + M.tabTopInset}px`, [edge]: `${width - M.tabTopInset - M.tabExpandedSize}px` };\n const tabIcon = p.collapsedTabIcon ?? (left ? glyphs.chevronForward : glyphs.chevronBack);\n\n return (\n <view className=\"g9-edge-panel\">\n {useBackdrop && cardRendered ? (\n <view\n className=\"g9-edge-panel__backdrop\"\n style={{\n opacity: shown ? 1 : 0,\n transition: `opacity ${shown ? o.openMs : o.closeMs}ms ease-out`,\n backgroundColor: `rgba(0, 0, 0, ${M.backdropAlpha})`,\n }}\n bindtap={o.onBackdrop}\n />\n ) : null}\n {cardRendered ? (\n <view\n className={`g9-edge-panel__card g9-edge-panel__card--${edge}`}\n style={{\n [edge]: `${-M.wallOverlap}px`,\n top: `${topGap}px`,\n width: `${width + M.wallOverlap}px`,\n maxHeight: `${maxHeight}px`,\n backgroundColor: p.panelBackgroundColor ?? 'var(--g9-surface-container-high)',\n transform: `translateX(${shown ? 0 : hiddenOffset}px)`,\n transition:\n o.phase === 'entering'\n ? 'none'\n : `transform ${shown ? o.openMs : o.closeMs}ms ${shown ? 'cubic-bezier(0.215, 0.61, 0.355, 1)' : 'cubic-bezier(0.55, 0.055, 0.675, 0.19)'}`,\n }}\n >\n <PanelBody o={o} contentRtl={contentRtl} closeOnFar={far} />\n </view>\n ) : null}\n {cardRendered ? (\n <view\n className={`g9-edge-panel__close g9-edge-panel__close--${placement}`}\n style={{\n ...closeStyle,\n opacity: shown ? 1 : 0,\n transition: `opacity ${g9Ms(M.tabEntranceDurationMs)}ms ease-out`,\n backgroundColor: p.tabBackgroundColor ?? 'var(--g9-surface-container-highest)',\n }}\n accessibility-element\n accessibility-traits=\"button\"\n bindtap={o.onTab}\n >\n <G9IconSlot icon={glyphs.clear} size={M.tabIconSize} color=\"var(--g9-on-surface)\" />\n </view>\n ) : p.showCollapsedTab ? (\n <view\n className={`g9-edge-panel__tab g9-edge-panel__tab--${edge}`}\n style={{\n [edge]: '0px',\n top: `${topGap + M.tabTopInset}px`,\n backgroundColor: p.tabBackgroundColor ?? 'var(--g9-surface-container-highest)',\n }}\n accessibility-element\n accessibility-traits=\"button\"\n bindtap={o.onTab}\n >\n <G9IconSlot icon={tabIcon} size={M.tabIconSize} color=\"var(--g9-on-surface)\" />\n </view>\n ) : null}\n </view>\n );\n}\n\nfunction headerText(header: G9EdgeMenuHeader, resolve: (key: string) => string | null): string {\n if (header.text) return header.text;\n const key = header.localizationKey as string;\n return resolve(key) ?? key;\n}\n\nfunction PanelBody(props: {\n readonly o: OverlayProps;\n readonly contentRtl: boolean;\n readonly closeOnFar: string;\n}): ReactNode {\n const { o, contentRtl } = props;\n const p = o.props;\n const strings = useG9Strings();\n const diagnostics = useG9Diagnostics();\n const glyphs = useG9Settings().glyphs;\n const resolve = (key: string) => strings.resolve(key);\n const nav = o.navigator;\n const frame = nav.frame;\n const header = p.panelContent != null ? (p.menuHeader ?? null) : (frame?.header ?? null);\n const alignment = p.menuHeaderAlignment ?? 'auto';\n const textAlign =\n alignment === 'center'\n ? 'center'\n : alignment === 'leftToRight'\n ? 'left'\n : alignment === 'rightToLeft'\n ? 'right'\n : contentRtl\n ? 'right'\n : 'left';\n const footprint = M.tabExpandedSize + M.tabTopInset;\n const headerPadding =\n alignment === 'center'\n ? { paddingLeft: `${footprint}px`, paddingRight: `${footprint}px` }\n : { [props.closeOnFar === 'right' ? 'paddingRight' : 'paddingLeft']: `${footprint}px` };\n\n // Directional entry of a new menu level (MAUI menu content slide, 220 ms).\n const [entered, setEntered] = useState(true);\n const version = o.navVersion;\n useEffect(() => {\n if (nav.transition === 'none') return;\n setEntered(false);\n const t = startTimer(() => setEntered(true), 16);\n return () => stopTimer(t);\n }, [version]);\n const sign = (nav.transition === 'forward' ? 1 : -1) * (contentRtl ? -1 : 1);\n\n const onRow = (item: G9EdgeMenuItem) => {\n if (item.isEnabled === false) return;\n try {\n item.onClick?.(item);\n item.command?.(item.commandParameter);\n } catch (error) {\n diagnostics.log({\n level: 'error',\n message: 'G9EdgePanel: menu item handler failed.',\n source: 'G9EdgePanel',\n error,\n });\n }\n if (item.nextList && item.nextList.length > 0) {\n nav.navigateToSubList(item.nextList, item.subMenuHeader ?? null);\n o.onNavigate();\n } else if (item.closeAfterClick) {\n o.onClose();\n }\n };\n\n const content =\n p.panelContent != null ? (\n p.panelContent\n ) : frame ? (\n <view\n key={`level-${version}`}\n className=\"g9-edge-panel__menu\"\n style={{\n transform: `translateX(${entered ? 0 : 24 * sign}px)`,\n opacity: entered ? 1 : 0,\n transition: entered\n ? `transform ${g9Ms(M.menuTransitionDurationMs)}ms ease-out, opacity ${g9Ms(M.menuTransitionDurationMs)}ms ease-out`\n : 'none',\n }}\n >\n {nav.isRoot ? null : (\n <view\n className=\"g9-edge-panel__back\"\n style={g9RowStyle(contentRtl ? 'rtl' : 'ltr')}\n accessibility-element\n accessibility-traits=\"button\"\n bindtap={() => {\n nav.back();\n o.onNavigate();\n }}\n >\n <G9IconSlot\n icon={contentRtl ? glyphs.chevronForward : glyphs.chevronBack}\n size={M.menuItemIconSize}\n color=\"var(--g9-on-surface)\"\n />\n <text className=\"g9-edge-panel__back-text\">{strings.get(G9StringKey.Back)}</text>\n </view>\n )}\n {frame.items.map((item, i) => (\n <view key={`${version}-${i}`} className=\"g9-edge-panel__row-wrap\">\n <view\n className={`g9-edge-panel__row${item.isEnabled === false ? ' g9-edge-panel__row--disabled' : ''}`}\n {...(item.automationId ? { id: item.automationId } : {})}\n style={{\n ...g9RowStyle(contentRtl ? 'rtl' : 'ltr'),\n backgroundColor: item.backgroundColor ?? 'transparent',\n opacity: item.isEnabled === false ? 0.5 : 1,\n }}\n accessibility-element\n accessibility-traits=\"button\"\n bindtap={item.isEnabled === false ? undefined : () => onRow(item)}\n >\n <G9IconSlot\n emoji={item.emoji}\n icon={item.icon}\n imagePath={item.imageSource}\n image={item.image}\n size={item.icon ? M.menuItemIconSize : item.emoji ? M.menuItemEmojiSize : M.menuItemImageSize}\n color={item.iconColor ?? 'var(--g9-on-surface-variant)'}\n />\n <text\n className=\"g9-edge-panel__row-text\"\n text-maxline=\"1\"\n style={{ color: item.textColor ?? 'var(--g9-on-surface)', ...g9TextStart(contentRtl ? 'rtl' : 'ltr') }}\n >\n {item.text ?? (item.localizedTextKey ? (resolve(item.localizedTextKey) ?? item.localizedTextKey) : '')}\n </text>\n {item.nextList && item.nextList.length > 0 ? (\n <G9IconSlot\n icon={contentRtl ? glyphs.chevronBack : glyphs.chevronForward}\n size={18}\n color=\"var(--g9-on-surface-variant)\"\n />\n ) : null}\n </view>\n {item.showDividerBelow ? <view className=\"g9-edge-panel__divider\" /> : null}\n </view>\n ))}\n </view>\n ) : null;\n\n return (\n <view className=\"g9-edge-panel__body\" style={{ direction: contentRtl ? 'rtl' : 'ltr' }}>\n {!isEdgeMenuHeaderEmpty(header) ? (\n <view className=\"g9-edge-panel__header\" style={headerPadding}>\n {(header as G9EdgeMenuHeader).view != null ? (\n (header as G9EdgeMenuHeader).view\n ) : (\n <text className=\"g9-edge-panel__title\" style={{ textAlign }}>\n {headerText(header as G9EdgeMenuHeader, resolve)}\n </text>\n )}\n </view>\n ) : null}\n <scroll-view className=\"g9-edge-panel__scroll\" scroll-orientation=\"vertical\">\n {content}\n </scroll-view>\n </view>\n );\n}\n"],"names":["createEdgePanelController","target","items","header","next","useEdgePanel","ref","useRef","panelSequence","G9EdgePanel","props","_props_defaultOpen","_ref","_ref1","_props_menuHeader","_props_useBackdrop","keyRef","key","isOpen","setOpen","useControllableState","openMs","g9Ms","M","closeMs","phase","setPhase","useState","latest","openRef","useEffect","_latest_current","p","enter","startTimer","done","stopTimer","navigator","useMemo","G9EdgeMenuNavigator","setNavVersion","renderNav","rootHeader","_props_controller","open","useG9Back","core","useG9Core","lastInteraction","Number","accept","now","animating","onTab","useBackdrop","onBackdrop","_props_enableOutsideTapToClose","overlay","EdgePanelOverlay","visible","useG9LayerItem","o","_p_side","_p_contentFlowDirection","_p_widthRatio","_p_topGap","_p_maxPanelHeight","_p_maxPanelHeightRatio","_p_useBackdrop","_p_closeButtonPlacement","_p_collapsedTabIcon","_p_panelBackgroundColor","_p_tabBackgroundColor","_p_tabBackgroundColor1","win","useG9Window","appRtl","useG9Direction","glyphs","useG9Settings","left","direction","contentRtl","width","Math","topGap","maxHeight","resolveEdgePanelMaxHeight","shown","cardRendered","hiddenOffset","edge","far","placement","closeStyle","tabIcon","view","PanelBody","G9IconSlot","headerText","resolve","_resolve","_p_menuHeader","_p_menuHeaderAlignment","strings","useG9Strings","diagnostics","useG9Diagnostics","nav","frame","alignment","textAlign","footprint","headerPadding","entered","setEntered","version","t","sign","onRow","item","error","_item_subMenuHeader","content","g9RowStyle","text","G9StringKey","i","_item_backgroundColor","_item_iconColor","_item_textColor","_item_text","undefined","g9TextStart","isEdgeMenuHeaderEmpty","scroll-view"],"mappings":";;;;;;;;;;AAuDO,SAASA;IACd,IAAIC,SAAmC;IACvC,OAAO;QACL,MAAM,IAAMA,QAAAA,SAAAA,KAAAA,IAAAA,OAAQ,OAAO,CAAC;QAC5B,OAAO,IAAMA,QAAAA,SAAAA,KAAAA,IAAAA,OAAQ,OAAO,CAAC;QAC7B,QAAQ,IAAMA,QAAAA,SAAAA,KAAAA,IAAAA,OAAQ,OAAO,CAAC,CAACA,OAAO,MAAM;QAC5C,IAAI;YACF,OAAOA,SAASA,OAAO,MAAM,KAAK;QACpC;QACA,IAAI;YACF,OAAOA,AAAW,SAAXA;QACT;QACA;YACE,IAAI,CAACA,CAAAA,QAAAA,SAAAA,KAAAA,IAAAA,OAAQ,MAAM,EAAC,GAAG,OAAO;YAC9BA,OAAO,OAAO,CAAC;YACf,OAAO;QACT;QACA,mBAAkBC,KAAK,EAAEC,SAAS,IAAI;YACpC,IAAI,CAACF,QAAQ;YACbA,OAAO,SAAS,CAAC,iBAAiB,CAACC,OAAOC;YAC1CF,OAAO,SAAS;QAClB;QACA;YACE,IAAI,CAACA,QAAQ;YACbA,OAAO,SAAS,CAAC,cAAc;YAC/BA,OAAO,SAAS;QAClB;QACA;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B,mBAAmB,WAAW;QAC3E,CAACZ,QAAQ;MACX,EAAEY,YAAY;IAChB,EAAEvC;AAEN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expander.d.ts","sourceRoot":"","sources":["../../src/expander/expander.tsx"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"expander.d.ts","sourceRoot":"","sources":["../../src/expander/expander.tsx"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAEnE,OAAO,EAAc,KAAK,SAAS,EAAoD,MAAM,gBAAgB,CAAC;AAC9G,OAAO,EAAE,KAAK,kBAAkB,EAAkD,MAAM,iBAAiB,CAAC;AAK1G,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAIhD,mEAAmE;AACnE,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAExC,uDAAuD;AACvD,MAAM,WAAW,eAAgB,SAAQ,kBAAkB;IACzD,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,wCAAwC;IACxC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,SAAS,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IAC1C,wCAAwC;IACxC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,0CAA0C;IAC1C,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,iDAAiD;IACjD,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IACnC,8FAA8F;IAC9F,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IACxD,uFAAuF;IACvF,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B,yCAAyC;IACzC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,iGAAiG;IACjG,QAAQ,CAAC,cAAc,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACpE,8FAA8F;IAC9F,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;CAC/B;AAED,+CAA+C;AAC/C,MAAM,WAAW,gBAAgB;IAC/B,4CAA4C;IAC5C,MAAM,IAAI,IAAI,CAAC;CAChB;AAID;;;;GAIG;AACH,eAAO,MAAM,UAAU,8GA+FrB,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "./expander.css";
|
|
2
|
+
import { g9Ms } from "@g9tm/lynxcontrols-foundation";
|
|
2
3
|
import { forwardRef, useEffect, useImperativeHandle, useRef, useState } from "@lynx-js/react";
|
|
3
4
|
import { g9ChildId, g9IdProps, g9RowStyle, useG9Control } from "../base/control.jsx";
|
|
4
5
|
import { useG9Press, usePressVisual } from "../base/press.jsx";
|
|
@@ -34,7 +35,7 @@ const expander_G9Expander = forwardRef(function(props, ref) {
|
|
|
34
35
|
timer.current = startTimer(()=>{
|
|
35
36
|
timer.current = null;
|
|
36
37
|
setPhase(expanded ? 'open' : 'closed');
|
|
37
|
-
}, g9ExpanderDurationMs);
|
|
38
|
+
}, g9Ms(g9ExpanderDurationMs));
|
|
38
39
|
}, [
|
|
39
40
|
expanded
|
|
40
41
|
]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expander/expander.jsx","sources":["../../src/expander/expander.tsx"],"sourcesContent":["import './expander.css';\nimport type { G9ImageSource } from '@g9tm/lynxcontrols-foundation';\nimport { forwardRef, type ReactNode, useEffect, useImperativeHandle, useRef, useState } from '@lynx-js/react';\nimport { type G9ControlBaseProps, g9ChildId, g9IdProps, g9RowStyle, useG9Control } from '../base/control';\nimport { useG9Press, usePressVisual } from '../base/press';\nimport { type G9TimerHandle, startTimer, stopTimer } from '../base/timers';\nimport { useControllableState } from '../base/use-controllable-state';\nimport { g9FieldNotchStyle } from '../fields/notch';\nimport type { G9IconInput } from '../icon/icon';\nimport { G9IconSlot, hasIconSlot } from '../icon/slot';\nimport { useG9Settings, useG9Theme } from '../provider/hooks';\n\n/** Expand/collapse duration (MAUI `G9Metrics` expander 220 ms). */\nexport const g9ExpanderDurationMs = 220;\n\n/** Props of {@link G9Expander} (MAUI `G9Expander`). */\nexport interface G9ExpanderProps extends G9ControlBaseProps {\n readonly title?: string | null;\n /** Default `var(--g9-text-primary)`. */\n readonly titleColor?: string | null;\n readonly iconEmoji?: string | null;\n readonly icon?: G9IconInput;\n readonly iconPath?: string | null;\n readonly iconImage?: G9ImageSource | null;\n /** Default `var(--g9-text-primary)`. */\n readonly iconColor?: string | null;\n /** Default `var(--g9-text-secondary)`. */\n readonly chevronColor?: string | null;\n /** Controlled open state (MAUI `IsExpanded`). */\n readonly expanded?: boolean;\n readonly defaultExpanded?: boolean;\n /** Once per change made by the expander (header tap, `toggle()`); never for pushed values. */\n readonly onExpandedChange?: (expanded: boolean) => void;\n /** Card look: surface, 1 px outline, 16 px corners, 14 × 12 padding. Default false. */\n readonly showFrame?: boolean;\n /** Minimum header height. Default 48. */\n readonly headerHeight?: number;\n /** Content padding `[left, top, right, bottom]` (an 8 px top gap is always added). Default 0. */\n readonly contentPadding?: readonly [number, number, number, number];\n /** The content (MAUI `ExpanderContent`): mounted at once and kept, hidden while collapsed. */\n readonly children?: ReactNode;\n}\n\n/** Imperative handle of {@link G9Expander}. */\nexport interface G9ExpanderHandle {\n /** Same as a header tap (MAUI `Toggle`). */\n toggle(): void;\n}\n\ntype Phase = 'open' | 'opening' | 'closing' | 'closed';\n\n/**\n * Collapsible section (MAUI `G9Expander`): only the header toggles; the chevron turns 180° and the content height\n * animates over 220 ms (CSS transition on the measured height; instant when it cannot be measured). The first render\n * does not animate. The content stays mounted.\n */\nexport const G9Expander = forwardRef<G9ExpanderHandle, G9ExpanderProps>(function G9Expander(props, ref): ReactNode {\n const control = useG9Control(props, 'g9-expander');\n const glyphs = useG9Settings().glyphs;\n // A framed expander is a Surface card: fields inside notch their floated label with it.\n const palette = useG9Theme().palette;\n const [expanded, setExpanded] = useControllableState<boolean>({\n value: props.expanded,\n defaultValue: props.defaultExpanded ?? false,\n onChange: props.onExpandedChange,\n name: 'G9Expander.expanded',\n });\n const [phase, setPhase] = useState<Phase>(expanded ? 'open' : 'closed');\n const [measured, setMeasured] = useState(0);\n const timer = useRef<G9TimerHandle | null>(null);\n const first = useRef(true);\n useEffect(() => {\n if (first.current) {\n first.current = false;\n return;\n }\n if (timer.current !== null) stopTimer(timer.current);\n if (measured <= 0) {\n setPhase(expanded ? 'open' : 'closed');\n return;\n }\n setPhase(expanded ? 'opening' : 'closing');\n timer.current = startTimer(() => {\n timer.current = null;\n setPhase(expanded ? 'open' : 'closed');\n }, g9ExpanderDurationMs);\n }, [expanded]);\n useEffect(\n () => () => {\n if (timer.current !== null) stopTimer(timer.current);\n },\n [],\n );\n\n const toggle = () => {\n if (!control.disabled) setExpanded((v) => !v);\n };\n useImperativeHandle(ref, () => ({ toggle }));\n const press = useG9Press(toggle, { blocked: control.disabled, source: 'G9Expander', guardMs: 0 });\n const visual = usePressVisual({ property: 'scale', rest: 1, pressed: 0.99, inMs: 60, outMs: 90 }, control.disabled);\n const icon = { emoji: props.iconEmoji, icon: props.icon, imagePath: props.iconPath, image: props.iconImage };\n const [pl, pt, pr, pb] = props.contentPadding ?? [0, 0, 0, 0];\n const height = phase === 'open' ? undefined : phase === 'opening' ? `${measured}px` : '0px';\n return (\n <view\n className={`${control.className}${props.showFrame ? ' g9-expander--frame' : ''}`}\n {...control.idProps}\n style={props.showFrame ? g9FieldNotchStyle(palette.Surface) : {}}\n >\n <view\n className=\"g9-expander__header\"\n {...g9IdProps(g9ChildId(props.id, 'Header'))}\n style={{ minHeight: `${props.headerHeight ?? 48}px`, ...g9RowStyle(control.direction) }}\n accessibility-element={true}\n accessibility-traits=\"button\"\n {...(props.title ? { 'accessibility-label': props.title } : {})}\n bindtap={press}\n {...visual}\n >\n <view className=\"g9-expander__lead\" style={g9RowStyle(control.direction)}>\n {hasIconSlot(icon) ? (\n <G9IconSlot {...icon} size={20} color={props.iconColor ?? 'var(--g9-text-primary)'} />\n ) : null}\n {props.title ? (\n <text\n className=\"g9-expander__title\"\n text-maxline=\"1\"\n style={{ color: props.titleColor ?? 'var(--g9-text-primary)' }}\n >\n {props.title}\n </text>\n ) : null}\n </view>\n <view className={`g9-expander__chevron${expanded ? ' g9-expander__chevron--open' : ''}`}>\n <G9IconSlot icon={glyphs.chevron} size={22} color={props.chevronColor ?? 'var(--g9-text-secondary)'} />\n </view>\n </view>\n <view className={`g9-expander__clip g9-expander__clip--${phase}`} style={height === undefined ? {} : { height }}>\n <view\n className=\"g9-expander__content\"\n style={{ padding: `${pt + 8}px ${pr}px ${pb}px ${pl}px` }}\n bindlayoutchange={(e: { detail?: { height?: number } }) => {\n const h = e.detail?.height ?? 0;\n if (h > 0 && h !== measured) setMeasured(h);\n }}\n >\n {props.children}\n </view>\n </view>\n </view>\n );\n});\n"],"names":["g9ExpanderDurationMs","G9Expander","forwardRef","props","ref","_props_defaultExpanded","_props_contentPadding","_props_headerHeight","_props_iconColor","_props_titleColor","_props_chevronColor","control","useG9Control","glyphs","useG9Settings","palette","useG9Theme","expanded","setExpanded","useControllableState","phase","setPhase","useState","measured","setMeasured","timer","useRef","first","useEffect","stopTimer","startTimer","toggle","v","useImperativeHandle","press","useG9Press","visual","usePressVisual","icon","pl","pt","pr","pb","height","undefined","view","g9FieldNotchStyle","g9IdProps","g9ChildId","g9RowStyle","hasIconSlot","G9IconSlot","text","e","_e_detail","h"],"mappings":";;;;;;;;;AAaO,MAAMA,uBAAuB;AA2C7B,MAAMC,sBAAaC,WAA8C,SAAoBC,KAAK,EAAEC,GAAG;QAOpFC,wBAsCSC,uBAWIC,qBASoBC,kBAMrBC,mBAO+BC;IA7E3D,MAAMC,UAAUC,aAAaT,OAAO;IACpC,MAAMU,SAASC,gBAAgB,MAAM;IAErC,MAAMC,UAAUC,aAAa,OAAO;IACpC,MAAM,CAACC,UAAUC,YAAY,GAAGC,qBAA8B;QAC5D,OAAOhB,MAAM,QAAQ;QACrB,cAAc,QAAAE,CAAAA,yBAAAA,MAAM,eAAe,AAAD,IAApBA,yBAAyB;QACvC,UAAUF,MAAM,gBAAgB;QAChC,MAAM;IACR;IACA,MAAM,CAACiB,OAAOC,SAAS,GAAGC,SAAgBL,WAAW,SAAS;IAC9D,MAAM,CAACM,UAAUC,YAAY,GAAGF,SAAS;IACzC,MAAMG,QAAQC,OAA6B;IAC3C,MAAMC,QAAQD,OAAO;IACrBE,UAAU;QACR,IAAID,MAAM,OAAO,EAAE;YACjBA,MAAM,OAAO,GAAG;YAChB;QACF;QACA,IAAIF,AAAkB,SAAlBA,MAAM,OAAO,EAAWI,UAAUJ,MAAM,OAAO;QACnD,IAAIF,YAAY,GAAG,YACjBF,SAASJ,WAAW,SAAS;QAG/BI,SAASJ,WAAW,YAAY;QAChCQ,MAAM,OAAO,GAAGK,WAAW;YACzBL,MAAM,OAAO,GAAG;YAChBJ,SAASJ,WAAW,SAAS;QAC/B,GAAGjB;IACL,GAAG;QAACiB;KAAS;IACbW,UACE,IAAM;YACJ,IAAIH,AAAkB,SAAlBA,MAAM,OAAO,EAAWI,UAAUJ,MAAM,OAAO;QACrD,GACA,EAAE;IAGJ,MAAMM,SAAS;QACb,IAAI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,KAAK;MACT,EAAEA,KAAK;IACT,EAAEA;AAEN"}
|
|
1
|
+
{"version":3,"file":"expander/expander.jsx","sources":["../../src/expander/expander.tsx"],"sourcesContent":["import './expander.css';\nimport type { G9ImageSource } from '@g9tm/lynxcontrols-foundation';\nimport { g9Ms } from '@g9tm/lynxcontrols-foundation';\nimport { forwardRef, type ReactNode, useEffect, useImperativeHandle, useRef, useState } from '@lynx-js/react';\nimport { type G9ControlBaseProps, g9ChildId, g9IdProps, g9RowStyle, useG9Control } from '../base/control';\nimport { useG9Press, usePressVisual } from '../base/press';\nimport { type G9TimerHandle, startTimer, stopTimer } from '../base/timers';\nimport { useControllableState } from '../base/use-controllable-state';\nimport { g9FieldNotchStyle } from '../fields/notch';\nimport type { G9IconInput } from '../icon/icon';\nimport { G9IconSlot, hasIconSlot } from '../icon/slot';\nimport { useG9Settings, useG9Theme } from '../provider/hooks';\n\n/** Expand/collapse duration (MAUI `G9Metrics` expander 220 ms). */\nexport const g9ExpanderDurationMs = 220;\n\n/** Props of {@link G9Expander} (MAUI `G9Expander`). */\nexport interface G9ExpanderProps extends G9ControlBaseProps {\n readonly title?: string | null;\n /** Default `var(--g9-text-primary)`. */\n readonly titleColor?: string | null;\n readonly iconEmoji?: string | null;\n readonly icon?: G9IconInput;\n readonly iconPath?: string | null;\n readonly iconImage?: G9ImageSource | null;\n /** Default `var(--g9-text-primary)`. */\n readonly iconColor?: string | null;\n /** Default `var(--g9-text-secondary)`. */\n readonly chevronColor?: string | null;\n /** Controlled open state (MAUI `IsExpanded`). */\n readonly expanded?: boolean;\n readonly defaultExpanded?: boolean;\n /** Once per change made by the expander (header tap, `toggle()`); never for pushed values. */\n readonly onExpandedChange?: (expanded: boolean) => void;\n /** Card look: surface, 1 px outline, 16 px corners, 14 × 12 padding. Default false. */\n readonly showFrame?: boolean;\n /** Minimum header height. Default 48. */\n readonly headerHeight?: number;\n /** Content padding `[left, top, right, bottom]` (an 8 px top gap is always added). Default 0. */\n readonly contentPadding?: readonly [number, number, number, number];\n /** The content (MAUI `ExpanderContent`): mounted at once and kept, hidden while collapsed. */\n readonly children?: ReactNode;\n}\n\n/** Imperative handle of {@link G9Expander}. */\nexport interface G9ExpanderHandle {\n /** Same as a header tap (MAUI `Toggle`). */\n toggle(): void;\n}\n\ntype Phase = 'open' | 'opening' | 'closing' | 'closed';\n\n/**\n * Collapsible section (MAUI `G9Expander`): only the header toggles; the chevron turns 180° and the content height\n * animates over 220 ms (CSS transition on the measured height; instant when it cannot be measured). The first render\n * does not animate. The content stays mounted.\n */\nexport const G9Expander = forwardRef<G9ExpanderHandle, G9ExpanderProps>(function G9Expander(props, ref): ReactNode {\n const control = useG9Control(props, 'g9-expander');\n const glyphs = useG9Settings().glyphs;\n // A framed expander is a Surface card: fields inside notch their floated label with it.\n const palette = useG9Theme().palette;\n const [expanded, setExpanded] = useControllableState<boolean>({\n value: props.expanded,\n defaultValue: props.defaultExpanded ?? false,\n onChange: props.onExpandedChange,\n name: 'G9Expander.expanded',\n });\n const [phase, setPhase] = useState<Phase>(expanded ? 'open' : 'closed');\n const [measured, setMeasured] = useState(0);\n const timer = useRef<G9TimerHandle | null>(null);\n const first = useRef(true);\n useEffect(() => {\n if (first.current) {\n first.current = false;\n return;\n }\n if (timer.current !== null) stopTimer(timer.current);\n if (measured <= 0) {\n setPhase(expanded ? 'open' : 'closed');\n return;\n }\n setPhase(expanded ? 'opening' : 'closing');\n timer.current = startTimer(() => {\n timer.current = null;\n setPhase(expanded ? 'open' : 'closed');\n }, g9Ms(g9ExpanderDurationMs));\n }, [expanded]);\n useEffect(\n () => () => {\n if (timer.current !== null) stopTimer(timer.current);\n },\n [],\n );\n\n const toggle = () => {\n if (!control.disabled) setExpanded((v) => !v);\n };\n useImperativeHandle(ref, () => ({ toggle }));\n const press = useG9Press(toggle, { blocked: control.disabled, source: 'G9Expander', guardMs: 0 });\n const visual = usePressVisual({ property: 'scale', rest: 1, pressed: 0.99, inMs: 60, outMs: 90 }, control.disabled);\n const icon = { emoji: props.iconEmoji, icon: props.icon, imagePath: props.iconPath, image: props.iconImage };\n const [pl, pt, pr, pb] = props.contentPadding ?? [0, 0, 0, 0];\n const height = phase === 'open' ? undefined : phase === 'opening' ? `${measured}px` : '0px';\n return (\n <view\n className={`${control.className}${props.showFrame ? ' g9-expander--frame' : ''}`}\n {...control.idProps}\n style={props.showFrame ? g9FieldNotchStyle(palette.Surface) : {}}\n >\n <view\n className=\"g9-expander__header\"\n {...g9IdProps(g9ChildId(props.id, 'Header'))}\n style={{ minHeight: `${props.headerHeight ?? 48}px`, ...g9RowStyle(control.direction) }}\n accessibility-element={true}\n accessibility-traits=\"button\"\n {...(props.title ? { 'accessibility-label': props.title } : {})}\n bindtap={press}\n {...visual}\n >\n <view className=\"g9-expander__lead\" style={g9RowStyle(control.direction)}>\n {hasIconSlot(icon) ? (\n <G9IconSlot {...icon} size={20} color={props.iconColor ?? 'var(--g9-text-primary)'} />\n ) : null}\n {props.title ? (\n <text\n className=\"g9-expander__title\"\n text-maxline=\"1\"\n style={{ color: props.titleColor ?? 'var(--g9-text-primary)' }}\n >\n {props.title}\n </text>\n ) : null}\n </view>\n <view className={`g9-expander__chevron${expanded ? ' g9-expander__chevron--open' : ''}`}>\n <G9IconSlot icon={glyphs.chevron} size={22} color={props.chevronColor ?? 'var(--g9-text-secondary)'} />\n </view>\n </view>\n <view className={`g9-expander__clip g9-expander__clip--${phase}`} style={height === undefined ? {} : { height }}>\n <view\n className=\"g9-expander__content\"\n style={{ padding: `${pt + 8}px ${pr}px ${pb}px ${pl}px` }}\n bindlayoutchange={(e: { detail?: { height?: number } }) => {\n const h = e.detail?.height ?? 0;\n if (h > 0 && h !== measured) setMeasured(h);\n }}\n >\n {props.children}\n </view>\n </view>\n </view>\n );\n});\n"],"names":["g9ExpanderDurationMs","G9Expander","forwardRef","props","ref","_props_defaultExpanded","_props_contentPadding","_props_headerHeight","_props_iconColor","_props_titleColor","_props_chevronColor","control","useG9Control","glyphs","useG9Settings","palette","useG9Theme","expanded","setExpanded","useControllableState","phase","setPhase","useState","measured","setMeasured","timer","useRef","first","useEffect","stopTimer","startTimer","g9Ms","toggle","v","useImperativeHandle","press","useG9Press","visual","usePressVisual","icon","pl","pt","pr","pb","height","undefined","view","g9FieldNotchStyle","g9IdProps","g9ChildId","g9RowStyle","hasIconSlot","G9IconSlot","text","e","_e_detail","h"],"mappings":";;;;;;;;;;AAcO,MAAMA,uBAAuB;AA2C7B,MAAMC,sBAAaC,WAA8C,SAAoBC,KAAK,EAAEC,GAAG;QAOpFC,wBAsCSC,uBAWIC,qBASoBC,kBAMrBC,mBAO+BC;IA7E3D,MAAMC,UAAUC,aAAaT,OAAO;IACpC,MAAMU,SAASC,gBAAgB,MAAM;IAErC,MAAMC,UAAUC,aAAa,OAAO;IACpC,MAAM,CAACC,UAAUC,YAAY,GAAGC,qBAA8B;QAC5D,OAAOhB,MAAM,QAAQ;QACrB,cAAc,QAAAE,CAAAA,yBAAAA,MAAM,eAAe,AAAD,IAApBA,yBAAyB;QACvC,UAAUF,MAAM,gBAAgB;QAChC,MAAM;IACR;IACA,MAAM,CAACiB,OAAOC,SAAS,GAAGC,SAAgBL,WAAW,SAAS;IAC9D,MAAM,CAACM,UAAUC,YAAY,GAAGF,SAAS;IACzC,MAAMG,QAAQC,OAA6B;IAC3C,MAAMC,QAAQD,OAAO;IACrBE,UAAU;QACR,IAAID,MAAM,OAAO,EAAE;YACjBA,MAAM,OAAO,GAAG;YAChB;QACF;QACA,IAAIF,AAAkB,SAAlBA,MAAM,OAAO,EAAWI,UAAUJ,MAAM,OAAO;QACnD,IAAIF,YAAY,GAAG,YACjBF,SAASJ,WAAW,SAAS;QAG/BI,SAASJ,WAAW,YAAY;QAChCQ,MAAM,OAAO,GAAGK,WAAW;YACzBL,MAAM,OAAO,GAAG;YAChBJ,SAASJ,WAAW,SAAS;QAC/B,GAAGc,KAAK/B;IACV,GAAG;QAACiB;KAAS;IACbW,UACE,IAAM;YACJ,IAAIH,AAAkB,SAA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,KAAKA,MAAMjC,UAAUC,YAAYgC;IAC3C,GACD;UACC,CAACrD,MAAM,QAAQ,CAAC;QAClB,EAAE2C,KAAK;MACT,EAAEA,KAAK;IACT,EAAEA;AAEN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../src/fields/editor.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,gBAAgB,EAAgB,MAAM,kBAAkB,CAAC;AAE/F,0DAA0D;AAC1D,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,aAAa,CAAC;AAE1D,mDAAmD;AACnD,MAAM,WAAW,aAAc,SAAQ,gBAAgB;IACrD,mDAAmD;IACnD,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IACtC,mEAAmE;IACnE,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,+FAA+F;IAC/F,QAAQ,CAAC,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IACrC,4DAA4D;IAC5D,QAAQ,CAAC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IACvC,4EAA4E;IAC5E,QAAQ,CAAC,uBAAuB,CAAC,EAAE,OAAO,CAAC;CAC5C;AAED,6CAA6C;AAC7C,MAAM,MAAM,cAAc,GAAG,iBAAiB,CAAC;AAE/C;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../src/fields/editor.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,gBAAgB,EAAgB,MAAM,kBAAkB,CAAC;AAE/F,0DAA0D;AAC1D,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,aAAa,CAAC;AAE1D,mDAAmD;AACnD,MAAM,WAAW,aAAc,SAAQ,gBAAgB;IACrD,mDAAmD;IACnD,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IACtC,mEAAmE;IACnE,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,+FAA+F;IAC/F,QAAQ,CAAC,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IACrC,4DAA4D;IAC5D,QAAQ,CAAC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IACvC,4EAA4E;IAC5E,QAAQ,CAAC,uBAAuB,CAAC,EAAE,OAAO,CAAC;CAC5C;AAED,6CAA6C;AAC7C,MAAM,MAAM,cAAc,GAAG,iBAAiB,CAAC;AAE/C;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,6GA+CnB,CAAC"}
|
package/dist/fields/editor.jsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { G9Metrics } from "@g9tm/lynxcontrols-foundation";
|
|
2
2
|
import { forwardRef, useImperativeHandle } from "@lynx-js/react";
|
|
3
3
|
import { useG9Settings } from "../provider/hooks.jsx";
|
|
4
|
-
import { G9OutlinedField } from "./outlined-field.jsx";
|
|
4
|
+
import { G9OutlinedField, resolveInnerHint } from "./outlined-field.jsx";
|
|
5
5
|
import { useTextInput } from "./use-text-input.jsx";
|
|
6
6
|
const editor_G9Editor = forwardRef(function(props, ref) {
|
|
7
7
|
var _props_minimumEditorHeight, _props_maxEditorHeight, _props_autoSize, _core_errorText;
|
|
@@ -20,7 +20,7 @@ const editor_G9Editor = forwardRef(function(props, ref) {
|
|
|
20
20
|
const min = null != (_props_minimumEditorHeight = props.minimumEditorHeight) ? _props_minimumEditorHeight : 96;
|
|
21
21
|
const max = null != (_props_maxEditorHeight = props.maxEditorHeight) ? _props_maxEditorHeight : 0;
|
|
22
22
|
const autoSize = null != (_props_autoSize = props.autoSize) ? _props_autoSize : 'textChanges';
|
|
23
|
-
return <G9OutlinedField {...props} multiline hasError={core.hasError} errorText={null != (_core_errorText = core.errorText) ? _core_errorText : null} focused={core.focused} hasValue={core.hasValue} textLength={core.text.length} trailingAffordance={affordance} onFocusRequest={core.focus}>
|
|
23
|
+
return <G9OutlinedField {...props} hint={resolveInnerHint(props)} multiline hasError={core.hasError} errorText={null != (_core_errorText = core.errorText) ? _core_errorText : null} focused={core.focused} hasValue={core.hasValue} textLength={core.text.length} trailingAffordance={affordance} onFocusRequest={core.focus}>
|
|
24
24
|
<textarea {...core.elementProps} className="g9-field__textarea" ios-spell-check={false !== props.isSpellCheckEnabled} ios-auto-correct={false !== props.isTextPredictionEnabled} style={{
|
|
25
25
|
direction: core.textDirection,
|
|
26
26
|
textAlign: 'rtl' === core.textDirection ? 'right' : 'left',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fields/editor.jsx","sources":["../../src/fields/editor.tsx"],"sourcesContent":["import { G9Metrics } from '@g9tm/lynxcontrols-foundation';\nimport { forwardRef, type ReactNode, useImperativeHandle } from '@lynx-js/react';\nimport { useG9Settings } from '../provider/hooks';\nimport { G9OutlinedField, type G9TrailingAffordance } from './outlined-field';\nimport { type G9TextInputHandle, type G9TextInputProps, useTextInput } from './use-text-input';\n\n/** How the editor grows (MAUI `EditorAutoSizeOption`). */\nexport type G9EditorAutoSize = 'disabled' | 'textChanges';\n\n/** Props of {@link G9Editor} (MAUI `G9Editor`). */\nexport interface G9EditorProps extends G9TextInputProps {\n /** Minimum height of the text area. Default 96. */\n readonly minimumEditorHeight?: number;\n /** Maximum height while growing; `0` (default) means unbounded. */\n readonly maxEditorHeight?: number;\n /** `'textChanges'` (default) grows with the text; `'disabled'` keeps `minimumEditorHeight`. */\n readonly autoSize?: G9EditorAutoSize;\n /** Spell checking (iOS `ios-spell-check`). Default true. */\n readonly isSpellCheckEnabled?: boolean;\n /** Word prediction / autocorrect (iOS `ios-auto-correct`). Default true. */\n readonly isTextPredictionEnabled?: boolean;\n}\n\n/** Imperative handle of {@link G9Editor}. */\nexport type G9EditorHandle = G9TextInputHandle;\n\n/**\n * Multi-line outlined text area (MAUI `G9Editor`): the text-entry behaviour on a `<textarea>`, a microphone pinned to\n * the bottom-end corner whenever dictation is available, height from `minimumEditorHeight`/`maxEditorHeight`/\n * `autoSize`. Validates on blur only for email/url/custom types (no `validator`, as in MAUI). Requires the host's\n * `xelement-input` registration.\n */\nexport const G9Editor = forwardRef<G9EditorHandle, G9EditorProps>(function G9Editor(props, ref): ReactNode {\n const glyphs = useG9Settings().glyphs;\n const core = useTextInput(props, { name: 'G9Editor.value', showMic: (s) => s.available });\n useImperativeHandle(ref, () => core.handle);\n const affordance: G9TrailingAffordance | null = core.showMic\n ? {\n icon: core.dictation.listening ? glyphs.micOff : glyphs.mic,\n color: core.dictation.listening ? 'var(--g9-error)' : 'var(--g9-primary)',\n signature: 'voice',\n onPress: core.pressMic,\n }\n : null;\n const min = props.minimumEditorHeight ?? 96;\n const max = props.maxEditorHeight ?? 0;\n const autoSize = props.autoSize ?? 'textChanges';\n return (\n <G9OutlinedField\n {...props}\n multiline\n hasError={core.hasError}\n errorText={core.errorText ?? null}\n focused={core.focused}\n hasValue={core.hasValue}\n textLength={core.text.length}\n trailingAffordance={affordance}\n onFocusRequest={core.focus}\n >\n <textarea\n {...core.elementProps}\n className=\"g9-field__textarea\"\n ios-spell-check={props.isSpellCheckEnabled !== false}\n ios-auto-correct={props.isTextPredictionEnabled !== false}\n style={{\n direction: core.textDirection,\n textAlign: core.textDirection === 'rtl' ? 'right' : 'left',\n ...(core.font ? { fontFamily: core.font } : {}),\n color: props.disabled ? 'var(--g9-text-disabled)' : 'var(--g9-text-primary)',\n ...(autoSize === 'disabled'\n ? { height: `${min}px` }\n : { minHeight: `${min}px`, ...(max > 0 ? { maxHeight: `${Math.max(min, max)}px` } : {}) }),\n paddingTop: `${G9Metrics.FloatingLabelClearance + 8}px`,\n paddingBottom: '8px',\n }}\n />\n </G9OutlinedField>\n );\n});\n"],"names":["G9Editor","forwardRef","props","ref","_props_minimumEditorHeight","_props_maxEditorHeight","_props_autoSize","_core_errorText","glyphs","useG9Settings","core","useTextInput","s","useImperativeHandle","affordance","min","max","autoSize","G9OutlinedField","textarea","Math","G9Metrics"],"mappings":";;;;;AAgCO,MAAMA,kBAAWC,WAA0C,SAAkBC,KAAK,EAAEC,GAAG;QAYhFC,4BACAC,wBACKC,
|
|
1
|
+
{"version":3,"file":"fields/editor.jsx","sources":["../../src/fields/editor.tsx"],"sourcesContent":["import { G9Metrics } from '@g9tm/lynxcontrols-foundation';\nimport { forwardRef, type ReactNode, useImperativeHandle } from '@lynx-js/react';\nimport { useG9Settings } from '../provider/hooks';\nimport { G9OutlinedField, type G9TrailingAffordance, resolveInnerHint } from './outlined-field';\nimport { type G9TextInputHandle, type G9TextInputProps, useTextInput } from './use-text-input';\n\n/** How the editor grows (MAUI `EditorAutoSizeOption`). */\nexport type G9EditorAutoSize = 'disabled' | 'textChanges';\n\n/** Props of {@link G9Editor} (MAUI `G9Editor`). */\nexport interface G9EditorProps extends G9TextInputProps {\n /** Minimum height of the text area. Default 96. */\n readonly minimumEditorHeight?: number;\n /** Maximum height while growing; `0` (default) means unbounded. */\n readonly maxEditorHeight?: number;\n /** `'textChanges'` (default) grows with the text; `'disabled'` keeps `minimumEditorHeight`. */\n readonly autoSize?: G9EditorAutoSize;\n /** Spell checking (iOS `ios-spell-check`). Default true. */\n readonly isSpellCheckEnabled?: boolean;\n /** Word prediction / autocorrect (iOS `ios-auto-correct`). Default true. */\n readonly isTextPredictionEnabled?: boolean;\n}\n\n/** Imperative handle of {@link G9Editor}. */\nexport type G9EditorHandle = G9TextInputHandle;\n\n/**\n * Multi-line outlined text area (MAUI `G9Editor`): the text-entry behaviour on a `<textarea>`, a microphone pinned to\n * the bottom-end corner whenever dictation is available, height from `minimumEditorHeight`/`maxEditorHeight`/\n * `autoSize`. Validates on blur only for email/url/custom types (no `validator`, as in MAUI). Requires the host's\n * `xelement-input` registration.\n */\nexport const G9Editor = forwardRef<G9EditorHandle, G9EditorProps>(function G9Editor(props, ref): ReactNode {\n const glyphs = useG9Settings().glyphs;\n const core = useTextInput(props, { name: 'G9Editor.value', showMic: (s) => s.available });\n useImperativeHandle(ref, () => core.handle);\n const affordance: G9TrailingAffordance | null = core.showMic\n ? {\n icon: core.dictation.listening ? glyphs.micOff : glyphs.mic,\n color: core.dictation.listening ? 'var(--g9-error)' : 'var(--g9-primary)',\n signature: 'voice',\n onPress: core.pressMic,\n }\n : null;\n const min = props.minimumEditorHeight ?? 96;\n const max = props.maxEditorHeight ?? 0;\n const autoSize = props.autoSize ?? 'textChanges';\n return (\n <G9OutlinedField\n {...props}\n hint={resolveInnerHint(props)}\n multiline\n hasError={core.hasError}\n errorText={core.errorText ?? null}\n focused={core.focused}\n hasValue={core.hasValue}\n textLength={core.text.length}\n trailingAffordance={affordance}\n onFocusRequest={core.focus}\n >\n <textarea\n {...core.elementProps}\n className=\"g9-field__textarea\"\n ios-spell-check={props.isSpellCheckEnabled !== false}\n ios-auto-correct={props.isTextPredictionEnabled !== false}\n style={{\n direction: core.textDirection,\n textAlign: core.textDirection === 'rtl' ? 'right' : 'left',\n ...(core.font ? { fontFamily: core.font } : {}),\n color: props.disabled ? 'var(--g9-text-disabled)' : 'var(--g9-text-primary)',\n ...(autoSize === 'disabled'\n ? { height: `${min}px` }\n : { minHeight: `${min}px`, ...(max > 0 ? { maxHeight: `${Math.max(min, max)}px` } : {}) }),\n paddingTop: `${G9Metrics.FloatingLabelClearance + 8}px`,\n paddingBottom: '8px',\n }}\n />\n </G9OutlinedField>\n );\n});\n"],"names":["G9Editor","forwardRef","props","ref","_props_minimumEditorHeight","_props_maxEditorHeight","_props_autoSize","_core_errorText","glyphs","useG9Settings","core","useTextInput","s","useImperativeHandle","affordance","min","max","autoSize","G9OutlinedField","resolveInnerHint","textarea","Math","G9Metrics"],"mappings":";;;;;AAgCO,MAAMA,kBAAWC,WAA0C,SAAkBC,KAAK,EAAEC,GAAG;QAYhFC,4BACAC,wBACKC,iBAOFC;IApBf,MAAMC,SAASC,gBAAgB,MAAM;IACrC,MAAMC,OAAOC,aAAaT,OAAO;QAAE,MAAM;QAAkB,SAAS,C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,EAAE,CAAC;QAAC,IACrB;YAAE,WAAW,GAAGA,IAAI,EAAE,CAAC;YAAE,GAAIC,MAAM,IAAI;gBAAE,WAAW,GAAGK,KAAK,GAAG,CAACN,KAAKC,KAAK,EAAE,CAAC;YAAC,IAAI,CAAC,CAAC;QAAE,CAAC;QAC3F,YAAY,GAAGM,UAAU,sBAAsB,GAAG,EAAE,EAAE,CAAC;QACvD,eAAe;IACjB,IACA;IACJ,EAAEJ;AAEN"}
|
package/dist/fields/fields.css
CHANGED
|
@@ -40,6 +40,27 @@
|
|
|
40
40
|
height: auto;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
.g9-field__hint {
|
|
44
|
+
pointer-events: none;
|
|
45
|
+
flex-direction: column;
|
|
46
|
+
justify-content: center;
|
|
47
|
+
display: flex;
|
|
48
|
+
position: absolute;
|
|
49
|
+
top: 0;
|
|
50
|
+
bottom: 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.g9-field__hint--multiline {
|
|
54
|
+
justify-content: flex-start;
|
|
55
|
+
bottom: auto;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.g9-field__hint-text {
|
|
59
|
+
text-overflow: ellipsis;
|
|
60
|
+
width: 100%;
|
|
61
|
+
font-size: 15px;
|
|
62
|
+
}
|
|
63
|
+
|
|
43
64
|
.g9-field__textarea {
|
|
44
65
|
background-color: #0000;
|
|
45
66
|
width: 100%;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack://./src/fields/fields.css"],"names":[],"mappings":"AACA;EAAE,sBAAsB;EACtB,WAAW;EACX,aAAa;AACf;;AAGA;EAAE,uBAAuB;EACvB,sBAAsB;EACtB,aAAa;EACb,kBAAkB;AACpB;;AAGA;EAAE,oBAAoB;EACpB,mBAAmB;EACnB,kBAAkB;EAClB,MAAM;EACN,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;AAaA;EAVE,sBAAsB;EACtB,OAAO;EACP,uBAAuB;EACvB,aAAa;AACf;;AAaA;EAVE,uBAAuB;EACvB,WAAW;EACX,YAAY;EACZ,eAAe;AACjB;;AAcA;EAXE,uBAAuB;EACvB,YAAY;AACd;;
|
|
1
|
+
{"version":3,"sources":["webpack://./src/fields/fields.css"],"names":[],"mappings":"AACA;EAAE,sBAAsB;EACtB,WAAW;EACX,aAAa;AACf;;AAGA;EAAE,uBAAuB;EACvB,sBAAsB;EACtB,aAAa;EACb,kBAAkB;AACpB;;AAGA;EAAE,oBAAoB;EACpB,mBAAmB;EACnB,kBAAkB;EAClB,MAAM;EACN,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;AAaA;EAVE,sBAAsB;EACtB,OAAO;EACP,uBAAuB;EACvB,aAAa;AACf;;AAaA;EAVE,uBAAuB;EACvB,WAAW;EACX,YAAY;EACZ,eAAe;AACjB;;AAcA;EAXE,uBAAuB;EACvB,YAAY;AACd;;AAgBA;EAbE,oBAAoB;EACpB,sBAAsB;EACtB,uBAAuB;EACvB,aAAa;EACb,kBAAkB;EAClB,MAAM;EACN,SAAS;AACX;;AAgBA;EAbE,2BAA2B;EAC3B,YAAY;AACd;;AAgBA;EAbE,uBAAuB;EACvB,WAAW;EACX,eAAe;AACjB;;AAgBA;EAbE,uBAAuB;EACvB,WAAW;EACX,eAAe;AACjB;;AAgBA;EAbE,uBAAuB;EACvB,mBAAmB;EACnB,aAAa;EACb,kBAAkB;AACpB;;AAgBA;EAbE,oBAAoB;EACpB,uBAAuB;EACvB,YAAY;EACZ,iBAAiB;EACjB,kBAAkB;EAClB,iBAAiB;EACjB,qDAAqD;EACrD,yBAAyB;EACzB,kBAAkB;AACpB;;AAkBA;EAfE,wEAAwE;AAC1E;;AAkBA;EAfE,mBAAmB;EACnB,8BAA8B;EAC9B,gBAAgB;EAChB,kBAAkB;EAClB,mBAAmB;EACnB,aAAa;AACf;;AAkBA;EAfE,OAAO;EACP,iBAAiB;AACnB;;AAkBA;EAfE,8BAA8B;EAC9B,eAAe;AACjB;;AAkBA;EAfE,mBAAmB;EACnB,iBAAiB;EACjB,kBAAkB;EAClB,WAAW;EACX,YAAY;EACZ,4CAA4C;AAC9C;;AAkBA;EAfE;IACE,oBAAoB;EACtB;;EAEA;IACE,yBAAyB;EAC3B;AACF;;AAoBA;EAjBE,YAAY;AACd;;AAyBA;EAtBE,cAAc;EACd,mBAAmB;EACnB,mBAAmB;EACnB,aAAa;EACb,kBAAkB;AACpB;;AAyBA;EAtBE,mBAAmB;EACnB,mBAAmB;EACnB,uCAAuC;EACvC,mCAAmC;EACnC,mBAAmB;EACnB,uBAAuB;EACvB,mBAAmB;EACnB,iBAAiB;EACjB,aAAa;AACf;;AAyBA;EAtBE,sCAAsC;AACxC;;AAyBA;EAtBE,iBAAiB;EACjB,+BAA+B;AACjC;;AAyBA;EAtBE,6BAA6B;EAC7B,eAAe;AACjB;;AAyBA;EAtBE,8BAA8B;AAChC;;AAyBA;EAtBE,8BAA8B;EAC9B,eAAe;AACjB;;AAyBA;EAtBE,mCAAmC;EACnC,iBAAiB;EACjB,eAAe;AACjB","sourcesContent":["/* Outlined fields (MAUI G9OutlinedFieldBase). Colours come from the theme variables; sizes from G9Metrics. */\n.g9-field {\n display: flex;\n flex-direction: column;\n width: 100%;\n}\n\n.g9-field__box {\n display: flex;\n flex-direction: column;\n position: relative;\n background-color: transparent;\n}\n\n.g9-field__outline {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n border-style: solid;\n pointer-events: none;\n}\n\n.g9-field__halo {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n border-style: solid;\n pointer-events: none;\n}\n\n.g9-field__content {\n display: flex;\n flex-direction: column;\n justify-content: center;\n flex: 1;\n}\n\n.g9-field__input {\n width: 100%;\n height: 100%;\n font-size: 15px;\n background-color: transparent;\n}\n\n/* The read-only value: a text line centred like the input's. */\n.g9-field__input--readonly {\n height: auto;\n text-overflow: ellipsis;\n}\n\n/* MAUI 1.4.9 RestingPlaceholder: the hint inside an empty box (under an always-floated label, or placeholderInside),\n over the input where its text starts — the input's 15 px in TextTertiary; it never takes a touch. */\n.g9-field__hint {\n position: absolute;\n top: 0px;\n bottom: 0px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n pointer-events: none;\n}\n\n.g9-field__hint--multiline {\n bottom: auto;\n justify-content: flex-start;\n}\n\n.g9-field__hint-text {\n width: 100%;\n font-size: 15px;\n text-overflow: ellipsis;\n}\n\n.g9-field__textarea {\n width: 100%;\n font-size: 15px;\n background-color: transparent;\n}\n\n.g9-field__slot {\n display: flex;\n position: absolute;\n align-items: center;\n justify-content: center;\n}\n\n.g9-field__label {\n position: absolute;\n height: 22px;\n line-height: 22px;\n padding-left: 4px;\n padding-right: 4px;\n background-color: transparent;\n transition-property: top, font-size, transform, color;\n transition-duration: 160ms;\n pointer-events: none;\n}\n\n/* Only a floated label sits on the outline: its notch paints the colour behind the field (a container that is not\n --g9-background sets --g9-field-notch-background; G9 sheets and popups do). At rest it paints nothing. */\n.g9-field__label--floated {\n background-color: var(--g9-field-notch-background, var(--g9-background));\n}\n\n.g9-field__footer {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n padding-top: 4px;\n padding-left: 14px;\n padding-right: 14px;\n}\n\n.g9-field__helper {\n flex: 1;\n font-size: 11.5px;\n}\n\n.g9-field__counter {\n font-size: 11px;\n color: var(--g9-text-tertiary);\n}\n\n.g9-field__busy {\n width: 18px;\n height: 18px;\n border-width: 2px;\n border-style: solid;\n border-radius: 9px;\n animation: g9-field-spin 800ms linear infinite;\n}\n\n@keyframes g9-field-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n\n/* Disabled dims the field (MAUI DisabledDimAlpha) part by part: an opacity on the box itself renders it into a layer\n the size of the box on Android, which cut the floated label above it in half. The label takes the disabled colour\n instead, so its notch still hides the outline. */\n.g9-field--disabled .g9-field__outline,\n.g9-field--disabled .g9-field__halo,\n.g9-field--disabled .g9-field__content,\n.g9-field--disabled .g9-field__slot,\n.g9-field--disabled .g9-field__footer {\n opacity: 0.45;\n}\n\n/* PIN entry (MAUI G9PinEntry): the row is always left-to-right. */\n.g9-pin {\n display: flex;\n flex-direction: row;\n align-items: center;\n position: relative;\n direction: ltr;\n}\n\n.g9-pin__cell {\n display: flex;\n align-items: center;\n justify-content: center;\n margin-right: 8px;\n border-style: solid;\n border-width: 1.4px;\n border-radius: 10px;\n border-color: var(--g9-outline-variant);\n background-color: var(--g9-surface);\n}\n\n.g9-pin__cell--filled {\n border-color: var(--g9-primary-border);\n}\n\n.g9-pin__cell--active {\n border-width: 2px;\n border-color: var(--g9-primary);\n}\n\n.g9-pin__char {\n font-size: 22px;\n color: var(--g9-text-primary);\n}\n\n.g9-pin--disabled .g9-pin__char {\n color: var(--g9-text-disabled);\n}\n\n.g9-pin__placeholder {\n font-size: 22px;\n color: var(--g9-text-tertiary);\n}\n\n.g9-pin__separator {\n font-size: 22px;\n margin-right: 6px;\n color: var(--g9-on-surface-variant);\n}\n"],"sourceRoot":""}
|
package/dist/fields/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { G9VoiceDictation, type G9VoiceDictationOptions, } from './dictation.js'
|
|
|
2
2
|
export { G9Editor, type G9EditorAutoSize, type G9EditorHandle, type G9EditorProps } from './editor.js';
|
|
3
3
|
export { customPatternCacheSize, decimalSeparatorFor, type G9LynxInputElementType, g9CustomPatternCacheLimit, inputTypeHasValidationRule, inputTypePrefersLeftToRight, isAbsoluteUri, resolveEffectiveKeyboard, resolveInputElementType, resolveKeyboardForInputType, sanitizeInputText, validateInputText, } from './input-policy.js';
|
|
4
4
|
export { g9FieldNotchBackgroundVariable, g9FieldNotchStyle } from './notch.js';
|
|
5
|
-
export { G9OutlinedField, type G9OutlinedFieldFrameProps, type G9OutlinedFieldProps, type G9OutlinedFieldState, type G9OutlinedFieldStateInput, type G9TrailingAffordance, resolveOutlinedFieldState, useOutlinedField, } from './outlined-field.js';
|
|
5
|
+
export { G9OutlinedField, type G9OutlinedFieldFrameProps, type G9OutlinedFieldProps, type G9OutlinedFieldState, type G9OutlinedFieldStateInput, type G9TrailingAffordance, resolveInnerHint, resolveOutlinedFieldState, resolveRestingPlaceholder, useOutlinedField, } from './outlined-field.js';
|
|
6
6
|
export { filterPin, G9PinEntry, type G9PinEntryHandle, type G9PinEntryProps, isPinCharAllowed, parsePinGroupSizes, pinCellCount, } from './pin-entry.js';
|
|
7
7
|
export { type G9SearchContext, G9SearchEntry, type G9SearchEntryHandle, type G9SearchEntryProps, } from './search-entry.js';
|
|
8
8
|
export { type G9FieldSlotLayout, type G9FieldSlotLayoutInput, type G9PhysicalPadding, resolveFieldSlotLayout, } from './slot-layout.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fields/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,gBAAgB,EAChB,KAAK,uBAAuB,GAC7B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,QAAQ,EAAE,KAAK,gBAAgB,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AACpG,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,KAAK,sBAAsB,EAC3B,yBAAyB,EACzB,0BAA0B,EAC1B,2BAA2B,EAC3B,aAAa,EACb,wBAAwB,EACxB,uBAAuB,EACvB,2BAA2B,EAC3B,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,8BAA8B,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5E,OAAO,EACL,eAAe,EACf,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EACzB,yBAAyB,EACzB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,SAAS,EACT,UAAU,EACV,KAAK,gBAAgB,EACrB,KAAK,eAAe,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AC;AACxB,OAAO,EAAE,8BAA8B,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5E,OAAO,EACL,eAAe,EACf,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EACzB,gBAAgB,EAChB,yBAAyB,EACzB,yBAAyB,EACzB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,SAAS,EACT,UAAU,EACV,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,GACb,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,KAAK,eAAe,EACpB,aAAa,EACb,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,GACxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,EACtB,sBAAsB,GACvB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,KAAK,iBAAiB,EAAE,KAAK,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC9G,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,gBAAgB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/F,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,kBAAkB,EAClB,yBAAyB,GAC1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,iBAAiB,EACjB,KAAK,eAAe,EACpB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,aAAa,CAAC"}
|
package/dist/fields/index.jsx
CHANGED
|
@@ -2,7 +2,7 @@ export { G9VoiceDictation } from "./dictation.jsx";
|
|
|
2
2
|
export { G9Editor } from "./editor.jsx";
|
|
3
3
|
export { customPatternCacheSize, decimalSeparatorFor, g9CustomPatternCacheLimit, inputTypeHasValidationRule, inputTypePrefersLeftToRight, isAbsoluteUri, resolveEffectiveKeyboard, resolveInputElementType, resolveKeyboardForInputType, sanitizeInputText, validateInputText } from "./input-policy.jsx";
|
|
4
4
|
export { g9FieldNotchBackgroundVariable, g9FieldNotchStyle } from "./notch.jsx";
|
|
5
|
-
export { G9OutlinedField, resolveOutlinedFieldState, useOutlinedField } from "./outlined-field.jsx";
|
|
5
|
+
export { G9OutlinedField, resolveInnerHint, resolveOutlinedFieldState, resolveRestingPlaceholder, useOutlinedField } from "./outlined-field.jsx";
|
|
6
6
|
export { G9PinEntry, filterPin, isPinCharAllowed, parsePinGroupSizes, pinCellCount } from "./pin-entry.jsx";
|
|
7
7
|
export { G9SearchEntry } from "./search-entry.jsx";
|
|
8
8
|
export { resolveFieldSlotLayout } from "./slot-layout.jsx";
|
|
@@ -20,8 +20,18 @@ export interface G9OutlinedFieldProps {
|
|
|
20
20
|
readonly errorText?: string | null;
|
|
21
21
|
/** Error state: error outline, label and helper colour. Validation can also set it (`validate()`). Default false. */
|
|
22
22
|
readonly hasError?: boolean;
|
|
23
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* Keep the label floated even when empty and unfocused. Default false. With a `label` AND a `placeholder` the
|
|
25
|
+
* placeholder is then drawn inside the empty box under the floated label (MAUI 1.4.9: «عنوان» floated with «عنوان کار
|
|
26
|
+
* را وارد کنید» inside).
|
|
27
|
+
*/
|
|
24
28
|
readonly alwaysFloat?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* The `placeholder` is the box's own hint (MAUI 1.4.9 `PlaceholderInside`): inside while the field is empty, gone with
|
|
31
|
+
* a value, never lifted into the notch as a label — a chat composer's «یادداشت خود را بنویسید...». A `label`, if set,
|
|
32
|
+
* still floats as usual. Default false: without a label the placeholder is the floating label's text.
|
|
33
|
+
*/
|
|
34
|
+
readonly placeholderInside?: boolean;
|
|
25
35
|
/** Value visible and selectable but not editable (MAUI `IsReadOnly`). Default false. */
|
|
26
36
|
readonly readOnly?: boolean;
|
|
27
37
|
/** Not interactive and dimmed (MAUI `IsEnabled = false`). Default false. */
|
|
@@ -98,6 +108,17 @@ export interface G9OutlinedFieldState {
|
|
|
98
108
|
readonly haloWidth: number;
|
|
99
109
|
readonly fieldHeight: number;
|
|
100
110
|
}
|
|
111
|
+
/**
|
|
112
|
+
* The hint a field draws INSIDE its box while it is empty, or `null` (MAUI 1.4.9 `RestingPlaceholder`). Without a `label`
|
|
113
|
+
* (or with `placeholderInside`) it is the `placeholder`. With a label it is drawn only when `alwaysFloat` keeps the label
|
|
114
|
+
* up in the notch — otherwise the resting label sits where the hint would be — and never when it repeats the label.
|
|
115
|
+
*/
|
|
116
|
+
export declare function resolveRestingPlaceholder(props: Pick<G9OutlinedFieldProps, 'label' | 'placeholder' | 'alwaysFloat' | 'placeholderInside'>): string | null;
|
|
117
|
+
/**
|
|
118
|
+
* The hint a TEXT input draws itself (MAUI 1.4.9 `G9TextEntry` / `G9Editor`): only while the field owns it — a label is
|
|
119
|
+
* set, or `placeholderInside` — since without a label the floating label already is the placeholder.
|
|
120
|
+
*/
|
|
121
|
+
export declare function resolveInnerHint(props: Pick<G9OutlinedFieldProps, 'label' | 'placeholder' | 'alwaysFloat' | 'placeholderInside'>): string | null;
|
|
101
122
|
/**
|
|
102
123
|
* Resolves the field's state colours and footer (MAUI `ResolveStateColor`, `ResolveFloatingLabelColor`, the footer
|
|
103
124
|
* part of `Refresh`). Precedence: error > status colour > focus > accented filled value > resting.
|
|
@@ -135,6 +156,11 @@ export interface G9OutlinedFieldFrameProps extends G9OutlinedFieldProps {
|
|
|
135
156
|
readonly multiline?: boolean;
|
|
136
157
|
/** Accessibility label of the box (defaults to the label text). */
|
|
137
158
|
readonly accessibilityLabel?: string;
|
|
159
|
+
/**
|
|
160
|
+
* A hint the frame draws over the content while the field is empty (`resolveInnerHint`, MAUI 1.4.9): text inputs pass
|
|
161
|
+
* it; the pickers draw their own value text. TextTertiary, the input's 15 px, never taking a touch.
|
|
162
|
+
*/
|
|
163
|
+
readonly hint?: string | null;
|
|
138
164
|
}
|
|
139
165
|
/**
|
|
140
166
|
* The outlined field frame (MAUI `G9OutlinedFieldBase`): outline with a notched floating label, leading and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outlined-field.d.ts","sourceRoot":"","sources":["../../src/fields/outlined-field.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,sBAAsB,EAAE,KAAK,aAAa,EAAa,MAAM,+BAA+B,CAAC;AACtG,OAAO,EAAE,KAAK,SAAS,EAAY,MAAM,gBAAgB,CAAC;AAG1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,OAAO,EAAE,KAAK,iBAAiB,EAA0B,MAAM,eAAe,CAAC;AAM/E,4FAA4F;AAC5F,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB,6FAA6F;IAC7F,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,+DAA+D;IAC/D,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,yFAAyF;IACzF,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,mEAAmE;IACnE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,qHAAqH;IACrH,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B
|
|
1
|
+
{"version":3,"file":"outlined-field.d.ts","sourceRoot":"","sources":["../../src/fields/outlined-field.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,sBAAsB,EAAE,KAAK,aAAa,EAAa,MAAM,+BAA+B,CAAC;AACtG,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GAAG,aAAa,CAAC;IACjD,uGAAuG;IACvG,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC7B,mEAAmE;IACnE,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IACrC;;;OAGG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAMD;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,yBAAyB,GAAG,SAAS,CA6N3E"}
|
|
@@ -7,6 +7,17 @@ import { G9IconSlot, hasIconSlot } from "../icon/slot.jsx";
|
|
|
7
7
|
import { useG9Direction, useG9Settings } from "../provider/hooks.jsx";
|
|
8
8
|
import { resolveFieldSlotLayout } from "./slot-layout.jsx";
|
|
9
9
|
const v = (token)=>`var(--g9-${token})`;
|
|
10
|
+
const blank = (s)=>null == s || '' === s.trim();
|
|
11
|
+
function resolveRestingPlaceholder(props) {
|
|
12
|
+
if (blank(props.placeholder)) return null;
|
|
13
|
+
const placeholder = props.placeholder;
|
|
14
|
+
if (true === props.placeholderInside || blank(props.label)) return placeholder;
|
|
15
|
+
return true === props.alwaysFloat && props.label !== placeholder ? placeholder : null;
|
|
16
|
+
}
|
|
17
|
+
function resolveInnerHint(props) {
|
|
18
|
+
const owns = true === props.placeholderInside || !blank(props.label);
|
|
19
|
+
return owns ? resolveRestingPlaceholder(props) : null;
|
|
20
|
+
}
|
|
10
21
|
function resolveOutlinedFieldState(props, input) {
|
|
11
22
|
var _props_filledValueHighlight, _props_statusColor, _props_errorText, _props_helperText, _props_maxLength, _ref, _props_label;
|
|
12
23
|
const hasError = true === props.hasError;
|
|
@@ -28,7 +39,7 @@ function resolveOutlinedFieldState(props, input) {
|
|
|
28
39
|
const counterText = true === props.showCharacterCounter && maxLength > 0 ? `${input.textLength} / ${maxLength}` : '';
|
|
29
40
|
const emphasis = input.focused || hasError || useStatus;
|
|
30
41
|
const halo = true === props.showFocusHalo && input.focused && !hasError && !useStatus;
|
|
31
|
-
const labelRaw = null != (_ref = null != (_props_label = props.label) ? _props_label : props.placeholder) ? _ref : '';
|
|
42
|
+
const labelRaw = null != (_ref = null != (_props_label = props.label) ? _props_label : true === props.placeholderInside ? null : props.placeholder) ? _ref : '';
|
|
32
43
|
return {
|
|
33
44
|
floated,
|
|
34
45
|
stateColor,
|
|
@@ -166,6 +177,22 @@ function G9OutlinedField(props) {
|
|
|
166
177
|
paddingBottom: `${slot.innerPadding.bottom}px`
|
|
167
178
|
}}>
|
|
168
179
|
{props.children}
|
|
180
|
+
{props.hint && !props.hasValue && true !== props.valueFloated ? <view className={`g9-field__hint${multiline ? ' g9-field__hint--multiline' : ''}`} user-interaction-enabled={false} style={{
|
|
181
|
+
left: `${slot.innerPadding.left + (hasLeading && 0 === slot.leadingColumn ? G9Metrics.LeadingIconSlotWidth : 0) + (hasTrailing && 0 === slot.trailingColumn ? G9Metrics.TrailingIconSlotWidth : 0)}px`,
|
|
182
|
+
right: `${slot.innerPadding.right + (hasLeading && 2 === slot.leadingColumn ? G9Metrics.LeadingIconSlotWidth : 0) + (hasTrailing && 2 === slot.trailingColumn ? G9Metrics.TrailingIconSlotWidth : 0)}px`,
|
|
183
|
+
...multiline ? {
|
|
184
|
+
top: `${slot.innerPadding.top}px`
|
|
185
|
+
} : {}
|
|
186
|
+
}}>
|
|
187
|
+
<text className="g9-field__hint-text" {...multiline ? {} : {
|
|
188
|
+
'text-maxline': '1'
|
|
189
|
+
}} style={{
|
|
190
|
+
textAlign: isRtl ? 'right' : 'left',
|
|
191
|
+
color: disabled ? 'var(--g9-text-disabled)' : 'var(--g9-text-tertiary)'
|
|
192
|
+
}}>
|
|
193
|
+
{props.hint}
|
|
194
|
+
</text>
|
|
195
|
+
</view> : null}
|
|
169
196
|
</view>
|
|
170
197
|
{hasLeading ? <view className="g9-field__slot g9-field__slot--leading" style={slotStyle(slot.leadingColumn, G9Metrics.LeadingIconSlotWidth, false)} catchtap={onLeadingTap} {...leadingActionable ? {
|
|
171
198
|
'accessibility-element': true,
|
|
@@ -204,6 +231,6 @@ function G9OutlinedField(props) {
|
|
|
204
231
|
</view> : null}
|
|
205
232
|
</view>;
|
|
206
233
|
}
|
|
207
|
-
export { G9OutlinedField, resolveOutlinedFieldState, useOutlinedField };
|
|
234
|
+
export { G9OutlinedField, resolveInnerHint, resolveOutlinedFieldState, resolveRestingPlaceholder, useOutlinedField };
|
|
208
235
|
|
|
209
236
|
//# sourceMappingURL=outlined-field.jsx.map
|