@g9tm/lynxcontrols 1.4.0 → 1.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/base/control.d.ts +24 -0
- package/dist/base/control.d.ts.map +1 -1
- package/dist/base/control.jsx +14 -2
- package/dist/base/control.jsx.map +1 -1
- package/dist/base/index.d.ts +1 -1
- package/dist/base/index.d.ts.map +1 -1
- package/dist/base/index.jsx +1 -1
- package/dist/base/pressable.d.ts.map +1 -1
- package/dist/base/pressable.jsx +1 -1
- package/dist/base/pressable.jsx.map +1 -1
- package/dist/button/button.d.ts.map +1 -1
- package/dist/button/button.jsx +4 -3
- package/dist/button/button.jsx.map +1 -1
- package/dist/button/header-action-button.d.ts.map +1 -1
- package/dist/button/header-action-button.jsx +1 -1
- package/dist/button/header-action-button.jsx.map +1 -1
- package/dist/button/icon-button.d.ts.map +1 -1
- package/dist/button/icon-button.jsx +1 -1
- package/dist/button/icon-button.jsx.map +1 -1
- package/dist/button/nav-card.d.ts.map +1 -1
- package/dist/button/nav-card.jsx +6 -5
- package/dist/button/nav-card.jsx.map +1 -1
- package/dist/button/vertical-icon-text-button.d.ts.map +1 -1
- package/dist/button/vertical-icon-text-button.jsx +1 -1
- package/dist/button/vertical-icon-text-button.jsx.map +1 -1
- package/dist/display/culture-date-time-label.d.ts.map +1 -1
- package/dist/display/culture-date-time-label.jsx +3 -1
- package/dist/display/culture-date-time-label.jsx.map +1 -1
- package/dist/display/progress-bar.jsx +1 -1
- package/dist/display/progress-bar.jsx.map +1 -1
- package/dist/display/separator.jsx +2 -2
- package/dist/display/separator.jsx.map +1 -1
- package/dist/display/title-with-line.jsx +1 -1
- package/dist/display/title-with-line.jsx.map +1 -1
- package/dist/expander/expander.d.ts.map +1 -1
- package/dist/expander/expander.jsx +6 -4
- package/dist/expander/expander.jsx.map +1 -1
- package/dist/fields/fields.css +12 -4
- package/dist/fields/fields.css.map +1 -1
- package/dist/fields/index.d.ts +1 -0
- package/dist/fields/index.d.ts.map +1 -1
- package/dist/fields/index.jsx +1 -0
- package/dist/fields/notch.d.ts +10 -0
- package/dist/fields/notch.d.ts.map +1 -0
- package/dist/fields/notch.jsx +9 -0
- package/dist/fields/notch.jsx.map +1 -0
- package/dist/fields/outlined-field.d.ts +7 -1
- package/dist/fields/outlined-field.d.ts.map +1 -1
- package/dist/fields/outlined-field.jsx +8 -5
- package/dist/fields/outlined-field.jsx.map +1 -1
- package/dist/fields/pin-entry.d.ts +2 -0
- package/dist/fields/pin-entry.d.ts.map +1 -1
- package/dist/fields/pin-entry.jsx +2 -1
- package/dist/fields/pin-entry.jsx.map +1 -1
- package/dist/fields/text-entry.d.ts.map +1 -1
- package/dist/fields/text-entry.jsx +12 -2
- package/dist/fields/text-entry.jsx.map +1 -1
- package/dist/fields/use-text-input.d.ts.map +1 -1
- package/dist/fields/use-text-input.jsx +11 -1
- package/dist/fields/use-text-input.jsx.map +1 -1
- package/dist/host/hooks.d.ts +5 -0
- package/dist/host/hooks.d.ts.map +1 -1
- package/dist/host/hooks.jsx +4 -1
- package/dist/host/hooks.jsx.map +1 -1
- package/dist/host/index.d.ts +1 -1
- package/dist/host/index.d.ts.map +1 -1
- package/dist/host/index.jsx +1 -1
- package/dist/popup/frame.d.ts.map +1 -1
- package/dist/popup/frame.jsx +11 -3
- package/dist/popup/frame.jsx.map +1 -1
- package/dist/popup/index.d.ts +1 -1
- package/dist/popup/index.d.ts.map +1 -1
- package/dist/popup/popup.css +1 -1
- package/dist/popup/popup.css.map +1 -1
- package/dist/popup/service.d.ts.map +1 -1
- package/dist/popup/service.jsx +12 -4
- package/dist/popup/service.jsx.map +1 -1
- package/dist/popup/types.d.ts +11 -0
- package/dist/popup/types.d.ts.map +1 -1
- package/dist/popup/types.jsx.map +1 -1
- package/dist/selection/selection-sheet.d.ts.map +1 -1
- package/dist/selection/selection-sheet.jsx +7 -3
- package/dist/selection/selection-sheet.jsx.map +1 -1
- package/dist/selection/selection.css +1 -0
- package/dist/selection/selection.css.map +1 -1
- package/dist/sheet/frame.d.ts +2 -0
- package/dist/sheet/frame.d.ts.map +1 -1
- package/dist/sheet/frame.jsx +134 -69
- package/dist/sheet/frame.jsx.map +1 -1
- package/dist/sheet/gesture.d.ts +51 -0
- package/dist/sheet/gesture.d.ts.map +1 -0
- package/dist/sheet/gesture.jsx +107 -0
- package/dist/sheet/gesture.jsx.map +1 -0
- package/dist/sheet/handoff.d.ts +32 -0
- package/dist/sheet/handoff.d.ts.map +1 -0
- package/dist/sheet/handoff.jsx +33 -0
- package/dist/sheet/handoff.jsx.map +1 -0
- package/dist/sheet/header.d.ts +12 -1
- package/dist/sheet/header.d.ts.map +1 -1
- package/dist/sheet/header.jsx +42 -29
- package/dist/sheet/header.jsx.map +1 -1
- package/dist/sheet/index.d.ts +3 -2
- package/dist/sheet/index.d.ts.map +1 -1
- package/dist/sheet/index.jsx +3 -2
- package/dist/sheet/motion.d.ts +59 -0
- package/dist/sheet/motion.d.ts.map +1 -0
- package/dist/sheet/motion.jsx +59 -0
- package/dist/sheet/motion.jsx.map +1 -0
- package/dist/sheet/options.d.ts +34 -2
- package/dist/sheet/options.d.ts.map +1 -1
- package/dist/sheet/options.jsx +2 -1
- package/dist/sheet/options.jsx.map +1 -1
- package/dist/sheet/service.d.ts.map +1 -1
- package/dist/sheet/service.jsx +1 -1
- package/dist/sheet/service.jsx.map +1 -1
- package/dist/sheet/sheet.css +52 -1
- package/dist/sheet/sheet.css.map +1 -1
- package/dist/sheet/sizing.d.ts +27 -3
- package/dist/sheet/sizing.d.ts.map +1 -1
- package/dist/sheet/sizing.jsx +19 -4
- package/dist/sheet/sizing.jsx.map +1 -1
- package/dist/tab-bar/tab-bar.d.ts +5 -0
- package/dist/tab-bar/tab-bar.d.ts.map +1 -1
- package/dist/tab-bar/tab-bar.jsx +5 -2
- package/dist/tab-bar/tab-bar.jsx.map +1 -1
- package/dist/toast/service.d.ts.map +1 -1
- package/dist/toast/service.jsx +58 -21
- package/dist/toast/service.jsx.map +1 -1
- package/dist/toast/store.d.ts +2 -0
- package/dist/toast/store.d.ts.map +1 -1
- package/dist/toast/store.jsx +4 -2
- package/dist/toast/store.jsx.map +1 -1
- package/dist/toast/toast.css +20 -13
- package/dist/toast/toast.css.map +1 -1
- package/dist/toggle/checkbox.d.ts.map +1 -1
- package/dist/toggle/checkbox.jsx +1 -1
- package/dist/toggle/checkbox.jsx.map +1 -1
- package/dist/toggle/chip-group.d.ts.map +1 -1
- package/dist/toggle/chip-group.jsx +5 -5
- package/dist/toggle/chip-group.jsx.map +1 -1
- package/dist/toggle/switch.d.ts.map +1 -1
- package/dist/toggle/switch.jsx +2 -2
- package/dist/toggle/switch.jsx.map +1 -1
- package/dist/toggle/toggle.css +1 -2
- package/dist/toggle/toggle.css.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selection-sheet.d.ts","sourceRoot":"","sources":["../../src/selection/selection-sheet.tsx"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,CAAC;AACzB,OAAO,EAA4B,KAAK,oBAAoB,EAAa,MAAM,+BAA+B,CAAC;AAI/G,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAQ9D,OAAO,EAAiE,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACtH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAIvD,+GAA+G;AAC/G,eAAO,MAAM,8BAA8B,KAAK,CAAC;AACjD,mDAAmD;AACnD,eAAO,MAAM,oBAAoB,KAAK,CAAC;AACvC,4DAA4D;AAC5D,eAAO,MAAM,2BAA2B,MAAM,CAAC;AAC/C,sEAAsE;AACtE,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAE3C,wEAAwE;AACxE,MAAM,WAAW,sBAAsB,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe;IACjF,sFAAsF;IACtF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;IAC3C,wGAAwG;IACxG,QAAQ,CAAC,OAAO,CAAC,EAAE,cAAc,CAAC;IAClC,4DAA4D;IAC5D,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;CACnC;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,eAAe,EACrD,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAC7B,OAAO,CAAC,CAAC,EAAE,CAAC,CAiEd"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./selection.css";
|
|
2
2
|
import { G9StringKey, formatColor, withAlpha } from "@g9tm/lynxcontrols-foundation";
|
|
3
3
|
import { useEffect, useRef, useState, useSyncExternalStore } from "@lynx-js/react";
|
|
4
|
-
import { g9RowStyle, g9TextStart } from "../base/control.jsx";
|
|
4
|
+
import { g9ChildId, g9RowStyle, g9TextStart } from "../base/control.jsx";
|
|
5
5
|
import { useG9Press } from "../base/press.jsx";
|
|
6
6
|
import { startTimer, stopTimer } from "../base/timers.jsx";
|
|
7
7
|
import { G9Button } from "../button/button.jsx";
|
|
@@ -49,7 +49,9 @@ function SelectionRow(props) {
|
|
|
49
49
|
image: item.iconImage
|
|
50
50
|
};
|
|
51
51
|
const iconColor = null != (_item_iconTintColor = item.iconTintColor) ? _item_iconTintColor : selected ? palette.Primary : palette.TextSecondary;
|
|
52
|
-
return <view
|
|
52
|
+
return <view {...props.elementId ? {
|
|
53
|
+
id: props.elementId
|
|
54
|
+
} : {}} className={`g9-selection-row${selected ? ' g9-selection-row--selected' : ''}`} style={selected ? {
|
|
53
55
|
backgroundColor: formatColor(withAlpha(palette.Primary, 0.1))
|
|
54
56
|
} : {}} accessibility-element={true} accessibility-traits="button" accessibility-label={item.text} {...selected ? {
|
|
55
57
|
'accessibility-value': 'selected'
|
|
@@ -115,9 +117,11 @@ function SelectionBody(props) {
|
|
|
115
117
|
<G9TextEntry placeholder={strings.get(G9StringKey.Search)} leadingIcon="search" value={query} onValueChange={onQuery}/>
|
|
116
118
|
</view> : null}
|
|
117
119
|
{request.items.map((item, i)=>{
|
|
120
|
+
var _item_key;
|
|
121
|
+
var _request_options;
|
|
118
122
|
const id = ids[i];
|
|
119
123
|
if (!visibleIds.has(id)) return null;
|
|
120
|
-
return <SelectionRow key={id} item={item} selected={model.isSelected(id)} direction={dir} onTap={()=>tap(id)}/>;
|
|
124
|
+
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)}/>;
|
|
121
125
|
})}
|
|
122
126
|
{0 === visible.length ? <text className="g9-selection__empty">{null != (_request_emptyText = request.emptyText) ? _request_emptyText : strings.get(G9StringKey.NoResults)}</text> : null}
|
|
123
127
|
</view>;
|
|
@@ -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 { 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 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 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 key={id} item={item} selected={model.isSelected(id)} direction={dir} onTap={() => tap(id)} />\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","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","_request_options","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,IAAI,KAApBC,cAAyB,KAAK;IACvG;IACA,OAAOJ,MAAM,GAAG,CAAC,CAACG,MAAME;YAGjBD;eAFLD,AAAY,QAAZA,KAAK,GAAG,IAAYA,AAAoB,OAApBA,KAAK,GAAG,CAAC,IAAI,KAC7B,CAAC,EAAE,EAA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K;IACX,EAAEA;AAEN;AAEA,SAAS8F,cAAc3G,KAKtB;IACC,MAAMS,QAAQC,WAAWV,MAAM,KAAK,EAAE;QACpC,QAAQ;QACR,SAAS;QACT,SAASA,AAAyB,UAAzBA,MAAM,IAAI,CAAC,SAAS;IAC/B;IACA,MAAMW,OAAO;QAAE,MAAMX,MAAM,IAAI,CAAC,IAAI;QAAE,WAAWA,MAAM,IAAI,CAAC,QAAQ;QAAE,OAAOA,MAAM,IAAI,CAAC,SAAS;IAAC;IAClG,MAAM8F,YAAYnE;IAClB,QACGd,KACC,WAAW,CAAC,mBAAmB,EAAEb,MAAM,QAAQ,GAAG,mCAAmC,IAAI,EACzF,OAAO;QAAE,GAAGgB,WAAW8E,UAAU;QAAE,GAAI9F,MAAM,QAAQ,GAAG;YAAE,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,YAAYyE,YAAY;QACrF,CAAC9F,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 ) : 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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MAAM,QAAQ,GAAG;YAAE,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 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack://./src/selection/selection.css"],"names":[],"mappings":"AACA;EAAE,sBAAsB;EACtB,aAAa;AACf;;AAIA;EADE,iBAAiB;AACnB;;
|
|
1
|
+
{"version":3,"sources":["webpack://./src/selection/selection.css"],"names":[],"mappings":"AACA;EAAE,sBAAsB;EACtB,aAAa;AACf;;AAIA;EADE,iBAAiB;AACnB;;AAMA;EAHE,sBAAsB;EACtB,uBAAuB;EACvB,gBAAgB;EAChB,aAAa;AACf;;AAMA;EAHE,mBAAmB;EACnB,mBAAmB;EACnB,gBAAgB;EAChB,eAAe;EACf,aAAa;AACf;;AAMA;EAHE,uBAAuB;EACvB,OAAO;EACP,eAAe;AACjB;;AAMA;EAHE,kBAAkB;EAClB,8BAA8B;EAC9B,kBAAkB;EAClB,eAAe;AACjB;;AAMA;EAHE,mBAAmB;EACnB,mBAAmB;EACnB,eAAe;EACf,aAAa;AACf;;AAMA;EAHE,6CAA6C;EAC7C,mBAAmB;EACnB,gBAAgB;AAClB;;AAMA;EAHE,qCAAqC;EACrC,eAAe;AACjB;;AAMA;EAHE,mBAAmB;EACnB,mBAAmB;EACnB,gBAAgB;EAChB,gBAAgB;EAChB,eAAe;EACf,aAAa;AACf;;AAMA;EAHE,6BAA6B;EAC7B,OAAO;EACP,eAAe;AACjB;;AAMA;EAHE,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.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__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":""}
|
package/dist/sheet/frame.d.ts
CHANGED
|
@@ -27,6 +27,8 @@ export interface G9SheetFrameProps {
|
|
|
27
27
|
readonly hostHeight: number;
|
|
28
28
|
readonly hostWidth: number;
|
|
29
29
|
readonly topInset: number;
|
|
30
|
+
/** The host's bottom safe inset (a visible navigation bar); the surface pads by it. Default 0. */
|
|
31
|
+
readonly bottomInset?: number;
|
|
30
32
|
readonly settings: Required<G9SheetSettings>;
|
|
31
33
|
readonly memo: G9SheetHeightMemo | null;
|
|
32
34
|
/** Culture tag of the memo key. */
|
|
@@ -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,
|
|
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;AAahE,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEzE,qGAAqG;AACrG,MAAM,WAAW,mBAAmB;IAClC,iEAAiE;IACjE,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,oEAAoE;IACpE,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,oCAAoC;IACpC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,4BAA4B;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,yDAAyD;IACzD,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CACvC;AAID,kDAAkD;AAClD,wBAAgB,iBAAiB,IAAI,mBAAmB,GAAG,IAAI,CAE9D;AAED,qCAAqC;AACrC,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B,wEAAwE;IACxE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,kGAAkG;IAClG,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC;IAC7C,QAAQ,CAAC,IAAI,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACxC,mCAAmC;IACnC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,gEAAgE;IAChE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,qFAAqF;IACrF,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C;AA4BD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,SAAS,CAoThE"}
|
package/dist/sheet/frame.jsx
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import "./sheet.css";
|
|
2
|
-
import { createAbortController, formatColor, tryParseColor, withAlpha } from "@g9tm/lynxcontrols-foundation";
|
|
3
|
-
import { SheetContent,
|
|
2
|
+
import { createAbortController, formatColor, resolveThemeColor, tryParseColor, withAlpha } from "@g9tm/lynxcontrols-foundation";
|
|
3
|
+
import { SheetContent, SheetRoot, SheetView } from "@lynx-js/lynx-ui-sheet";
|
|
4
4
|
import { createContext, useContext, useEffect, useRef, useState } from "@lynx-js/react";
|
|
5
|
+
import { g9IdProps } from "../base/control.jsx";
|
|
5
6
|
import { startTimer, stopTimer } from "../base/timers.jsx";
|
|
6
7
|
import { G9ActivityIndicator } from "../display/activity-indicator.jsx";
|
|
7
8
|
import { G9SheetSkeleton } from "../display/shimmer.jsx";
|
|
9
|
+
import { g9FieldNotchStyle } from "../fields/notch.jsx";
|
|
10
|
+
import { useG9Theme } from "../provider/hooks.jsx";
|
|
11
|
+
import { G9SheetGestureFrame, useSheetBodyGesture, useSheetGestureRefs } from "./gesture.jsx";
|
|
8
12
|
import { G9SheetFooter, G9SheetHeader, g9SheetHeaderMetrics } from "./header.jsx";
|
|
9
|
-
import {
|
|
13
|
+
import { resolveSheetMotion } from "./motion.jsx";
|
|
14
|
+
import { clampFitHeight, currentPlatform, g9SheetDragCloseThreshold, g9SheetFitLoadingMinHeight, parentRecedeOffset, platformSheetConstraints, resolveSheetLayout, sheetOverlayOpacity, sheetSurfaceBottomPadding, sheetSurfaceTopPadding } from "./sizing.jsx";
|
|
10
15
|
const SheetContext = createContext(null);
|
|
11
16
|
function useG9SheetContext() {
|
|
12
17
|
return useContext(SheetContext);
|
|
@@ -17,10 +22,36 @@ function scrimColor(entry, settings, opacity) {
|
|
|
17
22
|
if (!parsed) return null != explicit ? explicit : settings.modalOverlayColor;
|
|
18
23
|
return formatColor(withAlpha(parsed, explicit ? parsed.a : opacity));
|
|
19
24
|
}
|
|
25
|
+
const sheetInnerStyle = {
|
|
26
|
+
display: 'flex',
|
|
27
|
+
flexDirection: 'column'
|
|
28
|
+
};
|
|
29
|
+
const g9SheetRecedeTransition = 'transform 220ms ease-out, opacity 220ms ease-out';
|
|
30
|
+
function orderedDetents(o) {
|
|
31
|
+
const requested = o.states && o.states.length > 0 ? o.states : [
|
|
32
|
+
'medium',
|
|
33
|
+
'large'
|
|
34
|
+
];
|
|
35
|
+
return [
|
|
36
|
+
'peek',
|
|
37
|
+
'medium',
|
|
38
|
+
'large'
|
|
39
|
+
].filter((d)=>requested.includes(d));
|
|
40
|
+
}
|
|
41
|
+
function initialDetent(o, fit) {
|
|
42
|
+
var _o_currentState, _ordered_;
|
|
43
|
+
if (fit) return 'fit';
|
|
44
|
+
const ordered = orderedDetents(o);
|
|
45
|
+
const current = null != (_o_currentState = o.currentState) ? _o_currentState : 'medium';
|
|
46
|
+
return ordered.includes(current) ? current : null != (_ordered_ = ordered[0]) ? _ordered_ : 'medium';
|
|
47
|
+
}
|
|
20
48
|
function G9SheetFrame(props) {
|
|
21
|
-
var _ref, _o_deferredLoadingPlaceholderHeight, _o_loadingSkeletonRowCount, _ratios_layout_initialSnap, _o_openAnimationDurationMs, _o_closeAnimationDurationMs, _o_cornerRadius, _o_backgroundColor, _o_padding;
|
|
49
|
+
var _ref, _o_deferredLoadingPlaceholderHeight, _o_loadingSkeletonRowCount, _ratios_layout_initialSnap, _props_bottomInset, _o_openAnimationDurationMs, _o_closeAnimationDurationMs, _o_cornerRadius, _o_backgroundColor, _ratios_restIndex, _o_padding, _o_padding1;
|
|
22
50
|
var _props_memo;
|
|
23
51
|
const { entry, stack, settings } = props;
|
|
52
|
+
const palette = useG9Theme().palette;
|
|
53
|
+
const gesture = useSheetGestureRefs();
|
|
54
|
+
const bodyGesture = useSheetBodyGesture(gesture);
|
|
24
55
|
const o = entry.options;
|
|
25
56
|
const layout = resolveSheetLayout(o, props.hostHeight);
|
|
26
57
|
const showing = 'opening' === entry.status || 'open' === entry.status;
|
|
@@ -70,6 +101,12 @@ function G9SheetFrame(props) {
|
|
|
70
101
|
const memoKey = o.heightMemoKey ? `${o.heightMemoKey}|w${Math.round(props.hostWidth)}|${props.culture}|fs1` : null;
|
|
71
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;
|
|
72
103
|
const [bodyHeight, setBodyHeight] = useState(0);
|
|
104
|
+
const [footerHeight, setFooterHeight] = useState(0);
|
|
105
|
+
const onFooterLayout = (e)=>{
|
|
106
|
+
var _ref;
|
|
107
|
+
var _e_detail;
|
|
108
|
+
return setFooterHeight(Math.max(0, null != (_ref = null == (_e_detail = e.detail) ? void 0 : _e_detail.height) ? _ref : 0));
|
|
109
|
+
};
|
|
73
110
|
const onBodyLayout = (e)=>{
|
|
74
111
|
var _ref;
|
|
75
112
|
var _e_detail, _props_memo;
|
|
@@ -98,7 +135,8 @@ function G9SheetFrame(props) {
|
|
|
98
135
|
};
|
|
99
136
|
const ratios = layout.snapPoints.map((p)=>'number' == typeof p ? p / Math.max(1, props.hostHeight) : 'fit' === p ? 0.5 : Number.parseFloat(p) / 100);
|
|
100
137
|
const restingRatio = null != (_ratios_layout_initialSnap = ratios[layout.initialSnap]) ? _ratios_layout_initialSnap : 1;
|
|
101
|
-
const
|
|
138
|
+
const contentRatio = bodyHeight > 0 ? Math.min(1, bodyHeight / Math.max(1, props.hostHeight)) : 0.5;
|
|
139
|
+
const opacity = entry.handingOff ? 0 : layout.fit ? contentRatio >= 0.99 ? settings.modalOverlayMaximumOpacity : settings.modalOverlayMinimumOpacity : sheetOverlayOpacity(restingRatio, ratios, settings.modalOverlayMinimumOpacity, settings.modalOverlayMaximumOpacity);
|
|
102
140
|
const modal = false !== o.isModal;
|
|
103
141
|
const recede = entry.receded ? {
|
|
104
142
|
transform: `translateY(${parentRecedeOffset(bodyHeight || 0.5 * props.hostHeight)}px)`,
|
|
@@ -107,52 +145,71 @@ function G9SheetFrame(props) {
|
|
|
107
145
|
transform: 'translateY(0px)',
|
|
108
146
|
opacity: 1
|
|
109
147
|
};
|
|
110
|
-
const
|
|
148
|
+
const [resting, setResting] = useState(()=>initialDetent(o, layout.fit));
|
|
149
|
+
const rootRef = useRef(null);
|
|
150
|
+
const lastFitBody = useRef(0);
|
|
151
|
+
useEffect(()=>{
|
|
152
|
+
var _rootRef_current;
|
|
153
|
+
if (!layout.fit || bodyHeight <= 0 || 'open' !== entry.status || 'fit' !== resting) return;
|
|
154
|
+
const fitHeight = bodyHeight + footerHeight;
|
|
155
|
+
if (Math.abs(lastFitBody.current - fitHeight) < 1) return;
|
|
156
|
+
lastFitBody.current = fitHeight;
|
|
157
|
+
null == (_rootRef_current = rootRef.current) || _rootRef_current.snapTo(0, {
|
|
158
|
+
animate: true
|
|
159
|
+
});
|
|
160
|
+
}, [
|
|
161
|
+
bodyHeight,
|
|
162
|
+
footerHeight,
|
|
163
|
+
entry.status,
|
|
164
|
+
resting,
|
|
165
|
+
layout.fit
|
|
166
|
+
]);
|
|
167
|
+
const topPadding = sheetSurfaceTopPadding(o, layout, resting, props.topInset, props.hostHeight);
|
|
168
|
+
const bottomPadding = sheetSurfaceBottomPadding(o, null != (_props_bottomInset = props.bottomInset) ? _props_bottomInset : 0);
|
|
111
169
|
const platform = currentPlatform();
|
|
170
|
+
const phone = 'android' === platform || 'ios' === platform;
|
|
112
171
|
const openMs = null != (_o_openAnimationDurationMs = o.openAnimationDurationMs) ? _o_openAnimationDurationMs : settings.openAnimationDurationMs;
|
|
113
172
|
const closeMs = null != (_o_closeAnimationDurationMs = o.closeAnimationDurationMs) ? _o_closeAnimationDurationMs : settings.closeAnimationDurationMs;
|
|
114
173
|
const corner = 'android' === platform && true === o.androidShouldRemoveExpandedCorners && layout.fullScreen ? 0 : null != (_o_cornerRadius = o.cornerRadius) ? _o_cornerRadius : 12;
|
|
115
|
-
const
|
|
116
|
-
const
|
|
117
|
-
const
|
|
118
|
-
const
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
174
|
+
const surface = null != (_o_backgroundColor = o.backgroundColor) ? _o_backgroundColor : 'var(--g9-surface-container)';
|
|
175
|
+
const notch = g9FieldNotchStyle(resolveThemeColor(surface, palette));
|
|
176
|
+
const detents = orderedDetents(o);
|
|
177
|
+
const restIndex = layout.fit ? 0 : Math.max(0, detents.indexOf(resting));
|
|
178
|
+
const fitRatio = bodyHeight > 0 ? Math.min(1, (bodyHeight + topPadding + bottomPadding) / Math.max(1, props.hostHeight)) : 0.4;
|
|
179
|
+
const openRatio = layout.fit ? fitRatio : null != (_ratios_restIndex = ratios[restIndex]) ? _ratios_restIndex : restingRatio;
|
|
180
|
+
const motion = resolveSheetMotion({
|
|
181
|
+
style: settings.motionStyle,
|
|
182
|
+
platform,
|
|
183
|
+
openRatio,
|
|
184
|
+
snapRatio: ratios.length > 1 ? Math.max(...ratios) - Math.min(...ratios) : openRatio,
|
|
185
|
+
openMs,
|
|
186
|
+
closeMs,
|
|
187
|
+
perSheetOpen: null != o.openAnimationDurationMs,
|
|
188
|
+
perSheetClose: null != o.closeAnimationDurationMs,
|
|
189
|
+
sizeScaled: settings.sizeScaledAnimationDuration
|
|
190
|
+
});
|
|
191
|
+
const content = <view className={`g9-sheet__content${false === o.scrollBody ? ' g9-sheet__content--fill' : ''}`} key={entry.version} bindlayoutchange={onBodyLayout}>
|
|
192
|
+
{body}
|
|
193
|
+
{!revealed ? placeholder : null}
|
|
194
|
+
{covering ? <view className="g9-sheet__cover" style={{
|
|
195
|
+
height: `${clampFitHeight(placeholderHeight, props.hostHeight, true)}px`
|
|
196
|
+
}}>
|
|
197
|
+
{placeholder}
|
|
198
|
+
</view> : null}
|
|
199
|
+
</view>;
|
|
200
|
+
return <SheetRoot ref={rootRef} show={showing} snapPoints={layout.snapPoints} initialSnap={layout.initialSnap} screenHeight={props.hostHeight} dragDisabled={layout.dragDisabled} enableDragToClose={layout.enableDragToClose} dismissThreshold={g9SheetDragCloseThreshold} handleOnly onShowChange={(open)=>{
|
|
137
201
|
if (!open) stack.requestBack(entry.id, 'drag');
|
|
138
202
|
}} onSnapChange={(index, value)=>{
|
|
139
|
-
var
|
|
203
|
+
var _detents_index;
|
|
140
204
|
var _props_onRest, _o_onStateChanged;
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
'large'
|
|
144
|
-
]).filter((d)=>d);
|
|
145
|
-
const ordered = [
|
|
146
|
-
'peek',
|
|
147
|
-
'medium',
|
|
148
|
-
'large'
|
|
149
|
-
].filter((d)=>detents.includes(d));
|
|
205
|
+
const detent = layout.fit ? 'fit' : null != (_detents_index = detents[index]) ? _detents_index : 'large';
|
|
206
|
+
setResting(detent);
|
|
150
207
|
null == (_props_onRest = props.onRest) || _props_onRest.call(props, value);
|
|
151
|
-
null == (_o_onStateChanged = o.onStateChanged) || _o_onStateChanged.call(o,
|
|
208
|
+
null == (_o_onStateChanged = o.onStateChanged) || _o_onStateChanged.call(o, detent, value);
|
|
152
209
|
}} onOpen={()=>stack.markOpened(entry.id)} onClose={()=>stack.markClosed(entry.id)}>
|
|
153
210
|
{}
|
|
154
|
-
<SheetView className=
|
|
155
|
-
'event-through':
|
|
211
|
+
<SheetView className={`g9-sheet__view${modal ? '' : ' g9-sheet__view--passthrough'}`} nativeProps={{
|
|
212
|
+
'event-through': modal
|
|
156
213
|
}}>
|
|
157
214
|
{modal ? <view event-through={false} className={`g9-sheet__scrim${props.isTop && !closing ? '' : ' g9-sheet__scrim--covered'}`} style={{
|
|
158
215
|
backgroundColor: scrimColor(entry, settings, opacity),
|
|
@@ -160,42 +217,50 @@ function G9SheetFrame(props) {
|
|
|
160
217
|
}} bindtap={()=>{
|
|
161
218
|
if (layout.closeOnOverlayTap) stack.requestBack(entry.id, 'overlayTap');
|
|
162
219
|
}}/> : null}
|
|
163
|
-
|
|
164
|
-
|
|
220
|
+
{}
|
|
221
|
+
<SheetContent className={`g9-sheet g9-sheet--${entry.status}${layout.fit ? ' g9-sheet--fit' : ''}`} style={platformSheetConstraints(o)} innerStyle={sheetInnerStyle} {...motion}>
|
|
222
|
+
<G9SheetGestureFrame refs={gesture} canDrag={!layout.dragDisabled} bodyDrags={false !== o.scrollingExpandsSheet} className="g9-sheet__frame" style={{
|
|
223
|
+
...recede,
|
|
224
|
+
transition: g9SheetRecedeTransition
|
|
225
|
+
}}>
|
|
226
|
+
<view className="g9-sheet__surface" {...g9IdProps(o.automationId)} style={{
|
|
227
|
+
backgroundColor: surface,
|
|
165
228
|
borderTopLeftRadius: `${corner}px`,
|
|
166
229
|
borderTopRightRadius: `${corner}px`,
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
...
|
|
170
|
-
}}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
<
|
|
176
|
-
|
|
177
|
-
<G9SheetHeader options={o} onBack={()=>void stack.requestBack(entry.id, 'toolbarButton')}/>
|
|
178
|
-
{o.showToolbar && false !== o.useStandardBodyTopGap ? <view className="g9-sheet__body-gap" style={{
|
|
230
|
+
paddingTop: `${topPadding}px`,
|
|
231
|
+
paddingBottom: `${bottomPadding}px`,
|
|
232
|
+
...notch
|
|
233
|
+
}}>
|
|
234
|
+
<SheetContext.Provider value={contextValue}>
|
|
235
|
+
{layout.showHandle || layout.fullScreen && o.showToolbar && false !== o.showFullScreenDragHandle && !layout.dragDisabled ? <view className="g9-sheet__grabber-area">
|
|
236
|
+
<view className="g9-sheet__grabber"/>
|
|
237
|
+
</view> : null}
|
|
238
|
+
<G9SheetHeader options={o} onBack={()=>void stack.requestBack(entry.id, 'toolbarButton')}/>
|
|
239
|
+
{o.showToolbar && false !== o.useStandardBodyTopGap ? <view className="g9-sheet__body-gap" style={{
|
|
179
240
|
height: `${g9SheetHeaderMetrics.bodyTopGap}px`
|
|
180
241
|
}}/> : null}
|
|
181
|
-
|
|
182
|
-
padding: `${null != (_o_padding = o.padding) ? _o_padding : 0}px
|
|
242
|
+
{false === o.scrollBody ? <view className={`g9-sheet__body g9-sheet__body--static${layout.fillBody ? ' g9-sheet__body--fill' : ''}`} style={{
|
|
243
|
+
padding: `${null != (_o_padding = o.padding) ? _o_padding : 0}px`
|
|
244
|
+
}}>
|
|
245
|
+
{content}
|
|
246
|
+
</view> : <scroll-view className={`g9-sheet__body${layout.fillBody ? ' g9-sheet__body--fill' : ''}`} scroll-orientation="vertical" main-thread:ref={gesture.body} main-thread:bindscroll={phone ? bodyGesture.onScrollMT : void 0} main-thread:bindtouchstart={bodyGesture.onTouchStartMT} style={{
|
|
247
|
+
padding: `${null != (_o_padding1 = o.padding) ? _o_padding1 : 0}px`,
|
|
183
248
|
...null !== maxBody ? {
|
|
184
249
|
maxHeight: `${maxBody}px`
|
|
185
250
|
} : {}
|
|
186
251
|
}}>
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
</
|
|
252
|
+
{content}
|
|
253
|
+
</scroll-view>}
|
|
254
|
+
<view className="g9-sheet__footer-slot" bindlayoutchange={onFooterLayout}>
|
|
255
|
+
<G9SheetFooter options={o}/>
|
|
256
|
+
</view>
|
|
257
|
+
</SheetContext.Provider>
|
|
258
|
+
</view>
|
|
259
|
+
{}
|
|
260
|
+
<view className="g9-sheet__skirt" style={{
|
|
261
|
+
backgroundColor: surface
|
|
262
|
+
}}/>
|
|
263
|
+
</G9SheetGestureFrame>
|
|
199
264
|
</SheetContent>
|
|
200
265
|
</SheetView>
|
|
201
266
|
</SheetRoot>;
|