@g9tm/lynxcontrols 1.4.5 → 1.4.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.tsbuildinfo +1 -1
- package/dist/base/index.d.ts +1 -1
- package/dist/base/index.d.ts.map +1 -1
- package/dist/base/index.jsx +1 -1
- package/dist/base/pressable.d.ts.map +1 -1
- package/dist/base/pressable.jsx +2 -1
- package/dist/base/pressable.jsx.map +1 -1
- package/dist/base/selection-item.d.ts +9 -1
- package/dist/base/selection-item.d.ts.map +1 -1
- package/dist/base/selection-item.jsx +10 -1
- package/dist/base/selection-item.jsx.map +1 -1
- package/dist/button/button.css +20 -0
- package/dist/button/button.css.map +1 -1
- package/dist/button/header-action-button.d.ts +5 -0
- package/dist/button/header-action-button.d.ts.map +1 -1
- package/dist/button/header-action-button.jsx +6 -1
- package/dist/button/header-action-button.jsx.map +1 -1
- package/dist/button/visuals.d.ts.map +1 -1
- package/dist/button/visuals.jsx +1 -1
- package/dist/button/visuals.jsx.map +1 -1
- package/dist/cascade/cascade-panel.d.ts.map +1 -1
- package/dist/cascade/cascade-panel.jsx +2 -2
- package/dist/cascade/cascade-panel.jsx.map +1 -1
- package/dist/edge-panel/edge-panel.jsx +5 -5
- package/dist/edge-panel/edge-panel.jsx.map +1 -1
- package/dist/expander/expander.d.ts.map +1 -1
- package/dist/expander/expander.jsx +2 -1
- package/dist/expander/expander.jsx.map +1 -1
- package/dist/fields/editor.d.ts.map +1 -1
- package/dist/fields/editor.jsx +2 -2
- package/dist/fields/editor.jsx.map +1 -1
- package/dist/fields/fields.css +21 -0
- package/dist/fields/fields.css.map +1 -1
- package/dist/fields/index.d.ts +1 -1
- package/dist/fields/index.d.ts.map +1 -1
- package/dist/fields/index.jsx +1 -1
- package/dist/fields/outlined-field.d.ts +27 -1
- package/dist/fields/outlined-field.d.ts.map +1 -1
- package/dist/fields/outlined-field.jsx +29 -2
- package/dist/fields/outlined-field.jsx.map +1 -1
- package/dist/fields/text-entry.d.ts.map +1 -1
- package/dist/fields/text-entry.jsx +2 -2
- package/dist/fields/text-entry.jsx.map +1 -1
- package/dist/host/host.css.map +1 -1
- package/dist/host/host.d.ts +3 -2
- package/dist/host/host.d.ts.map +1 -1
- package/dist/host/host.jsx +2 -2
- package/dist/host/host.jsx.map +1 -1
- package/dist/pickers/combo-box.d.ts +8 -0
- package/dist/pickers/combo-box.d.ts.map +1 -1
- package/dist/pickers/combo-box.jsx +51 -9
- package/dist/pickers/combo-box.jsx.map +1 -1
- package/dist/pickers/date-time-picker.d.ts +2 -2
- package/dist/pickers/date-time-picker.d.ts.map +1 -1
- package/dist/pickers/date-time-picker.jsx +4 -3
- package/dist/pickers/date-time-picker.jsx.map +1 -1
- package/dist/pickers/date-time.d.ts +5 -2
- package/dist/pickers/date-time.d.ts.map +1 -1
- package/dist/pickers/date-time.jsx +1 -1
- package/dist/pickers/date-time.jsx.map +1 -1
- package/dist/pickers/picker-sheet.d.ts +6 -2
- package/dist/pickers/picker-sheet.d.ts.map +1 -1
- package/dist/pickers/picker-sheet.jsx +2 -3
- package/dist/pickers/picker-sheet.jsx.map +1 -1
- package/dist/pickers/picker.d.ts.map +1 -1
- package/dist/pickers/picker.jsx +3 -2
- package/dist/pickers/picker.jsx.map +1 -1
- package/dist/pickers/pickers.css +27 -0
- package/dist/pickers/pickers.css.map +1 -1
- package/dist/pickers/timespan-picker.d.ts.map +1 -1
- package/dist/pickers/timespan-picker.jsx +3 -2
- package/dist/pickers/timespan-picker.jsx.map +1 -1
- package/dist/pickers/trigger.d.ts +3 -1
- package/dist/pickers/trigger.d.ts.map +1 -1
- package/dist/pickers/trigger.jsx +6 -1
- package/dist/pickers/trigger.jsx.map +1 -1
- package/dist/plus-button/model.d.ts.map +1 -1
- package/dist/plus-button/model.jsx +5 -1
- package/dist/plus-button/model.jsx.map +1 -1
- package/dist/popup/frame.jsx +2 -2
- package/dist/popup/frame.jsx.map +1 -1
- package/dist/popup/service.d.ts.map +1 -1
- package/dist/popup/service.jsx +2 -2
- package/dist/popup/service.jsx.map +1 -1
- package/dist/provider/provider.css +4 -0
- package/dist/provider/provider.css.map +1 -1
- package/dist/provider/provider.d.ts.map +1 -1
- package/dist/provider/provider.jsx +4 -2
- package/dist/provider/provider.jsx.map +1 -1
- package/dist/provider/settings.d.ts +12 -0
- package/dist/provider/settings.d.ts.map +1 -1
- package/dist/provider/settings.jsx +6 -3
- package/dist/provider/settings.jsx.map +1 -1
- package/dist/provider/theme.css +4 -0
- package/dist/provider/theme.css.map +1 -1
- package/dist/range-slider/math.d.ts +14 -4
- package/dist/range-slider/math.d.ts.map +1 -1
- package/dist/range-slider/math.jsx +16 -4
- package/dist/range-slider/math.jsx.map +1 -1
- package/dist/range-slider/range-slider.css +17 -0
- package/dist/range-slider/range-slider.css.map +1 -1
- package/dist/range-slider/range-slider.d.ts +11 -0
- package/dist/range-slider/range-slider.d.ts.map +1 -1
- package/dist/range-slider/range-slider.jsx +35 -13
- package/dist/range-slider/range-slider.jsx.map +1 -1
- package/dist/selection/index.d.ts +2 -1
- package/dist/selection/index.d.ts.map +1 -1
- package/dist/selection/index.jsx +2 -1
- package/dist/selection/selection-sheet.d.ts +8 -1
- package/dist/selection/selection-sheet.d.ts.map +1 -1
- package/dist/selection/selection-sheet.jsx +64 -11
- package/dist/selection/selection-sheet.jsx.map +1 -1
- package/dist/selection/selection.css +7 -0
- package/dist/selection/selection.css.map +1 -1
- package/dist/selection/window.d.ts +29 -0
- package/dist/selection/window.d.ts.map +1 -0
- package/dist/selection/window.jsx +24 -0
- package/dist/selection/window.jsx.map +1 -0
- package/dist/sheet/frame.d.ts.map +1 -1
- package/dist/sheet/frame.jsx +35 -9
- package/dist/sheet/frame.jsx.map +1 -1
- package/dist/sheet/header.d.ts.map +1 -1
- package/dist/sheet/header.jsx +3 -1
- package/dist/sheet/header.jsx.map +1 -1
- package/dist/sheet/index.d.ts +2 -1
- package/dist/sheet/index.d.ts.map +1 -1
- package/dist/sheet/index.jsx +2 -1
- package/dist/sheet/motion.d.ts.map +1 -1
- package/dist/sheet/motion.jsx +14 -0
- package/dist/sheet/motion.jsx.map +1 -1
- package/dist/sheet/options.d.ts +26 -0
- package/dist/sheet/options.d.ts.map +1 -1
- package/dist/sheet/options.jsx +2 -1
- package/dist/sheet/options.jsx.map +1 -1
- package/dist/sheet/scroll-indicator.d.ts +33 -0
- package/dist/sheet/scroll-indicator.d.ts.map +1 -0
- package/dist/sheet/scroll-indicator.jsx +84 -0
- package/dist/sheet/scroll-indicator.jsx.map +1 -0
- package/dist/sheet/service.d.ts +8 -0
- package/dist/sheet/service.d.ts.map +1 -1
- package/dist/sheet/service.jsx +15 -4
- package/dist/sheet/service.jsx.map +1 -1
- package/dist/sheet/sheet.css +14 -0
- package/dist/sheet/sheet.css.map +1 -1
- package/dist/sheet/sizing.d.ts +2 -0
- package/dist/sheet/sizing.d.ts.map +1 -1
- package/dist/sheet/sizing.jsx +2 -1
- package/dist/sheet/sizing.jsx.map +1 -1
- package/dist/tab-bar/tab-bar.d.ts.map +1 -1
- package/dist/tab-bar/tab-bar.jsx +11 -6
- package/dist/tab-bar/tab-bar.jsx.map +1 -1
- package/dist/toast/service.jsx +3 -3
- package/dist/toast/service.jsx.map +1 -1
- package/dist/toast/store.d.ts.map +1 -1
- package/dist/toast/store.jsx +3 -2
- package/dist/toast/store.jsx.map +1 -1
- package/dist/toggle/chip-group.d.ts +9 -1
- package/dist/toggle/chip-group.d.ts.map +1 -1
- package/dist/toggle/chip-group.jsx +51 -12
- package/dist/toggle/chip-group.jsx.map +1 -1
- package/dist/toggle/switch.d.ts +1 -1
- package/dist/toggle/switch.d.ts.map +1 -1
- package/dist/toggle/switch.jsx +3 -2
- package/dist/toggle/switch.jsx.map +1 -1
- package/dist/toggle/toggle.css +20 -0
- package/dist/toggle/toggle.css.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pickers/timespan-picker.jsx","sources":["../../src/pickers/timespan-picker.tsx"],"sourcesContent":["import './pickers.css';\nimport { type G9Culture, G9StringKey, toNativeDigits } from '@g9tm/lynxcontrols-foundation';\nimport { type ReactNode, useRef, useState } from '@lynx-js/react';\nimport { useControllableState } from '../base/use-controllable-state';\nimport { useG9Culture, useG9Settings, useG9Strings } from '../provider/hooks';\nimport { useG9Sheets } from '../sheet/service';\nimport type { G9WheelItem } from './date-time';\nimport { PickerSheetHeader, showPickerSheet } from './picker-sheet';\nimport {\n composeTimeSpan,\n formatTimeSpan,\n type G9TimeSpanParts,\n G9TimeSpanPickerMode,\n g9TimeSpanDefaultMaxDays,\n g9TimeSpanMaxYears,\n timeSpanDepth,\n timeSpanParts,\n} from './timespan';\nimport { type G9PickerFieldProps, PickerField, usePickerOpen } from './trigger';\nimport { G9WheelColumn } from './wheel-column';\n\n/** Props of {@link G9TimeSpanPicker}. */\nexport interface G9TimeSpanPickerProps extends G9PickerFieldProps {\n /** Duration in milliseconds (MAUI `SelectedTimeSpan`); `null` = none. Controlled with `onValueChange`. */\n readonly value?: number | null;\n readonly defaultValue?: number | null;\n readonly onValueChange?: (ms: number | null) => void;\n /** Which drums show. Default `'yearsMonthsDays'`. */\n readonly mode?: G9TimeSpanPickerMode;\n /** Caption of the seconds drum (there is no localized key for it). Default `'s'`. */\n readonly secondsLabel?: string;\n /** Done confirmed a duration (MAUI `TimeSpanSelected`). */\n readonly onTimeSpanSelected?: (ms: number) => void;\n}\n\nconst range = (from: number, to: number, culture: G9Culture, width: number): G9WheelItem[] =>\n Array.from({ length: to - from + 1 }, (_, i) => ({\n value: from + i,\n text: toNativeDigits(String(from + i).padStart(width, '0'), culture.numberingSystem),\n }));\n\n/** The duration drum sheet body (MAUI `G9TimeSpanPickerSheet`, plus the hours/minutes/seconds drums). */\nexport function TimeSpanSheetBody(props: {\n readonly title: string;\n readonly initial: number;\n readonly mode: G9TimeSpanPickerMode;\n readonly culture: G9Culture;\n readonly secondsLabel: string;\n readonly done: (ms: number) => void;\n readonly cancel: () => void;\n}): ReactNode {\n const strings = useG9Strings();\n const { culture } = props;\n const depth = timeSpanDepth(props.mode);\n // What Done returns is what the drums show, also when nothing is touched (MAUI fix).\n const [parts, setParts] = useState<G9TimeSpanParts>(() => timeSpanParts(props.initial, props.mode));\n // The latest drums, written synchronously: Done can be tapped before the re-render binds a handler that closes over\n // the new parts, and returned the old duration (Windows CI agent, Azure build 541). See DateTimeSheetBody.\n const latest = useRef(parts);\n const change = (patch: Partial<G9TimeSpanParts>) => {\n latest.current = { ...latest.current, ...patch };\n setParts(latest.current);\n };\n return (\n <view className=\"g9-picker-sheet\">\n <PickerSheetHeader\n title={props.title}\n onCancel={props.cancel}\n onDone={() => props.done(composeTimeSpan(latest.current))}\n />\n <view className={`g9-picker-sheet__wheels g9-dir-${culture.direction}`}>\n <G9WheelColumn\n label={strings.get(G9StringKey.Year)}\n items={range(0, g9TimeSpanMaxYears, culture, 2)}\n value={parts.years}\n onValueChange={(years) => change({ years })}\n />\n <G9WheelColumn\n label={strings.get(G9StringKey.Month)}\n items={range(0, 11, culture, 2)}\n value={parts.months}\n onValueChange={(months) => change({ months })}\n />\n {depth >= 1 ? (\n <G9WheelColumn\n label={strings.get(G9StringKey.Day)}\n items={range(0, Math.max(g9TimeSpanDefaultMaxDays, parts.days), culture, 2)}\n value={parts.days}\n onValueChange={(days) => change({ days })}\n />\n ) : null}\n {depth >= 2 ? (\n <G9WheelColumn\n label={strings.get(G9StringKey.Hour)}\n items={range(0, 23, culture, 2)}\n value={parts.hours}\n onValueChange={(hours) => change({ hours })}\n />\n ) : null}\n {depth >= 3 ? (\n <G9WheelColumn\n label={strings.get(G9StringKey.Minute)}\n items={range(0, 59, culture, 2)}\n value={parts.minutes}\n onValueChange={(minutes) => change({ minutes })}\n />\n ) : null}\n {depth >= 4 ? (\n <G9WheelColumn\n label={props.secondsLabel}\n items={range(0, 59, culture, 2)}\n value={parts.seconds}\n onValueChange={(seconds) => change({ seconds })}\n />\n ) : null}\n </view>\n </view>\n );\n}\n\n/**\n * A duration in an outlined box (MAUI `G9TimeSpanPicker`): a tap opens the drum sheet; Done writes the value and\n * fires `onTimeSpanSelected`, Cancel and dismissals write nothing. Years/months/days follow the 365/30 convention;\n * the hours/minutes/seconds modes add those drums (MAUI accepted the modes but never showed them). Must be inside a\n * `G9Host`.\n */\nexport function G9TimeSpanPicker(props: G9TimeSpanPickerProps): ReactNode {\n const sheets = useG9Sheets();\n const culture = useG9Culture();\n const strings = useG9Strings();\n const glyphs = useG9Settings().glyphs;\n const open = usePickerOpen();\n const mode = props.mode ?? G9TimeSpanPickerMode.YearsMonthsDays;\n const [value, setValue] = useControllableState<number | null>({\n value: props.value,\n defaultValue: props.defaultValue ?? null,\n onChange: props.onValueChange,\n name: 'G9TimeSpanPicker.value',\n });\n const latest = useRef({ props, value });\n latest.current = { props, value };\n\n const onOpen = () =>\n open(async (isCurrent) => {\n const p = latest.current.props;\n const title = p.label?.trim() ? p.label : strings.get(G9StringKey.SelectDuration);\n const result = await showPickerSheet<number>(sheets, ({ done, cancel }) => (\n <TimeSpanSheetBody\n title={title}\n initial={latest.current.value ?? 0}\n mode={mode}\n culture={culture}\n secondsLabel={p.secondsLabel ?? 's'}\n done={done}\n cancel={cancel}\n />\n ));\n if (!isCurrent() || result === null) return;\n setValue(result);\n latest.current.props.onTimeSpanSelected?.(result);\n });\n\n return (\n <PickerField field={{ trailingIcon: glyphs.dateRange, ...props }} hasValue={value !== null} onOpen={onOpen}>\n <text className={`g9-picker__text${value !== null ? '' : ' g9-picker__text--placeholder'}`} text-maxline=\"1\">\n {value !== null ? formatTimeSpan(value, mode, strings, culture) : props.label ? '' : (props.placeholder ?? '')}\n </text>\n </PickerField>\n );\n}\n"],"names":["range","from","to","culture","width","Array","_","i","toNativeDigits","String","TimeSpanSheetBody","props","strings","useG9Strings","depth","timeSpanDepth","parts","setParts","useState","timeSpanParts","latest","useRef","change","patch","view","PickerSheetHeader","composeTimeSpan","G9WheelColumn","G9StringKey","g9TimeSpanMaxYears","years","months","Math","g9TimeSpanDefaultMaxDays","days","hours","minutes","seconds","G9TimeSpanPicker","_props_mode","_props_defaultValue","_props_placeholder","sheets","useG9Sheets","useG9Culture","glyphs","useG9Settings","open","usePickerOpen","mode","G9TimeSpanPickerMode","value","setValue","useControllableState","onOpen","isCurrent","_p_label","_latest_current_props","p","title","result","showPickerSheet","done","cancel","_latest_current_value","_p_secondsLabel","PickerField","text","formatTimeSpan"],"mappings":";;;;;;;;;;AAmCA,MAAMA,QAAQ,CAACC,MAAcC,IAAYC,SAAoBC,QAC3DC,MAAM,IAAI,CAAC;QAAE,QAAQH,KAAKD,OAAO;IAAE,GAAG,CAACK,GAAGC,IAAO;YAC/C,OAAON,OAAOM;YACd,MAAMC,eAAeC,OAAOR,OAAOM,GAAG,QAAQ,CAACH,OAAO,MAAMD,QAAQ,eAAe;QACrF;AAGK,SAASO,kBAAkBC,KAQjC;IACC,MAAMC,UAAUC;IAChB,MAAM,EAAEV,OAAO,EAAE,GAAGQ;IACpB,MAAMG,QAAQC,cAAcJ,MAAM,IAAI;IAEtC,MAAM,CAACK,OAAOC,SAAS,GAAGC,SAA0B,IAAMC,cAAcR,MAAM,OAAO,EAAEA,MAAM,IAAI;IAGjG,MAAMS,SAASC,OAAOL;IACtB,MAAMM,SAAS,CAACC;QACdH,OAAO,OAAO,GAAG;YAAE,GAAGA,OAAO,OAAO;YAAE,GAAGG,KAAK;QAAC;QAC/CN,SAASG,OAAO,OAAO;IACzB;IACA,QACGI,KAAK,UAAU,kBAAkB;MAChC,CAACC,kBACC,OAAOd,MAAM,KAAK,EAClB,UAAUA,MAAM,MAAM,EACtB,QAAQ,IAAMA,MAAM,IAAI,CAACe,gBAAgBN,OAAO,OAAO,KACvD;MACF,CAACI,KAAK,WAAW,CAAC,+BAA+B,EAAErB,QAAQ,SAAS,EAAE,EAAE;QACtE,CAACwB,cACC,OAAOf,QAAQ,GAAG,CAACgB,YAAY,IAAI,GACnC,OAAO5B,MAAM,GAAG6B,oB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,QACGM,YAAY,OAAO;QAAE,cAAcrB,OAAO,SAAS;QAAE,GAAGlC,KAAK;IAAC,GAAG,UAAUwC,AAAU,SAAVA,OAAgB,QAAQG,QAAQ;MAC1G,CAACa,KAAK,WAAW,CAAC,eAAe,EAAEhB,AAAU,SAAVA,QAAiB,KAAK,iCAAiC,EAAE,aAAa,IAAI;QAC3G,CAACA,AAAU,SAAVA,QAAiBiB,eAAejB,OAAOF,MAAMrC,SAAST,WAAWQ,MAAM,KAAK,GAAG,KAAK,QAAC8B,CAAAA,qBAAAA,MAAM,WAAW,AAAD,IAAhBA,qBAAqB,GAAI;MACjH,EAAE0B,KAAK;IACT,EAAED;AAEN"}
|
|
1
|
+
{"version":3,"file":"pickers/timespan-picker.jsx","sources":["../../src/pickers/timespan-picker.tsx"],"sourcesContent":["import { resolveRestingPlaceholder } from '../fields/outlined-field';\nimport './pickers.css';\nimport { type G9Culture, G9StringKey, toNativeDigits } from '@g9tm/lynxcontrols-foundation';\nimport { type ReactNode, useRef, useState } from '@lynx-js/react';\nimport { useControllableState } from '../base/use-controllable-state';\nimport { useG9Culture, useG9Settings, useG9Strings } from '../provider/hooks';\nimport { useG9Sheets } from '../sheet/service';\nimport type { G9WheelItem } from './date-time';\nimport { PickerSheetHeader, showPickerSheet } from './picker-sheet';\nimport {\n composeTimeSpan,\n formatTimeSpan,\n type G9TimeSpanParts,\n G9TimeSpanPickerMode,\n g9TimeSpanDefaultMaxDays,\n g9TimeSpanMaxYears,\n timeSpanDepth,\n timeSpanParts,\n} from './timespan';\nimport { type G9PickerFieldProps, PickerField, usePickerOpen } from './trigger';\nimport { G9WheelColumn } from './wheel-column';\n\n/** Props of {@link G9TimeSpanPicker}. */\nexport interface G9TimeSpanPickerProps extends G9PickerFieldProps {\n /** Duration in milliseconds (MAUI `SelectedTimeSpan`); `null` = none. Controlled with `onValueChange`. */\n readonly value?: number | null;\n readonly defaultValue?: number | null;\n readonly onValueChange?: (ms: number | null) => void;\n /** Which drums show. Default `'yearsMonthsDays'`. */\n readonly mode?: G9TimeSpanPickerMode;\n /** Caption of the seconds drum (there is no localized key for it). Default `'s'`. */\n readonly secondsLabel?: string;\n /** Done confirmed a duration (MAUI `TimeSpanSelected`). */\n readonly onTimeSpanSelected?: (ms: number) => void;\n}\n\nconst range = (from: number, to: number, culture: G9Culture, width: number): G9WheelItem[] =>\n Array.from({ length: to - from + 1 }, (_, i) => ({\n value: from + i,\n text: toNativeDigits(String(from + i).padStart(width, '0'), culture.numberingSystem),\n }));\n\n/** The duration drum sheet body (MAUI `G9TimeSpanPickerSheet`, plus the hours/minutes/seconds drums). */\nexport function TimeSpanSheetBody(props: {\n readonly title: string;\n readonly initial: number;\n readonly mode: G9TimeSpanPickerMode;\n readonly culture: G9Culture;\n readonly secondsLabel: string;\n readonly done: (ms: number) => void;\n readonly cancel: () => void;\n}): ReactNode {\n const strings = useG9Strings();\n const { culture } = props;\n const depth = timeSpanDepth(props.mode);\n // What Done returns is what the drums show, also when nothing is touched (MAUI fix).\n const [parts, setParts] = useState<G9TimeSpanParts>(() => timeSpanParts(props.initial, props.mode));\n // The latest drums, written synchronously: Done can be tapped before the re-render binds a handler that closes over\n // the new parts, and returned the old duration (Windows CI agent, Azure build 541). See DateTimeSheetBody.\n const latest = useRef(parts);\n const change = (patch: Partial<G9TimeSpanParts>) => {\n latest.current = { ...latest.current, ...patch };\n setParts(latest.current);\n };\n return (\n <view className=\"g9-picker-sheet\">\n <PickerSheetHeader\n title={props.title}\n onCancel={props.cancel}\n onDone={() => props.done(composeTimeSpan(latest.current))}\n />\n <view className={`g9-picker-sheet__wheels g9-dir-${culture.direction}`}>\n <G9WheelColumn\n label={strings.get(G9StringKey.Year)}\n items={range(0, g9TimeSpanMaxYears, culture, 2)}\n value={parts.years}\n onValueChange={(years) => change({ years })}\n />\n <G9WheelColumn\n label={strings.get(G9StringKey.Month)}\n items={range(0, 11, culture, 2)}\n value={parts.months}\n onValueChange={(months) => change({ months })}\n />\n {depth >= 1 ? (\n <G9WheelColumn\n label={strings.get(G9StringKey.Day)}\n items={range(0, Math.max(g9TimeSpanDefaultMaxDays, parts.days), culture, 2)}\n value={parts.days}\n onValueChange={(days) => change({ days })}\n />\n ) : null}\n {depth >= 2 ? (\n <G9WheelColumn\n label={strings.get(G9StringKey.Hour)}\n items={range(0, 23, culture, 2)}\n value={parts.hours}\n onValueChange={(hours) => change({ hours })}\n />\n ) : null}\n {depth >= 3 ? (\n <G9WheelColumn\n label={strings.get(G9StringKey.Minute)}\n items={range(0, 59, culture, 2)}\n value={parts.minutes}\n onValueChange={(minutes) => change({ minutes })}\n />\n ) : null}\n {depth >= 4 ? (\n <G9WheelColumn\n label={props.secondsLabel}\n items={range(0, 59, culture, 2)}\n value={parts.seconds}\n onValueChange={(seconds) => change({ seconds })}\n />\n ) : null}\n </view>\n </view>\n );\n}\n\n/**\n * A duration in an outlined box (MAUI `G9TimeSpanPicker`): a tap opens the drum sheet; Done writes the value and\n * fires `onTimeSpanSelected`, Cancel and dismissals write nothing. Years/months/days follow the 365/30 convention;\n * the hours/minutes/seconds modes add those drums (MAUI accepted the modes but never showed them). Must be inside a\n * `G9Host`.\n */\nexport function G9TimeSpanPicker(props: G9TimeSpanPickerProps): ReactNode {\n const sheets = useG9Sheets();\n const culture = useG9Culture();\n const strings = useG9Strings();\n const glyphs = useG9Settings().glyphs;\n const open = usePickerOpen();\n const mode = props.mode ?? G9TimeSpanPickerMode.YearsMonthsDays;\n const [value, setValue] = useControllableState<number | null>({\n value: props.value,\n defaultValue: props.defaultValue ?? null,\n onChange: props.onValueChange,\n name: 'G9TimeSpanPicker.value',\n });\n const latest = useRef({ props, value });\n latest.current = { props, value };\n\n const onOpen = () =>\n open(async (isCurrent) => {\n const p = latest.current.props;\n const title = p.label?.trim() ? p.label : strings.get(G9StringKey.SelectDuration);\n const result = await showPickerSheet<number>(sheets, ({ done, cancel }) => (\n <TimeSpanSheetBody\n title={title}\n initial={latest.current.value ?? 0}\n mode={mode}\n culture={culture}\n secondsLabel={p.secondsLabel ?? 's'}\n done={done}\n cancel={cancel}\n />\n ));\n if (!isCurrent() || result === null) return;\n setValue(result);\n latest.current.props.onTimeSpanSelected?.(result);\n });\n\n return (\n <PickerField field={{ trailingIcon: glyphs.dateRange, ...props }} hasValue={value !== null} onOpen={onOpen}>\n <text className={`g9-picker__text${value !== null ? '' : ' g9-picker__text--placeholder'}`} text-maxline=\"1\">\n {value !== null ? formatTimeSpan(value, mode, strings, culture) : (resolveRestingPlaceholder(props) ?? '')}\n </text>\n </PickerField>\n );\n}\n"],"names":["range","from","to","culture","width","Array","_","i","toNativeDigits","String","TimeSpanSheetBody","props","strings","useG9Strings","depth","timeSpanDepth","parts","setParts","useState","timeSpanParts","latest","useRef","change","patch","view","PickerSheetHeader","composeTimeSpan","G9WheelColumn","G9StringKey","g9TimeSpanMaxYears","years","months","Math","g9TimeSpanDefaultMaxDays","days","hours","minutes","seconds","G9TimeSpanPicker","_props_mode","_props_defaultValue","_resolveRestingPlaceholder","sheets","useG9Sheets","useG9Culture","glyphs","useG9Settings","open","usePickerOpen","mode","G9TimeSpanPickerMode","value","setValue","useControllableState","onOpen","isCurrent","_p_label","_latest_current_props","p","title","result","showPickerSheet","done","cancel","_latest_current_value","_p_secondsLabel","PickerField","text","formatTimeSpan"],"mappings":";;;;;;;;;;;AAoCA,MAAMA,QAAQ,CAACC,MAAcC,IAAYC,SAAoBC,QAC3DC,MAAM,IAAI,CAAC;QAAE,QAAQH,KAAKD,OAAO;IAAE,GAAG,CAACK,GAAGC,IAAO;YAC/C,OAAON,OAAOM;YACd,MAAMC,eAAeC,OAAOR,OAAOM,GAAG,QAAQ,CAACH,OAAO,MAAMD,QAAQ,eAAe;QACrF;AAGK,SAASO,kBAAkBC,KAQjC;IACC,MAAMC,UAAUC;IAChB,MAAM,EAAEV,OAAO,EAAE,GAAGQ;IACpB,MAAMG,QAAQC,cAAcJ,MAAM,IAAI;IAEtC,MAAM,CAACK,OAAOC,SAAS,GAAGC,SAA0B,IA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AS,MAAMC,gBAAwBnB,QAAQ,CAAC,EAAEoB,IAAI,EAAEC,MAAM,EAAE;oBAGzDC,uBAGKC;wBALfvD,kBACC,OAAOiD,OACP,SAAS,QAAAK,CAAAA,wBAAAA,OAAO,OAAO,CAAC,KAAK,AAAD,IAAnBA,wBAAwB,GACjC,MAAMf,MACN,SAAS9C,SACT,cAAc,QAAA8D,CAAAA,kBAAAA,EAAE,YAAY,AAAD,IAAbA,kBAAkB,KAChC,MAAMH,MACN,QAAQC;;YAGZ,IAAI,CAACR,eAAeK,AAAW,SAAXA,QAAiB;YACrCR,SAASQ;oBACTH,CAAAA,2CAAAA,AAAAA,CAAAA,wBAAAA,OAAO,OAAO,CAAC,KAAK,AAAD,EAAE,kBAAkB,AAAD,KAAtCA,yCAAAA,IAAAA,CAAAA,uBAA0CG;QAC5C;IAEF,QACGM,YAAY,OAAO;QAAE,cAAcrB,OAAO,SAAS;QAAE,GAAGlC,KAAK;IAAC,GAAG,UAAUwC,AAAU,SAAVA,OAAgB,QAAQG,QAAQ;MAC1G,CAACa,KAAK,WAAW,CAAC,eAAe,EAAEhB,AAAU,SAAVA,QAAiB,KAAK,iCAAiC,EAAE,aAAa,IAAI;QAC3G,CAACA,AAAU,SAAVA,QAAiBiB,eAAejB,OAAOF,MAAMrC,SAAST,WAAW,QAACsC,CAAAA,6BAAAA,0BAA0B9B,MAAK,IAA/B8B,6BAAoC,GAAI;MAC7G,EAAE0B,KAAK;IACT,EAAED;AAEN"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import './pickers.css';
|
|
2
2
|
import type { G9TextInputDirection } from '@g9tm/lynxcontrols-foundation';
|
|
3
3
|
import { type ReactNode } from '@lynx-js/react';
|
|
4
|
-
import type
|
|
4
|
+
import { type G9SelectionItem } from '../base/selection-item.js';
|
|
5
5
|
import { type G9OutlinedFieldProps, type G9TrailingAffordance } from '../fields/outlined-field.js';
|
|
6
6
|
/**
|
|
7
7
|
* Opens a picker sheet at most once at a time and drops results that arrive after the field unmounted (MAUI
|
|
@@ -17,6 +17,8 @@ export declare function valueDirectionClass(direction: G9TextInputDirection | un
|
|
|
17
17
|
export declare function SelectionValueIcon(props: {
|
|
18
18
|
readonly item: G9SelectionItem;
|
|
19
19
|
readonly color?: string;
|
|
20
|
+
/** In a multi-select chip: a person's picture is left out — the chip is the name alone (MAUI 1.4.10 IsAvatar). */
|
|
21
|
+
readonly inChip?: boolean;
|
|
20
22
|
}): ReactNode;
|
|
21
23
|
/** Props shared by every picker trigger: the outlined field props (label, helper, error, icons, read-only, …). */
|
|
22
24
|
export type G9PickerFieldProps = G9OutlinedFieldProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trigger.d.ts","sourceRoot":"","sources":["../../src/pickers/trigger.tsx"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,gBAAgB,CAAC;AAEnE,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"trigger.d.ts","sourceRoot":"","sources":["../../src/pickers/trigger.tsx"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,gBAAgB,CAAC;AAEnE,OAAO,EAAE,KAAK,eAAe,EAAiB,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EAAmB,KAAK,oBAAoB,EAAE,KAAK,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAKjH;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,CAAC,GAAG,EAAE,CAAC,SAAS,EAAE,MAAM,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,CAwB1F;AAED,yFAAyF;AACzF,wBAAgB,cAAc,CAAC,SAAS,EAAE,oBAAoB,GAAG,SAAS,EAAE,OAAO,EAAE,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAEjH;AAED,qFAAqF;AACrF,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,oBAAoB,GAAG,SAAS,EAAE,OAAO,EAAE,KAAK,GAAG,KAAK,GAAG,MAAM,CAE/G;AAED,iHAAiH;AACjH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE;IACxC,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;IAC/B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,kHAAkH;IAClH,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;CAC3B,GAAG,SAAS,CA4BZ;AAED,kHAAkH;AAClH,MAAM,MAAM,kBAAkB,GAAG,oBAAoB,CAAC;AAEtD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE;IACjC,QAAQ,CAAC,KAAK,EAAE,kBAAkB,CAAC;IACnC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC;IAC5B,QAAQ,CAAC,kBAAkB,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAC1D,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;CAC/B,GAAG,SAAS,CAqBZ"}
|
package/dist/pickers/trigger.jsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "./pickers.css";
|
|
2
2
|
import { useEffect, useRef } from "@lynx-js/react";
|
|
3
3
|
import { g9RowStyle } from "../base/control.jsx";
|
|
4
|
+
import { isAvatarImage } from "../base/selection-item.jsx";
|
|
4
5
|
import { G9OutlinedField } from "../fields/outlined-field.jsx";
|
|
5
6
|
import { G9IconSlot, hasIconSlot } from "../icon/slot.jsx";
|
|
6
7
|
import { G9Swatch } from "../icon/swatch.jsx";
|
|
@@ -42,6 +43,8 @@ function SelectionValueIcon(props) {
|
|
|
42
43
|
var _item_emoji, _item_iconPath, _item_iconImage;
|
|
43
44
|
var _item_swatchFirstColor, _item_swatchSecondColor;
|
|
44
45
|
const { item } = props;
|
|
46
|
+
const avatar = isAvatarImage(item);
|
|
47
|
+
if (avatar && props.inChip) return null;
|
|
45
48
|
const icon = {
|
|
46
49
|
emoji: null != (_item_emoji = item.emoji) ? _item_emoji : null,
|
|
47
50
|
icon: item.icon,
|
|
@@ -51,7 +54,9 @@ function SelectionValueIcon(props) {
|
|
|
51
54
|
if (hasIconSlot(icon)) {
|
|
52
55
|
var _ref, _item_iconTintColor;
|
|
53
56
|
return <view className="g9-picker__icon">
|
|
54
|
-
<G9IconSlot {...icon} size={18} color={null != (_ref = null != (_item_iconTintColor = item.iconTintColor) ? _item_iconTintColor : props.color) ? _ref : 'var(--g9-on-surface-variant)'}
|
|
57
|
+
<G9IconSlot {...icon} size={18} color={null != (_ref = null != (_item_iconTintColor = item.iconTintColor) ? _item_iconTintColor : props.color) ? _ref : 'var(--g9-on-surface-variant)'} {...avatar ? {
|
|
58
|
+
imageCornerRadius: 9
|
|
59
|
+
} : {}}/>
|
|
55
60
|
</view>;
|
|
56
61
|
}
|
|
57
62
|
if ((null == (_item_swatchFirstColor = item.swatchFirstColor) ? void 0 : _item_swatchFirstColor.trim()) || (null == (_item_swatchSecondColor = item.swatchSecondColor) ? void 0 : _item_swatchSecondColor.trim())) return <G9Swatch first={item.swatchFirstColor} second={item.swatchSecondColor} className="g9-picker__swatch"/>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pickers/trigger.jsx","sources":["../../src/pickers/trigger.tsx"],"sourcesContent":["import './pickers.css';\nimport type { G9TextInputDirection } from '@g9tm/lynxcontrols-foundation';\nimport { type ReactNode, useEffect, useRef } from '@lynx-js/react';\nimport { g9RowStyle } from '../base/control';\nimport type
|
|
1
|
+
{"version":3,"file":"pickers/trigger.jsx","sources":["../../src/pickers/trigger.tsx"],"sourcesContent":["import './pickers.css';\nimport type { G9TextInputDirection } from '@g9tm/lynxcontrols-foundation';\nimport { type ReactNode, useEffect, useRef } from '@lynx-js/react';\nimport { g9RowStyle } from '../base/control';\nimport { type G9SelectionItem, isAvatarImage } from '../base/selection-item';\nimport { G9OutlinedField, type G9OutlinedFieldProps, type G9TrailingAffordance } from '../fields/outlined-field';\nimport { G9IconSlot, hasIconSlot } from '../icon/slot';\nimport { G9Swatch } from '../icon/swatch';\nimport { useG9Diagnostics, useG9Direction } from '../provider/hooks';\n\n/**\n * Opens a picker sheet at most once at a time and drops results that arrive after the field unmounted (MAUI\n * `_isOpening` + `Unloaded`). `open(run)` runs `run(isCurrent)`; `isCurrent()` is false once a newer open started or\n * the field is gone, so a stale result applies nothing. Errors go to the provider's diagnostics.\n */\nexport function usePickerOpen(): (run: (isCurrent: () => boolean) => Promise<void>) => void {\n const opening = useRef(false);\n const generation = useRef(0);\n const diagnostics = useG9Diagnostics();\n useEffect(\n () => () => {\n generation.current += 1;\n },\n [],\n );\n return (run) => {\n if (opening.current) return;\n opening.current = true;\n const mine = ++generation.current;\n void (async () => {\n try {\n await run(() => generation.current === mine);\n } catch (error) {\n diagnostics.log({ level: 'error', message: 'Picker failed.', source: 'G9Picker', error });\n } finally {\n opening.current = false;\n }\n })();\n };\n}\n\n/** The reading direction of a value written with a `G9TextInputDirection` (internal). */\nexport function valueDirection(direction: G9TextInputDirection | undefined, culture: 'ltr' | 'rtl'): 'ltr' | 'rtl' {\n return direction === 'leftToRight' ? 'ltr' : direction === 'rightToLeft' ? 'rtl' : culture;\n}\n\n/** The physical direction class of a value written with a `G9TextInputDirection`. */\nexport function valueDirectionClass(direction: G9TextInputDirection | undefined, culture: 'ltr' | 'rtl'): string {\n return `g9-dir-${valueDirection(direction, culture)}`;\n}\n\n/** The leading icon (or colour swatch) of a selected item inside the trigger (MAUI `CreateValueIcon`, 18 px). */\nexport function SelectionValueIcon(props: {\n readonly item: G9SelectionItem;\n readonly color?: string;\n /** In a multi-select chip: a person's picture is left out — the chip is the name alone (MAUI 1.4.10 IsAvatar). */\n readonly inChip?: boolean;\n}): ReactNode {\n const { item } = props;\n const avatar = isAvatarImage(item);\n if (avatar && props.inChip) return null;\n const icon = {\n emoji: item.emoji ?? null,\n icon: item.icon,\n imagePath: item.iconPath ?? null,\n image: item.iconImage ?? null,\n };\n if (hasIconSlot(icon)) {\n // MAUI keeps 8 px between the value icon and its text (6 px inside a combo chip): pickers.css. A single value that is\n // a person's picture is round (corner 9 of 18).\n return (\n <view className=\"g9-picker__icon\">\n <G9IconSlot\n {...icon}\n size={18}\n color={item.iconTintColor ?? props.color ?? 'var(--g9-on-surface-variant)'}\n {...(avatar ? { imageCornerRadius: 9 } : {})}\n />\n </view>\n );\n }\n if (item.swatchFirstColor?.trim() || item.swatchSecondColor?.trim()) {\n return <G9Swatch first={item.swatchFirstColor} second={item.swatchSecondColor} className=\"g9-picker__swatch\" />;\n }\n return null;\n}\n\n/** Props shared by every picker trigger: the outlined field props (label, helper, error, icons, read-only, …). */\nexport type G9PickerFieldProps = G9OutlinedFieldProps;\n\n/**\n * The tap-to-open outlined box every picker uses (MAUI `G9OutlinedFieldBase` with a tap recognizer): no keyboard,\n * the label floats while there is a value, a tap on the box opens the sheet unless disabled or read-only.\n */\nexport function PickerField(props: {\n readonly field: G9PickerFieldProps;\n readonly hasValue: boolean;\n readonly onOpen: () => void;\n readonly trailingAffordance?: G9TrailingAffordance | null;\n readonly children?: ReactNode;\n}): ReactNode {\n const direction = useG9Direction();\n const { field } = props;\n const blocked = field.disabled === true || field.readOnly === true;\n return (\n <G9OutlinedField\n {...field}\n className={`g9-picker${field.className ? ` ${field.className}` : ''}`}\n focused={false}\n hasValue={props.hasValue}\n {...(props.trailingAffordance !== undefined ? { trailingAffordance: props.trailingAffordance } : {})}\n onFocusRequest={() => {\n if (!blocked) props.onOpen();\n }}\n accessibilityLabel={field.label ?? field.placeholder ?? ''}\n >\n <view className={`g9-picker__value g9-dir-${direction}`} style={g9RowStyle(direction)}>\n {props.children}\n </view>\n </G9OutlinedField>\n );\n}\n"],"names":["usePickerOpen","opening","useRef","generation","diagnostics","useG9Diagnostics","useEffect","run","mine","error","valueDirection","direction","culture","valueDirectionClass","SelectionValueIcon","props","_item_emoji","_item_iconPath","_item_iconImage","_item_swatchFirstColor","_item_swatchSecondColor","item","avatar","isAvatarImage","icon","hasIconSlot","_ref","view","G9IconSlot","G9Swatch","PickerField","useG9Direction","field","blocked","G9OutlinedField","undefined","g9RowStyle"],"mappings":";;;;;;;;AAeO,SAASA;IACd,MAAMC,UAAUC,OAAO;IACvB,MAAMC,aAAaD,OAAO;IAC1B,MAAME,cAAcC;IACpBC,UACE,IAAM;YACJH,WAAW,OAAO,IAAI;QACxB,GACA,EAAE;IAEJ,OAAO,CAACI;QACN,IAAIN,QAAQ,OAAO,EAAE;QACrBA,QAAQ,OAAO,GAAG;QAClB,MAAMO,OAAO,EAAEL,WAAW,OAAO;QAC3B;YACJ,IAAI;gBACF,MAAMI,IAAI,IAAMJ,WAAW,OAAO,KAAKK;YACzC,EAAE,OAAOC,OAAO;gBACdL,YAAY,GAAG,CAAC;oBAAE,OAAO;oBAAS,SAAS;oBAAkB,QAAQ;oBAAYK;gBAAM;YACzF,SAAU;gBACRR,QAAQ,OAAO,GAAG;YACpB;QACF;IACF;AACF;AAGO,SAASS,eAAeC,SAA2C,EAAEC,OAAsB;IAChG,OAAOD,AAAc,kBAAdA,YAA8B,QAAQA,AAAc,kBAAdA,YAA8B,QAAQC;AACrF;AAGO,SAASC,oBAAoBF,SAA2C,EAAEC,OAAsB;IACrG,OAAO,CAAC,OAAO,EAAEF,eAAeC,WAAWC,UAAU;AACvD;AAGO,SAASE,mBAAmBC,KAKlC;QAKUC,aAEIC,gBACJC;QAgBLC,wBAAiCC;IAvBrC,MAAM,EAAEC,IAAI,EAAE,GAAGN;IACjB,MAAMO,SAASC,cAAcF;IAC7B,IAAIC,UAAUP,MAAM,MAAM,EAAE,OAAO;IACnC,MAAMS,OAAO;QACX,OAAO,QAA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AAM,kBAAkB,GAAiB;QAAE,oBAAoBA,MAAM,kBAAkB;IAAC,IAAI,CAAC,CAAC,EACnG,gBAAgB;QACd,IAAI,CAACkB,SAASlB,MAAM,MAAM;IAC5B,GACA,oBAAoB,QAAAW,CAAAA,OAAAA,QAAAA,CAAAA,eAAAA,MAAM,KAAK,AAAD,IAAVA,eAAeM,MAAM,WAAW,AAAD,IAA/BN,OAAoC,IACzD;MACC,CAACC,KAAK,WAAW,CAAC,wBAAwB,EAAEhB,WAAW,EAAE,OAAOyB,WAAWzB,YAAY;QACrF,CAACI,MAAM,QAAQ,CAAC;MAClB,EAAEY,KAAK;IACT,EAAEO;AAEN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/plus-button/model.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/plus-button/model.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,0EAA0E;AAC1E,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,+DAA+D;IAC/D,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IACrC,wGAAwG;IACxG,QAAQ,CAAC,UAAU,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvE;AAED,mHAAmH;AACnH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,qBAAqB,EAAE,MAAM,CAAC;IACvC,QAAQ,CAAC,iBAAiB,EAAE,M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;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,oBAAoB,CA2CnH;AAED,qFAAqF;AACrF,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,MAAM,CAExG"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { g9Ms } from "@g9tm/lynxcontrols-foundation";
|
|
1
2
|
const g9PlusButtonDefaults = Object.freeze({
|
|
2
3
|
mainSizeCollapsed: 69,
|
|
3
4
|
mainSizeExpanded: 49,
|
|
@@ -14,7 +15,10 @@ const g9PlusButtonDefaults = Object.freeze({
|
|
|
14
15
|
mainIconRotationExpanded: 45
|
|
15
16
|
});
|
|
16
17
|
function plusButtonSchedule(timing, count, expand) {
|
|
17
|
-
const t = timing
|
|
18
|
+
const t = Object.fromEntries(Object.entries(timing).map(([k, v])=>[
|
|
19
|
+
k,
|
|
20
|
+
k.endsWith('Ms') ? g9Ms(v) : v
|
|
21
|
+
]));
|
|
18
22
|
const items = [];
|
|
19
23
|
let end = 0;
|
|
20
24
|
if (expand) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plus-button/model.jsx","sources":["../../src/plus-button/model.ts"],"sourcesContent":["import type { G9IconInput } from '../icon/icon';\n\n/** One menu entry of a {@link G9PlusButton} (MAUI `G9PlusButtonItem`). */\nexport interface G9PlusButtonItem {\n readonly icon: G9IconInput;\n readonly text: string;\n /** Close the menu after `onSelected` settles. Default true. */\n readonly closeMenuOnSelect?: boolean;\n /** Runs through the provider's safe executor (errors show the error popup, MAUI `ShowErrorG9Popup`). */\n readonly onSelected: (item: G9PlusButtonItem) => void | Promise<void>;\n}\n\n/** Sizes and timings of the expand / collapse choreography (MAUI `G9PlusButton` properties and their defaults). */\nexport interface G9PlusButtonTiming {\n readonly mainSizeCollapsed: number;\n readonly mainSizeExpanded: number;\n readonly itemVerticalOffset: number;\n readonly textBorderTargetWidth: number;\n readonly itemsStartDelayMs: number;\n readonly itemStaggerMs: number;\n readonly phase1AnimationDurationMs: number;\n readonly phase2DelayDurationMs: number;\n readonly phase2AnimationDurationMs: number;\n readonly phase3DelayDurationMs: number;\n readonly phase3AnimationDurationMs: number;\n readonly mainAnimationDurationMs: number;\n readonly mainIconRotationExpanded: number;\n}\n\n/** The MAUI `G9PlusButton` sizes and timings (px, ms) every plus button starts from. */\nexport const g9PlusButtonDefaults: G9PlusButtonTiming = Object.freeze({\n mainSizeCollapsed: 69,\n mainSizeExpanded: 49,\n itemVerticalOffset: 55,\n textBorderTargetWidth: 139,\n itemsStartDelayMs: 50,\n itemStaggerMs: 40,\n phase1AnimationDurationMs: 200,\n phase2DelayDurationMs: 30,\n phase2AnimationDurationMs: 180,\n phase3DelayDurationMs: 20,\n phase3AnimationDurationMs: 150,\n mainAnimationDurationMs: 180,\n mainIconRotationExpanded: 45,\n});\n\n/** When each part of one item moves (ms from the toggle). */\nexport interface G9PlusButtonItemSchedule {\n /** Phase 1: the item slides to / from its row (translateY). */\n readonly slide: { readonly delay: number; readonly duration: number };\n /** Phase 2: the label pill grows / shrinks (width). */\n readonly pill: { readonly delay: number; readonly duration: number };\n /** Phase 3: the label fades (opacity). */\n readonly label: { readonly delay: number; readonly duration: number };\n}\n\n/** When each part of the expand/collapse sequence starts and how long it runs (ms): the main button, then each item. */\nexport interface G9PlusButtonSchedule {\n readonly main: { readonly delay: number; readonly duration: number };\n readonly items: readonly G9PlusButtonItemSchedule[];\n /** When the whole sequence has settled. */\n readonly totalMs: number;\n}\n\n/**\n * The MAUI choreography as start times. Expand: the main button shrinks and turns, then after `itemsStartDelayMs`\n * each item (staggered by `itemStaggerMs`, first item first) slides up, then its pill grows, then its label fades in.\n * Collapse runs the phases backwards, last item first, and the main button returns last.\n */\nexport function plusButtonSchedule(timing: G9PlusButtonTiming, count: number, expand: boolean): G9PlusButtonSchedule {\n const t = timing;\n const items: G9PlusButtonItemSchedule[] = [];\n let end = 0;\n if (expand) {\n const base = t.mainAnimationDurationMs + t.itemsStartDelayMs;\n for (let i = 0; i < count; i++) {\n const start = base + i * t.itemStaggerMs;\n const pill = start + t.phase1AnimationDurationMs + t.phase2DelayDurationMs;\n const label = pill + t.phase2AnimationDurationMs + t.phase3DelayDurationMs;\n items.push({\n slide: { delay: start, duration: t.phase1AnimationDurationMs },\n pill: { delay: pill, duration: t.phase2AnimationDurationMs },\n label: { delay: label, duration: t.phase3AnimationDurationMs },\n });\n end = Math.max(end, label + t.phase3AnimationDurationMs);\n }\n return {\n main: { delay: 0, duration: t.mainAnimationDurationMs },\n items,\n totalMs: Math.max(end, t.mainAnimationDurationMs),\n };\n }\n for (let i = 0; i < count; i++) {\n const start = (count - 1 - i) * t.itemStaggerMs;\n const pill = start + t.phase3AnimationDurationMs + t.phase3DelayDurationMs;\n const slide = pill + t.phase2AnimationDurationMs + t.phase2DelayDurationMs;\n items.push({\n slide: { delay: slide, duration: t.phase1AnimationDurationMs },\n pill: { delay: pill, duration: t.phase2AnimationDurationMs },\n label: { delay: start, duration: t.phase3AnimationDurationMs },\n });\n end = Math.max(end, slide + t.phase1AnimationDurationMs);\n }\n const mainDelay = (count > 0 ? end : 0) + t.itemsStartDelayMs;\n return {\n main: { delay: mainDelay, duration: t.mainAnimationDurationMs },\n items,\n totalMs: mainDelay + t.mainAnimationDurationMs,\n };\n}\n\n/** Hit-area height: the main button plus, while expanded, the item rows above it. */\nexport function plusButtonHitHeight(timing: G9PlusButtonTiming, count: number, expanded: boolean): number {\n return expanded ? timing.mainSizeCollapsed + count * timing.itemVerticalOffset : timing.mainSizeCollapsed;\n}\n"],"names":["g9PlusButtonDefaults","Object","plusButtonSchedule","timing","count","expand","t","items","end","base","i","start","pill","label","Math","slide","mainDelay","plusButtonHitHeight","expanded"],"mappings":"
|
|
1
|
+
{"version":3,"file":"plus-button/model.jsx","sources":["../../src/plus-button/model.ts"],"sourcesContent":["import { g9Ms } from '@g9tm/lynxcontrols-foundation';\nimport type { G9IconInput } from '../icon/icon';\n\n/** One menu entry of a {@link G9PlusButton} (MAUI `G9PlusButtonItem`). */\nexport interface G9PlusButtonItem {\n readonly icon: G9IconInput;\n readonly text: string;\n /** Close the menu after `onSelected` settles. Default true. */\n readonly closeMenuOnSelect?: boolean;\n /** Runs through the provider's safe executor (errors show the error popup, MAUI `ShowErrorG9Popup`). */\n readonly onSelected: (item: G9PlusButtonItem) => void | Promise<void>;\n}\n\n/** Sizes and timings of the expand / collapse choreography (MAUI `G9PlusButton` properties and their defaults). */\nexport interface G9PlusButtonTiming {\n readonly mainSizeCollapsed: number;\n readonly mainSizeExpanded: number;\n readonly itemVerticalOffset: number;\n readonly textBorderTargetWidth: number;\n readonly itemsStartDelayMs: number;\n readonly itemStaggerMs: number;\n readonly phase1AnimationDurationMs: number;\n readonly phase2DelayDurationMs: number;\n readonly phase2AnimationDurationMs: number;\n readonly phase3DelayDurationMs: number;\n readonly phase3AnimationDurationMs: number;\n readonly mainAnimationDurationMs: number;\n readonly mainIconRotationExpanded: number;\n}\n\n/** The MAUI `G9PlusButton` sizes and timings (px, ms) every plus button starts from. */\nexport const g9PlusButtonDefaults: G9PlusButtonTiming = Object.freeze({\n mainSizeCollapsed: 69,\n mainSizeExpanded: 49,\n itemVerticalOffset: 55,\n textBorderTargetWidth: 139,\n itemsStartDelayMs: 50,\n itemStaggerMs: 40,\n phase1AnimationDurationMs: 200,\n phase2DelayDurationMs: 30,\n phase2AnimationDurationMs: 180,\n phase3DelayDurationMs: 20,\n phase3AnimationDurationMs: 150,\n mainAnimationDurationMs: 180,\n mainIconRotationExpanded: 45,\n});\n\n/** When each part of one item moves (ms from the toggle). */\nexport interface G9PlusButtonItemSchedule {\n /** Phase 1: the item slides to / from its row (translateY). */\n readonly slide: { readonly delay: number; readonly duration: number };\n /** Phase 2: the label pill grows / shrinks (width). */\n readonly pill: { readonly delay: number; readonly duration: number };\n /** Phase 3: the label fades (opacity). */\n readonly label: { readonly delay: number; readonly duration: number };\n}\n\n/** When each part of the expand/collapse sequence starts and how long it runs (ms): the main button, then each item. */\nexport interface G9PlusButtonSchedule {\n readonly main: { readonly delay: number; readonly duration: number };\n readonly items: readonly G9PlusButtonItemSchedule[];\n /** When the whole sequence has settled. */\n readonly totalMs: number;\n}\n\n/**\n * The MAUI choreography as start times. Expand: the main button shrinks and turns, then after `itemsStartDelayMs`\n * each item (staggered by `itemStaggerMs`, first item first) slides up, then its pill grows, then its label fades in.\n * Collapse runs the phases backwards, last item first, and the main button returns last.\n */\nexport function plusButtonSchedule(timing: G9PlusButtonTiming, count: number, expand: boolean): G9PlusButtonSchedule {\n // every phase, delay and stagger (the `…Ms` fields; never a size) at the motion scale (foundation g9Ms): at 0 the menu opens at once\n const t = Object.fromEntries(\n Object.entries(timing).map(([k, v]) => [k, k.endsWith('Ms') ? g9Ms(v as number) : v]),\n ) as unknown as G9PlusButtonTiming;\n const items: G9PlusButtonItemSchedule[] = [];\n let end = 0;\n if (expand) {\n const base = t.mainAnimationDurationMs + t.itemsStartDelayMs;\n for (let i = 0; i < count; i++) {\n const start = base + i * t.itemStaggerMs;\n const pill = start + t.phase1AnimationDurationMs + t.phase2DelayDurationMs;\n const label = pill + t.phase2AnimationDurationMs + t.phase3DelayDurationMs;\n items.push({\n slide: { delay: start, duration: t.phase1AnimationDurationMs },\n pill: { delay: pill, duration: t.phase2AnimationDurationMs },\n label: { delay: label, duration: t.phase3AnimationDurationMs },\n });\n end = Math.max(end, label + t.phase3AnimationDurationMs);\n }\n return {\n main: { delay: 0, duration: t.mainAnimationDurationMs },\n items,\n totalMs: Math.max(end, t.mainAnimationDurationMs),\n };\n }\n for (let i = 0; i < count; i++) {\n const start = (count - 1 - i) * t.itemStaggerMs;\n const pill = start + t.phase3AnimationDurationMs + t.phase3DelayDurationMs;\n const slide = pill + t.phase2AnimationDurationMs + t.phase2DelayDurationMs;\n items.push({\n slide: { delay: slide, duration: t.phase1AnimationDurationMs },\n pill: { delay: pill, duration: t.phase2AnimationDurationMs },\n label: { delay: start, duration: t.phase3AnimationDurationMs },\n });\n end = Math.max(end, slide + t.phase1AnimationDurationMs);\n }\n const mainDelay = (count > 0 ? end : 0) + t.itemsStartDelayMs;\n return {\n main: { delay: mainDelay, duration: t.mainAnimationDurationMs },\n items,\n totalMs: mainDelay + t.mainAnimationDurationMs,\n };\n}\n\n/** Hit-area height: the main button plus, while expanded, the item rows above it. */\nexport function plusButtonHitHeight(timing: G9PlusButtonTiming, count: number, expanded: boolean): number {\n return expanded ? timing.mainSizeCollapsed + count * timing.itemVerticalOffset : timing.mainSizeCollapsed;\n}\n"],"names":["g9PlusButtonDefaults","Object","plusButtonSchedule","timing","count","expand","t","k","v","g9Ms","items","end","base","i","start","pill","label","Math","slide","mainDelay","plusButtonHitHeight","expanded"],"mappings":";AA+BO,MAAMA,uBAA2CC,OAAO,MAAM,CAAC;IACpE,mBAAmB;IACnB,kBAAkB;IAClB,oBAAoB;IACpB,uBAAuB;IACvB,mBAAmB;IACnB,eAAe;IACf,2BAA2B;IAC3B,uBAAuB;IACvB,2BAA2B;IAC3B,uBAAuB;IACvB,2BAA2B;IAC3B,yBAAyB;IACzB,0BAA0B;AAC5B;AAyBO,SAASC,mBAAmBC,MAA0B,EAAEC,KAAa,EAAEC,MAAe;IAE3F,MAAMC,IAAIL,OAAO,WAAW,CAC1BA,OAAO,OAAO,CAACE,QAAQ,GAAG,CAAC,CAAC,CAACI,GAAGC,EAAE,GAAK;YAACD;YAAGA,EAAE,QAAQ,CAAC,QAAQE,KAAKD,KAAeA;SAAE;IAEtF,MAAME,QAAoC,EAAE;IAC5C,IAAIC,MAAM;IACV,IAAIN,QAAQ;QACV,MAAMO,OAAON,EAAE,uBAAuB,GAAGA,EAAE,iBAAiB;QAC5D,IAAK,IAAIO,IAAI,GAAGA,IAAIT,OAAOS,IAAK;YAC9B,MAAMC,QAAQF,OAAOC,IAAIP,EAAE,aAAa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b,EAAE,uBAAuB;QAAC;QAC9DI;QACA,SAASS,YAAYb,EAAE,uBAAuB;IAChD;AACF;AAGO,SAASc,oBAAoBjB,MAA0B,EAAEC,KAAa,EAAEiB,QAAiB;IAC9F,OAAOA,WAAWlB,OAAO,iBAAiB,GAAGC,QAAQD,OAAO,kBAAkB,GAAGA,OAAO,iBAAiB;AAC3G"}
|
package/dist/popup/frame.jsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./popup.css";
|
|
2
|
-
import { formatColor, resolveThemeColor, withAlpha } from "@g9tm/lynxcontrols-foundation";
|
|
2
|
+
import { formatColor, g9Ms, resolveThemeColor, withAlpha } from "@g9tm/lynxcontrols-foundation";
|
|
3
3
|
import { createContext, useContext, useEffect, useRef, useState } from "@lynx-js/react";
|
|
4
4
|
import { g9SafeId } from "../base/control.jsx";
|
|
5
5
|
import { g9FieldNotchStyle } from "../fields/notch.jsx";
|
|
@@ -128,7 +128,7 @@ function PopupFrame(props) {
|
|
|
128
128
|
const notch = g9FieldNotchStyle(resolveThemeColor(null != (_o_cardBackground = o.cardBackground) ? _o_cardBackground : 'var(--g9-surface)', palette));
|
|
129
129
|
const scrimColor = formatColor(withAlpha(resolveThemeColor(null != (_o_overlayColor = o.overlayColor) ? _o_overlayColor : 'var(--g9-scrim)', palette), 1));
|
|
130
130
|
const animation = null != (_o_animation = o.animation) ? _o_animation : 'slideUp';
|
|
131
|
-
const duration = null != (_o_animationDuration = o.animationDuration) ? _o_animationDuration : 240;
|
|
131
|
+
const duration = g9Ms(null != (_o_animationDuration = o.animationDuration) ? _o_animationDuration : 240);
|
|
132
132
|
const mode = null != (_o_overlayMode = o.overlayMode) ? _o_overlayMode : 'transparent';
|
|
133
133
|
const [size, setSize] = useState({
|
|
134
134
|
width: 0,
|
package/dist/popup/frame.jsx.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popup/frame.jsx","sources":["../../src/popup/frame.tsx"],"sourcesContent":["import './popup.css';\nimport { formatColor, resolveThemeColor, withAlpha } from '@g9tm/lynxcontrols-foundation';\nimport { createContext, type ReactNode, useContext, useEffect, useRef, useState } from '@lynx-js/react';\nimport { g9SafeId } from '../base/control';\nimport { g9FieldNotchStyle } from '../fields/notch';\nimport { useG9Theme } from '../provider/hooks';\nimport type {\n G9PopupAnimationEasing,\n G9PopupAnimationType,\n G9PopupAutoSizeMode,\n G9PopupBlurIntensity,\n G9PopupOverlayMode,\n G9PopupRelativePosition,\n} from './types';\nimport { popupScrimOpacity } from './types';\n\n/** A rectangle in host coordinates (px), e.g. an anchor's `boundingClientRect`. */\nexport interface G9Rect {\n readonly left: number;\n readonly top: number;\n readonly width: number;\n readonly height: number;\n}\n\n/** How one popup card opens (MAUI `G9PopupViewOpenOptions`). */\nexport interface G9PopupViewOpenOptions {\n /** Card width (px); unset = the auto-size mode decides (90 % of the host for centred `height` mode). */\n readonly width?: number | null;\n readonly height?: number | null;\n /** Default 16. */\n readonly cornerRadius?: number;\n /** `[left, top, right, bottom]`. Default `[20, 16, 20, 12]`. */\n readonly padding?: readonly [number, number, number, number];\n /** Default `'height'`. */\n readonly autoSizeMode?: G9PopupAutoSizeMode;\n readonly cardBackground?: string | null;\n readonly borderColor?: string | null;\n /** Default `'transparent'`; `'none'` = non-modal (no scrim, taps pass through). */\n readonly overlayMode?: G9PopupOverlayMode;\n readonly blurIntensity?: G9PopupBlurIntensity;\n /** Scrim colour (its opacity is `overlayOpacity`). Default the `Scrim` token. */\n readonly overlayColor?: string | null;\n /** Default 0.45. */\n readonly overlayOpacity?: number;\n /** Default false. */\n readonly closeOnBackgroundTap?: boolean;\n /** Default true. */\n readonly closeOnBackButton?: boolean;\n /** Default `'slideUp'`. */\n readonly animation?: G9PopupAnimationType;\n /** Default `'sinOut'`. */\n readonly animationEasing?: G9PopupAnimationEasing;\n /** Default 240 ms. */\n readonly animationDuration?: number;\n /** Close after this many ms; 0 = never. */\n readonly autoCloseDuration?: number;\n /** Anchor rectangle (MAUI `RelativeView`'s bounds); with `relativePosition`. */\n readonly relativeRect?: G9Rect | null;\n readonly relativePosition?: G9PopupRelativePosition | null;\n /** Extra offset added to the relative placement. */\n readonly relativeAbsoluteX?: number;\n readonly relativeAbsoluteY?: number;\n /** Absolute card position (host px). */\n readonly absoluteX?: number | null;\n readonly absoluteY?: number | null;\n /** The card can be dragged: by a `<G9PopupDragHandle>` inside it, or anywhere when there is none. */\n readonly isDraggable?: boolean;\n}\n\n/**\n * The size every MAUI popup RESTS at: `G9PopupView` builds its card container with `ScaleX = ScaleY = 0.92` and its\n * open animations only ever set `Scale` (which multiplies them), so the card, its text and its buttons all show at\n * 92 % — a 403 dp card measures 371 dp on screen (MAUI 6.2.36, Pixel 9 Pro XL). The port reproduces what users see.\n */\nexport const g9PopupRestingScale = 0.92;\n\n/** The pose a card starts from / leaves to, per motion (MAUI `G9PopupView` animation table). */\nexport function popupMotionPose(\n animation: G9PopupAnimationType,\n phase: 'enter' | 'exit',\n): {\n opacity: number;\n transform: string;\n} {\n switch (animation) {\n case 'none':\n return { opacity: phase === 'enter' ? 1 : 0, transform: 'translateY(0px) scale(1)' };\n case 'fadeIn':\n return { opacity: 0, transform: 'translateY(0px) scale(1)' };\n case 'zoomIn':\n return { opacity: 0, transform: 'translateY(0px) scale(0.92)' };\n case 'dropIn':\n return { opacity: 0, transform: 'translateY(-40px) scale(1)' };\n case 'bounce':\n // Opens from 0.6 with the bounce easing; closes like ZoomIn (MAUI).\n return { opacity: 0, transform: `translateY(0px) scale(${phase === 'enter' ? 0.6 : 0.92})` };\n default:\n return { opacity: 0, transform: 'translateY(40px) scale(1)' };\n }\n}\n\n/** CSS timing function of an easing (bounce approximated with an overshoot curve; CSS has no bounce). */\nexport function popupEasingCss(easing: G9PopupAnimationEasing): string {\n switch (easing) {\n case 'linear':\n return 'linear';\n case 'sinIn':\n return 'cubic-bezier(0.47, 0, 0.745, 0.715)';\n case 'sinInOut':\n return 'cubic-bezier(0.445, 0.05, 0.55, 0.95)';\n case 'cubicOut':\n return 'cubic-bezier(0.215, 0.61, 0.355, 1)';\n case 'bounceOut':\n return 'cubic-bezier(0.34, 1.56, 0.64, 1)';\n default:\n return 'cubic-bezier(0.39, 0.575, 0.565, 1)';\n }\n}\n\n/**\n * Where the card's top-left goes (host px) for a relative placement (MAUI `ShowRelativeToView`); `null` when the\n * anchor or the card has no size yet (the card is then centred, and the next layout corrects it).\n */\nexport function relativePopupPlacement(\n anchor: G9Rect | null | undefined,\n position: G9PopupRelativePosition | null | undefined,\n card: { width: number; height: number },\n offset: { x: number; y: number } = { x: 0, y: 0 },\n): { left: number; top: number } | null {\n if (!anchor || !position || anchor.width <= 0 || anchor.height <= 0 || card.width <= 0 || card.height <= 0)\n return null;\n const right = anchor.left + anchor.width;\n const bottom = anchor.top + anchor.height;\n const cx = anchor.left + (anchor.width - card.width) / 2;\n const cy = anchor.top + (anchor.height - card.height) / 2;\n const at = (left: number, top: number) => ({ left: left + offset.x, top: top + offset.y });\n switch (position) {\n case 'alignTop':\n return at(cx, anchor.top);\n case 'alignBottom':\n return at(cx, bottom - card.height);\n case 'alignLeft':\n return at(anchor.left, cy);\n case 'alignRight':\n return at(right - card.width, cy);\n case 'alignTopLeft':\n return at(anchor.left, anchor.top);\n case 'alignTopRight':\n return at(right - card.width, anchor.top);\n case 'alignBottomLeft':\n return at(anchor.left, bottom - card.height);\n case 'alignBottomRight':\n return at(right - card.width, bottom - card.height);\n case 'alignToLeftOf':\n return at(anchor.left - card.width, cy);\n case 'alignToRightOf':\n return at(right, cy);\n case 'alignToTopOf':\n return at(cx, anchor.top - card.height);\n default:\n return at(cx, bottom);\n }\n}\n\ninterface DragApi {\n readonly onStart: (x: number, y: number) => void;\n readonly onMove: (x: number, y: number) => void;\n readonly register: () => () => void;\n}\n\nconst DragContext = createContext<DragApi | null>(null);\n\ntype TouchEvent = { touches?: Array<{ clientX?: number; clientY?: number; pageX?: number; pageY?: number }> };\nconst point = (e: TouchEvent) => {\n const t = e.touches?.[0];\n return { x: t?.clientX ?? t?.pageX ?? 0, y: t?.clientY ?? t?.pageY ?? 0 };\n};\n\n/**\n * The grip of a draggable popup (MAUI `DragHandle`): put the header inside it so taps in the body keep working.\n * Without one, a draggable card drags from anywhere.\n */\nexport function G9PopupDragHandle(props: { readonly children?: ReactNode; readonly className?: string }): ReactNode {\n const drag = useContext(DragContext);\n useEffect(() => drag?.register(), [drag !== null]);\n return (\n <view\n className={`g9-popup__drag-handle${props.className ? ` ${props.className}` : ''}`}\n bindtouchstart={(e: TouchEvent) => {\n const p = point(e);\n drag?.onStart(p.x, p.y);\n }}\n bindtouchmove={(e: TouchEvent) => {\n const p = point(e);\n drag?.onMove(p.x, p.y);\n }}\n >\n {props.children}\n </view>\n );\n}\n\n/** Props of {@link PopupFrame}. */\nexport interface PopupFrameProps {\n readonly options: G9PopupViewOpenOptions;\n /** `enter` = start pose (no transition), `open` = in place, `leave` = exit pose. */\n readonly phase: 'enter' | 'open' | 'leave';\n readonly hostWidth: number;\n readonly onBackgroundTap?: () => void;\n readonly children?: ReactNode;\n readonly testId?: string;\n}\n\n/**\n * Scrim + card (MAUI `G9PopupView` visuals): the scrim fades on its own (also when the card has no motion); the card\n * runs one compound transition (opacity with transform) between its pose and identity; no shadow, the stroke\n * separates it. Placement: absolute, relative to an anchor, or centred (90 % wide in `height` mode). Non-modal\n * (`overlayMode: 'none'`): no scrim and the layer lets taps through.\n */\nexport function PopupFrame(props: PopupFrameProps): ReactNode {\n const o = props.options;\n // Fields on the card hide their outline under a floated label with the card's colour.\n const palette = useG9Theme().palette;\n const notch = g9FieldNotchStyle(resolveThemeColor(o.cardBackground ?? 'var(--g9-surface)', palette));\n // MAUI ResolveOverlayColor: the colour's hue with the overlay opacity as its alpha (Colors.Black.WithAlpha by default) —\n // the Scrim token's own alpha (0.6) does not multiply in, or the 0.45 dim reads as 0.27.\n const scrimColor = formatColor(withAlpha(resolveThemeColor(o.overlayColor ?? 'var(--g9-scrim)', palette), 1));\n const animation = o.animation ?? 'slideUp';\n const duration = o.animationDuration ?? 240;\n const mode = o.overlayMode ?? 'transparent';\n const [size, setSize] = useState({ width: 0, height: 0 });\n const [offset, setOffset] = useState({ x: 0, y: 0 });\n const drag = useRef({ x: 0, y: 0, ox: 0, oy: 0 });\n const [handles, setHandles] = useState(0);\n const dragApi: DragApi = {\n onStart: (x, y) => {\n drag.current = { ...drag.current, x, y, ox: offset.x, oy: offset.y };\n },\n onMove: (x, y) => {\n if (!o.isDraggable) return;\n setOffset({ x: drag.current.ox + x - drag.current.x, y: drag.current.oy + y - drag.current.y });\n },\n register: () => {\n setHandles((n) => n + 1);\n return () => setHandles((n) => n - 1);\n },\n };\n const pose =\n props.phase === 'open'\n ? { opacity: 1, transform: 'translateY(0px) scale(1)' }\n : popupMotionPose(animation, props.phase === 'enter' ? 'enter' : 'exit');\n const easing =\n animation === 'bounce' && props.phase !== 'leave'\n ? popupEasingCss('bounceOut')\n : popupEasingCss(o.animationEasing ?? 'sinOut');\n const transition =\n props.phase === 'enter' || animation === 'none'\n ? 'none'\n : `opacity ${duration}ms ${easing}, transform ${duration}ms ${easing}`;\n const autoSize = o.autoSizeMode ?? 'height';\n const placed =\n o.absoluteX != null || o.absoluteY != null\n ? { left: o.absoluteX ?? 0, top: o.absoluteY ?? 0 }\n : relativePopupPlacement(o.relativeRect, o.relativePosition, size, {\n x: o.relativeAbsoluteX ?? 0,\n y: o.relativeAbsoluteY ?? 0,\n });\n const width =\n o.width != null && autoSize !== 'both' && autoSize !== 'width'\n ? `${o.width}px`\n : !placed && autoSize === 'height'\n ? `${Math.round(props.hostWidth * 0.9)}px`\n : undefined;\n const height = o.height != null && (autoSize === 'none' || autoSize === 'width') ? `${o.height}px` : undefined;\n const pad = o.padding ?? [20, 16, 20, 12];\n const scrimOpacity = popupScrimOpacity(mode, o.overlayOpacity ?? 0.45, o.blurIntensity ?? 'none');\n const dragTranslate = o.isDraggable ? `translate(${offset.x}px, ${offset.y}px) ` : '';\n const wholeCardDrags = o.isDraggable === true && handles === 0;\n return (\n <view\n className={`g9-popup${mode === 'none' ? ' g9-popup--nonmodal' : ''}${placed ? ' g9-popup--placed' : ''}`}\n {...(mode === 'none' ? { 'event-through': true } : {})}\n >\n {mode !== 'none' ? (\n <view\n // Never flattened (see the sheet scrim): over a native SurfaceView a flattened dim is painted underneath it.\n flatten={false}\n className=\"g9-popup__scrim\"\n style={{\n backgroundColor: scrimColor,\n opacity: props.phase === 'open' ? scrimOpacity : 0,\n transition: props.phase === 'enter' ? 'none' : `opacity ${duration}ms`,\n }}\n bindtap={() => props.onBackgroundTap?.()}\n />\n ) : null}\n <view\n className=\"g9-popup__card\"\n {...(props.testId ? { 'data-testid': props.testId, id: g9SafeId(props.testId) } : {})}\n event-through={false}\n style={{\n ...(placed ? { position: 'absolute', left: `${placed.left}px`, top: `${placed.top}px` } : {}),\n ...(width ? { width } : {}),\n ...(height ? { height } : {}),\n borderRadius: `${o.cornerRadius ?? 16}px`,\n backgroundColor: o.cardBackground ?? 'var(--g9-surface)',\n borderColor: o.borderColor ?? 'var(--g9-surface)',\n padding: `${pad[1]}px ${pad[2]}px ${pad[3]}px ${pad[0]}px`,\n ...notch,\n opacity: pose.opacity,\n transform: `${dragTranslate}${pose.transform} scale(${g9PopupRestingScale})`,\n transition,\n }}\n bindlayoutchange={(e: { detail?: { width?: number; height?: number } }) => {\n const w = e.detail?.width ?? 0;\n const h = e.detail?.height ?? 0;\n if (w > 0 && h > 0 && (w !== size.width || h !== size.height)) setSize({ width: w, height: h });\n }}\n {...(wholeCardDrags\n ? {\n bindtouchstart: (e: TouchEvent) => {\n const p = point(e);\n dragApi.onStart(p.x, p.y);\n },\n bindtouchmove: (e: TouchEvent) => {\n const p = point(e);\n dragApi.onMove(p.x, p.y);\n },\n }\n : {})}\n >\n <DragContext.Provider value={dragApi}>{props.children}</DragContext.Provider>\n </view>\n </view>\n );\n}\n"],"names":["g9PopupRestingScale","popupMotionPose","animation","phase","popupEasingCss","easing","relativePopupPlacement","anchor","position","card","offset","right","bottom","cx","cy","at","left","top","DragContext","createContext","point","e","_ref","_ref2","_e_touches","t","G9PopupDragHandle","props","drag","useContext","useEffect","view","p","PopupFrame","_o_cardBackground","_o_overlayColor","_o_animation","_o_animationDuration","_o_overlayMode","_o_animationEasing","_o_autoSizeMode","_o_absoluteX","_o_absoluteY","_o_relativeAbsoluteX","_o_relativeAbsoluteY","_o_padding","_o_overlayOpacity","_o_blurIntensity","_o_cornerRadius","_o_cardBackground1","_o_borderColor","o","palette","useG9Theme","notch","g9FieldNotchStyle","resolveThemeColor","scrimColor","formatColor","withAlpha","duration","mode","size","setSize","useState","setOffset","useRef","handles","setHandles","dragApi","x","y","n","pose","transition","autoSize","placed","width","undefined","Math","height","pad","scrimOpacity","popupScrimOpacity","dragTranslate","wholeCardDrags","g9SafeId","_e_detail","_e_detail1","w","h"],"mappings":";;;;;;;AA0EO,MAAMA,sBAAsB;AAG5B,SAASC,gBACdC,SAA+B,EAC/BC,KAAuB;IAKvB,OAAQD;QACN,KAAK;YACH,OAAO;gBAAE,SAASC,AAAU,YAAVA,QAAoB,IAAI;gBAAG,WAAW;YAA2B;QACrF,KAAK;YACH,OAAO;gBAAE,SAAS;gBAAG,WAAW;YAA2B;QAC7D,KAAK;YACH,OAAO;gBAAE,SAAS;gBAAG,WAAW;YAA8B;QAChE,KAAK;YACH,OAAO;gBAAE,SAAS;gBAAG,WAAW;YAA6B;QAC/D,KAAK;YAEH,OAAO;gBAAE,SAAS;gBAAG,WAAW,CAAC,sBAAsB,EAAEA,AAAU,YAAVA,QAAoB,MAAM,KAAK,CAAC,CAAC;YAAC;QAC7F;YACE,OAAO;gBAAE,SAAS;gBAAG,WAAW;YAA4B;IAChE;AACF;AAGO,SAASC,eAAeC,MAA8B;IAC3D,OAAQA;QACN,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT;YACE,OAAO;IACX;AACF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E;IACF,GACA,kBAAkB,CAACrD;;YACPkE,WACAC;QADV,MAAMC,IAAI,QAAJA,CAAAA,OAAAA,QAAIF,CAAAA,YAAAA,EAAE,MAAM,AAAD,IAAPA,KAAAA,IAAAA,UAAU,KAAK,AAAD,IAAC,OAAI;QAC7B,MAAMG,IAAI,QAAJA,CAAAA,QAAAA,QAAIF,CAAAA,aAAAA,EAAE,MAAM,AAAD,IAAPA,KAAAA,IAAAA,WAAU,MAAM,AAAD,IAAC,QAAI;QAC9B,IAAIC,IAAI,KAAKC,IAAI,KAAMD,CAAAA,MAAM3B,KAAK,KAAK,IAAI4B,MAAM5B,KAAK,MAAK,GAAIC,QAAQ;YAAE,OAAO0B;YAAG,QAAQC;QAAE;IAC/F,IACC,GAAIL,iBACD;QACE,gBAAgB,CAAChE;YACf,MAAMW,IAAIZ,MAAMC;YAChBgD,QAAQ,OAAO,CAACrC,EAAE,CAAC,EAAEA,EAAE,CAAC;QAC1B;QACA,eAAe,CAACX;YACd,MAAMW,IAAIZ,MAAMC;YAChBgD,QAAQ,MAAM,CAACrC,EAAE,CAAC,EAAEA,EAAE,CAAC;QACzB;IACF,IACA,CAAC,CAAC,EACP;QACC,CAACd,YAAY,SAAS,OAAOmD,UAAU1C,MAAM,QAAQ,GAAGT,YAAY,SAAS;MAC/E,EAAEa,KAAK;IACT,EAAEA;AAEN"}
|
|
1
|
+
{"version":3,"file":"popup/frame.jsx","sources":["../../src/popup/frame.tsx"],"sourcesContent":["import './popup.css';\nimport { formatColor, g9Ms, resolveThemeColor, withAlpha } from '@g9tm/lynxcontrols-foundation';\nimport { createContext, type ReactNode, useContext, useEffect, useRef, useState } from '@lynx-js/react';\nimport { g9SafeId } from '../base/control';\nimport { g9FieldNotchStyle } from '../fields/notch';\nimport { useG9Theme } from '../provider/hooks';\nimport type {\n G9PopupAnimationEasing,\n G9PopupAnimationType,\n G9PopupAutoSizeMode,\n G9PopupBlurIntensity,\n G9PopupOverlayMode,\n G9PopupRelativePosition,\n} from './types';\nimport { popupScrimOpacity } from './types';\n\n/** A rectangle in host coordinates (px), e.g. an anchor's `boundingClientRect`. */\nexport interface G9Rect {\n readonly left: number;\n readonly top: number;\n readonly width: number;\n readonly height: number;\n}\n\n/** How one popup card opens (MAUI `G9PopupViewOpenOptions`). */\nexport interface G9PopupViewOpenOptions {\n /** Card width (px); unset = the auto-size mode decides (90 % of the host for centred `height` mode). */\n readonly width?: number | null;\n readonly height?: number | null;\n /** Default 16. */\n readonly cornerRadius?: number;\n /** `[left, top, right, bottom]`. Default `[20, 16, 20, 12]`. */\n readonly padding?: readonly [number, number, number, number];\n /** Default `'height'`. */\n readonly autoSizeMode?: G9PopupAutoSizeMode;\n readonly cardBackground?: string | null;\n readonly borderColor?: string | null;\n /** Default `'transparent'`; `'none'` = non-modal (no scrim, taps pass through). */\n readonly overlayMode?: G9PopupOverlayMode;\n readonly blurIntensity?: G9PopupBlurIntensity;\n /** Scrim colour (its opacity is `overlayOpacity`). Default the `Scrim` token. */\n readonly overlayColor?: string | null;\n /** Default 0.45. */\n readonly overlayOpacity?: number;\n /** Default false. */\n readonly closeOnBackgroundTap?: boolean;\n /** Default true. */\n readonly closeOnBackButton?: boolean;\n /** Default `'slideUp'`. */\n readonly animation?: G9PopupAnimationType;\n /** Default `'sinOut'`. */\n readonly animationEasing?: G9PopupAnimationEasing;\n /** Default 240 ms. */\n readonly animationDuration?: number;\n /** Close after this many ms; 0 = never. */\n readonly autoCloseDuration?: number;\n /** Anchor rectangle (MAUI `RelativeView`'s bounds); with `relativePosition`. */\n readonly relativeRect?: G9Rect | null;\n readonly relativePosition?: G9PopupRelativePosition | null;\n /** Extra offset added to the relative placement. */\n readonly relativeAbsoluteX?: number;\n readonly relativeAbsoluteY?: number;\n /** Absolute card position (host px). */\n readonly absoluteX?: number | null;\n readonly absoluteY?: number | null;\n /** The card can be dragged: by a `<G9PopupDragHandle>` inside it, or anywhere when there is none. */\n readonly isDraggable?: boolean;\n}\n\n/**\n * The size every MAUI popup RESTS at: `G9PopupView` builds its card container with `ScaleX = ScaleY = 0.92` and its\n * open animations only ever set `Scale` (which multiplies them), so the card, its text and its buttons all show at\n * 92 % — a 403 dp card measures 371 dp on screen (MAUI 6.2.36, Pixel 9 Pro XL). The port reproduces what users see.\n */\nexport const g9PopupRestingScale = 0.92;\n\n/** The pose a card starts from / leaves to, per motion (MAUI `G9PopupView` animation table). */\nexport function popupMotionPose(\n animation: G9PopupAnimationType,\n phase: 'enter' | 'exit',\n): {\n opacity: number;\n transform: string;\n} {\n switch (animation) {\n case 'none':\n return { opacity: phase === 'enter' ? 1 : 0, transform: 'translateY(0px) scale(1)' };\n case 'fadeIn':\n return { opacity: 0, transform: 'translateY(0px) scale(1)' };\n case 'zoomIn':\n return { opacity: 0, transform: 'translateY(0px) scale(0.92)' };\n case 'dropIn':\n return { opacity: 0, transform: 'translateY(-40px) scale(1)' };\n case 'bounce':\n // Opens from 0.6 with the bounce easing; closes like ZoomIn (MAUI).\n return { opacity: 0, transform: `translateY(0px) scale(${phase === 'enter' ? 0.6 : 0.92})` };\n default:\n return { opacity: 0, transform: 'translateY(40px) scale(1)' };\n }\n}\n\n/** CSS timing function of an easing (bounce approximated with an overshoot curve; CSS has no bounce). */\nexport function popupEasingCss(easing: G9PopupAnimationEasing): string {\n switch (easing) {\n case 'linear':\n return 'linear';\n case 'sinIn':\n return 'cubic-bezier(0.47, 0, 0.745, 0.715)';\n case 'sinInOut':\n return 'cubic-bezier(0.445, 0.05, 0.55, 0.95)';\n case 'cubicOut':\n return 'cubic-bezier(0.215, 0.61, 0.355, 1)';\n case 'bounceOut':\n return 'cubic-bezier(0.34, 1.56, 0.64, 1)';\n default:\n return 'cubic-bezier(0.39, 0.575, 0.565, 1)';\n }\n}\n\n/**\n * Where the card's top-left goes (host px) for a relative placement (MAUI `ShowRelativeToView`); `null` when the\n * anchor or the card has no size yet (the card is then centred, and the next layout corrects it).\n */\nexport function relativePopupPlacement(\n anchor: G9Rect | null | undefined,\n position: G9PopupRelativePosition | null | undefined,\n card: { width: number; height: number },\n offset: { x: number; y: number } = { x: 0, y: 0 },\n): { left: number; top: number } | null {\n if (!anchor || !position || anchor.width <= 0 || anchor.height <= 0 || card.width <= 0 || card.height <= 0)\n return null;\n const right = anchor.left + anchor.width;\n const bottom = anchor.top + anchor.height;\n const cx = anchor.left + (anchor.width - card.width) / 2;\n const cy = anchor.top + (anchor.height - card.height) / 2;\n const at = (left: number, top: number) => ({ left: left + offset.x, top: top + offset.y });\n switch (position) {\n case 'alignTop':\n return at(cx, anchor.top);\n case 'alignBottom':\n return at(cx, bottom - card.height);\n case 'alignLeft':\n return at(anchor.left, cy);\n case 'alignRight':\n return at(right - card.width, cy);\n case 'alignTopLeft':\n return at(anchor.left, anchor.top);\n case 'alignTopRight':\n return at(right - card.width, anchor.top);\n case 'alignBottomLeft':\n return at(anchor.left, bottom - card.height);\n case 'alignBottomRight':\n return at(right - card.width, bottom - card.height);\n case 'alignToLeftOf':\n return at(anchor.left - card.width, cy);\n case 'alignToRightOf':\n return at(right, cy);\n case 'alignToTopOf':\n return at(cx, anchor.top - card.height);\n default:\n return at(cx, bottom);\n }\n}\n\ninterface DragApi {\n readonly onStart: (x: number, y: number) => void;\n readonly onMove: (x: number, y: number) => void;\n readonly register: () => () => void;\n}\n\nconst DragContext = createContext<DragApi | null>(null);\n\ntype TouchEvent = { touches?: Array<{ clientX?: number; clientY?: number; pageX?: number; pageY?: number }> };\nconst point = (e: TouchEvent) => {\n const t = e.touches?.[0];\n return { x: t?.clientX ?? t?.pageX ?? 0, y: t?.clientY ?? t?.pageY ?? 0 };\n};\n\n/**\n * The grip of a draggable popup (MAUI `DragHandle`): put the header inside it so taps in the body keep working.\n * Without one, a draggable card drags from anywhere.\n */\nexport function G9PopupDragHandle(props: { readonly children?: ReactNode; readonly className?: string }): ReactNode {\n const drag = useContext(DragContext);\n useEffect(() => drag?.register(), [drag !== null]);\n return (\n <view\n className={`g9-popup__drag-handle${props.className ? ` ${props.className}` : ''}`}\n bindtouchstart={(e: TouchEvent) => {\n const p = point(e);\n drag?.onStart(p.x, p.y);\n }}\n bindtouchmove={(e: TouchEvent) => {\n const p = point(e);\n drag?.onMove(p.x, p.y);\n }}\n >\n {props.children}\n </view>\n );\n}\n\n/** Props of {@link PopupFrame}. */\nexport interface PopupFrameProps {\n readonly options: G9PopupViewOpenOptions;\n /** `enter` = start pose (no transition), `open` = in place, `leave` = exit pose. */\n readonly phase: 'enter' | 'open' | 'leave';\n readonly hostWidth: number;\n readonly onBackgroundTap?: () => void;\n readonly children?: ReactNode;\n readonly testId?: string;\n}\n\n/**\n * Scrim + card (MAUI `G9PopupView` visuals): the scrim fades on its own (also when the card has no motion); the card\n * runs one compound transition (opacity with transform) between its pose and identity; no shadow, the stroke\n * separates it. Placement: absolute, relative to an anchor, or centred (90 % wide in `height` mode). Non-modal\n * (`overlayMode: 'none'`): no scrim and the layer lets taps through.\n */\nexport function PopupFrame(props: PopupFrameProps): ReactNode {\n const o = props.options;\n // Fields on the card hide their outline under a floated label with the card's colour.\n const palette = useG9Theme().palette;\n const notch = g9FieldNotchStyle(resolveThemeColor(o.cardBackground ?? 'var(--g9-surface)', palette));\n // MAUI ResolveOverlayColor: the colour's hue with the overlay opacity as its alpha (Colors.Black.WithAlpha by default) —\n // the Scrim token's own alpha (0.6) does not multiply in, or the 0.45 dim reads as 0.27.\n const scrimColor = formatColor(withAlpha(resolveThemeColor(o.overlayColor ?? 'var(--g9-scrim)', palette), 1));\n const animation = o.animation ?? 'slideUp';\n const duration = g9Ms(o.animationDuration ?? 240);\n const mode = o.overlayMode ?? 'transparent';\n const [size, setSize] = useState({ width: 0, height: 0 });\n const [offset, setOffset] = useState({ x: 0, y: 0 });\n const drag = useRef({ x: 0, y: 0, ox: 0, oy: 0 });\n const [handles, setHandles] = useState(0);\n const dragApi: DragApi = {\n onStart: (x, y) => {\n drag.current = { ...drag.current, x, y, ox: offset.x, oy: offset.y };\n },\n onMove: (x, y) => {\n if (!o.isDraggable) return;\n setOffset({ x: drag.current.ox + x - drag.current.x, y: drag.current.oy + y - drag.current.y });\n },\n register: () => {\n setHandles((n) => n + 1);\n return () => setHandles((n) => n - 1);\n },\n };\n const pose =\n props.phase === 'open'\n ? { opacity: 1, transform: 'translateY(0px) scale(1)' }\n : popupMotionPose(animation, props.phase === 'enter' ? 'enter' : 'exit');\n const easing =\n animation === 'bounce' && props.phase !== 'leave'\n ? popupEasingCss('bounceOut')\n : popupEasingCss(o.animationEasing ?? 'sinOut');\n const transition =\n props.phase === 'enter' || animation === 'none'\n ? 'none'\n : `opacity ${duration}ms ${easing}, transform ${duration}ms ${easing}`;\n const autoSize = o.autoSizeMode ?? 'height';\n const placed =\n o.absoluteX != null || o.absoluteY != null\n ? { left: o.absoluteX ?? 0, top: o.absoluteY ?? 0 }\n : relativePopupPlacement(o.relativeRect, o.relativePosition, size, {\n x: o.relativeAbsoluteX ?? 0,\n y: o.relativeAbsoluteY ?? 0,\n });\n const width =\n o.width != null && autoSize !== 'both' && autoSize !== 'width'\n ? `${o.width}px`\n : !placed && autoSize === 'height'\n ? `${Math.round(props.hostWidth * 0.9)}px`\n : undefined;\n const height = o.height != null && (autoSize === 'none' || autoSize === 'width') ? `${o.height}px` : undefined;\n const pad = o.padding ?? [20, 16, 20, 12];\n const scrimOpacity = popupScrimOpacity(mode, o.overlayOpacity ?? 0.45, o.blurIntensity ?? 'none');\n const dragTranslate = o.isDraggable ? `translate(${offset.x}px, ${offset.y}px) ` : '';\n const wholeCardDrags = o.isDraggable === true && handles === 0;\n return (\n <view\n className={`g9-popup${mode === 'none' ? ' g9-popup--nonmodal' : ''}${placed ? ' g9-popup--placed' : ''}`}\n {...(mode === 'none' ? { 'event-through': true } : {})}\n >\n {mode !== 'none' ? (\n <view\n // Never flattened (see the sheet scrim): over a native SurfaceView a flattened dim is painted underneath it.\n flatten={false}\n className=\"g9-popup__scrim\"\n style={{\n backgroundColor: scrimColor,\n opacity: props.phase === 'open' ? scrimOpacity : 0,\n transition: props.phase === 'enter' ? 'none' : `opacity ${duration}ms`,\n }}\n bindtap={() => props.onBackgroundTap?.()}\n />\n ) : null}\n <view\n className=\"g9-popup__card\"\n {...(props.testId ? { 'data-testid': props.testId, id: g9SafeId(props.testId) } : {})}\n event-through={false}\n style={{\n ...(placed ? { position: 'absolute', left: `${placed.left}px`, top: `${placed.top}px` } : {}),\n ...(width ? { width } : {}),\n ...(height ? { height } : {}),\n borderRadius: `${o.cornerRadius ?? 16}px`,\n backgroundColor: o.cardBackground ?? 'var(--g9-surface)',\n borderColor: o.borderColor ?? 'var(--g9-surface)',\n padding: `${pad[1]}px ${pad[2]}px ${pad[3]}px ${pad[0]}px`,\n ...notch,\n opacity: pose.opacity,\n transform: `${dragTranslate}${pose.transform} scale(${g9PopupRestingScale})`,\n transition,\n }}\n bindlayoutchange={(e: { detail?: { width?: number; height?: number } }) => {\n const w = e.detail?.width ?? 0;\n const h = e.detail?.height ?? 0;\n if (w > 0 && h > 0 && (w !== size.width || h !== size.height)) setSize({ width: w, height: h });\n }}\n {...(wholeCardDrags\n ? {\n bindtouchstart: (e: TouchEvent) => {\n const p = point(e);\n dragApi.onStart(p.x, p.y);\n },\n bindtouchmove: (e: TouchEvent) => {\n const p = point(e);\n dragApi.onMove(p.x, p.y);\n },\n }\n : {})}\n >\n <DragContext.Provider value={dragApi}>{props.children}</DragContext.Provider>\n </view>\n </view>\n );\n}\n"],"names":["g9PopupRestingScale","popupMotionPose","animation","phase","popupEasingCss","easing","relativePopupPlacement","anchor","position","card","offset","right","bottom","cx","cy","at","left","top","DragContext","createContext","point","e","_ref","_ref2","_e_touches","t","G9PopupDragHandle","props","drag","useContext","useEffect","view","p","PopupFrame","_o_cardBackground","_o_overlayColor","_o_animation","_o_animationDuration","_o_overlayMode","_o_animationEasing","_o_autoSizeMode","_o_absoluteX","_o_absoluteY","_o_relativeAbsoluteX","_o_relativeAbsoluteY","_o_padding","_o_overlayOpacity","_o_blurIntensity","_o_cornerRadius","_o_cardBackground1","_o_borderColor","o","palette","useG9Theme","notch","g9FieldNotchStyle","resolveThemeColor","scrimColor","formatColor","withAlpha","duration","g9Ms","mode","size","setSize","useState","setOffset","useRef","handles","setHandles","dragApi","x","y","n","pose","transition","autoSize","placed","width","undefined","Math","height","pad","scrimOpacity","popupScrimOpacity","dragTranslate","wholeCardDrags","g9SafeId","_e_detail","_e_detail1","w","h"],"mappings":";;;;;;;AA0EO,MAAMA,sBAAsB;AAG5B,SAASC,gBACdC,SAA+B,EAC/BC,KAAuB;IAKvB,OAAQD;QACN,KAAK;YACH,OAAO;gBAAE,SAASC,AAAU,YAAVA,QAAoB,IAAI;gBAAG,WAAW;YAA2B;QACrF,KAAK;YACH,OAAO;gBAAE,SAAS;gBAAG,WAAW;YAA2B;QAC7D,KAAK;YACH,OAAO;gBAAE,SAAS;gBAAG,WAAW;YAA8B;QAChE,KAAK;YACH,OAAO;gBAAE,SAAS;gBAAG,WAAW;YAA6B;QAC/D,KAAK;YAEH,OAAO;gBAAE,SAAS;gBAAG,WAAW,CAAC,sBAAsB,EAAEA,AAAU,YAAVA,QAAoB,MAAM,KAAK,CAAC,CAAC;YAAC;QAC7F;YACE,OAAO;gBAAE,SAAS;gBAAG,WAAW;YAA4B;IAChE;AACF;AAGO,SAASC,eAAeC,MAA8B;IAC3D,OAAQA;QACN,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT;YACE,OAAO;IACX;AACF;AAMO,SAASC,uBACdC,MAAiC,EACjCC,QAAoD,EACpDC,IAAuC,EACvCC,SAAmC;IAAE,GAAG;IAAG,GAAG;AAAE,CAAC;IAEjD,IAAI,CAACH,UAAU,CAACC,YAAYD,OAAO,KAAK,IAAI,KAAKA,OAAO,MAAM,IAAI,KAAKE,KAAK,KAAK,IAAI,KAAKA,KAAK,MAAM,IAAI,GACvG,OAAO;IACT,MAAME,QAAQJ,OAAO,IAAI,GAAGA,OAA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AAM,AAAD,IAAC,QAAI;QAC9B,IAAIC,IAAI,KAAKC,IAAI,KAAMD,CAAAA,MAAM3B,KAAK,KAAK,IAAI4B,MAAM5B,KAAK,MAAK,GAAIC,QAAQ;YAAE,OAAO0B;YAAG,QAAQC;QAAE;IAC/F,IACC,GAAIL,iBACD;QACE,gBAAgB,CAACjE;YACf,MAAMW,IAAIZ,MAAMC;YAChBiD,QAAQ,OAAO,CAACtC,EAAE,CAAC,EAAEA,EAAE,CAAC;QAC1B;QACA,eAAe,CAACX;YACd,MAAMW,IAAIZ,MAAMC;YAChBiD,QAAQ,MAAM,CAACtC,EAAE,CAAC,EAAEA,EAAE,CAAC;QACzB;IACF,IACA,CAAC,CAAC,EACP;QACC,CAACd,YAAY,SAAS,OAAOoD,UAAU3C,MAAM,QAAQ,GAAGT,YAAY,SAAS;MAC/E,EAAEa,KAAK;IACT,EAAEA;AAEN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/popup/service.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AACrB,OAAO,
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/popup/service.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AACrB,OAAO,EAGL,KAAK,mBAAmB,EAGzB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,KAAK,SAAS,EAAqD,MAAM,gBAAgB,CAAC;AAMnG,OAAO,EAAE,KAAK,YAAY,EAAW,MAAM,kBAAkB,CAAC;AAK9D,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,kBAAkB,EAAsB,MAAM,SAAS,CAAC;AAEhG,OAAO,EAAqB,KAAK,cAAc,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC/E,OAAO,EAGL,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,eAAe,E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AAI,CAAC;IACpB,qDAAqD;IACrD,UAAU,IAAI,IAAI,CAAC;IACnB,yBAAyB;IACzB,UAAU,IAAI,IAAI,CAAC;IACnB,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;CAC9B;AAqVD,oEAAoE;AACpE,wBAAgB,cAAc,CAAC,IAAI,EAAE,YAAY,GAAG,cAAc,CAGjE;AAED,kHAAkH;AAClH,wBAAgB,WAAW,IAAI,cAAc,CAE5C;AAED,wGAAwG;AACxG,wBAAgB,QAAQ,IAAI,cAAc,CAEzC;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,SAAS,CAWzF"}
|
package/dist/popup/service.jsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./popup.css";
|
|
2
|
-
import { G9StringKey, createCulture, createStrings } from "@g9tm/lynxcontrols-foundation";
|
|
2
|
+
import { G9StringKey, createCulture, createStrings, g9Ms } from "@g9tm/lynxcontrols-foundation";
|
|
3
3
|
import { useEffect, useRef, useState, useSyncExternalStore } from "@lynx-js/react";
|
|
4
4
|
import { g9RowStyle, g9SafeId, g9TextStart } from "../base/control.jsx";
|
|
5
5
|
import { useG9Press } from "../base/press.jsx";
|
|
@@ -178,7 +178,7 @@ function createPopupService(host) {
|
|
|
178
178
|
clearTimer: (h)=>stopTimer(h),
|
|
179
179
|
closeDurationMs: (d)=>{
|
|
180
180
|
var _resolvePopupSettings_animationDuration;
|
|
181
|
-
return 'none' === resolvePopupSettings(d, state.defaults).animation ? 0 : null != (_resolvePopupSettings_animationDuration = resolvePopupSettings(d, state.defaults).animationDuration) ? _resolvePopupSettings_animationDuration : 240;
|
|
181
|
+
return 'none' === resolvePopupSettings(d, state.defaults).animation ? 0 : g9Ms(null != (_resolvePopupSettings_animationDuration = resolvePopupSettings(d, state.defaults).animationDuration) ? _resolvePopupSettings_animationDuration : 240);
|
|
182
182
|
},
|
|
183
183
|
autoCloseMs: (d)=>{
|
|
184
184
|
var _resolvePopupSettings_autoCloseDuration;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popup/service.jsx","sources":["../../src/popup/service.tsx"],"sourcesContent":["import './popup.css';\nimport { createCulture, createStrings, type G9ErrorPopupRequest, G9StringKey } from '@g9tm/lynxcontrols-foundation';\nimport { type ReactNode, useEffect, useRef, useState, useSyncExternalStore } from '@lynx-js/react';\nimport { g9RowStyle, g9SafeId, g9TextStart } from '../base/control';\nimport { useG9Press } from '../base/press';\nimport { startTimer, stopTimer } from '../base/timers';\nimport { G9ActivityIndicator } from '../display/activity-indicator';\nimport { useG9Host } from '../host/hooks';\nimport { type G9HostHandle, g9Hosts } from '../host/registry';\nimport { G9IconSlot } from '../icon/slot';\nimport { useG9Diagnostics, useG9Direction, useG9Settings, useG9Strings, useG9Window } from '../provider/hooks';\nimport { g9DefaultErrorPresenter } from '../provider/settings';\nimport { type G9PopupViewOpenOptions, PopupFrame } from './frame';\nimport { type G9PopupInputOptions, type G9PopupInputResult, g9PopupInputResult } from './input';\nimport { createPopupFormStore, PopupInputForm } from './input-form';\nimport { type G9PopupEntry, type G9PopupOutcome, G9PopupQueue } from './queue';\nimport {\n createPopupVisualProfile,\n customPopup,\n type G9PopupAnimationType,\n type G9PopupButton,\n type G9PopupDescriptor,\n type G9PopupResult,\n type G9PopupSettings,\n type G9PopupType,\n type G9PopupVisualProfile,\n g9PopupResult,\n presetPopup,\n resolvePopupSettings,\n} from './types';\n\n/** Most buttons a `row` footer shows (MAUI); more are dropped with a warning. */\nexport const g9PopupRowButtonLimit = 3;\n\n/** Options of `showConfirm` (MAUI `ShowConfirmAsync`). */\nexport interface G9ConfirmOptions {\n readonly title?: string | null;\n readonly okCallback?: ((context: { readonly aborted: boolean }) => unknown) | null;\n readonly cancelCallback?: ((context: { readonly aborted: boolean }) => unknown) | null;\n /** Default `'information'`; `'warning'` for a lossy confirm (sign out, discard). */\n readonly type?: G9PopupType;\n readonly okText?: string;\n readonly cancelText?: string;\n}\n\n/** The popups of a host (MAUI `G9PopupHelper`). */\nexport interface G9PopupService {\n /** Information popup (MAUI `ShowG9PopupAsync`); resolves the result of the button that closed it. */\n show(\n message: string,\n title?: string | null,\n buttons?: ReadonlyArray<G9PopupButton> | null,\n settings?: G9PopupSettings | null,\n animation?: G9PopupAnimationType | null,\n ): Promise<G9PopupResult>;\n showSuccess(\n message: string,\n title?: string | null,\n buttons?: ReadonlyArray<G9PopupButton> | null,\n settings?: G9PopupSettings | null,\n animation?: G9PopupAnimationType | null,\n ): Promise<G9PopupResult>;\n showWarning(\n message: string,\n title?: string | null,\n buttons?: ReadonlyArray<G9PopupButton> | null,\n settings?: G9PopupSettings | null,\n animation?: G9PopupAnimationType | null,\n ): Promise<G9PopupResult>;\n showError(\n message: string,\n title?: string | null,\n buttons?: ReadonlyArray<G9PopupButton> | null,\n settings?: G9PopupSettings | null,\n animation?: G9PopupAnimationType | null,\n ): Promise<G9PopupResult>;\n /** Any content in the body (MAUI `ShowCustomG9PopupAsync`). */\n showCustom(\n content: ReactNode | (() => ReactNode),\n title?: string | null,\n buttons?: ReadonlyArray<G9PopupButton> | null,\n settings?: G9PopupSettings | null,\n animation?: G9PopupAnimationType | null,\n ): Promise<G9PopupResult>;\n /** Any descriptor; resolves how it ended. */\n showDescriptor(descriptor: G9PopupDescriptor): Promise<G9PopupOutcome>;\n /** A validated form (MAUI `ShowInputG9PopupAsync`). */\n showInput(options: G9PopupInputOptions): Promise<G9PopupInputResult>;\n /** OK/Cancel: `true` only for OK; every other exit is `false` (MAUI `ShowConfirmAsync`). */\n showConfirm(message: string, options?: G9ConfirmOptions): Promise<boolean>;\n /** Hardware back: `true` when a popup is on screen (closed unless `closeOnBackButton: false`). */\n handleHardwareBack(): boolean;\n /** Closes the popup on screen. */\n closeActive(): void;\n /** Drops waiting popups; the one on screen stays. */\n clearQueue(): void;\n /** Closes everything. */\n dismissAll(): void;\n readonly queue: G9PopupQueue;\n}\n\nconst FEATURE = 'g9.popups';\n\ninterface State {\n service: G9PopupService;\n defaults: G9PopupSettings;\n /** Strings and diagnostics of the provider; refreshed by the layer on every render. */\n strings: (key: G9StringKey) => string;\n warn?: (message: string) => void;\n report?: (error: unknown) => void;\n}\n\nconst fallbackStrings = createStrings({ culture: createCulture('en') });\n\nfunction PopupButtonView(props: {\n readonly button: G9PopupButton;\n /** Element id: the button's `testId` made selector-safe, else `G9Popup_Button_<index>`. */\n readonly id: string;\n readonly profile: G9PopupVisualProfile;\n readonly busy: boolean;\n readonly stacked: boolean;\n readonly onPress: () => void;\n}): ReactNode {\n const { button, profile } = props;\n const primary = button.isPrimary !== false;\n const press = useG9Press(props.onPress, { source: 'G9Popup', guardMs: 0 });\n const background = button.backgroundColor ?? (primary ? profile.buttonBackground : 'transparent');\n const color = button.textColor ?? (primary ? profile.buttonTextColor : 'var(--g9-on-surface)');\n return (\n <view\n className={`g9-popup__button${primary ? ' g9-popup__button--primary' : ' g9-popup__button--outline'}${props.stacked ? ' g9-popup__button--stacked' : ''}${props.busy ? ' g9-popup__button--busy' : ''}`}\n style={{ backgroundColor: background }}\n accessibility-element={true}\n accessibility-traits=\"button\"\n accessibility-label={button.text}\n {...(button.testId ? { 'data-testid': button.testId } : {})}\n id={props.id}\n bindtap={press}\n >\n {button.icon || button.iconImage ? (\n <G9IconSlot icon={button.icon} image={button.iconImage ?? null} size={18} color={color} />\n ) : null}\n <text className=\"g9-popup__button-text\" style={{ color }}>\n {button.text}\n </text>\n </view>\n );\n}\n\n/** Header, body and footer of a queued popup (MAUI helper templates). */\nfunction PopupCardContent(props: {\n readonly entry: G9PopupEntry;\n readonly settings: G9PopupSettings;\n readonly profile: G9PopupVisualProfile;\n readonly state: State;\n}): ReactNode {\n const { entry, settings, profile, state } = props;\n const strings = useG9Strings();\n const d = entry.descriptor;\n const close = useG9Press(() => state.service.queue.closeActive(), { source: 'G9Popup', guardMs: 0 });\n const glyphs = useG9Settings().glyphs;\n const buttons = d.buttons;\n const stacked = settings.footerButtonLayout === 'stacked';\n const shown = stacked ? buttons : buttons.slice(0, g9PopupRowButtonLimit);\n const warned = useRef(false);\n if (!stacked && buttons.length > g9PopupRowButtonLimit && !warned.current) {\n warned.current = true;\n state.warn?.(\n `A row footer shows at most ${g9PopupRowButtonLimit} buttons; ${buttons.length - g9PopupRowButtonLimit} dropped.`,\n );\n }\n const title = d.title?.trim()\n ? d.title\n : strings.get(\n d.type === 'success'\n ? G9StringKey.Success\n : d.type === 'warning'\n ? G9StringKey.Warning\n : d.type === 'error'\n ? G9StringKey.Error\n : G9StringKey.Information,\n );\n const content = typeof d.content === 'function' ? (d.content as () => ReactNode)() : d.content;\n const direction = useG9Direction();\n const row = g9RowStyle(direction);\n return (\n <view className=\"g9-popup__content\">\n {settings.showHeader !== false ? (\n <view className=\"g9-popup__header\" style={row}>\n <view className=\"g9-popup__badge\" accessibility-label={profile.semanticIconDescription}>\n <view className=\"g9-popup__badge-tint\" style={{ backgroundColor: profile.iconColor }} />\n <G9IconSlot icon={profile.icon} size={17} color={profile.iconColor} />\n </view>\n <text\n className=\"g9-popup__title\"\n text-maxline=\"1\"\n style={{ color: profile.titleColor, ...g9TextStart(direction) }}\n >\n {title}\n </text>\n {settings.showCloseButton ? (\n <view\n className=\"g9-popup__close\"\n accessibility-element={true}\n accessibility-traits=\"button\"\n accessibility-label={strings.get(G9StringKey.Close)}\n bindtap={close}\n >\n <G9IconSlot icon={glyphs.clear} size={20} color=\"var(--g9-on-surface-variant)\" />\n </view>\n ) : null}\n </view>\n ) : null}\n {settings.showHeader !== false ? <view className=\"g9-popup__divider\" /> : null}\n {d.message ? (\n <text className=\"g9-popup__message\" style={{ color: profile.messageColor, ...g9TextStart(direction) }}>\n {d.message}\n </text>\n ) : null}\n {content !== null && content !== undefined ? <view className=\"g9-popup__body\">{content}</view> : null}\n {settings.showFooter !== false ? (\n <view className={`g9-popup__footer${stacked ? ' g9-popup__footer--stacked' : ''}`} style={stacked ? {} : row}>\n {shown.map((button, i) => (\n <PopupButtonView\n key={i}\n id={button.testId ? g9SafeId(button.testId) : `G9Popup_Button_${i}`}\n button={button}\n profile={profile}\n busy={entry.busy}\n stacked={stacked}\n onPress={() => void state.service.queue.press(entry.id, i)}\n />\n ))}\n {entry.busy ? <G9ActivityIndicator running size={18} /> : null}\n </view>\n ) : null}\n </view>\n );\n}\n\n/** The popup layer: the active popup's frame; motion phases from the queue phase. */\nfunction PopupLayer(props: { readonly state: State }): ReactNode {\n const { state } = props;\n const settingsAll = useG9Settings();\n const diagnostics = useG9Diagnostics();\n state.defaults = settingsAll.popups;\n const glyphs = settingsAll.glyphs;\n const strings = useG9Strings();\n state.strings = (k) => strings.get(k);\n state.warn = (message) => diagnostics.log({ level: 'warning', message, source: 'G9Popup' });\n state.report = (error) =>\n diagnostics.log({ level: 'error', message: 'A popup callback failed.', source: 'G9Popup', error });\n const win = useG9Window();\n const queue = state.service.queue;\n const entry = useSyncExternalStore(\n (l) => queue.subscribe(l),\n () => queue.getSnapshot(),\n );\n // `enter` for one frame per show, then `open` (the transition runs), `leave` while closing.\n const [entered, setEntered] = useState<string | null>(null);\n const showKey = entry ? `${entry.id}:${entry.showCount}` : null;\n useEffect(() => {\n if (!showKey) return;\n const t = startTimer(() => setEntered(showKey), 16);\n return () => stopTimer(t);\n }, [showKey]);\n const settings = entry ? resolvePopupSettings(entry.descriptor, state.defaults) : null;\n const duration = settings?.animationDuration ?? 240;\n useEffect(() => {\n if (!entry || entered !== showKey || entry.phase !== 'opening') return;\n const t = startTimer(() => queue.markOpened(entry.id), duration);\n return () => stopTimer(t);\n }, [entered, showKey, entry?.phase]);\n useEffect(() => () => queue.dispose(), [queue]);\n if (!entry || !settings) return null;\n const profile = createPopupVisualProfile(entry.descriptor, settings, glyphs, (k) =>\n strings.get(\n k === 'success'\n ? G9StringKey.Success\n : k === 'warning'\n ? G9StringKey.Warning\n : k === 'error'\n ? G9StringKey.Error\n : G9StringKey.Information,\n ),\n );\n const options: G9PopupViewOpenOptions = {\n width: profile.width,\n height: profile.height,\n cornerRadius: profile.cornerRadius,\n padding: profile.padding,\n autoSizeMode: settings.autoSizeMode ?? 'height',\n cardBackground: profile.cardBackground,\n borderColor: profile.borderColor,\n overlayMode: settings.overlayMode ?? 'transparent',\n blurIntensity: settings.blurIntensity ?? 'none',\n overlayColor: profile.overlayColor,\n overlayOpacity: profile.overlayOpacity,\n animation: profile.animation,\n animationEasing: settings.animationEasing ?? 'sinOut',\n animationDuration: duration,\n };\n const phase = entry.phase === 'closing' ? 'leave' : entered === showKey ? 'open' : 'enter';\n return (\n <PopupFrame\n key={showKey as string}\n options={options}\n phase={phase}\n hostWidth={win.width}\n onBackgroundTap={() => queue.backgroundTap(entry.id)}\n >\n <PopupCardContent entry={entry} settings={settings} profile={profile} state={state} />\n </PopupFrame>\n );\n}\n\nfunction createPopupService(host: G9HostHandle): State {\n const state = { defaults: {}, strings: fallbackStrings.get } as unknown as State;\n const strings = (k: G9StringKey) => state.strings(k);\n const queue = new G9PopupQueue({\n setTimer: (cb, ms) => startTimer(cb, ms),\n clearTimer: (h) => stopTimer(h as never),\n closeDurationMs: (d) =>\n resolvePopupSettings(d, state.defaults).animation === 'none'\n ? 0\n : (resolvePopupSettings(d, state.defaults).animationDuration ?? 240),\n autoCloseMs: (d) => resolvePopupSettings(d, state.defaults).autoCloseDuration ?? 0,\n closesOnBack: (d) => resolvePopupSettings(d, state.defaults).closeOnBackButton !== false,\n closesOnBackgroundTap: (d) => resolvePopupSettings(d, state.defaults).closeOnBackgroundClick === true,\n onError: (error) => state.report?.(error),\n });\n // A popup without buttons gets an OK button (MAUI presets).\n const withOk = (d: G9PopupDescriptor): G9PopupDescriptor =>\n d.buttons.length > 0 ? d : { ...d, buttons: [{ text: strings(G9StringKey.Ok), isPrimary: true }] };\n const preset =\n (type: G9PopupType) =>\n (\n message: string,\n title?: string | null,\n buttons?: ReadonlyArray<G9PopupButton> | null,\n settings?: G9PopupSettings | null,\n animation?: G9PopupAnimationType | null,\n ) =>\n queue.show(withOk(presetPopup(type, message, title, buttons, settings, animation ?? null))).then((o) => o.result);\n const service: G9PopupService = {\n queue,\n show: preset('information'),\n showSuccess: preset('success'),\n showWarning: preset('warning'),\n showError: preset('error'),\n showCustom: (content, title, buttons, settings, animation) =>\n queue.show(withOk(customPopup(content, title, buttons, settings, animation ?? null))).then((o) => o.result),\n showDescriptor: (descriptor) => queue.show(withOk(descriptor)),\n async showInput(options) {\n const store = createPopupFormStore(options.fields);\n let result = g9PopupInputResult.cancel();\n const cancel: G9PopupButton = {\n ...(options.cancelButton ?? { text: options.cancelButtonText ?? strings(G9StringKey.Cancel) }),\n isPrimary: false,\n callback: () => {\n result = g9PopupInputResult.cancel();\n return g9PopupResult.close();\n },\n };\n const submit: G9PopupButton = {\n ...(options.submitButton ?? { text: options.submitButtonText ?? strings(G9StringKey.Save) }),\n isPrimary: true,\n callback: () => {\n const v = store.validate({\n requiredSuffix: strings(G9StringKey.RequiredSuffix),\n invalidEmail: strings(G9StringKey.InvalidEmail),\n });\n result = v.valid\n ? g9PopupInputResult.submit(v.values, v.arrayValues)\n : g9PopupInputResult.validationFailed(v.values, v.arrayValues, v.errors);\n return v.valid ? g9PopupResult.close() : g9PopupResult.noAction();\n },\n };\n const settings: G9PopupSettings = {\n showHeader: true,\n showFooter: true,\n showCloseButton: false,\n closeOnBackgroundClick: false,\n autoSizeMode: 'height',\n padding: [20, 12, 20, 8],\n ...Object.fromEntries(Object.entries(options.settings ?? {}).filter(([, v]) => v !== undefined && v !== null)),\n };\n await queue.show({\n type: options.type ?? 'information',\n title: options.title ?? null,\n message: options.message ?? null,\n content: () => <PopupInputForm store={store} focusFirst={options.focusFirstFieldOnOpen !== false} />,\n buttons: [cancel, submit],\n settings,\n animation: options.animation ?? null,\n form: {\n fieldKeys: options.fields.map((f) => f.key),\n setText: (key, value) => store.setText(key, value),\n getText: (key) => store.getState().form.text[key] ?? null,\n },\n });\n return result;\n },\n async showConfirm(message, options = {}) {\n let ok = false;\n await queue.show(\n presetPopup(options.type ?? 'information', message, options.title ?? null, [\n {\n text: options.cancelText ?? strings(G9StringKey.Cancel),\n isPrimary: false,\n callback: async (c) => {\n await options.cancelCallback?.(c);\n return g9PopupResult.close();\n },\n },\n {\n text: options.okText ?? strings(G9StringKey.Ok),\n isPrimary: true,\n callback: async (c) => {\n await options.okCallback?.(c);\n ok = true;\n return g9PopupResult.close();\n },\n },\n ]),\n );\n return ok;\n },\n handleHardwareBack: () => queue.handleBack(),\n closeActive: () => queue.closeActive(),\n clearQueue: () => queue.clearQueue(),\n dismissAll: () => queue.dismissAll(),\n };\n state.service = service;\n host.attachFeature(FEATURE, state);\n host.registerLayerItem('popups', { key: FEATURE, element: <PopupLayer state={state} />, order: 0 });\n host.back.push(() => (queue.handleBack() ? 'handled' : 'pass'), { layer: 'popups' });\n return state;\n}\n\n/** The popup service of a host (created once as a host feature). */\nexport function popupServiceOf(host: G9HostHandle): G9PopupService {\n const existing = host.getFeature(FEATURE) as State | undefined;\n return (existing ?? createPopupService(host)).service;\n}\n\n/** The popups of the nearest `G9Host` (MAUI `G9PopupHelper`): one card at a time, FIFO, in the `popups` layer. */\nexport function useG9Popups(): G9PopupService {\n return popupServiceOf(useG9Host());\n}\n\n/** The popups of the active host, for code outside components. Throws `host-missing` without a host. */\nexport function g9Popups(): G9PopupService {\n return popupServiceOf(g9Hosts.require());\n}\n\n/**\n * The default error presenter (installed when this module loads): the executor's error popup as an error-type popup\n * on the active host, with More details when diagnostics are available. Without a host it does nothing.\n */\nexport function presentErrorPopup(request: G9ErrorPopupRequest): Promise<void> | undefined {\n const host = g9Hosts.active();\n if (!host) return undefined;\n const popups = popupServiceOf(host);\n const buttons: G9PopupButton[] = [];\n if (request.moreDetails) {\n const more = request.moreDetails;\n buttons.push({ text: more.text, isPrimary: false, callback: async () => void (await more.open()) });\n }\n buttons.push({ text: request.okText, isPrimary: true });\n return popups.showError(request.message, request.title, buttons).then(() => undefined);\n}\n\ng9DefaultErrorPresenter.current = presentErrorPopup;\n"],"names":["g9PopupRowButtonLimit","FEATURE","fallbackStrings","createStrings","createCulture","PopupButtonView","props","_button_backgroundColor","_button_textColor","_button_iconImage","button","profile","primary","press","useG9Press","background","color","view","G9IconSlot","text","PopupCardContent","_d_title","entry","settings","state","strings","useG9Strings","d","close","glyphs","useG9Settings","buttons","stacked","shown","warned","useRef","title","G9StringKey","content","direction","useG9Direction","row","g9RowStyle","g9TextStart","i","g9SafeId","G9ActivityIndicator","PopupLayer","_settings_autoSizeMode","_settings_overlayMode","_settings_blurIntensity","_settings_animationEasing","settingsAll","diagnostics","useG9Diagnostics","k","message","error","win","useG9Window","queue","useSyncExternalStore","l","entered","setEntered","useState","showKey","useEffect","t","startTimer","stopTimer","resolvePopupSettings","duration","createPopupVisualProfile","options","phase","PopupFrame","createPopupService","host","G9PopupQueue","cb","ms","h","_resolvePopupSettings_animationDuration","_resolvePopupSettings_autoCloseDuration","withOk","preset","type","animation","presetPopup","o","service","customPopup","descriptor","_options_cancelButton","_options_cancelButtonText","_options_submitButton","_options_submitButtonText","_options_settings","_options_type","_options_title","_options_message","_options_animation","store","createPopupFormStore","result","g9PopupInputResult","cancel","g9PopupResult","submit","v","Object","PopupInputForm","f","key","value","_store_getState_form_text_key","_options_cancelText","_options_okText","ok","c","popupServiceOf","existing","useG9Popups","useG9Host","g9Popups","g9Hosts","presentErrorPopup","request","popups","more","undefined","g9DefaultErrorPresenter"],"mappings":";;;;;;;;;;;;;;;;;AAgCO,MAAMA,wBAAwB;AAqErC,MAAMC,UAAU;AAWhB,MAAMC,kBAAkBC,cAAc;IAAE,SAASC,cAAc;AAAM;AAErE,SAASC,gBAAgBC,KAQxB;QAIoBC,yBACLC,mBAa8BC;IAjB5C,MAAM,EAAEC,MAAM,EAAEC,OAAO,EAAE,GAAGL;IAC5B,MAAMM,UAAUF,AAAqB,UAArBA,OAAO,SAAS;IAChC,MAAMG,QAAQC,WAAWR,MAAM,OAAO,EAAE;QAAE,QAAQ;QAAW,SAA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'./popup.css';\nimport {\n createCulture,\n createStrings,\n type G9ErrorPopupRequest,\n G9StringKey,\n g9Ms,\n} from '@g9tm/lynxcontrols-foundation';\nimport { type ReactNode, useEffect, useRef, useState, useSyncExternalStore } from '@lynx-js/react';\nimport { g9RowStyle, g9SafeId, g9TextStart } from '../base/control';\nimport { useG9Press } from '../base/press';\nimport { startTimer, stopTimer } from '../base/timers';\nimport { G9ActivityIndicator } from '../display/activity-indicator';\nimport { useG9Host } from '../host/hooks';\nimport { type G9HostHandle, g9Hosts } from '../host/registry';\nimport { G9IconSlot } from '../icon/slot';\nimport { useG9Diagnostics, useG9Direction, useG9Settings, useG9Strings, useG9Window } from '../provider/hooks';\nimport { g9DefaultErrorPresenter } from '../provider/settings';\nimport { type G9PopupViewOpenOptions, PopupFrame } from './frame';\nimport { type G9PopupInputOptions, type G9PopupInputResult, g9PopupInputResult } from './input';\nimport { createPopupFormStore, PopupInputForm } from './input-form';\nimport { type G9PopupEntry, type G9PopupOutcome, G9PopupQueue } from './queue';\nimport {\n createPopupVisualProfile,\n customPopup,\n type G9PopupAnimationType,\n type G9PopupButton,\n type G9PopupDescriptor,\n type G9PopupResult,\n type G9PopupSettings,\n type G9PopupType,\n type G9PopupVisualProfile,\n g9PopupResult,\n presetPopup,\n resolvePopupSettings,\n} from './types';\n\n/** Most buttons a `row` footer shows (MAUI); more are dropped with a warning. */\nexport const g9PopupRowButtonLimit = 3;\n\n/** Options of `showConfirm` (MAUI `ShowConfirmAsync`). */\nexport interface G9ConfirmOptions {\n readonly title?: string | null;\n readonly okCallback?: ((context: { readonly aborted: boolean }) => unknown) | null;\n readonly cancelCallback?: ((context: { readonly aborted: boolean }) => unknown) | null;\n /** Default `'information'`; `'warning'` for a lossy confirm (sign out, discard). */\n readonly type?: G9PopupType;\n readonly okText?: string;\n readonly cancelText?: string;\n}\n\n/** The popups of a host (MAUI `G9PopupHelper`). */\nexport interface G9PopupService {\n /** Information popup (MAUI `ShowG9PopupAsync`); resolves the result of the button that closed it. */\n show(\n message: string,\n title?: string | null,\n buttons?: ReadonlyArray<G9PopupButton> | null,\n settings?: G9PopupSettings | null,\n animation?: G9PopupAnimationType | null,\n ): Promise<G9PopupResult>;\n showSuccess(\n message: string,\n title?: string | null,\n buttons?: ReadonlyArray<G9PopupButton> | null,\n settings?: G9PopupSettings | null,\n animation?: G9PopupAnimationType | null,\n ): Promise<G9PopupResult>;\n showWarning(\n message: string,\n title?: string | null,\n buttons?: ReadonlyArray<G9PopupButton> | null,\n settings?: G9PopupSettings | null,\n animation?: G9PopupAnimationType | null,\n ): Promise<G9PopupResult>;\n showError(\n message: string,\n title?: string | null,\n buttons?: ReadonlyArray<G9PopupButton> | null,\n settings?: G9PopupSettings | null,\n animation?: G9PopupAnimationType | null,\n ): Promise<G9PopupResult>;\n /** Any content in the body (MAUI `ShowCustomG9PopupAsync`). */\n showCustom(\n content: ReactNode | (() => ReactNode),\n title?: string | null,\n buttons?: ReadonlyArray<G9PopupButton> | null,\n settings?: G9PopupSettings | null,\n animation?: G9PopupAnimationType | null,\n ): Promise<G9PopupResult>;\n /** Any descriptor; resolves how it ended. */\n showDescriptor(descriptor: G9PopupDescriptor): Promise<G9PopupOutcome>;\n /** A validated form (MAUI `ShowInputG9PopupAsync`). */\n showInput(options: G9PopupInputOptions): Promise<G9PopupInputResult>;\n /** OK/Cancel: `true` only for OK; every other exit is `false` (MAUI `ShowConfirmAsync`). */\n showConfirm(message: string, options?: G9ConfirmOptions): Promise<boolean>;\n /** Hardware back: `true` when a popup is on screen (closed unless `closeOnBackButton: false`). */\n handleHardwareBack(): boolean;\n /** Closes the popup on screen. */\n closeActive(): void;\n /** Drops waiting popups; the one on screen stays. */\n clearQueue(): void;\n /** Closes everything. */\n dismissAll(): void;\n readonly queue: G9PopupQueue;\n}\n\nconst FEATURE = 'g9.popups';\n\ninterface State {\n service: G9PopupService;\n defaults: G9PopupSettings;\n /** Strings and diagnostics of the provider; refreshed by the layer on every render. */\n strings: (key: G9StringKey) => string;\n warn?: (message: string) => void;\n report?: (error: unknown) => void;\n}\n\nconst fallbackStrings = createStrings({ culture: createCulture('en') });\n\nfunction PopupButtonView(props: {\n readonly button: G9PopupButton;\n /** Element id: the button's `testId` made selector-safe, else `G9Popup_Button_<index>`. */\n readonly id: string;\n readonly profile: G9PopupVisualProfile;\n readonly busy: boolean;\n readonly stacked: boolean;\n readonly onPress: () => void;\n}): ReactNode {\n const { button, profile } = props;\n const primary = button.isPrimary !== false;\n const press = useG9Press(props.onPress, { source: 'G9Popup', guardMs: 0 });\n const background = button.backgroundColor ?? (primary ? profile.buttonBackground : 'transparent');\n const color = button.textColor ?? (primary ? profile.buttonTextColor : 'var(--g9-on-surface)');\n return (\n <view\n className={`g9-popup__button${primary ? ' g9-popup__button--primary' : ' g9-popup__button--outline'}${props.stacked ? ' g9-popup__button--stacked' : ''}${props.busy ? ' g9-popup__button--busy' : ''}`}\n style={{ backgroundColor: background }}\n accessibility-element={true}\n accessibility-traits=\"button\"\n accessibility-label={button.text}\n {...(button.testId ? { 'data-testid': button.testId } : {})}\n id={props.id}\n bindtap={press}\n >\n {button.icon || button.iconImage ? (\n <G9IconSlot icon={button.icon} image={button.iconImage ?? null} size={18} color={color} />\n ) : null}\n <text className=\"g9-popup__button-text\" style={{ color }}>\n {button.text}\n </text>\n </view>\n );\n}\n\n/** Header, body and footer of a queued popup (MAUI helper templates). */\nfunction PopupCardContent(props: {\n readonly entry: G9PopupEntry;\n readonly settings: G9PopupSettings;\n readonly profile: G9PopupVisualProfile;\n readonly state: State;\n}): ReactNode {\n const { entry, settings, profile, state } = props;\n const strings = useG9Strings();\n const d = entry.descriptor;\n const close = useG9Press(() => state.service.queue.closeActive(), { source: 'G9Popup', guardMs: 0 });\n const glyphs = useG9Settings().glyphs;\n const buttons = d.buttons;\n const stacked = settings.footerButtonLayout === 'stacked';\n const shown = stacked ? buttons : buttons.slice(0, g9PopupRowButtonLimit);\n const warned = useRef(false);\n if (!stacked && buttons.length > g9PopupRowButtonLimit && !warned.current) {\n warned.current = true;\n state.warn?.(\n `A row footer shows at most ${g9PopupRowButtonLimit} buttons; ${buttons.length - g9PopupRowButtonLimit} dropped.`,\n );\n }\n const title = d.title?.trim()\n ? d.title\n : strings.get(\n d.type === 'success'\n ? G9StringKey.Success\n : d.type === 'warning'\n ? G9StringKey.Warning\n : d.type === 'error'\n ? G9StringKey.Error\n : G9StringKey.Information,\n );\n const content = typeof d.content === 'function' ? (d.content as () => ReactNode)() : d.content;\n const direction = useG9Direction();\n const row = g9RowStyle(direction);\n return (\n <view className=\"g9-popup__content\">\n {settings.showHeader !== false ? (\n <view className=\"g9-popup__header\" style={row}>\n <view className=\"g9-popup__badge\" accessibility-label={profile.semanticIconDescription}>\n <view className=\"g9-popup__badge-tint\" style={{ backgroundColor: profile.iconColor }} />\n <G9IconSlot icon={profile.icon} size={17} color={profile.iconColor} />\n </view>\n <text\n className=\"g9-popup__title\"\n text-maxline=\"1\"\n style={{ color: profile.titleColor, ...g9TextStart(direction) }}\n >\n {title}\n </text>\n {settings.showCloseButton ? (\n <view\n className=\"g9-popup__close\"\n accessibility-element={true}\n accessibility-traits=\"button\"\n accessibility-label={strings.get(G9StringKey.Close)}\n bindtap={close}\n >\n <G9IconSlot icon={glyphs.clear} size={20} color=\"var(--g9-on-surface-variant)\" />\n </view>\n ) : null}\n </view>\n ) : null}\n {settings.showHeader !== false ? <view className=\"g9-popup__divider\" /> : null}\n {d.message ? (\n <text className=\"g9-popup__message\" style={{ color: profile.messageColor, ...g9TextStart(direction) }}>\n {d.message}\n </text>\n ) : null}\n {content !== null && content !== undefined ? <view className=\"g9-popup__body\">{content}</view> : null}\n {settings.showFooter !== false ? (\n <view className={`g9-popup__footer${stacked ? ' g9-popup__footer--stacked' : ''}`} style={stacked ? {} : row}>\n {shown.map((button, i) => (\n <PopupButtonView\n key={i}\n id={button.testId ? g9SafeId(button.testId) : `G9Popup_Button_${i}`}\n button={button}\n profile={profile}\n busy={entry.busy}\n stacked={stacked}\n onPress={() => void state.service.queue.press(entry.id, i)}\n />\n ))}\n {entry.busy ? <G9ActivityIndicator running size={18} /> : null}\n </view>\n ) : null}\n </view>\n );\n}\n\n/** The popup layer: the active popup's frame; motion phases from the queue phase. */\nfunction PopupLayer(props: { readonly state: State }): ReactNode {\n const { state } = props;\n const settingsAll = useG9Settings();\n const diagnostics = useG9Diagnostics();\n state.defaults = settingsAll.popups;\n const glyphs = settingsAll.glyphs;\n const strings = useG9Strings();\n state.strings = (k) => strings.get(k);\n state.warn = (message) => diagnostics.log({ level: 'warning', message, source: 'G9Popup' });\n state.report = (error) =>\n diagnostics.log({ level: 'error', message: 'A popup callback failed.', source: 'G9Popup', error });\n const win = useG9Window();\n const queue = state.service.queue;\n const entry = useSyncExternalStore(\n (l) => queue.subscribe(l),\n () => queue.getSnapshot(),\n );\n // `enter` for one frame per show, then `open` (the transition runs), `leave` while closing.\n const [entered, setEntered] = useState<string | null>(null);\n const showKey = entry ? `${entry.id}:${entry.showCount}` : null;\n useEffect(() => {\n if (!showKey) return;\n const t = startTimer(() => setEntered(showKey), 16);\n return () => stopTimer(t);\n }, [showKey]);\n const settings = entry ? resolvePopupSettings(entry.descriptor, state.defaults) : null;\n const duration = settings?.animationDuration ?? 240;\n useEffect(() => {\n if (!entry || entered !== showKey || entry.phase !== 'opening') return;\n const t = startTimer(() => queue.markOpened(entry.id), duration);\n return () => stopTimer(t);\n }, [entered, showKey, entry?.phase]);\n useEffect(() => () => queue.dispose(), [queue]);\n if (!entry || !settings) return null;\n const profile = createPopupVisualProfile(entry.descriptor, settings, glyphs, (k) =>\n strings.get(\n k === 'success'\n ? G9StringKey.Success\n : k === 'warning'\n ? G9StringKey.Warning\n : k === 'error'\n ? G9StringKey.Error\n : G9StringKey.Information,\n ),\n );\n const options: G9PopupViewOpenOptions = {\n width: profile.width,\n height: profile.height,\n cornerRadius: profile.cornerRadius,\n padding: profile.padding,\n autoSizeMode: settings.autoSizeMode ?? 'height',\n cardBackground: profile.cardBackground,\n borderColor: profile.borderColor,\n overlayMode: settings.overlayMode ?? 'transparent',\n blurIntensity: settings.blurIntensity ?? 'none',\n overlayColor: profile.overlayColor,\n overlayOpacity: profile.overlayOpacity,\n animation: profile.animation,\n animationEasing: settings.animationEasing ?? 'sinOut',\n animationDuration: duration,\n };\n const phase = entry.phase === 'closing' ? 'leave' : entered === showKey ? 'open' : 'enter';\n return (\n <PopupFrame\n key={showKey as string}\n options={options}\n phase={phase}\n hostWidth={win.width}\n onBackgroundTap={() => queue.backgroundTap(entry.id)}\n >\n <PopupCardContent entry={entry} settings={settings} profile={profile} state={state} />\n </PopupFrame>\n );\n}\n\nfunction createPopupService(host: G9HostHandle): State {\n const state = { defaults: {}, strings: fallbackStrings.get } as unknown as State;\n const strings = (k: G9StringKey) => state.strings(k);\n const queue = new G9PopupQueue({\n setTimer: (cb, ms) => startTimer(cb, ms),\n clearTimer: (h) => stopTimer(h as never),\n closeDurationMs: (d) =>\n resolvePopupSettings(d, state.defaults).animation === 'none'\n ? 0\n : g9Ms(resolvePopupSettings(d, state.defaults).animationDuration ?? 240),\n autoCloseMs: (d) => resolvePopupSettings(d, state.defaults).autoCloseDuration ?? 0,\n closesOnBack: (d) => resolvePopupSettings(d, state.defaults).closeOnBackButton !== false,\n closesOnBackgroundTap: (d) => resolvePopupSettings(d, state.defaults).closeOnBackgroundClick === true,\n onError: (error) => state.report?.(error),\n });\n // A popup without buttons gets an OK button (MAUI presets).\n const withOk = (d: G9PopupDescriptor): G9PopupDescriptor =>\n d.buttons.length > 0 ? d : { ...d, buttons: [{ text: strings(G9StringKey.Ok), isPrimary: true }] };\n const preset =\n (type: G9PopupType) =>\n (\n message: string,\n title?: string | null,\n buttons?: ReadonlyArray<G9PopupButton> | null,\n settings?: G9PopupSettings | null,\n animation?: G9PopupAnimationType | null,\n ) =>\n queue.show(withOk(presetPopup(type, message, title, buttons, settings, animation ?? null))).then((o) => o.result);\n const service: G9PopupService = {\n queue,\n show: preset('information'),\n showSuccess: preset('success'),\n showWarning: preset('warning'),\n showError: preset('error'),\n showCustom: (content, title, buttons, settings, animation) =>\n queue.show(withOk(customPopup(content, title, buttons, settings, animation ?? null))).then((o) => o.result),\n showDescriptor: (descriptor) => queue.show(withOk(descriptor)),\n async showInput(options) {\n const store = createPopupFormStore(options.fields);\n let result = g9PopupInputResult.cancel();\n const cancel: G9PopupButton = {\n ...(options.cancelButton ?? { text: options.cancelButtonText ?? strings(G9StringKey.Cancel) }),\n isPrimary: false,\n callback: () => {\n result = g9PopupInputResult.cancel();\n return g9PopupResult.close();\n },\n };\n const submit: G9PopupButton = {\n ...(options.submitButton ?? { text: options.submitButtonText ?? strings(G9StringKey.Save) }),\n isPrimary: true,\n callback: () => {\n const v = store.validate({\n requiredSuffix: strings(G9StringKey.RequiredSuffix),\n invalidEmail: strings(G9StringKey.InvalidEmail),\n });\n result = v.valid\n ? g9PopupInputResult.submit(v.values, v.arrayValues)\n : g9PopupInputResult.validationFailed(v.values, v.arrayValues, v.errors);\n return v.valid ? g9PopupResult.close() : g9PopupResult.noAction();\n },\n };\n const settings: G9PopupSettings = {\n showHeader: true,\n showFooter: true,\n showCloseButton: false,\n closeOnBackgroundClick: false,\n autoSizeMode: 'height',\n padding: [20, 12, 20, 8],\n ...Object.fromEntries(Object.entries(options.settings ?? {}).filter(([, v]) => v !== undefined && v !== null)),\n };\n await queue.show({\n type: options.type ?? 'information',\n title: options.title ?? null,\n message: options.message ?? null,\n content: () => <PopupInputForm store={store} focusFirst={options.focusFirstFieldOnOpen !== false} />,\n buttons: [cancel, submit],\n settings,\n animation: options.animation ?? null,\n form: {\n fieldKeys: options.fields.map((f) => f.key),\n setText: (key, value) => store.setText(key, value),\n getText: (key) => store.getState().form.text[key] ?? null,\n },\n });\n return result;\n },\n async showConfirm(message, options = {}) {\n let ok = false;\n await queue.show(\n presetPopup(options.type ?? 'information', message, options.title ?? null, [\n {\n text: options.cancelText ?? strings(G9StringKey.Cancel),\n isPrimary: false,\n callback: async (c) => {\n await options.cancelCallback?.(c);\n return g9PopupResult.close();\n },\n },\n {\n text: options.okText ?? strings(G9StringKey.Ok),\n isPrimary: true,\n callback: async (c) => {\n await options.okCallback?.(c);\n ok = true;\n return g9PopupResult.close();\n },\n },\n ]),\n );\n return ok;\n },\n handleHardwareBack: () => queue.handleBack(),\n closeActive: () => queue.closeActive(),\n clearQueue: () => queue.clearQueue(),\n dismissAll: () => queue.dismissAll(),\n };\n state.service = service;\n host.attachFeature(FEATURE, state);\n host.registerLayerItem('popups', { key: FEATURE, element: <PopupLayer state={state} />, order: 0 });\n host.back.push(() => (queue.handleBack() ? 'handled' : 'pass'), { layer: 'popups' });\n return state;\n}\n\n/** The popup service of a host (created once as a host feature). */\nexport function popupServiceOf(host: G9HostHandle): G9PopupService {\n const existing = host.getFeature(FEATURE) as State | undefined;\n return (existing ?? createPopupService(host)).service;\n}\n\n/** The popups of the nearest `G9Host` (MAUI `G9PopupHelper`): one card at a time, FIFO, in the `popups` layer. */\nexport function useG9Popups(): G9PopupService {\n return popupServiceOf(useG9Host());\n}\n\n/** The popups of the active host, for code outside components. Throws `host-missing` without a host. */\nexport function g9Popups(): G9PopupService {\n return popupServiceOf(g9Hosts.require());\n}\n\n/**\n * The default error presenter (installed when this module loads): the executor's error popup as an error-type popup\n * on the active host, with More details when diagnostics are available. Without a host it does nothing.\n */\nexport function presentErrorPopup(request: G9ErrorPopupRequest): Promise<void> | undefined {\n const host = g9Hosts.active();\n if (!host) return undefined;\n const popups = popupServiceOf(host);\n const buttons: G9PopupButton[] = [];\n if (request.moreDetails) {\n const more = request.moreDetails;\n buttons.push({ text: more.text, isPrimary: false, callback: async () => void (await more.open()) });\n }\n buttons.push({ text: request.okText, isPrimary: true });\n return popups.showError(request.message, request.title, buttons).then(() => undefined);\n}\n\ng9DefaultErrorPresenter.current = presentErrorPopup;\n"],"names":["g9PopupRowButtonLimit","FEATURE","fallbackStrings","createStrings","createCulture","PopupButtonView","props","_button_backgroundColor","_button_textColor","_button_iconImage","button","profile","primary","press","useG9Press","background","color","view","G9IconSlot","text","PopupCardContent","_d_title","entry","settings","state","strings","useG9Strings","d","close","glyphs","useG9Settings","buttons","stacked","shown","warned","useRef","title","G9StringKey","content","direction","useG9Direction","row","g9RowStyle","g9TextStart","i","g9SafeId","G9ActivityIndicator","PopupLayer","_settings_autoSizeMode","_settings_overlayMode","_settings_blurIntensity","_settings_animationEasing","settingsAll","diagnostics","useG9Diagnostics","k","message","error","win","useG9Window","queue","useSyncExternalStore","l","entered","setEntered","useState","showKey","useEffect","t","startTimer","stopTimer","resolvePopupSettings","duration","createPopupVisualProfile","options","phase","PopupFrame","createPopupService","host","G9PopupQueue","cb","ms","h","_resolvePopupSettings_animationDuration","g9Ms","_resolvePopupSettings_autoCloseDuration","withOk","preset","type","animation","presetPopup","o","service","customPopup","descriptor","_options_cancelButton","_options_cancelButtonText","_options_submitButton","_options_submitButtonText","_options_settings","_options_type","_options_title","_options_message","_options_animation","store","createPopupFormStore","result","g9PopupInputResult","cancel","g9PopupResult","submit","v","Object","PopupInputForm","f","key","value","_store_getState_form_text_key","_options_cancelText","_options_okText","ok","c","popupServiceOf","existing","useG9Popups","useG9Host","g9Popups","g9Hosts","presentErrorPopup","request","popups","more","undefined","g9DefaultErrorPresenter"],"mappings":";;;;;;;;;;;;;;;;;AAsCO,MAAMA,wBAAwB;AAqErC,MAAMC,UAAU;AAWhB,MAAMC,kBAAkBC,cAAc;IAAE,SAASC,cAAc;AAAM;AAErE,SAASC,gBAAgBC,KAQxB;QAIoBC,yBACLC,mBAa8BC;IAjB5C,MAAM,EAAEC,MAAM,EAAEC,OAAO,EAAE,GAAGL;IAC5B,MAAMM,UAAUF,AAAqB,UAArBA,OAAO,SAAS;IAChC,MAAMG,QAAQC,WAAWR,MAAM,OAAO,EAAE;QAAE,QAAQ;QAAW,SAAS;IAAE;IACxE,MAAMS,aAAa,QAAAR,CAAAA,0BAAAA,OAAO,eAAe,AAAD,IAArBA,0BAA2BK,UAAUD,QAAQ,gBAAgB,GAAG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g9-expander__clip, .g9-motion-off .g9-field__label, .g9-motion-off .g9-page-loading, .g9-motion-off .g9-toast__fill, .g9-motion-off .g9-switch__track, .g9-motion-off .g9-switch__thumb, .g9-motion-off .g9-chip, .g9-motion-off .g9-chip__check {
|
|
18
|
+
transition-duration: 0s;
|
|
19
|
+
}
|
|
20
|
+
|
|
17
21
|
|
|
18
22
|
/*# sourceMappingURL=provider.css.map */
|