@g9tm/lynxcontrols 1.4.3 → 1.4.4
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/button/button.css +1 -0
- package/dist/button/button.css.map +1 -1
- package/dist/button/button.d.ts +2 -0
- package/dist/button/button.d.ts.map +1 -1
- package/dist/button/button.jsx +3 -2
- package/dist/button/button.jsx.map +1 -1
- package/dist/fields/outlined-field.d.ts +1 -1
- package/dist/fields/outlined-field.d.ts.map +1 -1
- package/dist/fields/outlined-field.jsx +13 -3
- package/dist/fields/outlined-field.jsx.map +1 -1
- package/dist/fields/use-text-input.d.ts.map +1 -1
- package/dist/fields/use-text-input.jsx +2 -2
- package/dist/fields/use-text-input.jsx.map +1 -1
- package/dist/pickers/date-time-picker.d.ts.map +1 -1
- package/dist/pickers/date-time-picker.jsx +13 -4
- package/dist/pickers/date-time-picker.jsx.map +1 -1
- package/dist/pickers/picker-sheet.d.ts +5 -1
- package/dist/pickers/picker-sheet.d.ts.map +1 -1
- package/dist/pickers/picker-sheet.jsx +3 -17
- package/dist/pickers/picker-sheet.jsx.map +1 -1
- package/dist/pickers/pickers.css +32 -43
- package/dist/pickers/pickers.css.map +1 -1
- package/dist/pickers/wheel-column.d.ts +3 -1
- package/dist/pickers/wheel-column.d.ts.map +1 -1
- package/dist/pickers/wheel-column.jsx +17 -3
- package/dist/pickers/wheel-column.jsx.map +1 -1
- package/dist/popup/frame.d.ts +6 -0
- package/dist/popup/frame.d.ts.map +1 -1
- package/dist/popup/frame.jsx +8 -6
- package/dist/popup/frame.jsx.map +1 -1
- package/dist/popup/popup.css +23 -16
- package/dist/popup/popup.css.map +1 -1
- package/dist/popup/service.d.ts.map +1 -1
- package/dist/popup/service.jsx +3 -2
- package/dist/popup/service.jsx.map +1 -1
- package/dist/range-slider/range-slider.css +5 -0
- package/dist/range-slider/range-slider.css.map +1 -1
- package/dist/range-slider/range-slider.jsx +1 -1
- package/dist/range-slider/range-slider.jsx.map +1 -1
- package/dist/selection/selection-sheet.d.ts.map +1 -1
- package/dist/selection/selection-sheet.jsx +4 -2
- package/dist/selection/selection-sheet.jsx.map +1 -1
- package/dist/selection/selection.css +15 -0
- package/dist/selection/selection.css.map +1 -1
- package/dist/sheet/frame.d.ts.map +1 -1
- package/dist/sheet/frame.jsx +26 -19
- package/dist/sheet/frame.jsx.map +1 -1
- package/dist/sheet/sheet.css +10 -0
- package/dist/sheet/sheet.css.map +1 -1
- package/dist/tabs/model.d.ts +1 -1
- package/dist/tabs/model.d.ts.map +1 -1
- package/dist/tabs/model.jsx.map +1 -1
- package/dist/tabs/tab-view.jsx +1 -1
- package/dist/tabs/tab-view.jsx.map +1 -1
- package/dist/toggle/chip-group.jsx +8 -2
- package/dist/toggle/chip-group.jsx.map +1 -1
- package/dist/toggle/switch.jsx +2 -1
- package/dist/toggle/switch.jsx.map +1 -1
- package/dist/toggle/toggle.css +5 -2
- package/dist/toggle/toggle.css.map +1 -1
- package/package.json +2 -2
|
@@ -62,7 +62,7 @@ function SelectionRow(props) {
|
|
|
62
62
|
opacity: 0.45
|
|
63
63
|
} : {}
|
|
64
64
|
}}>
|
|
65
|
-
{hasIconSlot(icon) ? <G9IconSlot {...icon} size={18} color={iconColor}/> : (null == (_item_swatchFirstColor = item.swatchFirstColor) ? void 0 : _item_swatchFirstColor.trim()) || (null == (_item_swatchSecondColor = item.swatchSecondColor) ? void 0 : _item_swatchSecondColor.trim()) ? <G9Swatch first={item.swatchFirstColor} second={item.swatchSecondColor} direction={props.direction}/> :
|
|
65
|
+
{hasIconSlot(icon) ? <G9IconSlot {...icon} size={18} color={iconColor}/> : (null == (_item_swatchFirstColor = item.swatchFirstColor) ? void 0 : _item_swatchFirstColor.trim()) || (null == (_item_swatchSecondColor = item.swatchSecondColor) ? void 0 : _item_swatchSecondColor.trim()) ? <G9Swatch first={item.swatchFirstColor} second={item.swatchSecondColor} direction={props.direction}/> : <view className="g9-selection-row__icon-gap"/>}
|
|
66
66
|
<text className="g9-selection-row__text" text-maxline="1" style={{
|
|
67
67
|
color: selected ? palette.Primary : palette.TextPrimary,
|
|
68
68
|
fontWeight: selected ? 'bold' : 'normal',
|
|
@@ -116,13 +116,15 @@ function SelectionBody(props) {
|
|
|
116
116
|
{request.showSearch ? <view className="g9-selection__search">
|
|
117
117
|
<G9TextEntry placeholder={strings.get(G9StringKey.Search)} leadingIcon="search" value={query} onValueChange={onQuery}/>
|
|
118
118
|
</view> : null}
|
|
119
|
-
{
|
|
119
|
+
{visible.length > 0 ? <view className="g9-selection__items">
|
|
120
|
+
{request.items.map((item, i)=>{
|
|
120
121
|
var _item_key;
|
|
121
122
|
var _request_options;
|
|
122
123
|
const id = ids[i];
|
|
123
124
|
if (!visibleIds.has(id)) return null;
|
|
124
125
|
return <SelectionRow key={id} item={item} elementId={g9ChildId(null == (_request_options = request.options) ? void 0 : _request_options.automationId, `Item_${null != (_item_key = item.key) ? _item_key : i}`)} selected={model.isSelected(id)} direction={dir} onTap={()=>tap(id)}/>;
|
|
125
126
|
})}
|
|
127
|
+
</view> : null}
|
|
126
128
|
{0 === visible.length ? <text className="g9-selection__empty">{null != (_request_emptyText = request.emptyText) ? _request_emptyText : strings.get(G9StringKey.NoResults)}</text> : null}
|
|
127
129
|
</view>;
|
|
128
130
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selection/selection-sheet.jsx","sources":["../../src/selection/selection-sheet.tsx"],"sourcesContent":["import './selection.css';\nimport { formatColor, G9StringKey, type G9TextInputDirection, withAlpha } from '@g9tm/lynxcontrols-foundation';\nimport { type ReactNode, useEffect, useRef, useState, useSyncExternalStore } from '@lynx-js/react';\nimport { g9ChildId, g9RowStyle, g9TextStart } from '../base/control';\nimport { useG9Press } from '../base/press';\nimport type { G9SelectionItem } from '../base/selection-item';\nimport { type G9TimerHandle, startTimer, stopTimer } from '../base/timers';\nimport { G9Button } from '../button/button';\nimport { G9SearchEntry } from '../fields/search-entry';\nimport { G9TextEntry } from '../fields/text-entry';\nimport { G9IconSlot, hasIconSlot } from '../icon/slot';\nimport { G9Swatch } from '../icon/swatch';\nimport { useG9Direction, useG9Settings, useG9Strings, useG9Theme } from '../provider/hooks';\nimport { fitToContentSheetOptions, fullScreenWithoutHandleSheetOptions, type G9SheetOptions } from '../sheet/options';\nimport type { G9SheetService } from '../sheet/service';\nimport type { G9SheetHandle } from '../sheet/stack';\nimport { createSelectionModel, type G9SelectionModel } from './model';\n\n/** MAUI `G9SelectionSheet.EagerBuildItemLimit`: lists up to 40 items are built at once; longer lists defer. */\nexport const g9SelectionEagerBuildItemLimit = 40;\n/** Row height of the selection sheet (MAUI 52). */\nexport const g9SelectionRowHeight = 52;\n/** Search debounce of the selection sheet (MAUI 150 ms). */\nexport const g9SelectionSearchDebounceMs = 150;\n/** Wait after a close-on-select pick before closing (MAUI 120 ms). */\nexport const g9SelectionCloseDelayMs = 120;\n\n/** The outcome of a selection sheet (MAUI `G9SelectionSheetResult`). */\nexport interface G9SelectionSheetResult<T extends G9SelectionItem = G9SelectionItem> {\n /** A pick on a close-on-select sheet, Done, or Reset; `false` for every dismissal. */\n readonly wasAccepted: boolean;\n /** The selection differs from the opening one. */\n readonly selectionChanged: boolean;\n /** The final selection (opening items that are not listed or disabled stay unless deselected). */\n readonly items: ReadonlyArray<T>;\n}\n\n/**\n * The selection identity of an item inside one list (MAUI `G9SelectionSheet.KeyOf`): `k:<key>` when the key is set,\n * else `t:<text>` when the text is unique among key-less items, else the position (`i:<n>`). Keys and texts never\n * match each other.\n */\nexport function selectionIdentities(items: ReadonlyArray<G9SelectionItem>): string[] {\n const counts = new Map<string, number>();\n for (const item of items) {\n if (item.key == null || item.key.trim() === '') counts.set(item.text, (counts.get(item.text) ?? 0) + 1);\n }\n return items.map((item, i) =>\n item.key != null && item.key.trim() !== ''\n ? `k:${item.key}`\n : (counts.get(item.text) ?? 0) > 1\n ? `i:${i}`\n : `t:${item.text}`,\n );\n}\n\n/** Estimated body height (MAUI `EstimateContentHeight`): rows × 52 + chrome, clamped to [2 rows + chrome, 520]. */\nexport function estimateSelectionHeight(count: number, showSearch: boolean): number {\n const chrome = (showSearch ? 64 : 0) + 18;\n return Math.min(520, Math.max(2 * g9SelectionRowHeight + chrome, count * g9SelectionRowHeight + chrome));\n}\n\n/** Arguments of {@link showSelectionSheet} (MAUI `ShowForResultAsync`). */\nexport interface G9SelectionSheetRequest<T extends G9SelectionItem> {\n readonly title: string;\n readonly items: ReadonlyArray<T>;\n readonly selectedItems?: ReadonlyArray<T>;\n readonly allowMultiple?: boolean;\n /** Single mode: a pick completes and closes after 120 ms. Default true. */\n readonly closeOnSingleSelection?: boolean;\n readonly showSearch?: boolean;\n /** No-results text. Default the `noResults` string. */\n readonly emptyText?: string | null;\n /** Row text direction. Default `'matchParent'`. */\n readonly itemTextDirection?: G9TextInputDirection;\n /** A non-empty reset selection adds a Reset toolbar item that completes with it. */\n readonly resetSelection?: ReadonlyArray<T> | null;\n /** Count pill label (multi). Default `\"{n} {selected}\"`. */\n readonly countLabel?: (count: number) => string;\n /** Extra sheet options (merged over the defaults). */\n readonly options?: G9SheetOptions;\n}\n\ninterface BodyProps<T extends G9SelectionItem> {\n readonly request: G9SelectionSheetRequest<T>;\n readonly ids: ReadonlyArray<string>;\n readonly initial: G9SelectionModel<T>;\n readonly onComplete: (keys: ReadonlyArray<string>, accepted: boolean) => void;\n readonly onDraft: (model: G9SelectionModel<T>) => void;\n readonly done: { current: boolean };\n}\n\nfunction SelectionRow(props: {\n readonly item: G9SelectionItem;\n /** Element id (`${sheet automationId}_Item_${key}`), so automation finds the row like a person sees it. */\n readonly elementId?: string | undefined;\n readonly selected: boolean;\n readonly direction: 'ltr' | 'rtl';\n readonly onTap: () => void;\n}): ReactNode {\n const palette = useG9Theme().palette;\n const glyphs = useG9Settings().glyphs;\n const { item, selected } = props;\n const press = useG9Press(props.onTap, { blocked: item.isEnabled === false, source: 'G9SelectionSheet', guardMs: 0 });\n const icon = { emoji: item.emoji, icon: item.icon, imagePath: item.iconPath, image: item.iconImage };\n const iconColor = item.iconTintColor ?? (selected ? palette.Primary : palette.TextSecondary);\n return (\n <view\n {...(props.elementId ? { id: props.elementId } : {})}\n className={`g9-selection-row${selected ? ' g9-selection-row--selected' : ''}`}\n style={selected ? { backgroundColor: formatColor(withAlpha(palette.Primary, 0.1)) } : {}}\n accessibility-element={true}\n accessibility-traits=\"button\"\n accessibility-label={item.text}\n {...(selected ? { 'accessibility-value': 'selected' } : {})}\n bindtap={press}\n >\n <view\n className={`g9-selection-row__inner g9-dir-${props.direction}`}\n style={{ ...g9RowStyle(props.direction), ...(item.isEnabled === false ? { opacity: 0.45 } : {}) }}\n >\n {hasIconSlot(icon) ? (\n <G9IconSlot {...icon} size={18} color={iconColor} />\n ) : item.swatchFirstColor?.trim() || item.swatchSecondColor?.trim() ? (\n <G9Swatch first={item.swatchFirstColor} second={item.swatchSecondColor} direction={props.direction} />\n ) : null}\n <text\n className=\"g9-selection-row__text\"\n text-maxline=\"1\"\n style={{\n color: selected ? palette.Primary : palette.TextPrimary,\n fontWeight: selected ? 'bold' : 'normal',\n ...g9TextStart(props.direction),\n }}\n >\n {item.text}\n </text>\n <view style={{ opacity: selected ? 1 : 0 }}>\n <G9IconSlot icon={glyphs.check} size={18} color={palette.Primary} />\n </view>\n </view>\n </view>\n );\n}\n\nfunction SelectionBody<T extends G9SelectionItem>(props: BodyProps<T>): ReactNode {\n const strings = useG9Strings();\n const parentDir = useG9Direction();\n const { request, ids } = props;\n const [model, setModel] = useState(props.initial);\n const [query, setQuery] = useState('');\n const [applied, setApplied] = useState('');\n const timer = useRef<G9TimerHandle | null>(null);\n const picking = useRef(false);\n useEffect(\n () => () => {\n if (timer.current !== null) stopTimer(timer.current);\n },\n [],\n );\n const visible = request.showSearch ? model.withItems(request.items).filter(applied) : request.items;\n const visibleIds = new Set(visible.map((item) => ids[request.items.indexOf(item)]));\n const dir =\n request.itemTextDirection === 'leftToRight'\n ? 'ltr'\n : request.itemTextDirection === 'rightToLeft'\n ? 'rtl'\n : parentDir;\n const multiple = request.allowMultiple === true;\n const onQuery = (value: string) => {\n setQuery(value);\n if (timer.current !== null) stopTimer(timer.current);\n if (value.trim() === '') {\n setApplied(value);\n return;\n }\n timer.current = startTimer(() => setApplied(value), g9SelectionSearchDebounceMs);\n };\n const tap = (id: string) => {\n if (props.done.current || picking.current) return;\n const next = model.toggle(id);\n if (next === model) return;\n setModel(next);\n props.onDraft(next);\n if (!multiple && request.closeOnSingleSelection !== false) {\n picking.current = true;\n startTimer(() => props.onComplete(next.selectedKeys, true), g9SelectionCloseDelayMs);\n }\n };\n return (\n <view className=\"g9-selection\">\n {request.showSearch ? (\n <view className=\"g9-selection__search\">\n <G9TextEntry\n placeholder={strings.get(G9StringKey.Search)}\n leadingIcon=\"search\"\n value={query}\n onValueChange={onQuery}\n />\n </view>\n ) : null}\n {request.items.map((item, i) => {\n const id = ids[i] as string;\n if (!visibleIds.has(id)) return null;\n return (\n <SelectionRow\n key={id}\n item={item}\n elementId={g9ChildId(request.options?.automationId, `Item_${item.key ?? i}`)}\n selected={model.isSelected(id)}\n direction={dir}\n onTap={() => tap(id)}\n />\n );\n })}\n {visible.length === 0 ? (\n <text className=\"g9-selection__empty\">{request.emptyText ?? strings.get(G9StringKey.NoResults)}</text>\n ) : null}\n </view>\n );\n}\n\n/**\n * Shows the selection sheet (MAUI `G9SelectionSheet.ShowForResultAsync`): a fit sheet with a header (title near the\n * close button), optional search (150 ms debounce, text match, hidden selected rows stay selected), rows with icon or\n * swatch, check mark and selection tint. Single mode with `closeOnSingleSelection` completes on a pick; multi mode\n * shows a count pill and Done; a reset selection adds Reset. Any dismissal resolves `wasAccepted: false` with the\n * current draft (or the opening selection when the sheet never built).\n */\nexport function showSelectionSheet<T extends G9SelectionItem>(\n sheets: G9SheetService,\n request: G9SelectionSheetRequest<T>,\n): Promise<G9SelectionSheetResult<T>> {\n const items = [...request.items];\n const ids = selectionIdentities(items);\n const opening = request.selectedItems ?? [];\n // Opening items match listed items by identity; the rest are kept as \"not listed\".\n const openingIds = selectionIdentities([...items, ...opening]).slice(items.length);\n const listedIds = new Set(ids);\n const initialKeys = openingIds.filter((id) => listedIds.has(id));\n const unlisted = opening.filter((_, i) => !listedIds.has(openingIds[i] as string));\n const multiple = request.allowMultiple === true;\n const initial = createSelectionModel<T>({\n items,\n getKey: (item) => ids[items.indexOf(item)] as string,\n getText: (item) => item.text,\n mode: multiple ? 'multiple' : 'single',\n selectedKeys: initialKeys,\n isEnabled: (item) => item.isEnabled !== false,\n });\n return new Promise((resolve) => {\n let draft = initial;\n const draftListeners = new Set<() => void>();\n const draftStore = {\n subscribe: (l: () => void) => {\n draftListeners.add(l);\n return () => {\n draftListeners.delete(l);\n };\n },\n count: () => draft.selectedKeys.length,\n };\n let settled = false;\n const done = { current: false };\n const startKeys = new Set(initialKeys);\n const collect = (keys: ReadonlyArray<string>): T[] => {\n const set = new Set(keys);\n return [...items.filter((_, i) => set.has(ids[i] as string)), ...unlisted];\n };\n const settle = (keys: ReadonlyArray<string>, accepted: boolean, explicit?: ReadonlyArray<T>) => {\n if (settled) return;\n settled = true;\n done.current = true;\n const result = explicit ?? collect(keys);\n const changed = explicit !== undefined || keys.length !== startKeys.size || keys.some((k) => !startKeys.has(k));\n resolve({ wasAccepted: accepted, selectionChanged: changed, items: result });\n };\n let handle: G9SheetHandle | null = null;\n const complete = (keys: ReadonlyArray<string>, accepted: boolean) => {\n settle(keys, accepted);\n handle?.close();\n };\n const reset = request.resetSelection && request.resetSelection.length > 0 ? request.resetSelection : null;\n const body = () => (\n <SelectionBody\n request={request}\n ids={ids}\n initial={initial}\n done={done}\n onDraft={(m) => {\n draft = m;\n for (const l of [...draftListeners]) l();\n }}\n onComplete={complete}\n />\n );\n const options: G9SheetOptions = {\n ...fitToContentSheetOptions(),\n deferContent: items.length > g9SelectionEagerBuildItemLimit,\n deferredLoadingPlaceholderHeight: estimateSelectionHeight(items.length, request.showSearch === true),\n loadingSkeleton: 'listRows',\n loadingSkeletonRowCount: items.length,\n backgroundColor: 'var(--g9-surface)',\n showToolbar: true,\n showCloseButton: true,\n title: request.title,\n headerTitlePlacement: 'nearBack',\n ...(multiple || reset\n ? {\n headerTrailingView: (\n <SelectionHeaderActions\n multiple={multiple}\n draft={draftStore}\n {...(request.countLabel ? { countLabel: request.countLabel } : {})}\n onDone={() => complete(draft.selectedKeys, true)}\n {...(reset\n ? {\n onReset: () => {\n settle([], true, reset);\n handle?.close();\n },\n }\n : {})}\n />\n ),\n }\n : {}),\n ...request.options,\n onClosed: () => {\n request.options?.onClosed?.();\n settle(draft.selectedKeys, false);\n },\n };\n handle = sheets.show(items.length > g9SelectionEagerBuildItemLimit ? body : body(), options);\n if (!handle) settle(initialKeys, false);\n });\n}\n\nfunction SelectionHeaderActions(props: {\n readonly multiple: boolean;\n readonly draft: { subscribe(listener: () => void): () => void; count(): number };\n readonly countLabel?: (n: number) => string;\n readonly onDone: () => void;\n readonly onReset?: () => void;\n}): ReactNode {\n const strings = useG9Strings();\n const direction = useG9Direction();\n const n = useSyncExternalStore(props.draft.subscribe, props.draft.count);\n return (\n <view className=\"g9-selection__actions\" style={g9RowStyle(direction)}>\n {props.onReset ? (\n <G9Button text={strings.get(G9StringKey.Reset)} variant=\"text\" size=\"small\" onPress={props.onReset} />\n ) : null}\n {props.multiple && n > 0 ? (\n <view className=\"g9-selection__count\">\n <text className=\"g9-selection__count-text\">\n {props.countLabel ? props.countLabel(n) : `${n} ${strings.get(G9StringKey.Selected)}`}\n </text>\n </view>\n ) : null}\n {props.multiple ? (\n <G9Button text={strings.get(G9StringKey.Done)} variant=\"text\" size=\"small\" onPress={props.onDone} />\n ) : null}\n </view>\n );\n}\n\n/** Arguments of {@link showListSheet} (MAUI `ShowListG9BottomSheetAsync`). */\nexport interface G9ListSheetRequest<T extends G9SelectionItem> {\n readonly title: string;\n readonly items: ReadonlyArray<T>;\n readonly selected?: ReadonlyArray<T>;\n readonly multiple?: boolean;\n /** Default true. */\n readonly closeOnSingleSelection?: boolean;\n /** Shows the search field (250 ms debounce, trimmed) with this placeholder. */\n readonly searchPlaceholder?: string | null;\n /** Default full screen without a handle (MAUI). A fit-to-content `sizeMode` keeps the sheet compact. */\n readonly options?: G9SheetOptions;\n /** Apply button text (multi). Default the `save` string. */\n readonly applyButtonText?: string;\n}\n\n/**\n * The shared list picker (MAUI `ShowListG9BottomSheetAsync` / `G9BottomSheetListPickerModal`): search field with\n * placeholder, rows with a selection tint (no check mark), Apply in multi mode, close-on-select after 120 ms. Resolves\n * with the selection when it completes or closes (no accepted/dismissed distinction, as MAUI); `[]` when throttled.\n */\nexport function showListSheet<T extends G9SelectionItem>(\n sheets: G9SheetService,\n request: G9ListSheetRequest<T>,\n): Promise<T[]> {\n const items = [...request.items];\n const keyOf = (item: G9SelectionItem) => (item.key != null && item.key.trim() !== '' ? item.key : item.text);\n const multiple = request.multiple === true;\n const initial = createSelectionModel<T>({\n items,\n getKey: keyOf,\n getText: (item) => item.text,\n mode: multiple ? 'multiple' : 'single',\n selectedKeys: (request.selected ?? []).map(keyOf),\n isEnabled: (item) => item.isEnabled !== false,\n });\n return new Promise((resolve) => {\n let draft = initial;\n let settled = false;\n let handle: G9SheetHandle | null = null;\n const settle = () => {\n if (settled) return;\n settled = true;\n resolve(draft.selectedItems());\n };\n const complete = () => {\n settle();\n handle?.close();\n };\n const body = () => (\n <ListPickerBody\n request={request}\n initial={initial}\n keyOf={keyOf}\n onDraft={(m) => {\n draft = m;\n }}\n onComplete={complete}\n />\n );\n const base = request.options ?? fullScreenWithoutHandleSheetOptions();\n const fit = base.sizeMode === 'fitToContent';\n const options: G9SheetOptions = {\n ...base,\n ...(fit\n ? {}\n : {\n states: ['large'],\n currentState: 'large',\n hasHandle: false,\n isDraggable: true,\n useFullScreenLoadingPlaceholder: true,\n }),\n showToolbar: true,\n showCloseButton: true,\n title: request.title,\n headerTitlePlacement: 'nearBack',\n deferContent: true,\n onClosed: () => {\n base.onClosed?.();\n settle();\n },\n };\n handle = sheets.show(body, options);\n if (!handle) {\n settled = true;\n resolve([]);\n }\n });\n}\n\nfunction ListPickerBody<T extends G9SelectionItem>(props: {\n readonly request: G9ListSheetRequest<T>;\n readonly initial: G9SelectionModel<T>;\n readonly keyOf: (item: G9SelectionItem) => string;\n readonly onDraft: (model: G9SelectionModel<T>) => void;\n readonly onComplete: () => void;\n}): ReactNode {\n const strings = useG9Strings();\n const palette = useG9Theme().palette;\n const [model, setModel] = useState(props.initial);\n const [query, setQuery] = useState('');\n const picking = useRef(false);\n const { request } = props;\n const visible = model.filter(query, { trim: true });\n const tap = (item: T) => {\n if (picking.current || item.isEnabled === false) return;\n const next = model.toggle(props.keyOf(item));\n setModel(next);\n props.onDraft(next);\n if (!request.multiple && request.closeOnSingleSelection !== false) {\n picking.current = true;\n startTimer(props.onComplete, g9SelectionCloseDelayMs);\n }\n };\n return (\n <view className=\"g9-list-picker\">\n {request.searchPlaceholder ? (\n <view className=\"g9-selection__search\">\n <G9SearchEntry\n placeholder={request.searchPlaceholder}\n voiceEnabled={false}\n onDebouncedValueChange={setQuery}\n />\n </view>\n ) : null}\n {visible.map((item) => (\n <ListPickerRow\n key={props.keyOf(item)}\n item={item}\n selected={model.isSelected(props.keyOf(item))}\n tint={palette.PrimaryContainer}\n onTap={() => tap(item)}\n />\n ))}\n {request.multiple ? (\n <view className=\"g9-list-picker__apply\">\n <G9Button\n text={request.applyButtonText ?? strings.get(G9StringKey.Save)}\n size=\"hero\"\n onPress={props.onComplete}\n />\n </view>\n ) : null}\n </view>\n );\n}\n\nfunction ListPickerRow(props: {\n readonly item: G9SelectionItem;\n readonly selected: boolean;\n readonly tint: string;\n readonly onTap: () => void;\n}): ReactNode {\n const press = useG9Press(props.onTap, {\n source: 'G9ListPicker',\n guardMs: 0,\n blocked: props.item.isEnabled === false,\n });\n const icon = { icon: props.item.icon, imagePath: props.item.iconPath, image: props.item.iconImage };\n const direction = useG9Direction();\n return (\n <view\n className={`g9-list-picker__row${props.selected ? ' g9-list-picker__row--selected' : ''}`}\n style={{ ...g9RowStyle(direction), ...(props.selected ? { backgroundColor: props.tint } : {}) }}\n accessibility-element={true}\n accessibility-traits=\"button\"\n accessibility-label={props.item.text}\n bindtap={press}\n >\n {hasIconSlot(icon) ? <G9IconSlot {...icon} size={20} color=\"var(--g9-on-surface-variant)\" /> : null}\n <text className=\"g9-list-picker__text\" text-maxline=\"1\" style={g9TextStart(direction)}>\n {props.item.text}\n </text>\n </view>\n );\n}\n"],"names":["g9SelectionEagerBuildItemLimit","g9SelectionRowHeight","g9SelectionSearchDebounceMs","g9SelectionCloseDelayMs","selectionIdentities","items","counts","Map","item","_counts_get","i","estimateSelectionHeight","count","showSearch","chrome","Math","SelectionRow","props","_item_iconTintColor","_item_swatchFirstColor","_item_swatchSecondColor","palette","useG9Theme","glyphs","useG9Settings","selected","press","useG9Press","icon","iconColor","view","formatColor","withAlpha","g9RowStyle","hasIconSlot","G9IconSlot","G9Swatch","text","g9TextStart","SelectionBody","_request_emptyText","strings","useG9Strings","parentDir","useG9Direction","request","ids","model","setModel","useState","query","setQuery","applied","setApplied","timer","useRef","picking","useEffect","stopTimer","visible","visibleIds","Set","dir","multiple","onQuery","value","startTimer","tap","id","next","G9TextEntry","G9StringKey","_item_key","_request_options","g9ChildId","showSelectionSheet","sheets","_request_selectedItems","opening","openingIds","listedIds","initialKeys","unlisted","_","initial","createSelectionModel","Promise","resolve","draft","draftListeners","draftStore","l","settled","done","startKeys","collect","keys","set","settle","accepted","explicit","result","changed","undefined","k","handle","complete","reset","body","m","options","fitToContentSheetOptions","SelectionHeaderActions","direction","n","useSyncExternalStore","G9Button","showListSheet","_request_selected","keyOf","ListPickerBody","base","fullScreenWithoutHandleSheetOptions","fit","_request_applyButtonText","G9SearchEntry","ListPickerRow"],"mappings":";;;;;;;;;;;;;;AAmBO,MAAMA,iCAAiC;AAEvC,MAAMC,uBAAuB;AAE7B,MAAMC,8BAA8B;AAEpC,MAAMC,0BAA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AAE,iBAAiBA,MAAM,IAAI;QAAC,IAAI,CAAC,CAAC;IAAE,GAC9F,uBAAuB,MACvB,qBAAqB,SACrB,qBAAqBA,MAAM,IAAI,CAAC,IAAI,EACpC,SAASS,OACV;MACC,CAACQ,YAAYN,SAASO,YAAY,GAAGP,IAAI,EAAE,MAAM,IAAI,MAAM,mCAAoC,KAAK;MACpG,CAACS,KAAK,UAAU,uBAAuB,aAAa,IAAI,OAAOC,YAAY2E,YAAY;QACrF,CAAChG,MAAM,IAAI,CAAC,IAAI,CAAC;MACnB,EAAEoB,KAAK;IACT,EAAEP;AAEN"}
|
|
1
|
+
{"version":3,"file":"selection/selection-sheet.jsx","sources":["../../src/selection/selection-sheet.tsx"],"sourcesContent":["import './selection.css';\nimport { formatColor, G9StringKey, type G9TextInputDirection, withAlpha } from '@g9tm/lynxcontrols-foundation';\nimport { type ReactNode, useEffect, useRef, useState, useSyncExternalStore } from '@lynx-js/react';\nimport { g9ChildId, g9RowStyle, g9TextStart } from '../base/control';\nimport { useG9Press } from '../base/press';\nimport type { G9SelectionItem } from '../base/selection-item';\nimport { type G9TimerHandle, startTimer, stopTimer } from '../base/timers';\nimport { G9Button } from '../button/button';\nimport { G9SearchEntry } from '../fields/search-entry';\nimport { G9TextEntry } from '../fields/text-entry';\nimport { G9IconSlot, hasIconSlot } from '../icon/slot';\nimport { G9Swatch } from '../icon/swatch';\nimport { useG9Direction, useG9Settings, useG9Strings, useG9Theme } from '../provider/hooks';\nimport { fitToContentSheetOptions, fullScreenWithoutHandleSheetOptions, type G9SheetOptions } from '../sheet/options';\nimport type { G9SheetService } from '../sheet/service';\nimport type { G9SheetHandle } from '../sheet/stack';\nimport { createSelectionModel, type G9SelectionModel } from './model';\n\n/** MAUI `G9SelectionSheet.EagerBuildItemLimit`: lists up to 40 items are built at once; longer lists defer. */\nexport const g9SelectionEagerBuildItemLimit = 40;\n/** Row height of the selection sheet (MAUI 52). */\nexport const g9SelectionRowHeight = 52;\n/** Search debounce of the selection sheet (MAUI 150 ms). */\nexport const g9SelectionSearchDebounceMs = 150;\n/** Wait after a close-on-select pick before closing (MAUI 120 ms). */\nexport const g9SelectionCloseDelayMs = 120;\n\n/** The outcome of a selection sheet (MAUI `G9SelectionSheetResult`). */\nexport interface G9SelectionSheetResult<T extends G9SelectionItem = G9SelectionItem> {\n /** A pick on a close-on-select sheet, Done, or Reset; `false` for every dismissal. */\n readonly wasAccepted: boolean;\n /** The selection differs from the opening one. */\n readonly selectionChanged: boolean;\n /** The final selection (opening items that are not listed or disabled stay unless deselected). */\n readonly items: ReadonlyArray<T>;\n}\n\n/**\n * The selection identity of an item inside one list (MAUI `G9SelectionSheet.KeyOf`): `k:<key>` when the key is set,\n * else `t:<text>` when the text is unique among key-less items, else the position (`i:<n>`). Keys and texts never\n * match each other.\n */\nexport function selectionIdentities(items: ReadonlyArray<G9SelectionItem>): string[] {\n const counts = new Map<string, number>();\n for (const item of items) {\n if (item.key == null || item.key.trim() === '') counts.set(item.text, (counts.get(item.text) ?? 0) + 1);\n }\n return items.map((item, i) =>\n item.key != null && item.key.trim() !== ''\n ? `k:${item.key}`\n : (counts.get(item.text) ?? 0) > 1\n ? `i:${i}`\n : `t:${item.text}`,\n );\n}\n\n/** Estimated body height (MAUI `EstimateContentHeight`): rows × 52 + chrome, clamped to [2 rows + chrome, 520]. */\nexport function estimateSelectionHeight(count: number, showSearch: boolean): number {\n const chrome = (showSearch ? 64 : 0) + 18;\n return Math.min(520, Math.max(2 * g9SelectionRowHeight + chrome, count * g9SelectionRowHeight + chrome));\n}\n\n/** Arguments of {@link showSelectionSheet} (MAUI `ShowForResultAsync`). */\nexport interface G9SelectionSheetRequest<T extends G9SelectionItem> {\n readonly title: string;\n readonly items: ReadonlyArray<T>;\n readonly selectedItems?: ReadonlyArray<T>;\n readonly allowMultiple?: boolean;\n /** Single mode: a pick completes and closes after 120 ms. Default true. */\n readonly closeOnSingleSelection?: boolean;\n readonly showSearch?: boolean;\n /** No-results text. Default the `noResults` string. */\n readonly emptyText?: string | null;\n /** Row text direction. Default `'matchParent'`. */\n readonly itemTextDirection?: G9TextInputDirection;\n /** A non-empty reset selection adds a Reset toolbar item that completes with it. */\n readonly resetSelection?: ReadonlyArray<T> | null;\n /** Count pill label (multi). Default `\"{n} {selected}\"`. */\n readonly countLabel?: (count: number) => string;\n /** Extra sheet options (merged over the defaults). */\n readonly options?: G9SheetOptions;\n}\n\ninterface BodyProps<T extends G9SelectionItem> {\n readonly request: G9SelectionSheetRequest<T>;\n readonly ids: ReadonlyArray<string>;\n readonly initial: G9SelectionModel<T>;\n readonly onComplete: (keys: ReadonlyArray<string>, accepted: boolean) => void;\n readonly onDraft: (model: G9SelectionModel<T>) => void;\n readonly done: { current: boolean };\n}\n\nfunction SelectionRow(props: {\n readonly item: G9SelectionItem;\n /** Element id (`${sheet automationId}_Item_${key}`), so automation finds the row like a person sees it. */\n readonly elementId?: string | undefined;\n readonly selected: boolean;\n readonly direction: 'ltr' | 'rtl';\n readonly onTap: () => void;\n}): ReactNode {\n const palette = useG9Theme().palette;\n const glyphs = useG9Settings().glyphs;\n const { item, selected } = props;\n const press = useG9Press(props.onTap, { blocked: item.isEnabled === false, source: 'G9SelectionSheet', guardMs: 0 });\n const icon = { emoji: item.emoji, icon: item.icon, imagePath: item.iconPath, image: item.iconImage };\n const iconColor = item.iconTintColor ?? (selected ? palette.Primary : palette.TextSecondary);\n return (\n <view\n {...(props.elementId ? { id: props.elementId } : {})}\n className={`g9-selection-row${selected ? ' g9-selection-row--selected' : ''}`}\n style={selected ? { backgroundColor: formatColor(withAlpha(palette.Primary, 0.1)) } : {}}\n accessibility-element={true}\n accessibility-traits=\"button\"\n accessibility-label={item.text}\n {...(selected ? { 'accessibility-value': 'selected' } : {})}\n bindtap={press}\n >\n <view\n className={`g9-selection-row__inner g9-dir-${props.direction}`}\n style={{ ...g9RowStyle(props.direction), ...(item.isEnabled === false ? { opacity: 0.45 } : {}) }}\n >\n {hasIconSlot(icon) ? (\n <G9IconSlot {...icon} size={18} color={iconColor} />\n ) : item.swatchFirstColor?.trim() || item.swatchSecondColor?.trim() ? (\n <G9Swatch first={item.swatchFirstColor} second={item.swatchSecondColor} direction={props.direction} />\n ) : (\n // MAUI's row is a Grid of ColumnSpacing 12 whose icon column stays when empty: its spacing still sits before\n // the text, so an icon-less row's text starts 16 + 12 dp in, level with nothing but the same in every picker.\n <view className=\"g9-selection-row__icon-gap\" />\n )}\n <text\n className=\"g9-selection-row__text\"\n text-maxline=\"1\"\n style={{\n color: selected ? palette.Primary : palette.TextPrimary,\n fontWeight: selected ? 'bold' : 'normal',\n ...g9TextStart(props.direction),\n }}\n >\n {item.text}\n </text>\n <view style={{ opacity: selected ? 1 : 0 }}>\n <G9IconSlot icon={glyphs.check} size={18} color={palette.Primary} />\n </view>\n </view>\n </view>\n );\n}\n\nfunction SelectionBody<T extends G9SelectionItem>(props: BodyProps<T>): ReactNode {\n const strings = useG9Strings();\n const parentDir = useG9Direction();\n const { request, ids } = props;\n const [model, setModel] = useState(props.initial);\n const [query, setQuery] = useState('');\n const [applied, setApplied] = useState('');\n const timer = useRef<G9TimerHandle | null>(null);\n const picking = useRef(false);\n useEffect(\n () => () => {\n if (timer.current !== null) stopTimer(timer.current);\n },\n [],\n );\n const visible = request.showSearch ? model.withItems(request.items).filter(applied) : request.items;\n const visibleIds = new Set(visible.map((item) => ids[request.items.indexOf(item)]));\n const dir =\n request.itemTextDirection === 'leftToRight'\n ? 'ltr'\n : request.itemTextDirection === 'rightToLeft'\n ? 'rtl'\n : parentDir;\n const multiple = request.allowMultiple === true;\n const onQuery = (value: string) => {\n setQuery(value);\n if (timer.current !== null) stopTimer(timer.current);\n if (value.trim() === '') {\n setApplied(value);\n return;\n }\n timer.current = startTimer(() => setApplied(value), g9SelectionSearchDebounceMs);\n };\n const tap = (id: string) => {\n if (props.done.current || picking.current) return;\n const next = model.toggle(id);\n if (next === model) return;\n setModel(next);\n props.onDraft(next);\n if (!multiple && request.closeOnSingleSelection !== false) {\n picking.current = true;\n startTimer(() => props.onComplete(next.selectedKeys, true), g9SelectionCloseDelayMs);\n }\n };\n return (\n <view className=\"g9-selection\">\n {request.showSearch ? (\n <view className=\"g9-selection__search\">\n <G9TextEntry\n placeholder={strings.get(G9StringKey.Search)}\n leadingIcon=\"search\"\n value={query}\n onValueChange={onQuery}\n />\n </view>\n ) : null}\n {visible.length > 0 ? (\n <view className=\"g9-selection__items\">\n {request.items.map((item, i) => {\n const id = ids[i] as string;\n if (!visibleIds.has(id)) return null;\n return (\n <SelectionRow\n key={id}\n item={item}\n elementId={g9ChildId(request.options?.automationId, `Item_${item.key ?? i}`)}\n selected={model.isSelected(id)}\n direction={dir}\n onTap={() => tap(id)}\n />\n );\n })}\n </view>\n ) : null}\n {visible.length === 0 ? (\n <text className=\"g9-selection__empty\">{request.emptyText ?? strings.get(G9StringKey.NoResults)}</text>\n ) : null}\n </view>\n );\n}\n\n/**\n * Shows the selection sheet (MAUI `G9SelectionSheet.ShowForResultAsync`): a fit sheet with a header (title near the\n * close button), optional search (150 ms debounce, text match, hidden selected rows stay selected), rows with icon or\n * swatch, check mark and selection tint. Single mode with `closeOnSingleSelection` completes on a pick; multi mode\n * shows a count pill and Done; a reset selection adds Reset. Any dismissal resolves `wasAccepted: false` with the\n * current draft (or the opening selection when the sheet never built).\n */\nexport function showSelectionSheet<T extends G9SelectionItem>(\n sheets: G9SheetService,\n request: G9SelectionSheetRequest<T>,\n): Promise<G9SelectionSheetResult<T>> {\n const items = [...request.items];\n const ids = selectionIdentities(items);\n const opening = request.selectedItems ?? [];\n // Opening items match listed items by identity; the rest are kept as \"not listed\".\n const openingIds = selectionIdentities([...items, ...opening]).slice(items.length);\n const listedIds = new Set(ids);\n const initialKeys = openingIds.filter((id) => listedIds.has(id));\n const unlisted = opening.filter((_, i) => !listedIds.has(openingIds[i] as string));\n const multiple = request.allowMultiple === true;\n const initial = createSelectionModel<T>({\n items,\n getKey: (item) => ids[items.indexOf(item)] as string,\n getText: (item) => item.text,\n mode: multiple ? 'multiple' : 'single',\n selectedKeys: initialKeys,\n isEnabled: (item) => item.isEnabled !== false,\n });\n return new Promise((resolve) => {\n let draft = initial;\n const draftListeners = new Set<() => void>();\n const draftStore = {\n subscribe: (l: () => void) => {\n draftListeners.add(l);\n return () => {\n draftListeners.delete(l);\n };\n },\n count: () => draft.selectedKeys.length,\n };\n let settled = false;\n const done = { current: false };\n const startKeys = new Set(initialKeys);\n const collect = (keys: ReadonlyArray<string>): T[] => {\n const set = new Set(keys);\n return [...items.filter((_, i) => set.has(ids[i] as string)), ...unlisted];\n };\n const settle = (keys: ReadonlyArray<string>, accepted: boolean, explicit?: ReadonlyArray<T>) => {\n if (settled) return;\n settled = true;\n done.current = true;\n const result = explicit ?? collect(keys);\n const changed = explicit !== undefined || keys.length !== startKeys.size || keys.some((k) => !startKeys.has(k));\n resolve({ wasAccepted: accepted, selectionChanged: changed, items: result });\n };\n let handle: G9SheetHandle | null = null;\n const complete = (keys: ReadonlyArray<string>, accepted: boolean) => {\n settle(keys, accepted);\n handle?.close();\n };\n const reset = request.resetSelection && request.resetSelection.length > 0 ? request.resetSelection : null;\n const body = () => (\n <SelectionBody\n request={request}\n ids={ids}\n initial={initial}\n done={done}\n onDraft={(m) => {\n draft = m;\n for (const l of [...draftListeners]) l();\n }}\n onComplete={complete}\n />\n );\n const options: G9SheetOptions = {\n ...fitToContentSheetOptions(),\n deferContent: items.length > g9SelectionEagerBuildItemLimit,\n deferredLoadingPlaceholderHeight: estimateSelectionHeight(items.length, request.showSearch === true),\n loadingSkeleton: 'listRows',\n loadingSkeletonRowCount: items.length,\n backgroundColor: 'var(--g9-surface)',\n showToolbar: true,\n showCloseButton: true,\n title: request.title,\n headerTitlePlacement: 'nearBack',\n ...(multiple || reset\n ? {\n headerTrailingView: (\n <SelectionHeaderActions\n multiple={multiple}\n draft={draftStore}\n {...(request.countLabel ? { countLabel: request.countLabel } : {})}\n onDone={() => complete(draft.selectedKeys, true)}\n {...(reset\n ? {\n onReset: () => {\n settle([], true, reset);\n handle?.close();\n },\n }\n : {})}\n />\n ),\n }\n : {}),\n ...request.options,\n onClosed: () => {\n request.options?.onClosed?.();\n settle(draft.selectedKeys, false);\n },\n };\n handle = sheets.show(items.length > g9SelectionEagerBuildItemLimit ? body : body(), options);\n if (!handle) settle(initialKeys, false);\n });\n}\n\nfunction SelectionHeaderActions(props: {\n readonly multiple: boolean;\n readonly draft: { subscribe(listener: () => void): () => void; count(): number };\n readonly countLabel?: (n: number) => string;\n readonly onDone: () => void;\n readonly onReset?: () => void;\n}): ReactNode {\n const strings = useG9Strings();\n const direction = useG9Direction();\n const n = useSyncExternalStore(props.draft.subscribe, props.draft.count);\n return (\n <view className=\"g9-selection__actions\" style={g9RowStyle(direction)}>\n {props.onReset ? (\n <G9Button text={strings.get(G9StringKey.Reset)} variant=\"text\" size=\"small\" onPress={props.onReset} />\n ) : null}\n {props.multiple && n > 0 ? (\n <view className=\"g9-selection__count\">\n <text className=\"g9-selection__count-text\">\n {props.countLabel ? props.countLabel(n) : `${n} ${strings.get(G9StringKey.Selected)}`}\n </text>\n </view>\n ) : null}\n {props.multiple ? (\n <G9Button text={strings.get(G9StringKey.Done)} variant=\"text\" size=\"small\" onPress={props.onDone} />\n ) : null}\n </view>\n );\n}\n\n/** Arguments of {@link showListSheet} (MAUI `ShowListG9BottomSheetAsync`). */\nexport interface G9ListSheetRequest<T extends G9SelectionItem> {\n readonly title: string;\n readonly items: ReadonlyArray<T>;\n readonly selected?: ReadonlyArray<T>;\n readonly multiple?: boolean;\n /** Default true. */\n readonly closeOnSingleSelection?: boolean;\n /** Shows the search field (250 ms debounce, trimmed) with this placeholder. */\n readonly searchPlaceholder?: string | null;\n /** Default full screen without a handle (MAUI). A fit-to-content `sizeMode` keeps the sheet compact. */\n readonly options?: G9SheetOptions;\n /** Apply button text (multi). Default the `save` string. */\n readonly applyButtonText?: string;\n}\n\n/**\n * The shared list picker (MAUI `ShowListG9BottomSheetAsync` / `G9BottomSheetListPickerModal`): search field with\n * placeholder, rows with a selection tint (no check mark), Apply in multi mode, close-on-select after 120 ms. Resolves\n * with the selection when it completes or closes (no accepted/dismissed distinction, as MAUI); `[]` when throttled.\n */\nexport function showListSheet<T extends G9SelectionItem>(\n sheets: G9SheetService,\n request: G9ListSheetRequest<T>,\n): Promise<T[]> {\n const items = [...request.items];\n const keyOf = (item: G9SelectionItem) => (item.key != null && item.key.trim() !== '' ? item.key : item.text);\n const multiple = request.multiple === true;\n const initial = createSelectionModel<T>({\n items,\n getKey: keyOf,\n getText: (item) => item.text,\n mode: multiple ? 'multiple' : 'single',\n selectedKeys: (request.selected ?? []).map(keyOf),\n isEnabled: (item) => item.isEnabled !== false,\n });\n return new Promise((resolve) => {\n let draft = initial;\n let settled = false;\n let handle: G9SheetHandle | null = null;\n const settle = () => {\n if (settled) return;\n settled = true;\n resolve(draft.selectedItems());\n };\n const complete = () => {\n settle();\n handle?.close();\n };\n const body = () => (\n <ListPickerBody\n request={request}\n initial={initial}\n keyOf={keyOf}\n onDraft={(m) => {\n draft = m;\n }}\n onComplete={complete}\n />\n );\n const base = request.options ?? fullScreenWithoutHandleSheetOptions();\n const fit = base.sizeMode === 'fitToContent';\n const options: G9SheetOptions = {\n ...base,\n ...(fit\n ? {}\n : {\n states: ['large'],\n currentState: 'large',\n hasHandle: false,\n isDraggable: true,\n useFullScreenLoadingPlaceholder: true,\n }),\n showToolbar: true,\n showCloseButton: true,\n title: request.title,\n headerTitlePlacement: 'nearBack',\n deferContent: true,\n onClosed: () => {\n base.onClosed?.();\n settle();\n },\n };\n handle = sheets.show(body, options);\n if (!handle) {\n settled = true;\n resolve([]);\n }\n });\n}\n\nfunction ListPickerBody<T extends G9SelectionItem>(props: {\n readonly request: G9ListSheetRequest<T>;\n readonly initial: G9SelectionModel<T>;\n readonly keyOf: (item: G9SelectionItem) => string;\n readonly onDraft: (model: G9SelectionModel<T>) => void;\n readonly onComplete: () => void;\n}): ReactNode {\n const strings = useG9Strings();\n const palette = useG9Theme().palette;\n const [model, setModel] = useState(props.initial);\n const [query, setQuery] = useState('');\n const picking = useRef(false);\n const { request } = props;\n const visible = model.filter(query, { trim: true });\n const tap = (item: T) => {\n if (picking.current || item.isEnabled === false) return;\n const next = model.toggle(props.keyOf(item));\n setModel(next);\n props.onDraft(next);\n if (!request.multiple && request.closeOnSingleSelection !== false) {\n picking.current = true;\n startTimer(props.onComplete, g9SelectionCloseDelayMs);\n }\n };\n return (\n <view className=\"g9-list-picker\">\n {request.searchPlaceholder ? (\n <view className=\"g9-selection__search\">\n <G9SearchEntry\n placeholder={request.searchPlaceholder}\n voiceEnabled={false}\n onDebouncedValueChange={setQuery}\n />\n </view>\n ) : null}\n {visible.map((item) => (\n <ListPickerRow\n key={props.keyOf(item)}\n item={item}\n selected={model.isSelected(props.keyOf(item))}\n tint={palette.PrimaryContainer}\n onTap={() => tap(item)}\n />\n ))}\n {request.multiple ? (\n <view className=\"g9-list-picker__apply\">\n <G9Button\n text={request.applyButtonText ?? strings.get(G9StringKey.Save)}\n size=\"hero\"\n onPress={props.onComplete}\n />\n </view>\n ) : null}\n </view>\n );\n}\n\nfunction ListPickerRow(props: {\n readonly item: G9SelectionItem;\n readonly selected: boolean;\n readonly tint: string;\n readonly onTap: () => void;\n}): ReactNode {\n const press = useG9Press(props.onTap, {\n source: 'G9ListPicker',\n guardMs: 0,\n blocked: props.item.isEnabled === false,\n });\n const icon = { icon: props.item.icon, imagePath: props.item.iconPath, image: props.item.iconImage };\n const direction = useG9Direction();\n return (\n <view\n className={`g9-list-picker__row${props.selected ? ' g9-list-picker__row--selected' : ''}`}\n style={{ ...g9RowStyle(direction), ...(props.selected ? { backgroundColor: props.tint } : {}) }}\n accessibility-element={true}\n accessibility-traits=\"button\"\n accessibility-label={props.item.text}\n bindtap={press}\n >\n {hasIconSlot(icon) ? <G9IconSlot {...icon} size={20} color=\"var(--g9-on-surface-variant)\" /> : null}\n <text className=\"g9-list-picker__text\" text-maxline=\"1\" style={g9TextStart(direction)}>\n {props.item.text}\n </text>\n </view>\n );\n}\n"],"names":["g9SelectionEagerBuildItemLimit","g9SelectionRowHeight","g9SelectionSearchDebounceMs","g9SelectionCloseDelayMs","selectionIdentities","items","counts","Map","item","_counts_get","i","estimateSelectionHeight","count","showSearch","chrome","Math","SelectionRow","props","_item_iconTintColor","_item_swatchFirstColor","_item_swatchSecondColor","palette","useG9Theme","glyphs","useG9Settings","selected","press","useG9Press","icon","iconColor","view","formatColor","withAlpha","g9RowStyle","hasIconSlot","G9IconSlot","G9Swatch","text","g9TextStart","SelectionBody","_request_emptyText","strings","useG9Strings","parentDir","useG9Direction","request","ids","model","setModel","useState","query","setQuery","applied","setApplied","timer","useRef","picking","useEffect","stopTimer","visible","visibleIds","Set","dir","multiple","onQuery","value","startTimer","tap","id","next","G9TextEntry","G9StringKey","_item_key","_request_options","g9ChildId","showSelectionSheet","sheets","_request_selectedItems","opening","openingIds","listedIds","initialKeys","unlisted","_","initial","createSelectionModel","Promise","resolve","draft","draftListeners","draftStore","l","settled","done","startKeys","collect","keys","set","settle","accepted","explicit","result","changed","undefined","k","handle","complete","reset","body","m","options","fitToContentSheetOptions","SelectionHeaderActions","direction","n","useSyncExternalStore","G9Button","showListSheet","_request_selected","keyOf","ListPickerBody","base","fullScreenWithoutHandleSheetOptions","fit","_request_applyButtonText","G9SearchEntry","ListPickerRow"],"mappings":";;;;;;;;;;;;;;AAmBO,MAAMA,iCAAiC;AAEvC,MAAMC,uBAAuB;AAE7B,MAAMC,8BAA8B;AAEpC,MAAMC,0BAA0B;AAiBhC,SAASC,oBAAoBC,KAAqC;IACvE,MAAMC,SAAS,IAAIC;IACnB,KAAK,MAAMC,QAAQH,MAAO;YAC+CI;QAAvE,IAAID,AAAY,QAAZA,KAAK,GAAG,IAAYA,AAAoB,OAApBA,KAAK,GAAG,CAAC,IAAI,IAAWF,OAAO,GAAG,CAACE,KAAK,IAAI,EAAE,AAAC,SAAAC,CAAAA,cAAAA,OAAO,GAAG,CAACD,KAAK,IA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IAAI,EAAE,MAAM,IAAI,MAAM,mCAAoC,KAAK;MACpG,CAACS,KAAK,UAAU,uBAAuB,aAAa,IAAI,OAAOC,YAAY2E,YAAY;QACrF,CAAChG,MAAM,IAAI,CAAC,IAAI,CAAC;MACnB,EAAEoB,KAAK;IACT,EAAEP;AAEN"}
|
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
display: flex;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
+
.g9-selection {
|
|
7
|
+
padding-bottom: 4px;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.g9-selection__items {
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
padding: 4px 0;
|
|
13
|
+
display: flex;
|
|
14
|
+
}
|
|
15
|
+
|
|
6
16
|
.g9-selection__search {
|
|
7
17
|
padding: 8px 12px;
|
|
8
18
|
}
|
|
@@ -22,6 +32,11 @@
|
|
|
22
32
|
display: flex;
|
|
23
33
|
}
|
|
24
34
|
|
|
35
|
+
.g9-selection-row__icon-gap {
|
|
36
|
+
width: 0;
|
|
37
|
+
height: 1px;
|
|
38
|
+
}
|
|
39
|
+
|
|
25
40
|
.g9-selection-row__text {
|
|
26
41
|
text-overflow: ellipsis;
|
|
27
42
|
flex: 1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack://./src/selection/selection.css"],"names":[],"mappings":"AACA;EAAE,sBAAsB;EACtB,aAAa;AACf;;
|
|
1
|
+
{"version":3,"sources":["webpack://./src/selection/selection.css"],"names":[],"mappings":"AACA;EAAE,sBAAsB;EACtB,aAAa;AACf;;AAMA;EAHE,mBAAmB;AACrB;;AAMA;EAHE,sBAAsB;EACtB,cAAc;EACd,aAAa;AACf;;AAMA;EAHE,iBAAiB;AACnB;;AAQA;EALE,sBAAsB;EACtB,uBAAuB;EACvB,gBAAgB;EAChB,aAAa;AACf;;AAQA;EALE,mBAAmB;EACnB,mBAAmB;EACnB,gBAAgB;EAChB,eAAe;EACf,aAAa;AACf;;AAQA;EALE,QAAQ;EACR,WAAW;AACb;;AAQA;EALE,uBAAuB;EACvB,OAAO;EACP,eAAe;AACjB;;AAQA;EALE,kBAAkB;EAClB,8BAA8B;EAC9B,kBAAkB;EAClB,eAAe;AACjB;;AAQA;EALE,mBAAmB;EACnB,mBAAmB;EACnB,eAAe;EACf,aAAa;AACf;;AAQA;EALE,6CAA6C;EAC7C,mBAAmB;EACnB,gBAAgB;AAClB;;AAQA;EALE,qCAAqC;EACrC,eAAe;AACjB;;AAQA;EALE,mBAAmB;EACnB,mBAAmB;EACnB,gBAAgB;EAChB,gBAAgB;EAChB,eAAe;EACf,aAAa;AACf;;AAQA;EALE,6BAA6B;EAC7B,OAAO;EACP,eAAe;AACjB;;AAQA;EALE,kBAAkB;AACpB","sourcesContent":["/* Selection sheet and list picker (MAUI G9SelectionSheet, G9BottomSheetListPickerModal). */\n.g9-selection,\n.g9-list-picker {\n display: flex;\n flex-direction: column;\n}\n\n/* MAUI G9SelectionSheet: the sheet's Padding (0, 0, 0, 4) and the rows host's Padding (0, 4, 0, 4) — 4 dp between the\n header and the first row, 8 dp under the last. */\n.g9-selection {\n padding-bottom: 4px;\n}\n\n.g9-selection__items {\n display: flex;\n flex-direction: column;\n padding: 4px 0px;\n}\n\n.g9-selection__search {\n padding: 8px 12px;\n}\n\n/* A column: the inner row stretches to the full width and is centred VERTICALLY (as a row container, the inner row\n was centred horizontally — icon, text and check bunched in the middle of the sheet). */\n.g9-selection-row {\n min-height: 52px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n}\n\n.g9-selection-row__inner {\n display: flex;\n flex-direction: row;\n align-items: center;\n column-gap: 12px;\n padding: 0px 16px;\n}\n\n.g9-selection-row__icon-gap {\n width: 0px;\n height: 1px;\n}\n\n.g9-selection-row__text {\n flex: 1;\n font-size: 14px;\n text-overflow: ellipsis;\n}\n\n.g9-selection__empty {\n padding: 28px 16px;\n font-size: 13px;\n text-align: center;\n color: var(--g9-text-tertiary);\n}\n\n.g9-selection__actions {\n display: flex;\n flex-direction: row;\n align-items: center;\n column-gap: 8px;\n}\n\n.g9-selection__count {\n padding: 2px 8px;\n border-radius: 10px;\n background-color: var(--g9-primary-container);\n}\n\n.g9-selection__count-text {\n font-size: 12px;\n color: var(--g9-on-primary-container);\n}\n\n.g9-list-picker__row {\n display: flex;\n flex-direction: row;\n align-items: center;\n column-gap: 10px;\n min-height: 52px;\n padding: 0px 16px;\n}\n\n.g9-list-picker__text {\n flex: 1;\n font-size: 14px;\n color: var(--g9-text-primary);\n}\n\n.g9-list-picker__apply {\n padding: 12px 16px;\n}\n"],"sourceRoot":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frame.d.ts","sourceRoot":"","sources":["../../src/sheet/frame.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AACrB,OAAO,EAIL,KAAK,aAAa,EAInB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAiB,KAAK,SAAS,EAA2C,MAAM,gBAAgB,CAAC;AASxG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEvD,OAAO,KAAK,EAAiB,eAAe,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"frame.d.ts","sourceRoot":"","sources":["../../src/sheet/frame.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AACrB,OAAO,EAIL,KAAK,aAAa,EAInB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAiB,KAAK,SAAS,EAA2C,MAAM,gBAAgB,CAAC;AASxG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEvD,OAAO,KAAK,EAAiB,eAAe,EAAE,MAAM,WAAW,CAAC;AAchE,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEzE,qGAAqG;AACrG,MAAM,WAAW,mBAAmB;IAClC,iEAAiE;IACjE,QAAQ,CAAC,MAAM,EA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ch.jsx";
|
|
10
10
|
import { useG9Theme } from "../provider/hooks.jsx";
|
|
11
11
|
import { G9SheetGestureFrame, useSheetBodyGesture, useSheetGestureRefs } from "./gesture.jsx";
|
|
12
|
-
import { G9SheetFooter, G9SheetHeader
|
|
12
|
+
import { G9SheetFooter, G9SheetHeader } from "./header.jsx";
|
|
13
13
|
import { resolveSheetMotion } from "./motion.jsx";
|
|
14
|
-
import { clampFitHeight, currentPlatform, g9SheetDragCloseThreshold, g9SheetFitLoadingMinHeight, parentRecedeOffset, platformSheetConstraints, resolveSheetLayout, sheetOverlayOpacity, sheetSurfaceBottomPadding, sheetSurfaceTopPadding } from "./sizing.jsx";
|
|
14
|
+
import { clampFitHeight, currentPlatform, g9SheetDragCloseThreshold, g9SheetFitLoadingMinHeight, g9SheetFitMinHeight, parentRecedeOffset, platformSheetConstraints, resolveSheetLayout, sheetOverlayOpacity, sheetSurfaceBottomPadding, sheetSurfaceTopPadding } from "./sizing.jsx";
|
|
15
15
|
const SheetContext = createContext(null);
|
|
16
16
|
function useG9SheetContext() {
|
|
17
17
|
return useContext(SheetContext);
|
|
@@ -102,6 +102,12 @@ function G9SheetFrame(props) {
|
|
|
102
102
|
const placeholderHeight = o.useFullScreenLoadingPlaceholder ? props.hostHeight : null != (_ref = null != (_o_deferredLoadingPlaceholderHeight = o.deferredLoadingPlaceholderHeight) ? _o_deferredLoadingPlaceholderHeight : memoKey ? null == (_props_memo = props.memo) ? void 0 : _props_memo.lookup(memoKey) : void 0) ? _ref : g9SheetFitLoadingMinHeight;
|
|
103
103
|
const [bodyHeight, setBodyHeight] = useState(0);
|
|
104
104
|
const [footerHeight, setFooterHeight] = useState(0);
|
|
105
|
+
const [chromeTopHeight, setChromeTopHeight] = useState(0);
|
|
106
|
+
const onChromeTopLayout = (e)=>{
|
|
107
|
+
var _ref;
|
|
108
|
+
var _e_detail;
|
|
109
|
+
return setChromeTopHeight(Math.max(0, null != (_ref = null == (_e_detail = e.detail) ? void 0 : _e_detail.height) ? _ref : 0));
|
|
110
|
+
};
|
|
105
111
|
const onFooterLayout = (e)=>{
|
|
106
112
|
var _ref;
|
|
107
113
|
var _e_detail;
|
|
@@ -125,17 +131,10 @@ function G9SheetFrame(props) {
|
|
|
125
131
|
<G9ActivityIndicator running size={32}/>
|
|
126
132
|
</view>;
|
|
127
133
|
const body = revealed ? factory ? entry.content() : entry.content : null;
|
|
128
|
-
const maxBody = layout.fitMaxHeight;
|
|
129
|
-
const contextValue = {
|
|
130
|
-
handle,
|
|
131
|
-
signal: controller.current.signal,
|
|
132
|
-
opened: 'open' === entry.status,
|
|
133
|
-
closing,
|
|
134
|
-
maxBodyHeight: maxBody
|
|
135
|
-
};
|
|
136
134
|
const ratios = layout.snapPoints.map((p)=>'number' == typeof p ? p / Math.max(1, props.hostHeight) : 'fit' === p ? 0.5 : Number.parseFloat(p) / 100);
|
|
137
135
|
const restingRatio = null != (_ratios_layout_initialSnap = ratios[layout.initialSnap]) ? _ratios_layout_initialSnap : 1;
|
|
138
|
-
const
|
|
136
|
+
const shown = null !== layout.fitMaxHeight ? Math.min(bodyHeight, layout.fitMaxHeight) : bodyHeight;
|
|
137
|
+
const contentRatio = bodyHeight > 0 ? Math.min(1, shown / Math.max(1, props.hostHeight)) : 0.5;
|
|
139
138
|
const opacity = entry.handingOff ? 0 : layout.fit ? contentRatio >= 0.99 ? settings.modalOverlayMaximumOpacity : settings.modalOverlayMinimumOpacity : sheetOverlayOpacity(restingRatio, ratios, settings.modalOverlayMinimumOpacity, settings.modalOverlayMaximumOpacity);
|
|
140
139
|
const modal = false !== o.isModal;
|
|
141
140
|
const recede = entry.receded ? {
|
|
@@ -166,6 +165,14 @@ function G9SheetFrame(props) {
|
|
|
166
165
|
]);
|
|
167
166
|
const topPadding = sheetSurfaceTopPadding(o, layout, resting, props.topInset, props.hostHeight);
|
|
168
167
|
const bottomPadding = sheetSurfaceBottomPadding(o, null != (_props_bottomInset = props.bottomInset) ? _props_bottomInset : 0);
|
|
168
|
+
const maxBody = null === layout.fitMaxHeight ? null : Math.max(g9SheetFitMinHeight, layout.fitMaxHeight - chromeTopHeight - footerHeight - topPadding - bottomPadding);
|
|
169
|
+
const contextValue = {
|
|
170
|
+
handle,
|
|
171
|
+
signal: controller.current.signal,
|
|
172
|
+
opened: 'open' === entry.status,
|
|
173
|
+
closing,
|
|
174
|
+
maxBodyHeight: maxBody
|
|
175
|
+
};
|
|
169
176
|
const platform = currentPlatform();
|
|
170
177
|
const phone = 'android' === platform || 'ios' === platform;
|
|
171
178
|
const openMs = null != (_o_openAnimationDurationMs = o.openAnimationDurationMs) ? _o_openAnimationDurationMs : settings.openAnimationDurationMs;
|
|
@@ -211,7 +218,7 @@ function G9SheetFrame(props) {
|
|
|
211
218
|
<SheetView className={`g9-sheet__view${modal ? '' : ' g9-sheet__view--passthrough'}`} nativeProps={{
|
|
212
219
|
'event-through': modal
|
|
213
220
|
}}>
|
|
214
|
-
{modal ? <view event-through={false} className={`g9-sheet__scrim${props.isTop && !closing ? '' : ' g9-sheet__scrim--covered'}`} style={{
|
|
221
|
+
{modal ? <view event-through={false} flatten={false} className={`g9-sheet__scrim${props.isTop && !closing ? '' : ' g9-sheet__scrim--covered'}`} style={{
|
|
215
222
|
backgroundColor: scrimColor(entry, settings, opacity),
|
|
216
223
|
transition: 'ios' === platform && false === o.animateOverlayToColorOnIos ? 'none' : `background-color ${closing ? closeMs : openMs}ms`
|
|
217
224
|
}} bindtap={()=>{
|
|
@@ -232,13 +239,13 @@ function G9SheetFrame(props) {
|
|
|
232
239
|
...notch
|
|
233
240
|
}}>
|
|
234
241
|
<SheetContext.Provider value={contextValue}>
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
+
<view className="g9-sheet__chrome-top" bindlayoutchange={onChromeTopLayout}>
|
|
243
|
+
{layout.showHandle || layout.fullScreen && o.showToolbar && false !== o.showFullScreenDragHandle && !layout.dragDisabled ? <view className="g9-sheet__grabber-area">
|
|
244
|
+
<view className="g9-sheet__grabber"/>
|
|
245
|
+
</view> : null}
|
|
246
|
+
<G9SheetHeader options={o} onBack={()=>void stack.requestBack(entry.id, 'toolbarButton')}/>
|
|
247
|
+
{o.showToolbar && false !== o.useStandardBodyTopGap ? <view className="g9-sheet__body-gap"/> : null}
|
|
248
|
+
</view>
|
|
242
249
|
{false === o.scrollBody ? <view className={`g9-sheet__body g9-sheet__body--static${layout.fillBody ? ' g9-sheet__body--fill' : ''}`} style={{
|
|
243
250
|
padding: `${null != (_o_padding = o.padding) ? _o_padding : 0}px`
|
|
244
251
|
}}>
|
package/dist/sheet/frame.jsx.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sheet/frame.jsx","sources":["../../src/sheet/frame.tsx"],"sourcesContent":["import './sheet.css';\nimport {\n createAbortController,\n formatColor,\n type G9AbortController,\n type G9AbortSignal,\n resolveThemeColor,\n tryParseColor,\n withAlpha,\n} from '@g9tm/lynxcontrols-foundation';\nimport { SheetContent, SheetRoot, type SheetRootRef, SheetView } from '@lynx-js/lynx-ui-sheet';\nimport { createContext, type ReactNode, useContext, useEffect, useRef, useState } from '@lynx-js/react';\nimport { g9IdProps } from '../base/control';\nimport { type G9TimerHandle, startTimer, stopTimer } from '../base/timers';\nimport { G9ActivityIndicator } from '../display/activity-indicator';\nimport { G9SheetSkeleton } from '../display/shimmer';\nimport { g9FieldNotchStyle } from '../fields/notch';\nimport { useG9Theme } from '../provider/hooks';\nimport { G9SheetGestureFrame, useSheetBodyGesture, useSheetGestureRefs } from './gesture';\nimport { G9SheetFooter, G9SheetHeader, g9SheetHeaderMetrics } from './header';\nimport type { G9SheetHeightMemo } from './height-memo';\nimport { resolveSheetMotion } from './motion';\nimport type { G9SheetDetent, G9SheetSettings } from './options';\nimport {\n clampFitHeight,\n currentPlatform,\n g9SheetDragCloseThreshold,\n g9SheetFitLoadingMinHeight,\n parentRecedeOffset,\n platformSheetConstraints,\n resolveSheetLayout,\n sheetOverlayOpacity,\n sheetSurfaceBottomPadding,\n sheetSurfaceTopPadding,\n} from './sizing';\nimport type { G9SheetEntry, G9SheetHandle, G9SheetStack } from './stack';\n\n/** What content inside a sheet can read (MAUI `IG9BottomSheetAwareView` + deferred load signals). */\nexport interface G9SheetContextValue {\n /** The sheet-scoped handle: `close()` closes only this sheet. */\n readonly handle: G9SheetHandle;\n /** Aborted when the sheet starts closing (cancel loads with it). */\n readonly signal: G9AbortSignal;\n /** The open motion has finished. */\n readonly opened: boolean;\n /** The sheet is closing. */\n readonly closing: boolean;\n /** Resting body cap of a fit sheet (px), else `null`. */\n readonly maxBodyHeight: number | null;\n}\n\nconst SheetContext = createContext<G9SheetContextValue | null>(null);\n\n/** The enclosing sheet, or `null` outside one. */\nexport function useG9SheetContext(): G9SheetContextValue | null {\n return useContext(SheetContext);\n}\n\n/** Props of {@link G9SheetFrame}. */\nexport interface G9SheetFrameProps {\n readonly entry: G9SheetEntry;\n readonly stack: G9SheetStack;\n /** Host height (px): percentage detents and caps resolve against it. */\n readonly hostHeight: number;\n readonly hostWidth: number;\n readonly topInset: number;\n /** The host's bottom safe inset (a visible navigation bar); the surface pads by it. Default 0. */\n readonly bottomInset?: number;\n readonly settings: Required<G9SheetSettings>;\n readonly memo: G9SheetHeightMemo | null;\n /** Culture tag of the memo key. */\n readonly culture: string;\n /** The sheet is the top of the stack (receives scrim input). */\n readonly isTop: boolean;\n /** The sheet came to rest at a new height (px); drives the page recede threshold. */\n readonly onRest?: (heightPx: number) => void;\n}\n\nfunction scrimColor(entry: G9SheetEntry, settings: Required<G9SheetSettings>, opacity: number): string {\n const explicit = entry.options.windowBackgroundColor;\n const parsed = tryParseColor(explicit ?? settings.modalOverlayColor);\n if (!parsed) return explicit ?? settings.modalOverlayColor;\n return formatColor(withAlpha(parsed, explicit ? parsed.a : opacity));\n}\n\n/** lynx-ui's inner view lays G9's frame out as a column (its default `linear` layout ignores `flex`). */\nconst sheetInnerStyle = { display: 'flex', flexDirection: 'column' } as const;\n/** The receded parent sinks and fades over 220 ms (MAUI `StackParentRecedeDurationMs`, CubicOut). */\nconst g9SheetRecedeTransition = 'transform 220ms ease-out, opacity 220ms ease-out';\n\n/** The sheet's detents, small to large (the order of lynx-ui's snap points). */\nfunction orderedDetents(o: G9SheetEntry['options']): G9SheetDetent[] {\n const requested = o.states && o.states.length > 0 ? o.states : (['medium', 'large'] as const);\n return (['peek', 'medium', 'large'] as const).filter((d) => requested.includes(d));\n}\n\n/** The detent a sheet opens at (`'fit'` for fit-to-content). */\nfunction initialDetent(o: G9SheetEntry['options'], fit: boolean): G9SheetDetent | 'fit' {\n if (fit) return 'fit';\n const ordered = orderedDetents(o);\n const current = o.currentState ?? 'medium';\n return ordered.includes(current) ? current : (ordered[0] ?? 'medium');\n}\n\n/**\n * One sheet of the stack on lynx-ui `SheetRoot` (motion, drag, snap points from lynx-ui; G9 adds detent mapping,\n * scrim, header/footer, deferred content, recede and results). Rendered by the sheet service in the host's sheets\n * layer; use `useG9Sheets()` to open sheets.\n */\nexport function G9SheetFrame(props: G9SheetFrameProps): ReactNode {\n const { entry, stack, settings } = props;\n const palette = useG9Theme().palette;\n const gesture = useSheetGestureRefs();\n const bodyGesture = useSheetBodyGesture(gesture);\n const o = entry.options;\n const layout = resolveSheetLayout(o, props.hostHeight);\n const showing = entry.status === 'opening' || entry.status === 'open';\n const closing = entry.status === 'closing';\n const handle = stack.handleOf(entry.id) as G9SheetHandle;\n\n const controller = useRef<G9AbortController | null>(null);\n if (controller.current === null) controller.current = createAbortController();\n useEffect(() => {\n if (closing || entry.status === 'closed') controller.current?.abort();\n }, [closing, entry.status]);\n useEffect(() => () => controller.current?.abort(), []);\n\n // Deferred (factory) content: placeholder until the open motion ended + loadDelayMs, then the body.\n const factory = typeof entry.content === 'function';\n const deferred = (factory || settings.deferPrebuiltContent) && o.deferContent !== false;\n const [revealed, setRevealed] = useState(!deferred);\n const [covering, setCovering] = useState(false);\n const timer = useRef<G9TimerHandle | null>(null);\n const coverTimer = useRef<G9TimerHandle | null>(null);\n useEffect(\n () => () => {\n if (coverTimer.current !== null) stopTimer(coverTimer.current);\n },\n [],\n );\n useEffect(() => {\n if (!deferred || revealed || entry.status !== 'open') return;\n const delay = layout.fullScreen\n ? Math.max(o.loadDelayMs ?? 369, settings.openAnimationDurationMs + 32)\n : (o.loadDelayMs ?? 369);\n timer.current = startTimer(() => {\n setRevealed(true);\n if (o.fadeDeferredContentIn !== false) {\n setCovering(true);\n coverTimer.current = startTimer(() => setCovering(false), 220);\n }\n }, delay);\n return () => {\n if (timer.current !== null) stopTimer(timer.current);\n };\n }, [deferred, revealed, entry.status]);\n\n const memoKey = o.heightMemoKey ? `${o.heightMemoKey}|w${Math.round(props.hostWidth)}|${props.culture}|fs1` : null;\n const placeholderHeight = o.useFullScreenLoadingPlaceholder\n ? props.hostHeight\n : (o.deferredLoadingPlaceholderHeight ??\n (memoKey ? props.memo?.lookup(memoKey) : undefined) ??\n g9SheetFitLoadingMinHeight);\n\n const [bodyHeight, setBodyHeight] = useState(0);\n // The footer can come and go after the open (a `footerBand` whose buttons wait for data): it counts for the fit too.\n const [footerHeight, setFooterHeight] = useState(0);\n const onFooterLayout = (e: { detail?: { height?: number } }) => setFooterHeight(Math.max(0, e.detail?.height ?? 0));\n const onBodyLayout = (e: { detail?: { height?: number } }) => {\n const h = e.detail?.height ?? 0;\n if (h <= 0) return;\n setBodyHeight(h);\n if (memoKey && revealed && !covering) props.memo?.record(memoKey, h);\n };\n\n const placeholder =\n o.loadingSkeleton && o.loadingSkeleton !== 'none' ? (\n <view className=\"g9-sheet__placeholder\" style={{ height: `${placeholderHeight}px` }}>\n <G9SheetSkeleton skeleton={o.loadingSkeleton} rowCount={o.loadingSkeletonRowCount ?? 0} />\n </view>\n ) : (\n <view\n className=\"g9-sheet__placeholder g9-sheet__placeholder--spinner\"\n style={{ height: `${placeholderHeight}px` }}\n >\n <G9ActivityIndicator running size={32} />\n </view>\n );\n const body = revealed ? (factory ? (entry.content as () => ReactNode)() : (entry.content as ReactNode)) : null;\n\n const maxBody = layout.fitMaxHeight;\n const contextValue: G9SheetContextValue = {\n handle,\n signal: (controller.current as G9AbortController).signal,\n opened: entry.status === 'open',\n closing,\n maxBodyHeight: maxBody,\n };\n\n // Scrim: the resting dim of the detent (one detent → max; several → interpolated at the initial detent). A fit sheet\n // ranges from its content height to full screen (MAUI ResolveModalOverlayOpacity), so at rest it dims at the\n // MINIMUM — unless its content fills the screen (MAUI's single-state range).\n const ratios = layout.snapPoints.map((p) =>\n typeof p === 'number' ? p / Math.max(1, props.hostHeight) : p === 'fit' ? 0.5 : Number.parseFloat(p) / 100,\n );\n const restingRatio = ratios[layout.initialSnap] ?? 1;\n const contentRatio = bodyHeight > 0 ? Math.min(1, bodyHeight / Math.max(1, props.hostHeight)) : 0.5;\n const opacity = entry.handingOff\n ? 0\n : layout.fit\n ? contentRatio >= 0.99\n ? settings.modalOverlayMaximumOpacity\n : settings.modalOverlayMinimumOpacity\n : sheetOverlayOpacity(\n restingRatio,\n ratios,\n settings.modalOverlayMinimumOpacity,\n settings.modalOverlayMaximumOpacity,\n );\n const modal = o.isModal !== false;\n // The receded parent sinks and fades (MAUI stack recede). This runs on G9's own frame view, never on lynx-ui's\n // SheetContent view: lynx-ui moves that one from a main-thread worklet, and an inline style written over it from\n // here put the parent back at its closed offset when the child closed (the parent vanished, its scrim stayed).\n const recede = entry.receded\n ? { transform: `translateY(${parentRecedeOffset(bodyHeight || props.hostHeight * 0.5)}px)`, opacity: 0 }\n : { transform: 'translateY(0px)', opacity: 1 };\n const [resting, setResting] = useState<G9SheetDetent | 'fit'>(() => initialDetent(o, layout.fit));\n\n // A fit sheet whose body grows or shrinks AFTER it opened (rows that load later, a spinner replaced by content):\n // lynx-ui re-measures the 'fit' snap point on layout but leaves the sheet where it was, so a taller body ran off the\n // bottom of the screen (its footer unreachable). Re-snap to the new fit while the sheet rests there.\n const rootRef = useRef<SheetRootRef | null>(null);\n const lastFitBody = useRef(0);\n useEffect(() => {\n if (!layout.fit || bodyHeight <= 0 || entry.status !== 'open' || resting !== 'fit') return;\n // Also right after the open motion: the body may have grown while the sheet was still sliding in.\n const fitHeight = bodyHeight + footerHeight;\n if (Math.abs(lastFitBody.current - fitHeight) < 1) return;\n lastFitBody.current = fitHeight;\n rootRef.current?.snapTo(0, { animate: true });\n }, [bodyHeight, footerHeight, entry.status, resting, layout.fit]);\n const topPadding = sheetSurfaceTopPadding(o, layout, resting, props.topInset, props.hostHeight);\n const bottomPadding = sheetSurfaceBottomPadding(o, props.bottomInset ?? 0);\n const platform = currentPlatform();\n // The body reports its scroll offset to the gesture routing on the main thread (./gesture.tsx) on the phones only:\n // Lynxtron (desktop) drops the WHOLE sheet, no element of it is created, when the body's scroll-view carries\n // `main-thread:bindscroll` (the gallery smoke, Azure build 614). On the desktop a wheel scrolls the body.\n const phone = platform === 'android' || platform === 'ios';\n const openMs = o.openAnimationDurationMs ?? settings.openAnimationDurationMs;\n const closeMs = o.closeAnimationDurationMs ?? settings.closeAnimationDurationMs;\n const corner =\n platform === 'android' && o.androidShouldRemoveExpandedCorners === true && layout.fullScreen\n ? 0\n : (o.cornerRadius ?? 12);\n const surface = o.backgroundColor ?? 'var(--g9-surface-container)';\n // Fields in the sheet hide their outline under a floated label with the sheet's colour, not the page's.\n const notch = g9FieldNotchStyle(resolveThemeColor(surface, palette));\n // Motion (MAUI G9SheetMotionModel, ./motion.ts): Material's settle on Android, the UIKit spring on iOS, or the timed\n // cubic; the travel is the share of the host the sheet covers where it rests (a fit sheet: its measured body).\n const detents = orderedDetents(o);\n const restIndex = layout.fit ? 0 : Math.max(0, detents.indexOf(resting as G9SheetDetent));\n const fitRatio =\n bodyHeight > 0 ? Math.min(1, (bodyHeight + topPadding + bottomPadding) / Math.max(1, props.hostHeight)) : 0.4;\n const openRatio = layout.fit ? fitRatio : (ratios[restIndex] ?? restingRatio);\n const motion = resolveSheetMotion({\n style: settings.motionStyle,\n platform,\n openRatio,\n snapRatio: ratios.length > 1 ? Math.max(...ratios) - Math.min(...ratios) : openRatio,\n openMs,\n closeMs,\n perSheetOpen: o.openAnimationDurationMs != null,\n perSheetClose: o.closeAnimationDurationMs != null,\n sizeScaled: settings.sizeScaledAnimationDuration,\n });\n // The body's content; inside a scroller by default, or filling a static body (`scrollBody: false`).\n const content = (\n <view\n className={`g9-sheet__content${o.scrollBody === false ? ' g9-sheet__content--fill' : ''}`}\n key={entry.version}\n bindlayoutchange={onBodyLayout}\n >\n {body}\n {!revealed ? placeholder : null}\n {covering ? (\n <view\n className=\"g9-sheet__cover\"\n style={{ height: `${clampFitHeight(placeholderHeight, props.hostHeight, true)}px` }}\n >\n {placeholder}\n </view>\n ) : null}\n </view>\n );\n return (\n <SheetRoot\n ref={rootRef}\n show={showing}\n snapPoints={layout.snapPoints}\n initialSnap={layout.initialSnap}\n screenHeight={props.hostHeight}\n dragDisabled={layout.dragDisabled}\n enableDragToClose={layout.enableDragToClose}\n dismissThreshold={g9SheetDragCloseThreshold}\n // G9 routes every touch itself (./gesture.tsx: drag vs. body scroll, N-028); lynx-ui's content handlers stay off.\n handleOnly\n onShowChange={(open) => {\n if (!open) void stack.requestBack(entry.id, 'drag');\n }}\n onSnapChange={(index, value) => {\n const detent = layout.fit ? 'fit' : (detents[index] ?? 'large');\n setResting(detent);\n props.onRest?.(value);\n o.onStateChanged?.(detent, value);\n }}\n onOpen={() => stack.markOpened(entry.id)}\n onClose={() => stack.markClosed(entry.id)}\n >\n {/* The view is `position: fixed` without a size; lynx-ui places the sheet at its `top: 100%` and the backdrop at\n its 100 %. Unsized it is 0 × 0 (Lynxtron), so the sheet slid in above the screen: give it the viewport.\n event-through lets taps reach the page around a modal sheet's scrim-less parts; the scrim and the sheet take theirs.\n A non-modal sheet's view is also `pointer-events: none`: with event-through alone the Lynx view handed a tap\n on it to what lies under the whole Lynx view, so a NATIVE element of the page under the sheet (a map's own\n MotionEvents) never got it. (A native window `container` would do it too, but needs the overlay XElement.) */}\n <SheetView\n className={`g9-sheet__view${modal ? '' : ' g9-sheet__view--passthrough'}`}\n nativeProps={{ 'event-through': modal }}\n >\n {modal ? (\n <view\n event-through={false}\n className={`g9-sheet__scrim${props.isTop && !closing ? '' : ' g9-sheet__scrim--covered'}`}\n style={{\n backgroundColor: scrimColor(entry, settings, opacity),\n transition:\n platform === 'ios' && o.animateOverlayToColorOnIos === false\n ? 'none'\n : `background-color ${closing ? closeMs : openMs}ms`,\n }}\n bindtap={() => {\n if (layout.closeOnOverlayTap) void stack.requestBack(entry.id, 'overlayTap');\n }}\n />\n ) : null}\n {/* SheetContent's own view is lynx-ui's: a worklet writes its transform every motion frame, so its style is\n set once and never changes (a later inline-style write replaces the worklet's transform). Everything that\n changes (recede, paddings, colour) lives on G9's frame and surface inside it. */}\n <SheetContent\n className={`g9-sheet g9-sheet--${entry.status}${layout.fit ? ' g9-sheet--fit' : ''}`}\n style={platformSheetConstraints(o)}\n innerStyle={sheetInnerStyle}\n {...motion}\n >\n <G9SheetGestureFrame\n refs={gesture}\n canDrag={!layout.dragDisabled}\n bodyDrags={o.scrollingExpandsSheet !== false}\n className=\"g9-sheet__frame\"\n style={{ ...recede, transition: g9SheetRecedeTransition }}\n >\n <view\n className=\"g9-sheet__surface\"\n {...g9IdProps(o.automationId)}\n style={{\n backgroundColor: surface,\n borderTopLeftRadius: `${corner}px`,\n borderTopRightRadius: `${corner}px`,\n paddingTop: `${topPadding}px`,\n paddingBottom: `${bottomPadding}px`,\n ...notch,\n }}\n >\n <SheetContext.Provider value={contextValue}>\n {layout.showHandle ||\n (layout.fullScreen && o.showToolbar && o.showFullScreenDragHandle !== false && !layout.dragDisabled) ? (\n <view className=\"g9-sheet__grabber-area\">\n <view className=\"g9-sheet__grabber\" />\n </view>\n ) : null}\n <G9SheetHeader options={o} onBack={() => void stack.requestBack(entry.id, 'toolbarButton')} />\n {o.showToolbar && o.useStandardBodyTopGap !== false ? (\n <view className=\"g9-sheet__body-gap\" style={{ height: `${g9SheetHeaderMetrics.bodyTopGap}px` }} />\n ) : null}\n {o.scrollBody === false ? (\n <view\n className={`g9-sheet__body g9-sheet__body--static${layout.fillBody ? ' g9-sheet__body--fill' : ''}`}\n style={{ padding: `${o.padding ?? 0}px` }}\n >\n {content}\n </view>\n ) : (\n <scroll-view\n className={`g9-sheet__body${layout.fillBody ? ' g9-sheet__body--fill' : ''}`}\n scroll-orientation=\"vertical\"\n main-thread:ref={gesture.body}\n main-thread:bindscroll={phone ? bodyGesture.onScrollMT : undefined}\n main-thread:bindtouchstart={bodyGesture.onTouchStartMT}\n style={{\n padding: `${o.padding ?? 0}px`,\n ...(maxBody !== null ? { maxHeight: `${maxBody}px` } : {}),\n }}\n >\n {content}\n </scroll-view>\n )}\n <view className=\"g9-sheet__footer-slot\" bindlayoutchange={onFooterLayout}>\n <G9SheetFooter options={o} />\n </view>\n </SheetContext.Provider>\n </view>\n {/* Below the surface, so a drag past the top detent (rubber band) never shows the page under it. */}\n <view className=\"g9-sheet__skirt\" style={{ backgroundColor: surface }} />\n </G9SheetGestureFrame>\n </SheetContent>\n </SheetView>\n </SheetRoot>\n );\n}\n"],"names":["SheetContext","createContext","useG9SheetContext","useContext","scrimColor","entry","settings","opacity","explicit","parsed","tryParseColor","formatColor","withAlpha","sheetInnerStyle","g9SheetRecedeTransition","orderedDetents","o","requested","d","initialDetent","fit","_o_currentState","_ordered_","ordered","current","G9SheetFrame","props","_ref","_o_loadingSkeletonRowCount","_ratios_layout_initialSnap","_props_bottomInset","_o_openAnimationDurationMs","_o_closeAnimationDurationMs","_o_cornerRadius","_o_backgroundColor","_ratios_restIndex","_o_padding","_o_padding1","_props_memo","stack","palette","useG9Theme","gesture","useSheetGestureRefs","bodyGesture","useSheetBodyGesture","layout","resolveSheetLayout","showing","closing","handle","controller","useRef","createAbortController","useEffect","_controller_current","factory","deferred","revealed","setRevealed","useState","covering","setCovering","timer","coverTimer","stopTimer","_o_loadDelayMs","_o_loadDelayMs1","delay","Math","startTimer","memoKey","placeholderHeight","undefined","g9SheetFitLoadingMinHeight","bodyHeight","setBodyHeight","footerHeight","setFooterHeight","onFooterLayout","e","_e_detail","onBodyLayout","h","placeholder","view","G9SheetSkeleton","G9ActivityIndicator","body","maxBody","contextValue","ratios","p","Number","restingRatio","contentRatio","sheetOverlayOpacity","modal","recede","parentRecedeOffset","resting","setResting","rootRef","lastFitBody","_rootRef_current","fitHeight","topPadding","sheetSurfaceTopPadding","bottomPadding","sheetSurfaceBottomPadding","platform","currentPlatform","phone","openMs","closeMs","corner","surface","notch","g9FieldNotchStyle","resolveThemeColor","detents","restIndex","fitRatio","openRatio","motion","resolveSheetMotion","content","clampFitHeight","SheetRoot","g9SheetDragCloseThreshold","open","index","value","_detents_index","detent","SheetView","SheetContent","platformSheetConstraints","G9SheetGestureFrame","g9IdProps","G9SheetHeader","g9SheetHeaderMetrics","scroll-view","G9SheetFooter"],"mappings":";;;;;;;;;;;;;;AAmDA,MAAMA,eAAeC,cAA0C;AAGxD,SAASC;IACd,OAAOC,WAAWH;AACpB;AAsBA,SAASI,WAAWC,KAAmB,EAAEC,QAAmC,EAAEC,OAAe;IAC3F,MAAMC,WAAWH,MAAM,OAAO,CAAC,qBAAqB;IACpD,MAAMI,SAASC,cAAcF,QAAAA,WAAAA,WAAYF,SAAS,iBAAiB;IACnE,IAAI,CAACG,QAAQ,OAAOD,QAAAA,WAAAA,WAAYF,SAAS,iBAAiB;IAC1D,OAAOK,YAAYC,UAAUH,QAAQD,WAAWC,OAAO,CAAC,GAAGF;AAC7D;AAGA,MAAMM,kBAAkB;IAAE,SAAS;IAAQ,eAAe;AAAS;AAEnE,MAAMC,0BAA0B;AAGhC,SAASC,eAAeC,CAA0B;IAChD,MAAMC,YAAYD,EAAE,MAAM,IAAIA,EAAE,MAAM,CAAC,MAAM,GAAG,IAAIA,EAAE,MAAM,GAAI;QAAC;QAAU;KAAQ;IACnF,OAAQ;QAAC;QAAQ;QAAU;KAAQ,CAAW,MAAM,CAAC,CAACE,IAAMD,UA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AE,SAAS,GAAG,QAAAV,CAAAA,aAAAA,EAAE,OAAO,AAAD,IAARA,aAAa,EAAE,EAAE,CAAC;IAAC,GACzC;oBACC,CAAC0F,QAAQ;kBACX,EAAEzC,SAEDyD,YACC,WAAW,CAAC,cAAc,EAAEhG,OAAO,QAAQ,GAAG,0BAA0B,IAAI,EAC5E,mBAAmB,WACnB,YAAY,KAAKJ,QAAQ,IAAI,EAC7B,YAAY,YAAYsE,QAAQpE,YAAY,UAAU,GAAG6B,QACzD,YAAY,gBAAgB7B,YAAY,cAAc,EACtD,OAAO;QACL,SAAS,GAAG,QAAAP,CAAAA,cAAAA,EAAE,OAAO,AAAD,IAARA,cAAa,EAAE,EAAE,CAAC;QAC9B,GAAIoD,AAAY,SAAZA,UAAmB;YAAE,WAAW,GAAGA,QAAQ,EAAE,CAAC;QAAC,IAAI,CAAC,CAAC;IAC3D,GACD;oBACC,CAACqC,QAAQ;kBACX,EAAEgB,aACF;gBACF,CAACzD,KAAK,UAAU,wBAAwB,kBAAkBN,gBAAgB;kBACxE,CAACgE,cAAc,SAAS/H,IAAK;gBAC/B,EAAEqE,KAAK;cACT,EAAErF,aAAa,SAAS;YAC1B,EAAEqF,KAAK;YACP,EAAqG;YACrG,CAACA,KAAK,UAAU,kBAAkB,OAAO;QAAE,iBAAiB+B;IAAQ,IAAK;UAC3E,EAAEsB,oBAAoB;QACxB,EAAEF,aAAa;MACjB,EAAED,UAAU;IACd,EAAEP;AAEN"}
|
|
1
|
+
{"version":3,"file":"sheet/frame.jsx","sources":["../../src/sheet/frame.tsx"],"sourcesContent":["import './sheet.css';\nimport {\n createAbortController,\n formatColor,\n type G9AbortController,\n type G9AbortSignal,\n resolveThemeColor,\n tryParseColor,\n withAlpha,\n} from '@g9tm/lynxcontrols-foundation';\nimport { SheetContent, SheetRoot, type SheetRootRef, SheetView } from '@lynx-js/lynx-ui-sheet';\nimport { createContext, type ReactNode, useContext, useEffect, useRef, useState } from '@lynx-js/react';\nimport { g9IdProps } from '../base/control';\nimport { type G9TimerHandle, startTimer, stopTimer } from '../base/timers';\nimport { G9ActivityIndicator } from '../display/activity-indicator';\nimport { G9SheetSkeleton } from '../display/shimmer';\nimport { g9FieldNotchStyle } from '../fields/notch';\nimport { useG9Theme } from '../provider/hooks';\nimport { G9SheetGestureFrame, useSheetBodyGesture, useSheetGestureRefs } from './gesture';\nimport { G9SheetFooter, G9SheetHeader } from './header';\nimport type { G9SheetHeightMemo } from './height-memo';\nimport { resolveSheetMotion } from './motion';\nimport type { G9SheetDetent, G9SheetSettings } from './options';\nimport {\n clampFitHeight,\n currentPlatform,\n g9SheetDragCloseThreshold,\n g9SheetFitLoadingMinHeight,\n g9SheetFitMinHeight,\n parentRecedeOffset,\n platformSheetConstraints,\n resolveSheetLayout,\n sheetOverlayOpacity,\n sheetSurfaceBottomPadding,\n sheetSurfaceTopPadding,\n} from './sizing';\nimport type { G9SheetEntry, G9SheetHandle, G9SheetStack } from './stack';\n\n/** What content inside a sheet can read (MAUI `IG9BottomSheetAwareView` + deferred load signals). */\nexport interface G9SheetContextValue {\n /** The sheet-scoped handle: `close()` closes only this sheet. */\n readonly handle: G9SheetHandle;\n /** Aborted when the sheet starts closing (cancel loads with it). */\n readonly signal: G9AbortSignal;\n /** The open motion has finished. */\n readonly opened: boolean;\n /** The sheet is closing. */\n readonly closing: boolean;\n /** Resting body cap of a fit sheet (px), else `null`. */\n readonly maxBodyHeight: number | null;\n}\n\nconst SheetContext = createContext<G9SheetContextValue | null>(null);\n\n/** The enclosing sheet, or `null` outside one. */\nexport function useG9SheetContext(): G9SheetContextValue | null {\n return useContext(SheetContext);\n}\n\n/** Props of {@link G9SheetFrame}. */\nexport interface G9SheetFrameProps {\n readonly entry: G9SheetEntry;\n readonly stack: G9SheetStack;\n /** Host height (px): percentage detents and caps resolve against it. */\n readonly hostHeight: number;\n readonly hostWidth: number;\n readonly topInset: number;\n /** The host's bottom safe inset (a visible navigation bar); the surface pads by it. Default 0. */\n readonly bottomInset?: number;\n readonly settings: Required<G9SheetSettings>;\n readonly memo: G9SheetHeightMemo | null;\n /** Culture tag of the memo key. */\n readonly culture: string;\n /** The sheet is the top of the stack (receives scrim input). */\n readonly isTop: boolean;\n /** The sheet came to rest at a new height (px); drives the page recede threshold. */\n readonly onRest?: (heightPx: number) => void;\n}\n\nfunction scrimColor(entry: G9SheetEntry, settings: Required<G9SheetSettings>, opacity: number): string {\n const explicit = entry.options.windowBackgroundColor;\n const parsed = tryParseColor(explicit ?? settings.modalOverlayColor);\n if (!parsed) return explicit ?? settings.modalOverlayColor;\n return formatColor(withAlpha(parsed, explicit ? parsed.a : opacity));\n}\n\n/** lynx-ui's inner view lays G9's frame out as a column (its default `linear` layout ignores `flex`). */\nconst sheetInnerStyle = { display: 'flex', flexDirection: 'column' } as const;\n/** The receded parent sinks and fades over 220 ms (MAUI `StackParentRecedeDurationMs`, CubicOut). */\nconst g9SheetRecedeTransition = 'transform 220ms ease-out, opacity 220ms ease-out';\n\n/** The sheet's detents, small to large (the order of lynx-ui's snap points). */\nfunction orderedDetents(o: G9SheetEntry['options']): G9SheetDetent[] {\n const requested = o.states && o.states.length > 0 ? o.states : (['medium', 'large'] as const);\n return (['peek', 'medium', 'large'] as const).filter((d) => requested.includes(d));\n}\n\n/** The detent a sheet opens at (`'fit'` for fit-to-content). */\nfunction initialDetent(o: G9SheetEntry['options'], fit: boolean): G9SheetDetent | 'fit' {\n if (fit) return 'fit';\n const ordered = orderedDetents(o);\n const current = o.currentState ?? 'medium';\n return ordered.includes(current) ? current : (ordered[0] ?? 'medium');\n}\n\n/**\n * One sheet of the stack on lynx-ui `SheetRoot` (motion, drag, snap points from lynx-ui; G9 adds detent mapping,\n * scrim, header/footer, deferred content, recede and results). Rendered by the sheet service in the host's sheets\n * layer; use `useG9Sheets()` to open sheets.\n */\nexport function G9SheetFrame(props: G9SheetFrameProps): ReactNode {\n const { entry, stack, settings } = props;\n const palette = useG9Theme().palette;\n const gesture = useSheetGestureRefs();\n const bodyGesture = useSheetBodyGesture(gesture);\n const o = entry.options;\n const layout = resolveSheetLayout(o, props.hostHeight);\n const showing = entry.status === 'opening' || entry.status === 'open';\n const closing = entry.status === 'closing';\n const handle = stack.handleOf(entry.id) as G9SheetHandle;\n\n const controller = useRef<G9AbortController | null>(null);\n if (controller.current === null) controller.current = createAbortController();\n useEffect(() => {\n if (closing || entry.status === 'closed') controller.current?.abort();\n }, [closing, entry.status]);\n useEffect(() => () => controller.current?.abort(), []);\n\n // Deferred (factory) content: placeholder until the open motion ended + loadDelayMs, then the body.\n const factory = typeof entry.content === 'function';\n const deferred = (factory || settings.deferPrebuiltContent) && o.deferContent !== false;\n const [revealed, setRevealed] = useState(!deferred);\n const [covering, setCovering] = useState(false);\n const timer = useRef<G9TimerHandle | null>(null);\n const coverTimer = useRef<G9TimerHandle | null>(null);\n useEffect(\n () => () => {\n if (coverTimer.current !== null) stopTimer(coverTimer.current);\n },\n [],\n );\n useEffect(() => {\n if (!deferred || revealed || entry.status !== 'open') return;\n const delay = layout.fullScreen\n ? Math.max(o.loadDelayMs ?? 369, settings.openAnimationDurationMs + 32)\n : (o.loadDelayMs ?? 369);\n timer.current = startTimer(() => {\n setRevealed(true);\n if (o.fadeDeferredContentIn !== false) {\n setCovering(true);\n coverTimer.current = startTimer(() => setCovering(false), 220);\n }\n }, delay);\n return () => {\n if (timer.current !== null) stopTimer(timer.current);\n };\n }, [deferred, revealed, entry.status]);\n\n const memoKey = o.heightMemoKey ? `${o.heightMemoKey}|w${Math.round(props.hostWidth)}|${props.culture}|fs1` : null;\n const placeholderHeight = o.useFullScreenLoadingPlaceholder\n ? props.hostHeight\n : (o.deferredLoadingPlaceholderHeight ??\n (memoKey ? props.memo?.lookup(memoKey) : undefined) ??\n g9SheetFitLoadingMinHeight);\n\n const [bodyHeight, setBodyHeight] = useState(0);\n // The footer can come and go after the open (a `footerBand` whose buttons wait for data): it counts for the fit too.\n const [footerHeight, setFooterHeight] = useState(0);\n // The grabber, header and body gap above the body: part of the chrome a fit sheet's cap includes.\n const [chromeTopHeight, setChromeTopHeight] = useState(0);\n const onChromeTopLayout = (e: { detail?: { height?: number } }) =>\n setChromeTopHeight(Math.max(0, e.detail?.height ?? 0));\n const onFooterLayout = (e: { detail?: { height?: number } }) => setFooterHeight(Math.max(0, e.detail?.height ?? 0));\n const onBodyLayout = (e: { detail?: { height?: number } }) => {\n const h = e.detail?.height ?? 0;\n if (h <= 0) return;\n setBodyHeight(h);\n if (memoKey && revealed && !covering) props.memo?.record(memoKey, h);\n };\n\n const placeholder =\n o.loadingSkeleton && o.loadingSkeleton !== 'none' ? (\n <view className=\"g9-sheet__placeholder\" style={{ height: `${placeholderHeight}px` }}>\n <G9SheetSkeleton skeleton={o.loadingSkeleton} rowCount={o.loadingSkeletonRowCount ?? 0} />\n </view>\n ) : (\n <view\n className=\"g9-sheet__placeholder g9-sheet__placeholder--spinner\"\n style={{ height: `${placeholderHeight}px` }}\n >\n <G9ActivityIndicator running size={32} />\n </view>\n );\n const body = revealed ? (factory ? (entry.content as () => ReactNode)() : (entry.content as ReactNode)) : null;\n\n // Scrim: the resting dim of the detent (one detent → max; several → interpolated at the initial detent). A fit sheet\n // ranges from its content height to full screen (MAUI ResolveModalOverlayOpacity), so at rest it dims at the\n // MINIMUM — unless its content fills the screen (MAUI's single-state range).\n const ratios = layout.snapPoints.map((p) =>\n typeof p === 'number' ? p / Math.max(1, props.hostHeight) : p === 'fit' ? 0.5 : Number.parseFloat(p) / 100,\n );\n const restingRatio = ratios[layout.initialSnap] ?? 1;\n // The share of the screen the sheet SHOWS: a fit sheet stops at its cap, so content taller than the cap (a long list\n // scrolling inside it) does not \"fill the screen\" — measured on the full content height, AgriPad's block sheet dimmed\n // at the maximum once its harvest list grew (0.69 where MAUI keeps 0.3).\n const shown = layout.fitMaxHeight !== null ? Math.min(bodyHeight, layout.fitMaxHeight) : bodyHeight;\n const contentRatio = bodyHeight > 0 ? Math.min(1, shown / Math.max(1, props.hostHeight)) : 0.5;\n const opacity = entry.handingOff\n ? 0\n : layout.fit\n ? contentRatio >= 0.99\n ? settings.modalOverlayMaximumOpacity\n : settings.modalOverlayMinimumOpacity\n : sheetOverlayOpacity(\n restingRatio,\n ratios,\n settings.modalOverlayMinimumOpacity,\n settings.modalOverlayMaximumOpacity,\n );\n const modal = o.isModal !== false;\n // The receded parent sinks and fades (MAUI stack recede). This runs on G9's own frame view, never on lynx-ui's\n // SheetContent view: lynx-ui moves that one from a main-thread worklet, and an inline style written over it from\n // here put the parent back at its closed offset when the child closed (the parent vanished, its scrim stayed).\n const recede = entry.receded\n ? { transform: `translateY(${parentRecedeOffset(bodyHeight || props.hostHeight * 0.5)}px)`, opacity: 0 }\n : { transform: 'translateY(0px)', opacity: 1 };\n const [resting, setResting] = useState<G9SheetDetent | 'fit'>(() => initialDetent(o, layout.fit));\n\n // A fit sheet whose body grows or shrinks AFTER it opened (rows that load later, a spinner replaced by content):\n // lynx-ui re-measures the 'fit' snap point on layout but leaves the sheet where it was, so a taller body ran off the\n // bottom of the screen (its footer unreachable). Re-snap to the new fit while the sheet rests there.\n const rootRef = useRef<SheetRootRef | null>(null);\n const lastFitBody = useRef(0);\n useEffect(() => {\n if (!layout.fit || bodyHeight <= 0 || entry.status !== 'open' || resting !== 'fit') return;\n // Also right after the open motion: the body may have grown while the sheet was still sliding in.\n const fitHeight = bodyHeight + footerHeight;\n if (Math.abs(lastFitBody.current - fitHeight) < 1) return;\n lastFitBody.current = fitHeight;\n rootRef.current?.snapTo(0, { animate: true });\n }, [bodyHeight, footerHeight, entry.status, resting, layout.fit]);\n const topPadding = sheetSurfaceTopPadding(o, layout, resting, props.topInset, props.hostHeight);\n const bottomPadding = sheetSurfaceBottomPadding(o, props.bottomInset ?? 0);\n // MAUI caps the WHOLE fit sheet at MaxFitToContentHeightRatio of the screen (the helper's chrome — header band, body\n // gap, footer — is part of the natural height it clamps); the body gets what is left. Capping only the body let a long\n // fit sheet stand ~65 dp taller than MAUI's (its header and gap on top of a 75 % body).\n const maxBody =\n layout.fitMaxHeight === null\n ? null\n : Math.max(\n g9SheetFitMinHeight,\n layout.fitMaxHeight - chromeTopHeight - footerHeight - topPadding - bottomPadding,\n );\n const contextValue: G9SheetContextValue = {\n handle,\n signal: (controller.current as G9AbortController).signal,\n opened: entry.status === 'open',\n closing,\n maxBodyHeight: maxBody,\n };\n const platform = currentPlatform();\n // The body reports its scroll offset to the gesture routing on the main thread (./gesture.tsx) on the phones only:\n // Lynxtron (desktop) drops the WHOLE sheet, no element of it is created, when the body's scroll-view carries\n // `main-thread:bindscroll` (the gallery smoke, Azure build 614). On the desktop a wheel scrolls the body.\n const phone = platform === 'android' || platform === 'ios';\n const openMs = o.openAnimationDurationMs ?? settings.openAnimationDurationMs;\n const closeMs = o.closeAnimationDurationMs ?? settings.closeAnimationDurationMs;\n const corner =\n platform === 'android' && o.androidShouldRemoveExpandedCorners === true && layout.fullScreen\n ? 0\n : (o.cornerRadius ?? 12);\n const surface = o.backgroundColor ?? 'var(--g9-surface-container)';\n // Fields in the sheet hide their outline under a floated label with the sheet's colour, not the page's.\n const notch = g9FieldNotchStyle(resolveThemeColor(surface, palette));\n // Motion (MAUI G9SheetMotionModel, ./motion.ts): Material's settle on Android, the UIKit spring on iOS, or the timed\n // cubic; the travel is the share of the host the sheet covers where it rests (a fit sheet: its measured body).\n const detents = orderedDetents(o);\n const restIndex = layout.fit ? 0 : Math.max(0, detents.indexOf(resting as G9SheetDetent));\n const fitRatio =\n bodyHeight > 0 ? Math.min(1, (bodyHeight + topPadding + bottomPadding) / Math.max(1, props.hostHeight)) : 0.4;\n const openRatio = layout.fit ? fitRatio : (ratios[restIndex] ?? restingRatio);\n const motion = resolveSheetMotion({\n style: settings.motionStyle,\n platform,\n openRatio,\n snapRatio: ratios.length > 1 ? Math.max(...ratios) - Math.min(...ratios) : openRatio,\n openMs,\n closeMs,\n perSheetOpen: o.openAnimationDurationMs != null,\n perSheetClose: o.closeAnimationDurationMs != null,\n sizeScaled: settings.sizeScaledAnimationDuration,\n });\n // The body's content; inside a scroller by default, or filling a static body (`scrollBody: false`).\n const content = (\n <view\n className={`g9-sheet__content${o.scrollBody === false ? ' g9-sheet__content--fill' : ''}`}\n key={entry.version}\n bindlayoutchange={onBodyLayout}\n >\n {body}\n {!revealed ? placeholder : null}\n {covering ? (\n <view\n className=\"g9-sheet__cover\"\n style={{ height: `${clampFitHeight(placeholderHeight, props.hostHeight, true)}px` }}\n >\n {placeholder}\n </view>\n ) : null}\n </view>\n );\n return (\n <SheetRoot\n ref={rootRef}\n show={showing}\n snapPoints={layout.snapPoints}\n initialSnap={layout.initialSnap}\n screenHeight={props.hostHeight}\n dragDisabled={layout.dragDisabled}\n enableDragToClose={layout.enableDragToClose}\n dismissThreshold={g9SheetDragCloseThreshold}\n // G9 routes every touch itself (./gesture.tsx: drag vs. body scroll, N-028); lynx-ui's content handlers stay off.\n handleOnly\n onShowChange={(open) => {\n if (!open) void stack.requestBack(entry.id, 'drag');\n }}\n onSnapChange={(index, value) => {\n const detent = layout.fit ? 'fit' : (detents[index] ?? 'large');\n setResting(detent);\n props.onRest?.(value);\n o.onStateChanged?.(detent, value);\n }}\n onOpen={() => stack.markOpened(entry.id)}\n onClose={() => stack.markClosed(entry.id)}\n >\n {/* The view is `position: fixed` without a size; lynx-ui places the sheet at its `top: 100%` and the backdrop at\n its 100 %. Unsized it is 0 × 0 (Lynxtron), so the sheet slid in above the screen: give it the viewport.\n event-through lets taps reach the page around a modal sheet's scrim-less parts; the scrim and the sheet take theirs.\n A non-modal sheet's view is also `pointer-events: none`: with event-through alone the Lynx view handed a tap\n on it to what lies under the whole Lynx view, so a NATIVE element of the page under the sheet (a map's own\n MotionEvents) never got it. (A native window `container` would do it too, but needs the overlay XElement.) */}\n <SheetView\n className={`g9-sheet__view${modal ? '' : ' g9-sheet__view--passthrough'}`}\n nativeProps={{ 'event-through': modal }}\n >\n {modal ? (\n <view\n event-through={false}\n // Never flattened: a flattened view is painted on the Lynx root canvas, which a native SurfaceView (a map)\n // covers — the dim vanished over AgriPad's map while the sheet itself, a native view, still showed.\n flatten={false}\n className={`g9-sheet__scrim${props.isTop && !closing ? '' : ' g9-sheet__scrim--covered'}`}\n style={{\n backgroundColor: scrimColor(entry, settings, opacity),\n transition:\n platform === 'ios' && o.animateOverlayToColorOnIos === false\n ? 'none'\n : `background-color ${closing ? closeMs : openMs}ms`,\n }}\n bindtap={() => {\n if (layout.closeOnOverlayTap) void stack.requestBack(entry.id, 'overlayTap');\n }}\n />\n ) : null}\n {/* SheetContent's own view is lynx-ui's: a worklet writes its transform every motion frame, so its style is\n set once and never changes (a later inline-style write replaces the worklet's transform). Everything that\n changes (recede, paddings, colour) lives on G9's frame and surface inside it. */}\n <SheetContent\n className={`g9-sheet g9-sheet--${entry.status}${layout.fit ? ' g9-sheet--fit' : ''}`}\n style={platformSheetConstraints(o)}\n innerStyle={sheetInnerStyle}\n {...motion}\n >\n <G9SheetGestureFrame\n refs={gesture}\n canDrag={!layout.dragDisabled}\n bodyDrags={o.scrollingExpandsSheet !== false}\n className=\"g9-sheet__frame\"\n style={{ ...recede, transition: g9SheetRecedeTransition }}\n >\n <view\n className=\"g9-sheet__surface\"\n {...g9IdProps(o.automationId)}\n style={{\n backgroundColor: surface,\n borderTopLeftRadius: `${corner}px`,\n borderTopRightRadius: `${corner}px`,\n paddingTop: `${topPadding}px`,\n paddingBottom: `${bottomPadding}px`,\n ...notch,\n }}\n >\n <SheetContext.Provider value={contextValue}>\n <view className=\"g9-sheet__chrome-top\" bindlayoutchange={onChromeTopLayout}>\n {layout.showHandle ||\n (layout.fullScreen &&\n o.showToolbar &&\n o.showFullScreenDragHandle !== false &&\n !layout.dragDisabled) ? (\n <view className=\"g9-sheet__grabber-area\">\n <view className=\"g9-sheet__grabber\" />\n </view>\n ) : null}\n <G9SheetHeader options={o} onBack={() => void stack.requestBack(entry.id, 'toolbarButton')} />\n {o.showToolbar && o.useStandardBodyTopGap !== false ? (\n // MAUI UseStandardBodyTopGap: G9LayoutMetrics.SheetHeaderVerticalGap, which an app scales (AgriPad ×\n // 1.3 = 13) — read from the app's --g9-layout-* variable; g9SheetHeaderMetrics.bodyTopGap is the default.\n <view className=\"g9-sheet__body-gap\" />\n ) : null}\n </view>\n {o.scrollBody === false ? (\n <view\n className={`g9-sheet__body g9-sheet__body--static${layout.fillBody ? ' g9-sheet__body--fill' : ''}`}\n style={{ padding: `${o.padding ?? 0}px` }}\n >\n {content}\n </view>\n ) : (\n <scroll-view\n className={`g9-sheet__body${layout.fillBody ? ' g9-sheet__body--fill' : ''}`}\n scroll-orientation=\"vertical\"\n main-thread:ref={gesture.body}\n main-thread:bindscroll={phone ? bodyGesture.onScrollMT : undefined}\n main-thread:bindtouchstart={bodyGesture.onTouchStartMT}\n style={{\n padding: `${o.padding ?? 0}px`,\n ...(maxBody !== null ? { maxHeight: `${maxBody}px` } : {}),\n }}\n >\n {content}\n </scroll-view>\n )}\n <view className=\"g9-sheet__footer-slot\" bindlayoutchange={onFooterLayout}>\n <G9SheetFooter options={o} />\n </view>\n </SheetContext.Provider>\n </view>\n {/* Below the surface, so a drag past the top detent (rubber band) never shows the page under it. */}\n <view className=\"g9-sheet__skirt\" style={{ backgroundColor: surface }} />\n </G9SheetGestureFrame>\n </SheetContent>\n </SheetView>\n </SheetRoot>\n );\n}\n"],"names":["SheetContext","createContext","useG9SheetContext","useContext","scrimColor","entry","settings","opacity","explicit","parsed","tryParseColor","formatColor","withAlpha","sheetInnerStyle","g9SheetRecedeTransition","orderedDetents","o","requested","d","initialDetent","fit","_o_currentState","_ordered_","ordered","current","G9SheetFrame","props","_ref","_o_loadingSkeletonRowCount","_ratios_layout_initialSnap","_props_bottomInset","_o_openAnimationDurationMs","_o_closeAnimationDurationMs","_o_cornerRadius","_o_backgroundColor","_ratios_restIndex","_o_padding","_o_padding1","_props_memo","stack","palette","useG9Theme","gesture","useSheetGestureRefs","bodyGesture","useSheetBodyGesture","layout","resolveSheetLayout","showing","closing","handle","controller","useRef","createAbortController","useEffect","_controller_current","factory","deferred","revealed","setRevealed","useState","covering","setCovering","timer","coverTimer","stopTimer","_o_loadDelayMs","_o_loadDelayMs1","delay","Math","startTimer","memoKey","placeholderHeight","undefined","g9SheetFitLoadingMinHeight","bodyHeight","setBodyHeight","footerHeight","setFooterHeight","chromeTopHeight","setChromeTopHeight","onChromeTopLayout","e","_e_detail","onFooterLayout","onBodyLayout","h","placeholder","view","G9SheetSkeleton","G9ActivityIndicator","body","ratios","p","Number","restingRatio","shown","contentRatio","sheetOverlayOpacity","modal","recede","parentRecedeOffset","resting","setResting","rootRef","lastFitBody","_rootRef_current","fitHeight","topPadding","sheetSurfaceTopPadding","bottomPadding","sheetSurfaceBottomPadding","maxBody","g9SheetFitMinHeight","contextValue","platform","currentPlatform","phone","openMs","closeMs","corner","surface","notch","g9FieldNotchStyle","resolveThemeColor","detents","restIndex","fitRatio","openRatio","motion","resolveSheetMotion","content","clampFitHeight","SheetRoot","g9SheetDragCloseThreshold","open","index","value","_detents_index","detent","SheetView","SheetContent","platformSheetConstraints","G9SheetGestureFrame","g9IdProps","G9SheetHeader","scroll-view","G9SheetFooter"],"mappings":";;;;;;;;;;;;;;AAoDA,MAAMA,eAAeC,cAA0C;AAGxD,SAASC;IACd,OAAOC,WAAWH;AACpB;AAsBA,SAASI,WAAWC,KAAmB,EAAEC,QAAmC,EAAEC,OAAe;IAC3F,MAAMC,WAAWH,MAAM,OAAO,CAAC,qBAAqB;IACpD,MAAMI,SAASC,cAAcF,QAAAA,WAAAA,WAAYF,SAAS,iBAAiB;IACnE,IAAI,CAACG,QAAQ,OAAOD,QAAAA,WAAAA,WAAYF,SAAS,iBAAiB;IAC1D,OAAOK,YAAYC,UAAUH,QAAQD,WAAWC,OAAO,CAAC,GAAGF;AAC7D;AAGA,MAAMM,kBAAkB;IAAE,SAAS;IAAQ,eAAe;AAAS;AAEnE,MAAMC,0BAA0B;AAGhC,SAASC,eAAeC,CAA0B;IAChD,MAAMC,YAAYD,EAAE,MAAM,IAAIA,EAAE,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,gBAAgB;kBACxE,CAAC+D,cAAc,SAASnI,IAAK;gBAC/B,EAAEwE,KAAK;cACT,EAAExF,aAAa,SAAS;YAC1B,EAAEwF,KAAK;YACP,EAAqG;YACrG,CAACA,KAAK,UAAU,kBAAkB,OAAO;QAAE,iBAAiBiC;IAAQ,IAAK;UAC3E,EAAEsB,oBAAoB;QACxB,EAAEF,aAAa;MACjB,EAAED,UAAU;IACd,EAAEP;AAEN"}
|
package/dist/sheet/sheet.css
CHANGED
|
@@ -81,6 +81,16 @@
|
|
|
81
81
|
height: 4px;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
+
.g9-sheet__chrome-top {
|
|
85
|
+
flex-direction: column;
|
|
86
|
+
flex-shrink: 0;
|
|
87
|
+
display: flex;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.g9-sheet__body-gap {
|
|
91
|
+
height: var(--g9-layout-sheet-header-vertical-gap, 10px);
|
|
92
|
+
}
|
|
93
|
+
|
|
84
94
|
.g9-sheet__body {
|
|
85
95
|
flex-shrink: 1;
|
|
86
96
|
}
|
package/dist/sheet/sheet.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack://./src/sheet/sheet.css"],"names":[],"mappings":"AACA;EAAE,oBAAoB;EACpB,kBAAkB;EAClB,MAAM;EACN,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;AAIA;EADE,MAAM;EACN,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;AAKA;EAFE,oBAAoB;AACtB;;AAKA;EAFE,oBAAoB;AACtB;;AAKA;EAFE,oBAAoB;EACpB,sBAAsB;EACtB,aAAa;EACb,gBAAgB;AAClB;;AAMA;EAHE,sBAAsB;EACtB,YAAY;EACZ,cAAc;EACd,aAAa;EACb,kBAAkB;EAClB,iBAAiB;AACnB;;AAMA;EAHE,sBAAsB;EACtB,YAAY;EACZ,cAAc;EACd,aAAa;EACb,gBAAgB;AAClB;;AAOA;EAJE,YAAY;EACZ,kBAAkB;EAClB,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;AAOA;EAJE,oBAAoB;EACpB,kBAAkB;EAClB,MAAM;EACN,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;AAOA;EAJE,oBAAoB;AACtB;;AAOA;EAJE,uBAAuB;EACvB,mBAAmB;EACnB,YAAY;EACZ,aAAa;AACf;;AAOA;EAJE,2CAA2C;EAC3C,mBAAmB;EACnB,WAAW;EACX,WAAW;AACb;;
|
|
1
|
+
{"version":3,"sources":["webpack://./src/sheet/sheet.css"],"names":[],"mappings":"AACA;EAAE,oBAAoB;EACpB,kBAAkB;EAClB,MAAM;EACN,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;AAIA;EADE,MAAM;EACN,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;AAKA;EAFE,oBAAoB;AACtB;;AAKA;EAFE,oBAAoB;AACtB;;AAKA;EAFE,oBAAoB;EACpB,sBAAsB;EACtB,aAAa;EACb,gBAAgB;AAClB;;AAMA;EAHE,sBAAsB;EACtB,YAAY;EACZ,cAAc;EACd,aAAa;EACb,kBAAkB;EAClB,iBAAiB;AACnB;;AAMA;EAHE,sBAAsB;EACtB,YAAY;EACZ,cAAc;EACd,aAAa;EACb,gBAAgB;AAClB;;AAOA;EAJE,YAAY;EACZ,kBAAkB;EAClB,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;AAOA;EAJE,oBAAoB;EACpB,kBAAkB;EAClB,MAAM;EACN,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;AAOA;EAJE,oBAAoB;AACtB;;AAOA;EAJE,uBAAuB;EACvB,mBAAmB;EACnB,YAAY;EACZ,aAAa;AACf;;AAOA;EAJE,2CAA2C;EAC3C,mBAAmB;EACnB,WAAW;EACX,WAAW;AACb;;AAQA;EALE,sBAAsB;EACtB,cAAc;EACd,aAAa;AACf;;AASA;EANE,wDAAwD;AAC1D;;AASA;EANE,cAAc;AAChB;;AASA;EANE,OAAO;AACT;;AASA;EANE,s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eAAe;EACf,aAAa;AACf;;AAkBA;EAfE,sBAAsB;EACtB,OAAO;EACP,aAAa;AACf","sourcesContent":["/* G9 sheets on lynx-ui Sheet (MAUI G9SheetView / header template). No shadows. */\n.g9-sheet-stack {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n pointer-events: none;\n}\n\n/* lynx-ui SheetView (position: fixed): the whole viewport, so the sheet rises from the bottom edge. */\n.g9-sheet__view {\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n}\n\n/* A non-modal sheet's view lets every touch it does not cover through to the page, native views included. */\n.g9-sheet__view--passthrough {\n pointer-events: none;\n}\n\n.g9-sheet__view--passthrough .g9-sheet {\n pointer-events: auto;\n}\n\n.g9-sheet {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n pointer-events: auto;\n}\n\n/* G9's own views inside lynx-ui's SheetContent (whose style a worklet owns): the frame recedes, the surface paints. */\n.g9-sheet__frame {\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n flex-shrink: 0;\n position: relative;\n overflow: visible;\n}\n\n.g9-sheet__surface {\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n flex-shrink: 0;\n overflow: hidden;\n}\n\n/* Paints below the surface for a drag past the top detent; outside the layout, so fit heights ignore it. */\n.g9-sheet__skirt {\n position: absolute;\n top: 100%;\n left: 0;\n right: 0;\n height: 50vh;\n}\n\n.g9-sheet__scrim {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n pointer-events: auto;\n}\n\n.g9-sheet__scrim--covered {\n pointer-events: none;\n}\n\n.g9-sheet__grabber-area {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 30px;\n}\n\n.g9-sheet__grabber {\n width: 32px;\n height: 4px;\n border-radius: 12px;\n background-color: var(--g9-outline-variant);\n}\n\n/* The grabber, header and body gap, measured as one: a fit sheet's cap includes them (MAUI). */\n.g9-sheet__chrome-top {\n display: flex;\n flex-direction: column;\n flex-shrink: 0;\n}\n\n/* MAUI UseStandardBodyTopGap: SheetHeaderVerticalGap under the header (10, or the app's scaled value). */\n.g9-sheet__body-gap {\n height: var(--g9-layout-sheet-header-vertical-gap, 10px);\n}\n\n.g9-sheet__body {\n flex-shrink: 1;\n}\n\n.g9-sheet__body--fill {\n flex: 1;\n}\n\n.g9-sheet__content {\n display: flex;\n flex-direction: column;\n position: relative;\n}\n\n/* scrollBody: false — the content scrolls itself and fills the body (longhands: a definite basis for its children). */\n.g9-sheet__body--static {\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n flex-shrink: 1;\n flex-basis: 0px;\n overflow: hidden;\n}\n\n.g9-sheet__content--fill {\n flex-grow: 1;\n flex-shrink: 1;\n flex-basis: 0px;\n}\n\n.g9-sheet__placeholder {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.g9-sheet__cover {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n background-color: var(--g9-surface-container);\n animation: g9-sheet-cover-out 220ms ease-out forwards;\n}\n\n@keyframes g9-sheet-cover-out {\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n}\n\n.g9-sheet-reveal {\n animation: g9-sheet-reveal-in 140ms ease-out;\n}\n\n@keyframes g9-sheet-reveal-in {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n\n.g9-sheet-loading,\n.g9-processing-sheet__loading {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.g9-sheet-header {\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 10px 16px;\n border-bottom-width: 1px;\n border-bottom-style: solid;\n border-bottom-color: rgba(121, 116, 126, 0.35);\n}\n\n.g9-sheet-header__side {\n display: flex;\n flex-direction: row;\n flex: 1;\n align-items: center;\n}\n\n.g9-sheet-header__start {\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n\n.g9-sheet-header__end {\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: flex-end;\n}\n\n.g9-sheet-header__side.g9-sheet-header__end {\n justify-content: flex-end;\n}\n\n.g9-sheet-header__grow {\n display: flex;\n flex-direction: row;\n flex: 1;\n align-items: center;\n}\n\n.g9-sheet-header__title-near {\n padding: 0px 8px;\n}\n\n.g9-sheet-header__back {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n}\n\n.g9-sheet-header__title {\n font-weight: bold;\n color: var(--g9-secondary);\n text-overflow: ellipsis;\n}\n\n.g9-sheet-header__items {\n display: flex;\n flex-direction: row;\n column-gap: 8px;\n}\n\n/* Holds the footer (or nothing) so its height is measured with the body's for a fit sheet. */\n.g9-sheet__footer-slot {\n display: flex;\n flex-direction: column;\n flex-shrink: 0;\n}\n\n.g9-sheet-footer {\n display: flex;\n flex-direction: column;\n row-gap: 8px;\n padding: 12px 16px;\n border-top-width: 1px;\n border-top-style: solid;\n border-top-color: var(--g9-outline-variant);\n}\n\n.g9-sheet-footer__row {\n display: flex;\n flex-direction: row;\n column-gap: 8px;\n}\n\n/* A column: whatever a cell holds (a button, a wrapper around one) stretches to the cell's width, as MAUI's footer\n buttons fill their cell. */\n.g9-sheet-footer__cell {\n display: flex;\n flex-direction: column;\n flex: 1;\n}\n"],"sourceRoot":""}
|
package/dist/tabs/model.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export interface G9TabItem {
|
|
|
26
26
|
readonly badgeText?: string | null;
|
|
27
27
|
/** A 7×7 dot instead of a pill. */
|
|
28
28
|
readonly badgeDot?: boolean;
|
|
29
|
-
/** Badge fill. Default `var(--g9-error)
|
|
29
|
+
/** Badge fill. Default `var(--g9-primary)` for the pill, `var(--g9-error)` for the dot (MAUI CreateBadge). */
|
|
30
30
|
readonly badgeColor?: string | null;
|
|
31
31
|
/** The body shown while this tab is active (MAUI `TabContent`); a function is called when the tab realizes. */
|
|
32
32
|
readonly content?: ReactNode | (() => ReactNode);
|