@g9tm/lynxcontrols 1.4.7 → 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.
Files changed (121) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/base/index.d.ts +1 -1
  3. package/dist/base/index.d.ts.map +1 -1
  4. package/dist/base/index.jsx +1 -1
  5. package/dist/base/selection-item.d.ts +9 -1
  6. package/dist/base/selection-item.d.ts.map +1 -1
  7. package/dist/base/selection-item.jsx +10 -1
  8. package/dist/base/selection-item.jsx.map +1 -1
  9. package/dist/button/button.css +20 -0
  10. package/dist/button/button.css.map +1 -1
  11. package/dist/button/header-action-button.d.ts +5 -0
  12. package/dist/button/header-action-button.d.ts.map +1 -1
  13. package/dist/button/header-action-button.jsx +6 -1
  14. package/dist/button/header-action-button.jsx.map +1 -1
  15. package/dist/button/visuals.d.ts.map +1 -1
  16. package/dist/button/visuals.jsx +1 -1
  17. package/dist/button/visuals.jsx.map +1 -1
  18. package/dist/fields/editor.d.ts.map +1 -1
  19. package/dist/fields/editor.jsx +2 -2
  20. package/dist/fields/editor.jsx.map +1 -1
  21. package/dist/fields/fields.css +21 -0
  22. package/dist/fields/fields.css.map +1 -1
  23. package/dist/fields/index.d.ts +1 -1
  24. package/dist/fields/index.d.ts.map +1 -1
  25. package/dist/fields/index.jsx +1 -1
  26. package/dist/fields/outlined-field.d.ts +27 -1
  27. package/dist/fields/outlined-field.d.ts.map +1 -1
  28. package/dist/fields/outlined-field.jsx +29 -2
  29. package/dist/fields/outlined-field.jsx.map +1 -1
  30. package/dist/fields/text-entry.d.ts.map +1 -1
  31. package/dist/fields/text-entry.jsx +2 -2
  32. package/dist/fields/text-entry.jsx.map +1 -1
  33. package/dist/pickers/combo-box.d.ts +8 -0
  34. package/dist/pickers/combo-box.d.ts.map +1 -1
  35. package/dist/pickers/combo-box.jsx +51 -9
  36. package/dist/pickers/combo-box.jsx.map +1 -1
  37. package/dist/pickers/date-time-picker.d.ts +2 -2
  38. package/dist/pickers/date-time-picker.d.ts.map +1 -1
  39. package/dist/pickers/date-time-picker.jsx +4 -3
  40. package/dist/pickers/date-time-picker.jsx.map +1 -1
  41. package/dist/pickers/date-time.d.ts +5 -2
  42. package/dist/pickers/date-time.d.ts.map +1 -1
  43. package/dist/pickers/date-time.jsx +1 -1
  44. package/dist/pickers/date-time.jsx.map +1 -1
  45. package/dist/pickers/picker-sheet.d.ts +6 -2
  46. package/dist/pickers/picker-sheet.d.ts.map +1 -1
  47. package/dist/pickers/picker-sheet.jsx +2 -3
  48. package/dist/pickers/picker-sheet.jsx.map +1 -1
  49. package/dist/pickers/picker.d.ts.map +1 -1
  50. package/dist/pickers/picker.jsx +3 -2
  51. package/dist/pickers/picker.jsx.map +1 -1
  52. package/dist/pickers/pickers.css +27 -0
  53. package/dist/pickers/pickers.css.map +1 -1
  54. package/dist/pickers/timespan-picker.d.ts.map +1 -1
  55. package/dist/pickers/timespan-picker.jsx +3 -2
  56. package/dist/pickers/timespan-picker.jsx.map +1 -1
  57. package/dist/pickers/trigger.d.ts +3 -1
  58. package/dist/pickers/trigger.d.ts.map +1 -1
  59. package/dist/pickers/trigger.jsx +6 -1
  60. package/dist/pickers/trigger.jsx.map +1 -1
  61. package/dist/provider/settings.d.ts +12 -0
  62. package/dist/provider/settings.d.ts.map +1 -1
  63. package/dist/provider/settings.jsx +6 -3
  64. package/dist/provider/settings.jsx.map +1 -1
  65. package/dist/provider/theme.css +4 -0
  66. package/dist/provider/theme.css.map +1 -1
  67. package/dist/range-slider/math.d.ts +14 -4
  68. package/dist/range-slider/math.d.ts.map +1 -1
  69. package/dist/range-slider/math.jsx +16 -4
  70. package/dist/range-slider/math.jsx.map +1 -1
  71. package/dist/range-slider/range-slider.css +17 -0
  72. package/dist/range-slider/range-slider.css.map +1 -1
  73. package/dist/range-slider/range-slider.d.ts +11 -0
  74. package/dist/range-slider/range-slider.d.ts.map +1 -1
  75. package/dist/range-slider/range-slider.jsx +35 -13
  76. package/dist/range-slider/range-slider.jsx.map +1 -1
  77. package/dist/selection/index.d.ts +2 -1
  78. package/dist/selection/index.d.ts.map +1 -1
  79. package/dist/selection/index.jsx +2 -1
  80. package/dist/selection/selection-sheet.d.ts +3 -1
  81. package/dist/selection/selection-sheet.d.ts.map +1 -1
  82. package/dist/selection/selection-sheet.jsx +57 -8
  83. package/dist/selection/selection-sheet.jsx.map +1 -1
  84. package/dist/selection/selection.css +7 -0
  85. package/dist/selection/selection.css.map +1 -1
  86. package/dist/selection/window.d.ts +29 -0
  87. package/dist/selection/window.d.ts.map +1 -0
  88. package/dist/selection/window.jsx +24 -0
  89. package/dist/selection/window.jsx.map +1 -0
  90. package/dist/sheet/frame.d.ts.map +1 -1
  91. package/dist/sheet/frame.jsx +8 -4
  92. package/dist/sheet/frame.jsx.map +1 -1
  93. package/dist/sheet/header.d.ts.map +1 -1
  94. package/dist/sheet/header.jsx +3 -1
  95. package/dist/sheet/header.jsx.map +1 -1
  96. package/dist/sheet/index.d.ts +1 -1
  97. package/dist/sheet/index.d.ts.map +1 -1
  98. package/dist/sheet/index.jsx +1 -1
  99. package/dist/sheet/options.d.ts +20 -0
  100. package/dist/sheet/options.d.ts.map +1 -1
  101. package/dist/sheet/options.jsx +2 -1
  102. package/dist/sheet/options.jsx.map +1 -1
  103. package/dist/sheet/service.d.ts +8 -0
  104. package/dist/sheet/service.d.ts.map +1 -1
  105. package/dist/sheet/service.jsx +15 -4
  106. package/dist/sheet/service.jsx.map +1 -1
  107. package/dist/sheet/sizing.d.ts +2 -0
  108. package/dist/sheet/sizing.d.ts.map +1 -1
  109. package/dist/sheet/sizing.jsx +2 -1
  110. package/dist/sheet/sizing.jsx.map +1 -1
  111. package/dist/toggle/chip-group.d.ts +9 -1
  112. package/dist/toggle/chip-group.d.ts.map +1 -1
  113. package/dist/toggle/chip-group.jsx +51 -12
  114. package/dist/toggle/chip-group.jsx.map +1 -1
  115. package/dist/toggle/switch.d.ts +1 -1
  116. package/dist/toggle/switch.d.ts.map +1 -1
  117. package/dist/toggle/switch.jsx +3 -2
  118. package/dist/toggle/switch.jsx.map +1 -1
  119. package/dist/toggle/toggle.css +20 -0
  120. package/dist/toggle/toggle.css.map +1 -1
  121. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"pickers/date-time-picker.jsx","sources":["../../src/pickers/date-time-picker.tsx"],"sourcesContent":["import './pickers.css';\nimport {\n daysInMonth,\n formatColor,\n type G9CalendarSystem,\n type G9Culture,\n G9DateTimeDisplayFormat,\n G9DateTimePickerMode,\n type G9LocalDate,\n type G9LocalDateTime,\n G9StringKey,\n localDateTimeFromDate,\n withAlpha,\n} from '@g9tm/lynxcontrols-foundation';\nimport { type ReactNode, useRef, useState } from '@lynx-js/react';\nimport { g9RowStyle } from '../base/control';\nimport { useG9Press } from '../base/press';\nimport { useControllableState } from '../base/use-controllable-state';\nimport { G9IconSlot } from '../icon/slot';\nimport { useG9Culture, useG9Service, useG9Settings, useG9Strings, useG9Theme } from '../provider/hooks';\nimport { useG9Sheets } from '../sheet/service';\nimport {\n asDateTime,\n clampPickerValue,\n composePickerValue,\n dayWheelItems,\n formatPickerValue,\n hourWheelItems,\n minuteWheelItems,\n monthWheelItems,\n normalizePickerBounds,\n pickerParts,\n resolvePickerCalendar,\n yearWheelItems,\n yearWindow,\n} from './date-time';\nimport { PickerSheetHeader, showPickerSheet } from './picker-sheet';\nimport { type G9PickerFieldProps, PickerField, usePickerOpen } from './trigger';\nimport { G9WheelColumn } from './wheel-column';\n\n/** Years the year window grows by at an edge (MAUI `YearWindowStep`). */\nexport const g9YearWindowStep = 25;\n\n/** Props of {@link G9DateTimePicker}. */\nexport interface G9DateTimePickerProps extends G9PickerFieldProps {\n /** The value, always Gregorian (MAUI `SelectedDateTime`); `null` = none. Controlled with `onValueChange`. */\n readonly value?: G9LocalDateTime | null;\n readonly defaultValue?: G9LocalDateTime | null;\n readonly onValueChange?: (value: G9LocalDateTime | null) => void;\n /** Default `'date'`. */\n readonly mode?: G9DateTimePickerMode;\n /** Default `'shortDate'`. */\n readonly displayFormat?: G9DateTimeDisplayFormat;\n /** Text of the `'custom'` format (MAUI `FormattedDisplayText`). */\n readonly formattedDisplayText?: string | null;\n readonly minDate?: G9LocalDate | null;\n readonly maxDate?: G9LocalDate | null;\n /** Hours 0–23 instead of 12-hour AM/PM. Default false. */\n readonly twentyFourHourDisplay?: boolean;\n /**\n * Default true (MAUI `RestoreOnCancel`): Cancel or a dismissal puts back the value the picker had when it opened if\n * it changed meanwhile. False leaves the current value.\n */\n readonly restoreOnCancel?: boolean;\n /** The Today / Now chip. Default true. */\n readonly showTodayButton?: boolean;\n /** Calendar override; default Persian for `fa`, else Gregorian (follows the language, not the direction). */\n readonly calendar?: G9CalendarSystem | null;\n /** Done confirmed a value (MAUI `DateTimeSelected`). */\n readonly onDateTimeSelected?: (value: G9LocalDateTime) => void;\n}\n\ninterface SheetBodyProps {\n readonly title: string;\n readonly initial: G9LocalDateTime;\n readonly now: () => G9LocalDateTime;\n readonly mode: G9DateTimePickerMode;\n readonly calendar: G9CalendarSystem;\n readonly culture: G9Culture;\n readonly bounds: { min: G9LocalDateTime | null; max: G9LocalDateTime | null };\n readonly twentyFourHour: boolean;\n readonly showToday: boolean;\n readonly format: (value: G9LocalDateTime) => string;\n readonly done: (value: G9LocalDateTime) => void;\n readonly cancel: () => void;\n}\n\n/** The drum sheet body (MAUI `G9DateTimePickerSheet`): header, live preview, Today/Now chip, the wheels. */\nexport function DateTimeSheetBody(props: SheetBodyProps): ReactNode {\n const strings = useG9Strings();\n const palette = useG9Theme().palette;\n const glyphs = useG9Settings().glyphs;\n const { calendar, culture, bounds, mode } = props;\n const [value, setValueState] = useState(() => clampPickerValue(props.initial, bounds, calendar));\n // The latest value, written synchronously: a wheel that settles and a Done tap (or a second wheel) can arrive before\n // the re-render binds handlers that close over the new state. Reading the render's `value` there returned the old\n // one, and a second wheel overwrote the first (seen on the Windows CI agent, Azure builds 539/541).\n const latest = useRef(value);\n const setValue = (next: G9LocalDateTime) => {\n latest.current = next;\n setValueState(next);\n };\n const partsOf = (v: G9LocalDateTime) => ({ ...pickerParts(v, calendar), hour: v.hour, minute: v.minute });\n const parts = partsOf(value);\n const minYear = bounds.min ? pickerParts(bounds.min, calendar).year : null;\n const maxYear = bounds.max ? pickerParts(bounds.max, calendar).year : null;\n const [years, setYears] = useState(() => yearWindow(parts.year, minYear, maxYear));\n // A value outside the window (Today, a clamp) rebuilds it around the value.\n const window_ = parts.year < years.from || parts.year > years.to ? yearWindow(parts.year, minYear, maxYear) : years;\n const change = (patch: Partial<typeof parts>) =>\n setValue(composePickerValue({ ...partsOf(latest.current), ...patch }, calendar, bounds));\n const grow = (edge: 'start' | 'end') =>\n setYears((w) =>\n edge === 'end'\n ? { from: w.from, to: Math.min(maxYear ?? 9999, 9999, w.to + g9YearWindowStep) }\n : { from: Math.max(minYear ?? 1, 1, w.from - g9YearWindowStep), to: w.to },\n );\n const today = useG9Press(\n () => {\n const now = props.now();\n setValue(clampPickerValue(mode === G9DateTimePickerMode.Date ? asDateTime(now) : now, bounds, calendar));\n },\n { source: 'G9DateTimePicker', guardMs: 0 },\n );\n const showDate = mode !== G9DateTimePickerMode.Time;\n const showTime = mode !== G9DateTimePickerMode.Date;\n return (\n <view className=\"g9-picker-sheet\">\n <PickerSheetHeader title={props.title} onCancel={props.cancel} onDone={() => props.done(latest.current)} />\n <text className=\"g9-picker-sheet__preview\" text-maxline=\"1\">\n {props.format(value)}\n </text>\n {props.showToday ? (\n // MAUI CreateTodayChip: a 14 dp calendar and 12 bold Primary text, 6 apart, in a pill of Primary 8 % with a\n // Primary 30 % stroke.\n <view\n className=\"g9-picker-sheet__today\"\n accessibility-element={true}\n accessibility-traits=\"button\"\n bindtap={today}\n style={{\n ...g9RowStyle(culture.direction),\n backgroundColor: formatColor(withAlpha(palette.Primary, 0.08)),\n borderColor: formatColor(withAlpha(palette.Primary, 0.3)),\n }}\n >\n <G9IconSlot icon={glyphs.calendarToday} size={14} color={palette.Primary} />\n <text className=\"g9-picker-sheet__today-text\">\n {strings.get(mode === G9DateTimePickerMode.Time ? G9StringKey.Now : G9StringKey.Today)}\n </text>\n </view>\n ) : null}\n <view className={`g9-picker-sheet__wheels g9-dir-${culture.direction}`}>\n {showDate ? (\n <G9WheelColumn\n label={strings.get(G9StringKey.Day)}\n items={dayWheelItems(daysInMonth(calendar, parts.year, parts.month), culture)}\n value={parts.day}\n onValueChange={(day) => change({ day })}\n />\n ) : null}\n {showDate ? (\n <G9WheelColumn\n label={strings.get(G9StringKey.Month)}\n weight={1.7}\n items={monthWheelItems(calendar, culture)}\n value={parts.month}\n onValueChange={(month) => change({ month })}\n />\n ) : null}\n {showDate ? (\n <G9WheelColumn\n label={strings.get(G9StringKey.Year)}\n items={yearWheelItems(window_.from, window_.to, culture)}\n value={parts.year}\n onValueChange={(year) => change({ year })}\n onNearEdge={grow}\n />\n ) : null}\n {showTime ? (\n <G9WheelColumn\n label={strings.get(G9StringKey.Hour)}\n items={hourWheelItems(props.twentyFourHour, culture)}\n value={parts.hour}\n onValueChange={(hour) => change({ hour })}\n />\n ) : null}\n {showTime ? (\n <G9WheelColumn\n label={strings.get(G9StringKey.Minute)}\n items={minuteWheelItems(culture)}\n value={parts.minute}\n onValueChange={(minute) => change({ minute })}\n />\n ) : null}\n </view>\n </view>\n );\n}\n\n/**\n * Date, time or date-time in an outlined box (MAUI `G9DateTimePicker`): a tap opens the drum sheet (Cancel, title,\n * Done, live preview, Today/Now, day/month/year and hour/minute wheels). The calendar follows the language (`fa` →\n * Persian) unless `calendar` is set; the value stays Gregorian. Min/max clamp the drums (they roll onto the clamped\n * value); a day past the month's end clamps to its last day. Done writes the value and fires `onDateTimeSelected`;\n * Cancel and dismissals write nothing (see `restoreOnCancel`). Must be inside a `G9Host`.\n */\nexport function G9DateTimePicker(props: G9DateTimePickerProps): ReactNode {\n const sheets = useG9Sheets();\n const culture = useG9Culture();\n const strings = useG9Strings();\n const glyphs = useG9Settings().glyphs;\n const clock = useG9Service('clock');\n const open = usePickerOpen();\n const [value, setValue] = useControllableState<G9LocalDateTime | null>({\n value: props.value,\n defaultValue: props.defaultValue ?? null,\n onChange: props.onValueChange,\n name: 'G9DateTimePicker.value',\n });\n const latest = useRef({ props, value });\n latest.current = { props, value };\n const mode = props.mode ?? G9DateTimePickerMode.Date;\n const calendar = resolvePickerCalendar(culture, props.calendar);\n const format = (v: G9LocalDateTime) =>\n formatPickerValue(v, culture, {\n mode,\n displayFormat: props.displayFormat ?? G9DateTimeDisplayFormat.ShortDate,\n twentyFourHour: props.twentyFourHourDisplay === true,\n calendar,\n customText: props.formattedDisplayText ?? null,\n });\n\n const onOpen = () =>\n open(async (isCurrent) => {\n const previous = latest.current.value;\n const p = latest.current.props;\n const now = () => localDateTimeFromDate(new Date(clock.now()));\n const title = p.label?.trim()\n ? p.label\n : strings.get(\n mode === G9DateTimePickerMode.Time\n ? G9StringKey.SelectTime\n : mode === G9DateTimePickerMode.DateTime\n ? G9StringKey.SelectDateTime\n : G9StringKey.SelectDate,\n );\n const bounds = normalizePickerBounds(p.minDate, p.maxDate, calendar);\n const result = await showPickerSheet<G9LocalDateTime>(sheets, ({ done, cancel }) => (\n <DateTimeSheetBody\n title={title}\n initial={previous ?? now()}\n now={now}\n mode={mode}\n calendar={calendar}\n culture={culture}\n bounds={bounds}\n twentyFourHour={p.twentyFourHourDisplay === true}\n showToday={p.showTodayButton !== false}\n format={format}\n done={done}\n cancel={cancel}\n />\n ));\n if (!isCurrent()) return;\n if (result) {\n setValue(result);\n latest.current.props.onDateTimeSelected?.(result);\n } else if (latest.current.props.restoreOnCancel !== false && latest.current.value !== previous) {\n setValue(previous);\n }\n });\n\n return (\n <PickerField\n field={{ trailingIcon: mode === G9DateTimePickerMode.Time ? glyphs.clock : glyphs.calendar, ...props }}\n hasValue={value !== null}\n onOpen={onOpen}\n >\n <text className={`g9-picker__text${value ? '' : ' g9-picker__text--placeholder'}`} text-maxline=\"1\">\n {value ? format(value) : props.label ? '' : (props.placeholder ?? '')}\n </text>\n </PickerField>\n );\n}\n"],"names":["g9YearWindowStep","DateTimeSheetBody","props","strings","useG9Strings","palette","useG9Theme","glyphs","useG9Settings","calendar","culture","bounds","mode","value","setValueState","useState","clampPickerValue","latest","useRef","setValue","next","partsOf","v","pickerParts","parts","minYear","maxYear","years","setYears","yearWindow","window_","change","patch","composePickerValue","grow","edge","w","Math","today","useG9Press","now","G9DateTimePickerMode","asDateTime","showDate","showTime","view","PickerSheetHeader","text","g9RowStyle","formatColor","withAlpha","G9IconSlot","G9StringKey","G9WheelColumn","dayWheelItems","daysInMonth","day","monthWheelItems","month","yearWheelItems","year","hourWheelItems","hour","minuteWheelItems","minute","G9DateTimePicker","_props_defaultValue","_props_mode","_props_placeholder","sheets","useG9Sheets","useG9Culture","clock","useG9Service","open","usePickerOpen","useControllableState","resolvePickerCalendar","format","_props_displayFormat","_props_formattedDisplayText","formatPickerValue","G9DateTimeDisplayFormat","onOpen","isCurrent","_p_label","previous","p","localDateTimeFromDate","Date","title","normalizePickerBounds","result","showPickerSheet","done","cancel","_latest_current_props","PickerField"],"mappings":";;;;;;;;;;;;;AAyCO,MAAMA,mBAAmB;AA+CzB,SAASC,kBAAkBC,KAAqB;IACrD,MAAMC,UAAUC;IAChB,MAAMC,UAAUC,aAAa,OAAO;IACpC,MAAMC,SAASC,gBAAgB,MAAM;IACrC,MAAM,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,MAAM,EAAEC,IAAI,EAAE,GAAGV;IAC5C,MAAM,CAACW,OAAOC,cAAc,GAAGC,SAAS,IAAMC,iBAAiBd,MAAM,OAAO,EAAES,QAAQF;IAItF,MAAMQ,SAASC,OAAOL;IACtB,MAAMM,WAAW,CAACC;QAChBH,OAAO,OAAO,GAAGG;QACjBN,cAAcM;IAChB;IACA,MAAMC,UAAU,CAACC,IAAwB;YAAE,GAAGC,YAAYD,GAAGb,SAAS;YAAE,MAAMa,EAAE,IAAI;YAAE,QAAQA,EAAE,M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CAAAA;gBADA7E,SAASyE;wBACTI,CAAAA,2CAAAA,AAAAA,CAAAA,wBAAAA,OAAO,OAAO,CAAC,KAAK,AAAD,EAAE,kBAAkB,AAAD,KAAtCA,yCAAAA,IAAAA,CAAAA,uBAA0CJ;YAC5C,OAAO,IAAI3E,AAAyC,UAAzCA,OAAO,OAAO,CAAC,KAAK,CAAC,eAAe,IAAcA,OAAO,OAAO,CAAC,KAAK,KAAKqE,UACpFnE,SAASmE;QAEb;IAEF,QACGW,YACC,OAAO;QAAE,cAAcrF,SAAS6B,qBAAqB,IAAI,GAAGlC,OAAO,KAAK,GAAGA,OAAO,QAAQ;QAAE,GAAGL,KAAK;IAAC,GACrG,UAAUW,AAAU,SAAVA,OACV,QAAQsE,QACT;MACC,CAACpC,KAAK,WAAW,CAAC,eAAe,EAAElC,QAAQ,KAAK,iCAAiC,EAAE,aAAa,IAAI;QAClG,CAACA,QAAQiE,OAAOjE,SAASX,MAAM,KAAK,GAAG,KAAK,QAACkE,CAAAA,qBAAAA,MAAM,WAAW,AAAD,IAAhBA,qBAAqB,GAAI;MACxE,EAAErB,KAAK;IACT,EAAEkD;AAEN"}
1
+ {"version":3,"file":"pickers/date-time-picker.jsx","sources":["../../src/pickers/date-time-picker.tsx"],"sourcesContent":["import { resolveRestingPlaceholder } from '../fields/outlined-field';\nimport './pickers.css';\nimport {\n daysInMonth,\n formatColor,\n type G9CalendarSystem,\n type G9Culture,\n G9DateTimeDisplayFormat,\n G9DateTimePickerMode,\n type G9LocalDate,\n type G9LocalDateTime,\n G9StringKey,\n localDateTimeFromDate,\n withAlpha,\n} from '@g9tm/lynxcontrols-foundation';\nimport { type ReactNode, useRef, useState } from '@lynx-js/react';\nimport { g9RowStyle } from '../base/control';\nimport { useG9Press } from '../base/press';\nimport { useControllableState } from '../base/use-controllable-state';\nimport { G9IconSlot } from '../icon/slot';\nimport { useG9Culture, useG9Service, useG9Settings, useG9Strings, useG9Theme } from '../provider/hooks';\nimport { useG9Sheets } from '../sheet/service';\nimport {\n asDateTime,\n clampPickerValue,\n composePickerValue,\n dayWheelItems,\n formatPickerValue,\n hourWheelItems,\n minuteWheelItems,\n monthWheelItems,\n normalizePickerBounds,\n pickerParts,\n resolvePickerCalendar,\n yearWheelItems,\n yearWindow,\n} from './date-time';\nimport { PickerSheetHeader, showPickerSheet } from './picker-sheet';\nimport { type G9PickerFieldProps, PickerField, usePickerOpen } from './trigger';\nimport { G9WheelColumn } from './wheel-column';\n\n/** Years the year window grows by at an edge (MAUI `YearWindowStep`: 12 since 1.4.11, was 25). */\nexport const g9YearWindowStep = 12;\n\n/** Props of {@link G9DateTimePicker}. */\nexport interface G9DateTimePickerProps extends G9PickerFieldProps {\n /** The value, always Gregorian (MAUI `SelectedDateTime`); `null` = none. Controlled with `onValueChange`. */\n readonly value?: G9LocalDateTime | null;\n readonly defaultValue?: G9LocalDateTime | null;\n readonly onValueChange?: (value: G9LocalDateTime | null) => void;\n /** Default `'date'`. */\n readonly mode?: G9DateTimePickerMode;\n /** Default `'shortDate'`. */\n readonly displayFormat?: G9DateTimeDisplayFormat;\n /** Text of the `'custom'` format (MAUI `FormattedDisplayText`). */\n readonly formattedDisplayText?: string | null;\n readonly minDate?: G9LocalDate | null;\n readonly maxDate?: G9LocalDate | null;\n /** Hours 0–23 instead of 12-hour AM/PM. Default false. */\n readonly twentyFourHourDisplay?: boolean;\n /**\n * Default true (MAUI `RestoreOnCancel`): Cancel or a dismissal puts back the value the picker had when it opened if\n * it changed meanwhile. False leaves the current value.\n */\n readonly restoreOnCancel?: boolean;\n /** The Today / Now chip. Default true. */\n readonly showTodayButton?: boolean;\n /** Calendar override; default Persian for `fa`, else Gregorian (follows the language, not the direction). */\n readonly calendar?: G9CalendarSystem | null;\n /** Done confirmed a value (MAUI `DateTimeSelected`). */\n readonly onDateTimeSelected?: (value: G9LocalDateTime) => void;\n}\n\ninterface SheetBodyProps {\n readonly title: string;\n readonly initial: G9LocalDateTime;\n readonly now: () => G9LocalDateTime;\n readonly mode: G9DateTimePickerMode;\n readonly calendar: G9CalendarSystem;\n readonly culture: G9Culture;\n readonly bounds: { min: G9LocalDateTime | null; max: G9LocalDateTime | null };\n readonly twentyFourHour: boolean;\n readonly showToday: boolean;\n readonly format: (value: G9LocalDateTime) => string;\n readonly done: (value: G9LocalDateTime) => void;\n readonly cancel: () => void;\n}\n\n/** The drum sheet body (MAUI `G9DateTimePickerSheet`): header, live preview, Today/Now chip, the wheels. */\nexport function DateTimeSheetBody(props: SheetBodyProps): ReactNode {\n const strings = useG9Strings();\n const palette = useG9Theme().palette;\n const glyphs = useG9Settings().glyphs;\n const { calendar, culture, bounds, mode } = props;\n const [value, setValueState] = useState(() => clampPickerValue(props.initial, bounds, calendar));\n // The latest value, written synchronously: a wheel that settles and a Done tap (or a second wheel) can arrive before\n // the re-render binds handlers that close over the new state. Reading the render's `value` there returned the old\n // one, and a second wheel overwrote the first (seen on the Windows CI agent, Azure builds 539/541).\n const latest = useRef(value);\n const setValue = (next: G9LocalDateTime) => {\n latest.current = next;\n setValueState(next);\n };\n const partsOf = (v: G9LocalDateTime) => ({ ...pickerParts(v, calendar), hour: v.hour, minute: v.minute });\n const parts = partsOf(value);\n const minYear = bounds.min ? pickerParts(bounds.min, calendar).year : null;\n const maxYear = bounds.max ? pickerParts(bounds.max, calendar).year : null;\n const [years, setYears] = useState(() => yearWindow(parts.year, minYear, maxYear));\n // A value outside the window (Today, a clamp) rebuilds it around the value.\n const window_ = parts.year < years.from || parts.year > years.to ? yearWindow(parts.year, minYear, maxYear) : years;\n const change = (patch: Partial<typeof parts>) =>\n setValue(composePickerValue({ ...partsOf(latest.current), ...patch }, calendar, bounds));\n const grow = (edge: 'start' | 'end') =>\n setYears((w) =>\n edge === 'end'\n ? { from: w.from, to: Math.min(maxYear ?? 9999, 9999, w.to + g9YearWindowStep) }\n : { from: Math.max(minYear ?? 1, 1, w.from - g9YearWindowStep), to: w.to },\n );\n const today = useG9Press(\n () => {\n const now = props.now();\n setValue(clampPickerValue(mode === G9DateTimePickerMode.Date ? asDateTime(now) : now, bounds, calendar));\n },\n { source: 'G9DateTimePicker', guardMs: 0 },\n );\n const showDate = mode !== G9DateTimePickerMode.Time;\n const showTime = mode !== G9DateTimePickerMode.Date;\n return (\n <view className=\"g9-picker-sheet\">\n <PickerSheetHeader title={props.title} onCancel={props.cancel} onDone={() => props.done(latest.current)} />\n <text className=\"g9-picker-sheet__preview\" text-maxline=\"1\">\n {props.format(value)}\n </text>\n {props.showToday ? (\n // MAUI CreateTodayChip: a 14 dp calendar and 12 bold Primary text, 6 apart, in a pill of Primary 8 % with a\n // Primary 30 % stroke.\n <view\n className=\"g9-picker-sheet__today\"\n accessibility-element={true}\n accessibility-traits=\"button\"\n bindtap={today}\n style={{\n ...g9RowStyle(culture.direction),\n backgroundColor: formatColor(withAlpha(palette.Primary, 0.08)),\n borderColor: formatColor(withAlpha(palette.Primary, 0.3)),\n }}\n >\n <G9IconSlot icon={glyphs.calendarToday} size={14} color={palette.Primary} />\n <text className=\"g9-picker-sheet__today-text\">\n {strings.get(mode === G9DateTimePickerMode.Time ? G9StringKey.Now : G9StringKey.Today)}\n </text>\n </view>\n ) : null}\n <view className={`g9-picker-sheet__wheels g9-dir-${culture.direction}`}>\n {showDate ? (\n <G9WheelColumn\n label={strings.get(G9StringKey.Day)}\n items={dayWheelItems(daysInMonth(calendar, parts.year, parts.month), culture)}\n value={parts.day}\n onValueChange={(day) => change({ day })}\n />\n ) : null}\n {showDate ? (\n <G9WheelColumn\n label={strings.get(G9StringKey.Month)}\n weight={1.7}\n items={monthWheelItems(calendar, culture)}\n value={parts.month}\n onValueChange={(month) => change({ month })}\n />\n ) : null}\n {showDate ? (\n <G9WheelColumn\n label={strings.get(G9StringKey.Year)}\n items={yearWheelItems(window_.from, window_.to, culture)}\n value={parts.year}\n onValueChange={(year) => change({ year })}\n onNearEdge={grow}\n />\n ) : null}\n {showTime ? (\n <G9WheelColumn\n label={strings.get(G9StringKey.Hour)}\n items={hourWheelItems(props.twentyFourHour, culture)}\n value={parts.hour}\n onValueChange={(hour) => change({ hour })}\n />\n ) : null}\n {showTime ? (\n <G9WheelColumn\n label={strings.get(G9StringKey.Minute)}\n items={minuteWheelItems(culture)}\n value={parts.minute}\n onValueChange={(minute) => change({ minute })}\n />\n ) : null}\n </view>\n </view>\n );\n}\n\n/**\n * Date, time or date-time in an outlined box (MAUI `G9DateTimePicker`): a tap opens the drum sheet (Cancel, title,\n * Done, live preview, Today/Now, day/month/year and hour/minute wheels). The calendar follows the language (`fa` →\n * Persian) unless `calendar` is set; the value stays Gregorian. Min/max clamp the drums (they roll onto the clamped\n * value); a day past the month's end clamps to its last day. Done writes the value and fires `onDateTimeSelected`;\n * Cancel and dismissals write nothing (see `restoreOnCancel`). Must be inside a `G9Host`.\n */\nexport function G9DateTimePicker(props: G9DateTimePickerProps): ReactNode {\n const sheets = useG9Sheets();\n const culture = useG9Culture();\n const strings = useG9Strings();\n const glyphs = useG9Settings().glyphs;\n const clock = useG9Service('clock');\n const open = usePickerOpen();\n const [value, setValue] = useControllableState<G9LocalDateTime | null>({\n value: props.value,\n defaultValue: props.defaultValue ?? null,\n onChange: props.onValueChange,\n name: 'G9DateTimePicker.value',\n });\n const latest = useRef({ props, value });\n latest.current = { props, value };\n const mode = props.mode ?? G9DateTimePickerMode.Date;\n const calendar = resolvePickerCalendar(culture, props.calendar);\n const format = (v: G9LocalDateTime) =>\n formatPickerValue(v, culture, {\n mode,\n displayFormat: props.displayFormat ?? G9DateTimeDisplayFormat.ShortDate,\n twentyFourHour: props.twentyFourHourDisplay === true,\n calendar,\n customText: props.formattedDisplayText ?? null,\n });\n\n const onOpen = () =>\n open(async (isCurrent) => {\n const previous = latest.current.value;\n const p = latest.current.props;\n const now = () => localDateTimeFromDate(new Date(clock.now()));\n const title = p.label?.trim()\n ? p.label\n : strings.get(\n mode === G9DateTimePickerMode.Time\n ? G9StringKey.SelectTime\n : mode === G9DateTimePickerMode.DateTime\n ? G9StringKey.SelectDateTime\n : G9StringKey.SelectDate,\n );\n const bounds = normalizePickerBounds(p.minDate, p.maxDate, calendar);\n const result = await showPickerSheet<G9LocalDateTime>(sheets, ({ done, cancel }) => (\n <DateTimeSheetBody\n title={title}\n initial={previous ?? now()}\n now={now}\n mode={mode}\n calendar={calendar}\n culture={culture}\n bounds={bounds}\n twentyFourHour={p.twentyFourHourDisplay === true}\n showToday={p.showTodayButton !== false}\n format={format}\n done={done}\n cancel={cancel}\n />\n ));\n if (!isCurrent()) return;\n if (result) {\n setValue(result);\n latest.current.props.onDateTimeSelected?.(result);\n } else if (latest.current.props.restoreOnCancel !== false && latest.current.value !== previous) {\n setValue(previous);\n }\n });\n\n return (\n <PickerField\n field={{ trailingIcon: mode === G9DateTimePickerMode.Time ? glyphs.clock : glyphs.calendar, ...props }}\n hasValue={value !== null}\n onOpen={onOpen}\n >\n <text className={`g9-picker__text${value ? '' : ' g9-picker__text--placeholder'}`} text-maxline=\"1\">\n {value ? format(value) : (resolveRestingPlaceholder(props) ?? '')}\n </text>\n </PickerField>\n );\n}\n"],"names":["g9YearWindowStep","DateTimeSheetBody","props","strings","useG9Strings","palette","useG9Theme","glyphs","useG9Settings","calendar","culture","bounds","mode","value","setValueState","useState","clampPickerValue","latest","useRef","setValue","next","partsOf","v","pickerParts","parts","minYear","maxYear","years","setYears","yearWindow","window_","change","patch","composePickerValue","grow","edge","w","Math","today","useG9Press","now","G9DateTimePickerMode","asDateTime","showDate","showTime","view","PickerSheetHeader","text","g9RowStyle","formatColor","withAlpha","G9IconSlot","G9StringKey","G9WheelColumn","dayWheelItems","daysInMonth","day","monthWheelItems","month","yearWheelItems","year","hourWheelItems","hour","minuteWheelItems","minute","G9DateTimePicker","_props_defaultValue","_props_mode","_resolveRestingPlaceholder","sheets","useG9Sheets","useG9Culture","clock","useG9Service","open","usePickerOpen","useControllableState","resolvePickerCalendar","format","_props_displayFormat","_props_formattedDisplayText","formatPickerValue","G9DateTimeDisplayFormat","onOpen","isCurrent","_p_label","previous","p","localDateTimeFromDate","Date","title","normalizePickerBounds","result","showPickerSheet","done","cancel","_latest_current_props","PickerField"],"mappings":";;;;;;;;;;;;;;AA0CO,MAAMA,mBAAmB;AA+CzB,SAASC,kBAAkBC,KAAqB;IACrD,MAAMC,UAAUC;IAChB,MAAMC,UAAUC,aAAa,OAAO;IACpC,MAAMC,SAASC,gBAAgB,MAAM;IACrC,MAAM,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,MAAM,EAAEC,IAAI,EAAE,GAAGV;IAC5C,MAAM,CAACW,OAAOC,cAAc,GAAGC,SAAS,IAAMC,iBAAiBd,MAAM,OAAO,EAAES,QAAQF;IAItF,MAAMQ,SAASC,OAAOL;IACtB,MAAMM,WAAW,CAACC;QAChBH,OAAO,OAAO,GAAGG;QACjBN,cAAcM;IAChB;IACA,MAAMC,UAAU,CAACC,IAAwB;YAAE,GAAGC,YAAYD,GAAGb,SAAS;YAAE,MAAMa,EAAE,IAAI;YAAE,QAAQA,EAAE,MAAM;QAAC;IACvG,MAAME,QAAQH,QAAQR;IACtB,MAAMY,UAAUd,OAAO,GAAG,GAAGY,YAAYZ,OAAO,GAAG,EAAEF,UAAU,IAAI,GAAG;IACtE,MAAMiB,UAAUf,OAAO,GAAG,GAAGY,YAAYZ,OAAO,GAAG,EAAEF,UAAU,IAAI,GAAG;IACtE,MAAM,CAACkB,OAAOC,SAAS,GAAGb,SAAS,IAAMc,WAAWL,MAAM,IAAI,EAAEC,SAASC;IAEzE,MAAMI,UAAUN,MAAM,IAAI,GAAGG,MAAM,IAAI,IAAIH,MAAM,IAAI,GAAGG,MAAM,EAAE,GAAGE,WAAWL,MAAM,IAAI,EAAEC,SAASC,WAAWC;IAC9G,MAAMI,SAAS,CAACC,QACdb,SAASc,mBAAmB;YAAE,GAAGZ,QAAQJ,OAAO,OAAO,CAAC;YAAE,GAAGe,KAAK;QAAC,GAAGvB,UAAUE;IAClF,MAAMuB,OAAO,CAACC,OACZP,SAAS,CAACQ,IACRD,AAAS,UAATA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IAA/BkE,6BAAoC,GAAI;MACpE,EAAErB,KAAK;IACT,EAAEkD;AAEN"}
@@ -4,8 +4,11 @@ export interface G9WheelItem<V extends string | number = number> {
4
4
  readonly value: V;
5
5
  readonly text: string;
6
6
  }
7
- /** Year rows are a window of at most ±50 years around the selection (MAUI `YearWindowRadius`). */
8
- export declare const g9YearWindowRadius = 50;
7
+ /**
8
+ * Year rows are a window of at most ±12 years around the selection (MAUI `YearWindowRadius`; 50 until 1.4.11, when the
9
+ * picker began to open pre-built: every row is paid for in the tap-to-open time, and the window grows at both edges).
10
+ */
11
+ export declare const g9YearWindowRadius = 12;
9
12
  /** The calendar a picker shows: the explicit one, else Persian for a `fa` culture, else Gregorian (MAUI rule). */
10
13
  export declare function resolvePickerCalendar(culture: G9Culture, calendar?: G9CalendarSystem | null): G9CalendarSystem;
11
14
  /** A date-time with its time part (a plain date reads as midnight). */
@@ -1 +1 @@
1
- {"version":3,"file":"date-time.d.ts","sourceRoot":"","sources":["../../src/pickers/date-time.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,uBAAuB,EACvB,oBAAoB,EACpB,KAAK,WAAW,EAChB,KAAK,eAAe,EAOrB,MAAM,+BAA+B,CAAC;AAKvC,2DAA2D;AAC3D,MAAM,WAAW,WAAW,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM;IAC7D,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC;IAClB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,kGAAkG;AAClG,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC,kHAAkH;AAClH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,CAAC,EAAE,gBAAgB,GAAG,IAAI,GAAG,gBAAgB,CAG9G;AAED,uEAAuE;AACvE,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,GAAG,eAAe,CAW9D;AAED;;;GA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W,qBAAqB;IACpC,QAAQ,CAAC,IAAI,CAAC,EAAE,oBAAoB,CAAC;IACrC,QAAQ,CAAC,aAAa,CAAC,EAAE,uBAAuB,CAAC;IACjD,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;IAClC,QAAQ,CAAC,QAAQ,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC5C,uGAAuG;IACvG,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,GAAE,qBAA0B,GAAG,MAAM,CA6BrH"}
@@ -1,5 +1,5 @@
1
1
  import { G9DateTimeDisplayFormat, G9DateTimePickerMode, clampToPersianRange, compareLocal, daysInMonth, formatLocalDateTime, fromCalendarDate, getMonthNames, isPersianLanguage, isSupportedByPersianCalendar, localDateTime, toCalendarDate, toNativeDigits } from "@g9tm/lynxcontrols-foundation";
2
- const g9YearWindowRadius = 50;
2
+ const g9YearWindowRadius = 12;
3
3
  function resolvePickerCalendar(culture, calendar) {
4
4
  if (calendar) return calendar;
5
5
  return isPersianLanguage(culture) ? 'persian' : 'gregorian';
@@ -1 +1 @@
1
- {"version":3,"file":"pickers/date-time.jsx","sources":["../../src/pickers/date-time.ts"],"sourcesContent":["import {\n clampToPersianRange,\n compareLocal,\n daysInMonth,\n formatLocalDateTime,\n fromCalendarDate,\n type G9CalendarSystem,\n type G9Culture,\n G9DateTimeDisplayFormat,\n G9DateTimePickerMode,\n type G9LocalDate,\n type G9LocalDateTime,\n getMonthNames,\n isPersianLanguage,\n isSupportedByPersianCalendar,\n localDateTime,\n toCalendarDate,\n toNativeDigits,\n} from '@g9tm/lynxcontrols-foundation';\n\n// Date math and text of the date/time picker (MAUI `G9DateTimePicker` + `G9DateTimePickerSheet`), Intl-free: every\n// calendar step goes through the foundation calendar functions.\n\n/** One wheel row: the value it stands for and its text. */\nexport interface G9WheelItem<V extends string | number = number> {\n readonly value: V;\n readonly text: string;\n}\n\n/** Year rows are a window of at most ±50 years around the selection (MAUI `YearWindowRadius`). */\nexport const g9YearWindowRadius = 50;\n\n/** The calendar a picker shows: the explicit one, else Persian for a `fa` culture, else Gregorian (MAUI rule). */\nexport function resolvePickerCalendar(culture: G9Culture, calendar?: G9CalendarSystem | null): G9CalendarSystem {\n if (calendar) return calendar;\n return isPersianLanguage(culture) ? 'persian' : 'gregorian';\n}\n\n/** A date-time with its time part (a plain date reads as midnight). */\nexport function asDateTime(value: G9LocalDate): G9LocalDateTime {\n const t = value as Partial<G9LocalDateTime>;\n return localDateTime(\n value.year,\n value.month,\n value.day,\n t.hour ?? 0,\n t.minute ?? 0,\n t.second ?? 0,\n t.millisecond ?? 0,\n );\n}\n\n/**\n * Min/max for a calendar: Persian bounds are pulled into the range the Persian calendar supports (from 0622-03-22),\n * and an inverted pair is swapped.\n */\nexport function normalizePickerBounds(\n min: G9LocalDate | null | undefined,\n max: G9LocalDate | null | undefined,\n calendar: G9CalendarSystem,\n): { min: G9LocalDateTime | null; max: G9LocalDateTime | null } {\n let lo = min ? asDateTime(min) : null;\n let hi = max ? asDateTime(max) : null;\n if (calendar === 'persian') {\n lo = lo ? clampToPersianRange(lo) : null;\n hi = hi ? clampToPersianRange(hi) : null;\n }\n if (lo && hi && compareDateTime(lo, hi) > 0) [lo, hi] = [hi, lo];\n return { min: lo, max: hi };\n}\n\n/** Orders two date-times (date first, then time). */\nexport function compareDateTime(a: G9LocalDateTime, b: G9LocalDateTime): number {\n const d = compareLocal(a, b);\n if (d !== 0) return d;\n return (\n a.hour * 3_600_000 +\n a.minute * 60_000 +\n a.second * 1000 +\n a.millisecond -\n (b.hour * 3_600_000 + b.minute * 60_000 + b.second * 1000 + b.millisecond)\n );\n}\n\n/** Clamps a value into `[min, max]` (either bound optional) and, for Persian, into the supported range. */\nexport function clampPickerValue(\n value: G9LocalDateTime,\n bounds: { min: G9LocalDateTime | null; max: G9LocalDateTime | null },\n calendar: G9CalendarSystem,\n): G9LocalDateTime {\n let v = calendar === 'persian' ? clampToPersianRange(value) : value;\n if (bounds.min && compareDateTime(v, bounds.min) < 0) v = bounds.min;\n if (bounds.max && compareDateTime(v, bounds.max) > 0) v = bounds.max;\n return v;\n}\n\n/** The value's parts in the picker calendar (what the day/month/year wheels show). */\nexport function pickerParts(\n value: G9LocalDateTime,\n calendar: G9CalendarSystem,\n): {\n year: number;\n month: number;\n day: number;\n} {\n const c = toCalendarDate(value, calendar);\n return { year: c.year, month: c.month, day: c.day };\n}\n\n/**\n * Builds the value from wheel parts: the day is clamped to the month's length (31 Farvardin → 30 Mehr, 29 Feb → 28\n * in a common year, Esfand 30 → 29), then the result is clamped to the bounds.\n */\nexport function composePickerValue(\n parts: { year: number; month: number; day: number; hour: number; minute: number },\n calendar: G9CalendarSystem,\n bounds: { min: G9LocalDateTime | null; max: G9LocalDateTime | null },\n): G9LocalDateTime {\n const day = Math.min(parts.day, daysInMonth(calendar, parts.year, parts.month));\n const date = fromCalendarDate({ calendar, year: parts.year, month: parts.month, day });\n return clampPickerValue(localDateTime(date.year, date.month, date.day, parts.hour, parts.minute), bounds, calendar);\n}\n\nconst digits = (culture: G9Culture, n: number, width: number) =>\n toNativeDigits(String(n).padStart(width, '0'), culture.numberingSystem);\n\n/** Day rows 1…count (two digits, native numerals). */\nexport function dayWheelItems(count: number, culture: G9Culture): G9WheelItem[] {\n return Array.from({ length: count }, (_, i) => ({ value: i + 1, text: digits(culture, i + 1, 2) }));\n}\n\n/** Month rows with the calendar's month names. */\nexport function monthWheelItems(calendar: G9CalendarSystem, culture: G9Culture): G9WheelItem[] {\n return getMonthNames(calendar, culture).map((text, i) => ({ value: i + 1, text }));\n}\n\n/**\n * The year window (MAUI `BuildYears`): ±{@link g9YearWindowRadius} around `year`, inside the bounds' years (and the\n * calendar's 1…9999 range).\n */\nexport function yearWindow(year: number, minYear: number | null, maxYear: number | null): { from: number; to: number } {\n const lo = Math.max(1, minYear ?? 1);\n const hi = Math.min(9999, maxYear ?? 9999);\n return { from: Math.max(lo, year - g9YearWindowRadius), to: Math.min(hi, year + g9YearWindowRadius) };\n}\n\n/** Year rows `from…to` (four digits, native numerals). */\nexport function yearWheelItems(from: number, to: number, culture: G9Culture): G9WheelItem[] {\n return Array.from({ length: Math.max(0, to - from + 1) }, (_, i) => ({\n value: from + i,\n text: digits(culture, from + i, 4),\n }));\n}\n\n/** Hour rows 0…23: `HH`, or `hh tt` in 12-hour display (MAUI `BuildHours`). */\nexport function hourWheelItems(twentyFourHour: boolean, culture: G9Culture): G9WheelItem[] {\n return Array.from({ length: 24 }, (_, h) => ({\n value: h,\n text: formatLocalDateTime(localDateTime(2000, 1, 1, h), twentyFourHour ? 'HH' : 'hh tt', culture, {\n calendar: 'gregorian',\n }),\n }));\n}\n\n/** Minute rows 0…59. */\nexport function minuteWheelItems(culture: G9Culture): G9WheelItem[] {\n return Array.from({ length: 60 }, (_, m) => ({ value: m, text: digits(culture, m, 2) }));\n}\n\n/** Options of {@link formatPickerValue}. */\nexport interface G9PickerFormatOptions {\n readonly mode?: G9DateTimePickerMode;\n readonly displayFormat?: G9DateTimeDisplayFormat;\n readonly twentyFourHour?: boolean;\n readonly calendar?: G9CalendarSystem | null;\n /** Text of the `'custom'` format (MAUI `FormattedDisplayText`); blank falls back to the short date. */\n readonly customText?: string | null;\n}\n\n/**\n * The trigger and preview text (MAUI `FormatValue`). Gregorian: short `d MMM yyyy`, long `MMMM d, yyyy`, time\n * `HH:mm`/`hh:mm tt`, short date-time `d MMM yyyy, HH:mm`, long date-time `MMMM d, yyyy, hh:mm tt`. Persian:\n * `dd MMMM yyyy` and `{date}، {time}` (a date the Persian calendar cannot hold is written Gregorian). The `'time'`\n * mode always shows the time; `'custom'` shows `customText`.\n */\nexport function formatPickerValue(value: G9LocalDate, culture: G9Culture, options: G9PickerFormatOptions = {}): string {\n const format = options.displayFormat ?? G9DateTimeDisplayFormat.ShortDate;\n if (format === G9DateTimeDisplayFormat.Custom && options.customText && options.customText.trim() !== '') {\n return options.customText;\n }\n const v = asDateTime(value);\n const time = options.twentyFourHour ? 'HH:mm' : 'hh:mm tt';\n const calendar = resolvePickerCalendar(culture, options.calendar);\n const effective = options.mode === G9DateTimePickerMode.Time ? G9DateTimeDisplayFormat.TimeOnly : format;\n if (calendar === 'persian' && isSupportedByPersianCalendar(v)) {\n const fmt = (p: string) => formatLocalDateTime(v, p, culture, { calendar: 'persian' });\n const date = fmt('dd MMMM yyyy');\n if (effective === G9DateTimeDisplayFormat.TimeOnly) return fmt(time);\n if (effective === G9DateTimeDisplayFormat.ShortDateTime || effective === G9DateTimeDisplayFormat.LongDateTime) {\n return `${date}، ${fmt(time)}`;\n }\n return date;\n }\n const pattern =\n effective === G9DateTimeDisplayFormat.LongDate\n ? 'MMMM d, yyyy'\n : effective === G9DateTimeDisplayFormat.TimeOnly\n ? time\n : effective === G9DateTimeDisplayFormat.ShortDateTime\n ? 'd MMM yyyy, HH:mm'\n : effective === G9DateTimeDisplayFormat.LongDateTime\n ? 'MMMM d, yyyy, hh:mm tt'\n : 'd MMM yyyy';\n return formatLocalDateTime(v, pattern, culture, { calendar: 'gregorian' });\n}\n"],"names":["g9YearWindowRadius","resolvePickerCalendar","culture","calendar","isPersianLanguage","asDateTime","value","_t_hour","_t_minute","_t_second","_t_millisecond","t","localDateTime","normalizePickerBounds","min","max","lo","hi","clampToPersianRange","compareDateTime","a","b","d","compareLocal","clampPickerValue","bounds","v","pickerParts","c","toCalendarDate","composePickerValue","parts","day","Math","daysInMonth","date","fromCalendarDate","digits","n","width","toNativeDigits","String","dayWheelItems","count","Array","_","i","monthWheelItems","getMonthNames","text","yearWindow","year","minYear","maxYear","yearWheelItems","from","to","hourWheelItems","twentyFourHour","h","formatLocalDateTime","minuteWheelItems","m","formatPickerValue","options","_options_displayFormat","format","G9DateTimeDisplayFormat","time","effective","G9DateTimePickerMode","isSupportedByPersianCalendar","fmt","p","pattern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AAC,CAAC;QAC5FC;IAAf,MAAMC,SAAS,QAAAD,CAAAA,yBAAAA,QAAQ,aAAa,AAAD,IAApBA,yBAAyBE,wBAAwB,SAAS;IACzE,IAAID,WAAWC,wBAAwB,MAAM,IAAIH,QAAQ,UAAU,IAAIA,AAA8B,OAA9BA,QAAQ,UAAU,CAAC,IAAI,IAC5F,OAAOA,QAAQ,UAAU;IAE3B,MAAMtC,IAAIrB,WAAWC;IACrB,MAAM8D,OAAOJ,QAAQ,cAAc,GAAG,UAAU;IAChD,MAAM7D,WAAWF,sBAAsBC,SAAS8D,QAAQ,QAAQ;IAChE,MAAMK,YAAYL,QAAQ,IAAI,KAAKM,qBAAqB,IAAI,GAAGH,wBAAwB,QAAQ,GAAGD;IAClG,IAAI/D,AAAa,cAAbA,YAA0BoE,6BAA6B7C,IAAI;QAC7D,MAAM8C,MAAM,CAACC,IAAcb,oBAAoBlC,GAAG+C,GAAGvE,SAAS;gBAAE,UAAU;YAAU;QACpF,MAAMiC,OAAOqC,IAAI;QACjB,IAAIH,cAAcF,wBAAwB,QAAQ,EAAE,OAAOK,IAAIJ;QAC/D,IAAIC,cAAcF,wBAAwB,aAAa,IAAIE,cAAcF,wBAAwB,YAAY,EAC3G,OAAO,GAAGhC,KAAK,EAAE,EAAEqC,IAAIJ,OAAO;QAEhC,OAAOjC;IACT;IACA,MAAMuC,UACJL,cAAcF,wBAAwB,QAAQ,GAC1C,iBACAE,cAAcF,wBAAwB,QAAQ,GAC5CC,OACAC,cAAcF,wBAAwB,aAAa,GACjD,sBACAE,cAAcF,wBAAwB,YAAY,GAChD,2BACA;IACZ,OAAOP,oBAAoBlC,GAAGgD,SAASxE,SAAS;QAAE,UAAU;IAAY;AAC1E"}
1
+ {"version":3,"file":"pickers/date-time.jsx","sources":["../../src/pickers/date-time.ts"],"sourcesContent":["import {\n clampToPersianRange,\n compareLocal,\n daysInMonth,\n formatLocalDateTime,\n fromCalendarDate,\n type G9CalendarSystem,\n type G9Culture,\n G9DateTimeDisplayFormat,\n G9DateTimePickerMode,\n type G9LocalDate,\n type G9LocalDateTime,\n getMonthNames,\n isPersianLanguage,\n isSupportedByPersianCalendar,\n localDateTime,\n toCalendarDate,\n toNativeDigits,\n} from '@g9tm/lynxcontrols-foundation';\n\n// Date math and text of the date/time picker (MAUI `G9DateTimePicker` + `G9DateTimePickerSheet`), Intl-free: every\n// calendar step goes through the foundation calendar functions.\n\n/** One wheel row: the value it stands for and its text. */\nexport interface G9WheelItem<V extends string | number = number> {\n readonly value: V;\n readonly text: string;\n}\n\n/**\n * Year rows are a window of at most ±12 years around the selection (MAUI `YearWindowRadius`; 50 until 1.4.11, when the\n * picker began to open pre-built: every row is paid for in the tap-to-open time, and the window grows at both edges).\n */\nexport const g9YearWindowRadius = 12;\n\n/** The calendar a picker shows: the explicit one, else Persian for a `fa` culture, else Gregorian (MAUI rule). */\nexport function resolvePickerCalendar(culture: G9Culture, calendar?: G9CalendarSystem | null): G9CalendarSystem {\n if (calendar) return calendar;\n return isPersianLanguage(culture) ? 'persian' : 'gregorian';\n}\n\n/** A date-time with its time part (a plain date reads as midnight). */\nexport function asDateTime(value: G9LocalDate): G9LocalDateTime {\n const t = value as Partial<G9LocalDateTime>;\n return localDateTime(\n value.year,\n value.month,\n value.day,\n t.hour ?? 0,\n t.minute ?? 0,\n t.second ?? 0,\n t.millisecond ?? 0,\n );\n}\n\n/**\n * Min/max for a calendar: Persian bounds are pulled into the range the Persian calendar supports (from 0622-03-22),\n * and an inverted pair is swapped.\n */\nexport function normalizePickerBounds(\n min: G9LocalDate | null | undefined,\n max: G9LocalDate | null | undefined,\n calendar: G9CalendarSystem,\n): { min: G9LocalDateTime | null; max: G9LocalDateTime | null } {\n let lo = min ? asDateTime(min) : null;\n let hi = max ? asDateTime(max) : null;\n if (calendar === 'persian') {\n lo = lo ? clampToPersianRange(lo) : null;\n hi = hi ? clampToPersianRange(hi) : null;\n }\n if (lo && hi && compareDateTime(lo, hi) > 0) [lo, hi] = [hi, lo];\n return { min: lo, max: hi };\n}\n\n/** Orders two date-times (date first, then time). */\nexport function compareDateTime(a: G9LocalDateTime, b: G9LocalDateTime): number {\n const d = compareLocal(a, b);\n if (d !== 0) return d;\n return (\n a.hour * 3_600_000 +\n a.minute * 60_000 +\n a.second * 1000 +\n a.millisecond -\n (b.hour * 3_600_000 + b.minute * 60_000 + b.second * 1000 + b.millisecond)\n );\n}\n\n/** Clamps a value into `[min, max]` (either bound optional) and, for Persian, into the supported range. */\nexport function clampPickerValue(\n value: G9LocalDateTime,\n bounds: { min: G9LocalDateTime | null; max: G9LocalDateTime | null },\n calendar: G9CalendarSystem,\n): G9LocalDateTime {\n let v = calendar === 'persian' ? clampToPersianRange(value) : value;\n if (bounds.min && compareDateTime(v, bounds.min) < 0) v = bounds.min;\n if (bounds.max && compareDateTime(v, bounds.max) > 0) v = bounds.max;\n return v;\n}\n\n/** The value's parts in the picker calendar (what the day/month/year wheels show). */\nexport function pickerParts(\n value: G9LocalDateTime,\n calendar: G9CalendarSystem,\n): {\n year: number;\n month: number;\n day: number;\n} {\n const c = toCalendarDate(value, calendar);\n return { year: c.year, month: c.month, day: c.day };\n}\n\n/**\n * Builds the value from wheel parts: the day is clamped to the month's length (31 Farvardin → 30 Mehr, 29 Feb → 28\n * in a common year, Esfand 30 → 29), then the result is clamped to the bounds.\n */\nexport function composePickerValue(\n parts: { year: number; month: number; day: number; hour: number; minute: number },\n calendar: G9CalendarSystem,\n bounds: { min: G9LocalDateTime | null; max: G9LocalDateTime | null },\n): G9LocalDateTime {\n const day = Math.min(parts.day, daysInMonth(calendar, parts.year, parts.month));\n const date = fromCalendarDate({ calendar, year: parts.year, month: parts.month, day });\n return clampPickerValue(localDateTime(date.year, date.month, date.day, parts.hour, parts.minute), bounds, calendar);\n}\n\nconst digits = (culture: G9Culture, n: number, width: number) =>\n toNativeDigits(String(n).padStart(width, '0'), culture.numberingSystem);\n\n/** Day rows 1…count (two digits, native numerals). */\nexport function dayWheelItems(count: number, culture: G9Culture): G9WheelItem[] {\n return Array.from({ length: count }, (_, i) => ({ value: i + 1, text: digits(culture, i + 1, 2) }));\n}\n\n/** Month rows with the calendar's month names. */\nexport function monthWheelItems(calendar: G9CalendarSystem, culture: G9Culture): G9WheelItem[] {\n return getMonthNames(calendar, culture).map((text, i) => ({ value: i + 1, text }));\n}\n\n/**\n * The year window (MAUI `BuildYears`): ±{@link g9YearWindowRadius} around `year`, inside the bounds' years (and the\n * calendar's 1…9999 range).\n */\nexport function yearWindow(year: number, minYear: number | null, maxYear: number | null): { from: number; to: number } {\n const lo = Math.max(1, minYear ?? 1);\n const hi = Math.min(9999, maxYear ?? 9999);\n return { from: Math.max(lo, year - g9YearWindowRadius), to: Math.min(hi, year + g9YearWindowRadius) };\n}\n\n/** Year rows `from…to` (four digits, native numerals). */\nexport function yearWheelItems(from: number, to: number, culture: G9Culture): G9WheelItem[] {\n return Array.from({ length: Math.max(0, to - from + 1) }, (_, i) => ({\n value: from + i,\n text: digits(culture, from + i, 4),\n }));\n}\n\n/** Hour rows 0…23: `HH`, or `hh tt` in 12-hour display (MAUI `BuildHours`). */\nexport function hourWheelItems(twentyFourHour: boolean, culture: G9Culture): G9WheelItem[] {\n return Array.from({ length: 24 }, (_, h) => ({\n value: h,\n text: formatLocalDateTime(localDateTime(2000, 1, 1, h), twentyFourHour ? 'HH' : 'hh tt', culture, {\n calendar: 'gregorian',\n }),\n }));\n}\n\n/** Minute rows 0…59. */\nexport function minuteWheelItems(culture: G9Culture): G9WheelItem[] {\n return Array.from({ length: 60 }, (_, m) => ({ value: m, text: digits(culture, m, 2) }));\n}\n\n/** Options of {@link formatPickerValue}. */\nexport interface G9PickerFormatOptions {\n readonly mode?: G9DateTimePickerMode;\n readonly displayFormat?: G9DateTimeDisplayFormat;\n readonly twentyFourHour?: boolean;\n readonly calendar?: G9CalendarSystem | null;\n /** Text of the `'custom'` format (MAUI `FormattedDisplayText`); blank falls back to the short date. */\n readonly customText?: string | null;\n}\n\n/**\n * The trigger and preview text (MAUI `FormatValue`). Gregorian: short `d MMM yyyy`, long `MMMM d, yyyy`, time\n * `HH:mm`/`hh:mm tt`, short date-time `d MMM yyyy, HH:mm`, long date-time `MMMM d, yyyy, hh:mm tt`. Persian:\n * `dd MMMM yyyy` and `{date}، {time}` (a date the Persian calendar cannot hold is written Gregorian). The `'time'`\n * mode always shows the time; `'custom'` shows `customText`.\n */\nexport function formatPickerValue(value: G9LocalDate, culture: G9Culture, options: G9PickerFormatOptions = {}): string {\n const format = options.displayFormat ?? G9DateTimeDisplayFormat.ShortDate;\n if (format === G9DateTimeDisplayFormat.Custom && options.customText && options.customText.trim() !== '') {\n return options.customText;\n }\n const v = asDateTime(value);\n const time = options.twentyFourHour ? 'HH:mm' : 'hh:mm tt';\n const calendar = resolvePickerCalendar(culture, options.calendar);\n const effective = options.mode === G9DateTimePickerMode.Time ? G9DateTimeDisplayFormat.TimeOnly : format;\n if (calendar === 'persian' && isSupportedByPersianCalendar(v)) {\n const fmt = (p: string) => formatLocalDateTime(v, p, culture, { calendar: 'persian' });\n const date = fmt('dd MMMM yyyy');\n if (effective === G9DateTimeDisplayFormat.TimeOnly) return fmt(time);\n if (effective === G9DateTimeDisplayFormat.ShortDateTime || effective === G9DateTimeDisplayFormat.LongDateTime) {\n return `${date}، ${fmt(time)}`;\n }\n return date;\n }\n const pattern =\n effective === G9DateTimeDisplayFormat.LongDate\n ? 'MMMM d, yyyy'\n : effective === G9DateTimeDisplayFormat.TimeOnly\n ? time\n : effective === G9DateTimeDisplayFormat.ShortDateTime\n ? 'd MMM yyyy, HH:mm'\n : effective === G9DateTimeDisplayFormat.LongDateTime\n ? 'MMMM d, yyyy, hh:mm tt'\n : 'd MMM yyyy';\n return formatLocalDateTime(v, pattern, culture, { calendar: 'gregorian' });\n}\n"],"names":["g9YearWindowRadius","resolvePickerCalendar","culture","calendar","isPersianLanguage","asDateTime","value","_t_hour","_t_minute","_t_second","_t_millisecond","t","localDateTime","normalizePickerBounds","min","max","lo","hi","clampToPersianRange","compareDateTime","a","b","d","compareLocal","clampPickerValue","bounds","v","pickerParts","c","toCalendarDate","composePickerValue","parts","day","Math","daysInMonth","date","fromCalendarDate","digits","n","width","toNativeDigits","String","dayWheelItems","count","Array","_","i","monthWheelItems","getMonthNames","text","yearWindow","year","minYear","maxYear","yearWheelItems","from","to","hourWheelItems","twentyFourHour","h","formatLocalDateTime","minuteWheelItems","m","formatPickerValue","options","_options_displayFormat","format","G9DateTimeDisplayFormat","time","effective","G9DateTimePickerMode","isSupportedByPersianCalendar","fmt","p","pattern"],"mappings":";AAiCO,MAAMA,qBAAqB;AAG3B,SAASC,sBAAsBC,OAAkB,EAAEC,QAAkC;IAC1F,IAAIA,UAAU,OAAOA;IACrB,OAAOC,kBAAkBF,WAAW,YAAY;AAClD;AAGO,SAASG,WAAWC,KAAkB;QAMzCC,SACAC,WACAC,WACAC;IARF,MAAMC,IAAIL;IACV,OAAOM,cACLN,MAAM,IAAI,EACVA,MAAM,KAAK,EACXA,MAAM,GAAG,UACTC,CAAAA,UAAAA,EAAE,IAAI,AAAD,IAALA,UAAU,WACVC,CAAAA,YAAAA,EAAE,MAAM,AAAD,IAAPA,YAAY,WACZC,CAAAA,YAAAA,EAAE,MAAM,AAAD,IAAPA,YAAY,WACZC,CAAAA,iBAAAA,EAAE,WAAW,AAAD,IAAZA,iBAAiB;AAErB;AAMO,SAASG,sBACdC,GAAmC,EACnCC,GAAmC,EACnCZ,QAA0B;IAE1B,IAAIa,KAAKF,MAAMT,WAAWS,OAAO;IACjC,IAAIG,KAAKF,MAAMV,WAAWU,OAAO;IACjC,IAAIZ,AAAa,cAAbA,UAAwB;QAC1Ba,KAAKA,KAAKE,oBAAoBF,MAAM;QACpCC,KAAKA,KAAKC,oBAAoBD,MAAM;IACtC;IACA,IAAID,MAAMC,MAAME,gBAAgBH,IAAIC,MAAM,GAAG,CAACD,IAAIC,GAAG,GAAG;QAACA;QAAID;KAAG;IAChE,OAAO;QAAE,KAAKA;QAAI,KAAKC;I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F,wBAAwB,QAAQ,GAC5CC,OACAC,cAAcF,wBAAwB,aAAa,GACjD,sBACAE,cAAcF,wBAAwB,YAAY,GAChD,2BACA;IACZ,OAAOP,oBAAoBlC,GAAGgD,SAASxE,SAAS;QAAE,UAAU;IAAY;AAC1E"}
@@ -8,8 +8,12 @@ export interface G9PickerSheetBodyProps<T> {
8
8
  }
9
9
  /**
10
10
  * Opens a fit-to-content drum sheet (MAUI `G9DateTimePickerSheet.ShowAsync` / `G9TimeSpanPickerSheet.ShowAsync`) and
11
- * resolves the value Done returned, or `null` for Cancel, any dismissal, or a throttled open. The body is built after
12
- * the open motion and revealed as one settled unit (`fadeDeferredContentIn`, MAUI's crossfade).
11
+ * resolves the value Done returned, or `null` for Cancel, any dismissal, or a throttled open.
12
+ *
13
+ * ⛔ PRE-BUILT (MAUI 1.4.11): the body is built on the tap and opens finished — no spinner, and nothing waits on the
14
+ * open motion. It used to be a factory shown behind a spinner until the sheet had opened plus 369 ms: the only sheet of
15
+ * the suite that visibly «loaded» (MAUI's field report 2026-11-08, Samsung A24: the spinner stayed for seconds). What made
16
+ * an eager build costly is gone with the ±12-year window (`g9YearWindowRadius`).
13
17
  */
14
18
  export declare function showPickerSheet<T>(sheets: G9SheetService, body: (props: G9PickerSheetBodyProps<T>) => ReactNode): Promise<T | null>;
15
19
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"picker-sheet.d.ts","sourceRoot":"","sources":["../../src/pickers/picker-sheet.tsx"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAMhD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,wFAAwF;AACxF,MAAM,WAAW,sBAAsB,CAAC,CAAC;IACvC,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAClC,QAAQ,CAAC,MAAM,EAAE,MAAM,IAAI,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AAI,CAAC;CAC7B,GAAG,SAAS,CAwBZ"}
@@ -22,10 +22,9 @@ async function showPickerSheet(sheets, body) {
22
22
  cancel: ()=>finish(null)
23
23
  });
24
24
  };
25
- const handle = sheets.show(()=><Body/>, {
25
+ const handle = sheets.show(<Body/>, {
26
26
  ...fitToContentSheetOptions(),
27
- fadeDeferredContentIn: true,
28
- loadingSkeleton: 'none'
27
+ deferContent: false
29
28
  });
30
29
  if (!handle) return null;
31
30
  await handle.result;
@@ -1 +1 @@
1
- {"version":3,"file":"pickers/picker-sheet.jsx","sources":["../../src/pickers/picker-sheet.tsx"],"sourcesContent":["import './pickers.css';\nimport { G9StringKey } from '@g9tm/lynxcontrols-foundation';\nimport type { ReactNode } from '@lynx-js/react';\nimport { g9RowStyle } from '../base/control';\nimport { G9Button } from '../button/button';\nimport { useG9Direction, useG9Strings } from '../provider/hooks';\nimport { useG9SheetContext } from '../sheet/frame';\nimport { fitToContentSheetOptions } from '../sheet/options';\nimport type { G9SheetService } from '../sheet/service';\n\n/** Props a drum sheet body receives: finish with a value (Done) or without (Cancel). */\nexport interface G9PickerSheetBodyProps<T> {\n readonly done: (value: T) => void;\n readonly cancel: () => void;\n}\n\n/**\n * Opens a fit-to-content drum sheet (MAUI `G9DateTimePickerSheet.ShowAsync` / `G9TimeSpanPickerSheet.ShowAsync`) and\n * resolves the value Done returned, or `null` for Cancel, any dismissal, or a throttled open. The body is built after\n * the open motion and revealed as one settled unit (`fadeDeferredContentIn`, MAUI's crossfade).\n */\nexport async function showPickerSheet<T>(\n sheets: G9SheetService,\n body: (props: G9PickerSheetBodyProps<T>) => ReactNode,\n): Promise<T | null> {\n let result: T | null = null;\n let finished = false;\n const Body = () => {\n const handle = useG9SheetContext()?.handle;\n const finish = (value: T | null) => {\n if (finished) return;\n finished = true;\n result = value;\n handle?.close();\n };\n return body({ done: (v) => finish(v), cancel: () => finish(null) });\n };\n const handle = sheets.show(() => <Body />, {\n ...fitToContentSheetOptions(),\n fadeDeferredContentIn: true,\n loadingSkeleton: 'none',\n });\n if (!handle) return null;\n await handle.result;\n return result;\n}\n\n/**\n * The drum sheet header (MAUI `G9DateTimePickerSheet` / `G9TimeSpanPickerSheet.CreateHeader`): a Grid \"Auto,*,Auto\" of\n * Padding (16, 10) — Cancel as a small Text-variant G9Button (Primary text in an Outline pill), the title 15 bold\n * TextPrimary, Done as a small Primary G9Button.\n */\nexport function PickerSheetHeader(props: {\n readonly title: string;\n readonly onCancel: () => void;\n readonly onDone: () => void;\n}): ReactNode {\n const strings = useG9Strings();\n const direction = useG9Direction();\n return (\n <view className=\"g9-picker-sheet__header\" style={g9RowStyle(direction)}>\n <G9Button\n className=\"g9-picker-sheet__cancel\"\n text={strings.get(G9StringKey.Cancel)}\n variant=\"text\"\n size=\"small\"\n onPress={props.onCancel}\n />\n <text className=\"g9-picker-sheet__title\" text-maxline=\"1\">\n {props.title}\n </text>\n <G9Button\n className=\"g9-picker-sheet__done\"\n text={strings.get(G9StringKey.Done)}\n variant=\"primary\"\n size=\"small\"\n onPress={props.onDone}\n />\n </view>\n );\n}\n"],"names":["showPickerSheet","sheets","body","result","finished","Body","_useG9SheetContext","handle","finish","value","v","fitToContentSheetOptions","PickerSheetHeader","props","strings","useG9Strings","direction","useG9Direction","view","g9RowStyle","G9Button","G9StringKey","text"],"mappings":";;;;;;;AAqBO,eAAeA,gBACpBC,MAAsB,EACtBC,IAAqD;IAErD,IAAIC,SAAmB;IACvB,IAAIC,WAAW;IACf,MAAMC,OAAO;YACIC;QAAf,MAAMC,SAAS,QAAAD,CAAAA,qBAAAA,mBAAkB,IAAlBA,KAAAA,IAAAA,mBAAqB,MAAM;QAC1C,MAAME,SAAS,CAACC;YACd,IAAIL,UAAU;YACdA,WAAW;YACXD,SAASM;YACTF,QAAAA,UAAAA,OAAQ,KAAK;QACf;QACA,OAAOL,KAAK;YAAE,MAAM,CAACQ,IAAMF,OAAOE;YAAI,QAAQ,IAAMF,OAAO;QAAM;IACnE;IACA,MAAMD,SAASN,OAAO,IAAI,CAAC,KAAOI,QAAS;QACzC,GAAGM,0BAA0B;QAC7B,uBAAuB;QACvB,iBAAiB;IACnB;IACA,IAAI,CAACJ,QAAQ,OAAO;IACpB,MAAMA,OAAO,MAAM;IACnB,OAAOJ;AACT;AAOO,SAASS,kBAAkBC,KAIjC;IACC,MAAMC,UAAUC;IAChB,MAAMC,YAAYC;IAClB,QACGC,KAAK,UAAU,0BAA0B,OAAOC,WAAWH,YAAY;MACtE,CAACI,SACC,UAAU,0BACV,MAAMN,QAAQ,GAAG,CAACO,YAAY,MAAM,GACpC,QAAQ,OACR,KAAK,QACL,SAASR,MAAM,QAAQ,GACvB;MACF,CAACS,KAAK,UAAU,yBAAyB,aAAa,IAAI;QACxD,CAACT,MAAM,KAAK,CAAC;MACf,EAAES,KAAK;MACP,CAACF,SACC,UAAU,wBACV,MAAMN,QAAQ,GAAG,CAACO,YAAY,IAAI,GAClC,QAAQ,UACR,KAAK,QACL,SAASR,MAAM,MAAM,GACrB;IACJ,EAAEK;AAEN"}
1
+ {"version":3,"file":"pickers/picker-sheet.jsx","sources":["../../src/pickers/picker-sheet.tsx"],"sourcesContent":["import './pickers.css';\nimport { G9StringKey } from '@g9tm/lynxcontrols-foundation';\nimport type { ReactNode } from '@lynx-js/react';\nimport { g9RowStyle } from '../base/control';\nimport { G9Button } from '../button/button';\nimport { useG9Direction, useG9Strings } from '../provider/hooks';\nimport { useG9SheetContext } from '../sheet/frame';\nimport { fitToContentSheetOptions } from '../sheet/options';\nimport type { G9SheetService } from '../sheet/service';\n\n/** Props a drum sheet body receives: finish with a value (Done) or without (Cancel). */\nexport interface G9PickerSheetBodyProps<T> {\n readonly done: (value: T) => void;\n readonly cancel: () => void;\n}\n\n/**\n * Opens a fit-to-content drum sheet (MAUI `G9DateTimePickerSheet.ShowAsync` / `G9TimeSpanPickerSheet.ShowAsync`) and\n * resolves the value Done returned, or `null` for Cancel, any dismissal, or a throttled open.\n *\n * ⛔ PRE-BUILT (MAUI 1.4.11): the body is built on the tap and opens finished — no spinner, and nothing waits on the\n * open motion. It used to be a factory shown behind a spinner until the sheet had opened plus 369 ms: the only sheet of\n * the suite that visibly «loaded» (MAUI's field report 2026-11-08, Samsung A24: the spinner stayed for seconds). What made\n * an eager build costly is gone with the ±12-year window (`g9YearWindowRadius`).\n */\nexport async function showPickerSheet<T>(\n sheets: G9SheetService,\n body: (props: G9PickerSheetBodyProps<T>) => ReactNode,\n): Promise<T | null> {\n let result: T | null = null;\n let finished = false;\n const Body = () => {\n const handle = useG9SheetContext()?.handle;\n const finish = (value: T | null) => {\n if (finished) return;\n finished = true;\n result = value;\n handle?.close();\n };\n return body({ done: (v) => finish(v), cancel: () => finish(null) });\n };\n const handle = sheets.show(<Body />, { ...fitToContentSheetOptions(), deferContent: false });\n if (!handle) return null;\n await handle.result;\n return result;\n}\n\n/**\n * The drum sheet header (MAUI `G9DateTimePickerSheet` / `G9TimeSpanPickerSheet.CreateHeader`): a Grid \"Auto,*,Auto\" of\n * Padding (16, 10) — Cancel as a small Text-variant G9Button (Primary text in an Outline pill), the title 15 bold\n * TextPrimary, Done as a small Primary G9Button.\n */\nexport function PickerSheetHeader(props: {\n readonly title: string;\n readonly onCancel: () => void;\n readonly onDone: () => void;\n}): ReactNode {\n const strings = useG9Strings();\n const direction = useG9Direction();\n return (\n <view className=\"g9-picker-sheet__header\" style={g9RowStyle(direction)}>\n <G9Button\n className=\"g9-picker-sheet__cancel\"\n text={strings.get(G9StringKey.Cancel)}\n variant=\"text\"\n size=\"small\"\n onPress={props.onCancel}\n />\n <text className=\"g9-picker-sheet__title\" text-maxline=\"1\">\n {props.title}\n </text>\n <G9Button\n className=\"g9-picker-sheet__done\"\n text={strings.get(G9StringKey.Done)}\n variant=\"primary\"\n size=\"small\"\n onPress={props.onDone}\n />\n </view>\n );\n}\n"],"names":["showPickerSheet","sheets","body","result","finished","Body","_useG9SheetContext","handle","finish","value","v","fitToContentSheetOptions","PickerSheetHeader","props","strings","useG9Strings","direction","useG9Direction","view","g9RowStyle","G9Button","G9StringKey","text"],"mappings":";;;;;;;AAyBO,eAAeA,gBACpBC,MAAsB,EACtBC,IAAqD;IAErD,IAAIC,SAAmB;IACvB,IAAIC,WAAW;IACf,MAAMC,OAAO;YACIC;QAAf,MAAMC,SAAS,QAAAD,CAAAA,qBAAAA,mBAAkB,IAAlBA,KAAAA,IAAAA,mBAAqB,MAAM;QAC1C,MAAME,SAAS,CAACC;YACd,IAAIL,UAAU;YACdA,WAAW;YACXD,SAASM;YACTF,QAAAA,UAAAA,OAAQ,KAAK;QACf;QACA,OAAOL,KAAK;YAAE,MAAM,CAACQ,IAAMF,OAAOE;YAAI,QAAQ,IAAMF,OAAO;QAAM;IACnE;IACA,MAAMD,SAASN,OAAO,IAAI,EAAEI,QAAS;QAAE,GAAGM,0BAA0B;QAAE,cAAc;IAAM;IAC1F,IAAI,CAACJ,QAAQ,OAAO;IACpB,MAAMA,OAAO,MAAM;IACnB,OAAOJ;AACT;AAOO,SAASS,kBAAkBC,KAIjC;IACC,MAAMC,UAAUC;IAChB,MAAMC,YAAYC;IAClB,QACGC,KAAK,UAAU,0BAA0B,OAAOC,WAAWH,YAAY;MACtE,CAACI,SACC,UAAU,0BACV,MAAMN,QAAQ,GAAG,CAACO,YAAY,MAAM,GACpC,QAAQ,OACR,KAAK,QACL,SAASR,MAAM,QAAQ,GACvB;MACF,CAACS,KAAK,UAAU,yBAAyB,aAAa,IAAI;QACxD,CAACT,MAAM,KAAK,CAAC;MACf,EAAES,KAAK;MACP,CAACF,SACC,UAAU,wBACV,MAAMN,QAAQ,GAAG,CAACO,YAAY,IAAI,GAClC,QAAQ,UACR,KAAK,QACL,SAASR,MAAM,MAAM,GACrB;IACJ,EAAEK;AAEN"}
@@ -1 +1 @@
1
- {"version":3,"file":"picker.d.ts","sourceRoot":"","sources":["../../src/pickers/picker.tsx"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,SAAS,EAAU,MAAM,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wBAAwB,CAAC;AAK5E,OAAO,EAAE,KAAK,kBAAkB,EAAkD,MAAM,WAAW,CAAC;AAEpG,iCAAiC;AACjC,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe,CAAE,SAAQ,kBAAkB;IACpG,uGAAuG;IACvG,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IACjC,0GAA0G;IAC1G,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,gGAAgG;IAChG,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI,KAAK,IAAI,CAAC;IACtE,gFAAgF;IAChF,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC;;;OAGG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IACnC,mHAAmH;IACnH,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;IAC5C,wGAAwG;IACxG,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,IAAI,CAAC;CAC5C;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,SAAS,CAiDxG"}
@@ -1,3 +1,4 @@
1
+ import { resolveRestingPlaceholder } from "../fields/outlined-field.jsx";
1
2
  import "./pickers.css";
2
3
  import { useRef } from "@lynx-js/react";
3
4
  import { selectionKey } from "../base/selection-item.jsx";
@@ -7,7 +8,7 @@ import { showSelectionSheet } from "../selection/selection-sheet.jsx";
7
8
  import { useG9Sheets } from "../sheet/service.jsx";
8
9
  import { PickerField, SelectionValueIcon, usePickerOpen } from "./trigger.jsx";
9
10
  function G9Picker(props) {
10
- var _props_defaultValue, _props_placeholder;
11
+ var _props_defaultValue, _resolveRestingPlaceholder;
11
12
  const sheets = useG9Sheets();
12
13
  const glyphs = useG9Settings().glyphs;
13
14
  const open = usePickerOpen();
@@ -63,7 +64,7 @@ function G9Picker(props) {
63
64
  }} hasValue={void 0 !== selected} onOpen={onOpen}>
64
65
  {selected ? <SelectionValueIcon item={selected}/> : null}
65
66
  <text className={`g9-picker__text${selected ? '' : ' g9-picker__text--placeholder'}`} text-maxline="1">
66
- {selected ? selected.text : props.label ? '' : null != (_props_placeholder = props.placeholder) ? _props_placeholder : ''}
67
+ {selected ? selected.text : null != (_resolveRestingPlaceholder = resolveRestingPlaceholder(props)) ? _resolveRestingPlaceholder : ''}
67
68
  </text>
68
69
  </PickerField>;
69
70
  }
@@ -1 +1 @@
1
- {"version":3,"file":"pickers/picker.jsx","sources":["../../src/pickers/picker.tsx"],"sourcesContent":["import './pickers.css';\nimport { type ReactNode, useRef } from '@lynx-js/react';\nimport { type G9SelectionItem, selectionKey } from '../base/selection-item';\nimport { useControllableState } from '../base/use-controllable-state';\nimport { useG9Settings } from '../provider/hooks';\nimport { showSelectionSheet } from '../selection/selection-sheet';\nimport { useG9Sheets } from '../sheet/service';\nimport { type G9PickerFieldProps, PickerField, SelectionValueIcon, usePickerOpen } from './trigger';\n\n/** Props of {@link G9Picker}. */\nexport interface G9PickerProps<T extends G9SelectionItem = G9SelectionItem> extends G9PickerFieldProps {\n /** The rows of the sheet (MAUI `ItemsSource`). Disabled items are left out except the selected one. */\n readonly items: ReadonlyArray<T>;\n /** Selected item key (`selectionKey`: key, else text); `null` = none. Controlled with `onValueChange`. */\n readonly value?: string | null;\n readonly defaultValue?: string | null;\n /** The selection changed: by a pick, or by `restoreOnCancel` putting back the opening value. */\n readonly onValueChange?: (key: string | null, item: T | null) => void;\n /** Sheet title; default the label, else the placeholder (MAUI `SheetTitle`). */\n readonly sheetTitle?: string | null;\n /**\n * Default true (MAUI `RestoreOnCancel`): a dismissed sheet puts back the value the picker had when it opened (if it\n * changed meanwhile) and reports `onSelectionCancelled`. False leaves the current value and reports nothing.\n */\n readonly restoreOnCancel?: boolean;\n /** A row was picked (MAUI `ItemSelected` + `SelectionAcceptedCommand`); only for a pick, never for a dismissal. */\n readonly onItemSelected?: (item: T) => void;\n /** The sheet was dismissed without a pick (MAUI `SelectionCancelled` + `SelectionCancelledCommand`). */\n readonly onSelectionCancelled?: () => void;\n}\n\n/**\n * Single selection from a list in an outlined box (MAUI `G9Picker`): a tap opens the selection sheet (no search; a\n * pick closes it), the box shows the item's icon or swatch and text, the trailing chevron hints at the sheet. Must\n * be inside a `G9Host` (the sheet).\n */\nexport function G9Picker<T extends G9SelectionItem = G9SelectionItem>(props: G9PickerProps<T>): ReactNode {\n const sheets = useG9Sheets();\n const glyphs = useG9Settings().glyphs;\n const open = usePickerOpen();\n const [key, setKey] = useControllableState<string | null, [T | null]>({\n value: props.value,\n defaultValue: props.defaultValue ?? null,\n onChange: props.onValueChange,\n name: 'G9Picker.value',\n });\n const latest = useRef({ props, key });\n latest.current = { props, key };\n const selected = key === null ? undefined : props.items.find((i) => selectionKey(i) === key);\n\n const onOpen = () =>\n open(async (isCurrent) => {\n const p = latest.current.props;\n const previousKey = latest.current.key;\n const previous = previousKey === null ? undefined : p.items.find((i) => selectionKey(i) === previousKey);\n const items = p.items.filter((i) => i.isEnabled !== false || i === previous);\n if (items.length === 0) return;\n const result = await showSelectionSheet(sheets, {\n title: p.sheetTitle?.trim() ? p.sheetTitle : (p.label ?? p.placeholder ?? ''),\n items,\n selectedItems: previous ? [previous] : [],\n allowMultiple: false,\n closeOnSingleSelection: true,\n showSearch: false,\n });\n if (!isCurrent()) return;\n const next = result.wasAccepted ? result.items[0] : undefined;\n const now = latest.current.props;\n if (next) {\n setKey(selectionKey(next), next);\n now.onItemSelected?.(next);\n } else if (now.restoreOnCancel !== false) {\n if (latest.current.key !== previousKey) setKey(previousKey, previous ?? null);\n now.onSelectionCancelled?.();\n }\n });\n\n return (\n <PickerField field={{ trailingIcon: glyphs.chevron, ...props }} hasValue={selected !== undefined} onOpen={onOpen}>\n {selected ? <SelectionValueIcon item={selected} /> : null}\n <text className={`g9-picker__text${selected ? '' : ' g9-picker__text--placeholder'}`} text-maxline=\"1\">\n {selected ? selected.text : props.label ? '' : (props.placeholder ?? '')}\n </text>\n </PickerField>\n );\n}\n"],"names":["G9Picker","props","_props_defaultValue","_props_placeholder","sheets","useG9Sheets","glyphs","useG9Settings","open","usePickerOpen","key","setKey","useControllableState","latest","useRef","selected","undefined","i","selectionKey","onOpen","isCurrent","_ref","_p_sheetTitle","p","previousKey","previous","items","result","showSelectionSheet","next","now","PickerField","SelectionValueIcon","text"],"mappings":";;;;;;;;AAoCO,SAASA,SAAsDC,KAAuB;QAM3EC,qBAuCsCC;IA5CtD,MAAMC,SAASC;IACf,MAAMC,SAASC,gBAAgB,MAAM;IACrC,MAAMC,OAAOC;IACb,MAAM,CAACC,KAAKC,OAAO,GAAGC,qBAAgD;QACpE,OAAOX,MAAM,KAAK;QAClB,cAAc,QAAAC,CAAAA,sBAAAA,MAAM,YAAY,AAAD,IAAjBA,sBAAsB;QACpC,UAAUD,MAAM,aAAa;QAC7B,MAAM;IACR;IACA,MAAMY,SAASC,OAAO;QAAEb;QAAOS;IAAI;IACnCG,OAAO,OAAO,GAAG;QAAEZ;QAAOS;IAAI;IAC9B,MAAMK,WAAWL,AAAQ,SAARA,MAAeM,SAAYf,MAAM,KAAK,CAAC,IAAI,CAAC,CAACgB,IAAMC,aAAaD,OAAOP;IAExF,MAAMS,SAAS,IACbX,KAAK,OAAOY;gBAOsCC,MAAAA;gBAAvCC;YANT,MAAMC,IAAIV,OAAO,OAAO,CAAC,KAAK;YAC9B,MAAMW,cAAcX,OAAO,OAAO,CAAC,GAAG;YACtC,MAAMY,WAAWD,AAAgB,SAAhBA,cAAuBR,SAAYO,EAAE,KAAK,CAAC,IAAI,C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AAmB,MAAMjB,cAAe,KAAK;MAC1D,CAACkB,KAAK,WAAW,CAAC,eAAe,EAAElB,WAAW,KAAK,iCAAiC,EAAE,aAAa,IAAI;QACrG,CAACA,WAAWA,SAAS,IAAI,GAAGd,MAAM,KAAK,GAAG,KAAK,QAACE,CAAAA,qBAAAA,MAAM,WAAW,AAAD,IAAhBA,qBAAqB,GAAI;MAC3E,EAAE8B,KAAK;IACT,EAAEF;AAEN"}
1
+ {"version":3,"file":"pickers/picker.jsx","sources":["../../src/pickers/picker.tsx"],"sourcesContent":["import { resolveRestingPlaceholder } from '../fields/outlined-field';\nimport './pickers.css';\nimport { type ReactNode, useRef } from '@lynx-js/react';\nimport { type G9SelectionItem, selectionKey } from '../base/selection-item';\nimport { useControllableState } from '../base/use-controllable-state';\nimport { useG9Settings } from '../provider/hooks';\nimport { showSelectionSheet } from '../selection/selection-sheet';\nimport { useG9Sheets } from '../sheet/service';\nimport { type G9PickerFieldProps, PickerField, SelectionValueIcon, usePickerOpen } from './trigger';\n\n/** Props of {@link G9Picker}. */\nexport interface G9PickerProps<T extends G9SelectionItem = G9SelectionItem> extends G9PickerFieldProps {\n /** The rows of the sheet (MAUI `ItemsSource`). Disabled items are left out except the selected one. */\n readonly items: ReadonlyArray<T>;\n /** Selected item key (`selectionKey`: key, else text); `null` = none. Controlled with `onValueChange`. */\n readonly value?: string | null;\n readonly defaultValue?: string | null;\n /** The selection changed: by a pick, or by `restoreOnCancel` putting back the opening value. */\n readonly onValueChange?: (key: string | null, item: T | null) => void;\n /** Sheet title; default the label, else the placeholder (MAUI `SheetTitle`). */\n readonly sheetTitle?: string | null;\n /**\n * Default true (MAUI `RestoreOnCancel`): a dismissed sheet puts back the value the picker had when it opened (if it\n * changed meanwhile) and reports `onSelectionCancelled`. False leaves the current value and reports nothing.\n */\n readonly restoreOnCancel?: boolean;\n /** A row was picked (MAUI `ItemSelected` + `SelectionAcceptedCommand`); only for a pick, never for a dismissal. */\n readonly onItemSelected?: (item: T) => void;\n /** The sheet was dismissed without a pick (MAUI `SelectionCancelled` + `SelectionCancelledCommand`). */\n readonly onSelectionCancelled?: () => void;\n}\n\n/**\n * Single selection from a list in an outlined box (MAUI `G9Picker`): a tap opens the selection sheet (no search; a\n * pick closes it), the box shows the item's icon or swatch and text, the trailing chevron hints at the sheet. Must\n * be inside a `G9Host` (the sheet).\n */\nexport function G9Picker<T extends G9SelectionItem = G9SelectionItem>(props: G9PickerProps<T>): ReactNode {\n const sheets = useG9Sheets();\n const glyphs = useG9Settings().glyphs;\n const open = usePickerOpen();\n const [key, setKey] = useControllableState<string | null, [T | null]>({\n value: props.value,\n defaultValue: props.defaultValue ?? null,\n onChange: props.onValueChange,\n name: 'G9Picker.value',\n });\n const latest = useRef({ props, key });\n latest.current = { props, key };\n const selected = key === null ? undefined : props.items.find((i) => selectionKey(i) === key);\n\n const onOpen = () =>\n open(async (isCurrent) => {\n const p = latest.current.props;\n const previousKey = latest.current.key;\n const previous = previousKey === null ? undefined : p.items.find((i) => selectionKey(i) === previousKey);\n const items = p.items.filter((i) => i.isEnabled !== false || i === previous);\n if (items.length === 0) return;\n const result = await showSelectionSheet(sheets, {\n title: p.sheetTitle?.trim() ? p.sheetTitle : (p.label ?? p.placeholder ?? ''),\n items,\n selectedItems: previous ? [previous] : [],\n allowMultiple: false,\n closeOnSingleSelection: true,\n showSearch: false,\n });\n if (!isCurrent()) return;\n const next = result.wasAccepted ? result.items[0] : undefined;\n const now = latest.current.props;\n if (next) {\n setKey(selectionKey(next), next);\n now.onItemSelected?.(next);\n } else if (now.restoreOnCancel !== false) {\n if (latest.current.key !== previousKey) setKey(previousKey, previous ?? null);\n now.onSelectionCancelled?.();\n }\n });\n\n return (\n <PickerField field={{ trailingIcon: glyphs.chevron, ...props }} hasValue={selected !== undefined} onOpen={onOpen}>\n {selected ? <SelectionValueIcon item={selected} /> : null}\n <text className={`g9-picker__text${selected ? '' : ' g9-picker__text--placeholder'}`} text-maxline=\"1\">\n {selected ? selected.text : (resolveRestingPlaceholder(props) ?? '')}\n </text>\n </PickerField>\n );\n}\n"],"names":["G9Picker","props","_props_defaultValue","_resolveRestingPlaceholder","sheets","useG9Sheets","glyphs","useG9Settings","open","usePickerOpen","key","setKey","useControllableState","latest","useRef","selected","undefined","i","selectionKey","onOpen","isCurrent","_ref","_p_sheetTitle","p","previousKey","previous","items","result","showSelectionSheet","next","now","PickerField","SelectionValueIcon","text"],"mappings":";;;;;;;;;AAqCO,SAASA,SAAsDC,KAAuB;QAM3EC,qBAuCmBC;IA5CnC,MAAMC,SAASC;IACf,MAAMC,SAASC,gBAAgB,MAAM;IACrC,MAAMC,OAAOC;IACb,MAAM,CAACC,KAAKC,OAAO,GAAGC,qBAAgD;QACpE,OAAOX,MAAM,KAAK;QAClB,cAAc,QAAAC,CAAAA,sBAAAA,MAAM,YAAY,AAAD,IAAjBA,sBAAsB;QACpC,UAAUD,MAAM,aAAa;QAC7B,MAAM;IACR;IACA,MAAMY,SAASC,OAAO;QAAEb;QAAOS;IAAI;IACnCG,OAAO,OAAO,GAAG;QAAEZ;QAAOS;IAAI;IAC9B,MAAMK,WAAWL,AAAQ,SAARA,MAAeM,SAAYf,MAAM,KAAK,CAAC,IAAI,CAAC,CAACgB,IAAMC,aAAaD,OAAOP;IAExF,MAAMS,SAAS,IACbX,KAAK,OAAOY;gBAOsCC,MAAAA;gBAAvCC;YANT,MAAMC,IAAIV,OAAO,OAAO,CAAC,KAAK;YAC9B,MAAMW,cAAcX,OAAO,OAAO,CAAC,GAAG;YACtC,MAAMY,WAAWD,AAAgB,SAAhBA,cAAuBR,SAAYO,EAAE,KAAK,CAAC,IAAI,CAAC,CAACN,IAAMC,aAAaD,OAAOO;YAC5F,MAAME,QAAQH,EAAE,KAAK,CAAC,MAAM,CAAC,CAACN,IAAMA,AAAgB,UAAhBA,EAAE,SAAS,IAAcA,MAAMQ;YACnE,IAAIC,AAAiB,MAAjBA,MAAM,MAAM,EAAQ;YACxB,MAAMC,SAAS,MAAMC,mBAAm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8B,KAAK;IACT,EAAEF;AAEN"}
@@ -50,6 +50,33 @@
50
50
  display: flex;
51
51
  }
52
52
 
53
+ .g9-combo__tonal {
54
+ border-style: solid;
55
+ border-width: 1px;
56
+ border-color: var(--g9-outline-variant);
57
+ background-color: var(--g9-surface-container-low);
58
+ border-radius: 17px;
59
+ flex-direction: row;
60
+ align-items: center;
61
+ column-gap: 8px;
62
+ height: 34px;
63
+ display: flex;
64
+ }
65
+
66
+ .g9-combo__tonal-text {
67
+ color: var(--g9-text-primary);
68
+ text-overflow: ellipsis;
69
+ font-size: 14px;
70
+ }
71
+
72
+ .g9-combo__tonal-close {
73
+ justify-content: center;
74
+ align-items: center;
75
+ width: 24px;
76
+ height: 24px;
77
+ display: flex;
78
+ }
79
+
53
80
  .g9-combo__chips {
54
81
  flex-direction: row;
55
82
  align-items: center;
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack://./src/pickers/pickers.css"],"names":[],"mappings":"AAAA;EACE,mBAAmB;EACnB,mBAAmB;EACnB,YAAY;EACZ,aAAa;AACf;;AAEA;EACE,6BAA6B;EAC7B,cAAc;EACd,eAAe;AACjB;;AAEA;EACE,8BAA8B;AAChC;;AAGA;EAAE,iBAAiB;AACnB;;AAGA;EAAE,gBAAgB;EAChB,eAAe;AACjB;;AAGA;EAAE,iBAAiB;EACjB,aAAa;AACf;;AAGA;EAAE,gBAAgB;EAChB,eAAe;AACjB;;AAGA;EAAE,iBAAiB;AACnB;;AAGA;EAAE,gBAAgB;EAChB,eAAe;AACjB;;AAGA;EAAE,mBAAmB;EACnB,mBAAmB;EACnB,YAAY;EACZ,aAAa;AACf;;AAGA;EAAE,mBAAmB;EACnB,mBAAmB;EACnB,aAAa;AACf;;AAGA;EAAE,mCAAmC;EACnC,kBAAkB;EAClB,mBAAmB;EACnB,mBAAmB;EACnB,YAAY;EACZ,iBAAiB;EACjB,iBAAiB;EACjB,kBAAkB;EAClB,aAAa;AACf;;AAGA;EAAE,gBAAgB;EAChB,eAAe;AACj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;AAClB","sourcesContent":[".g9-picker__value {\n display: flex;\n flex-direction: row;\n align-items: center;\n height: 100%;\n}\n\n.g9-picker__text {\n font-size: 15px;\n color: var(--g9-text-primary);\n flex-shrink: 1;\n}\n\n.g9-picker__text--placeholder {\n color: var(--g9-text-tertiary);\n}\n\n/* Gap after the swatch on the reading side (logical margins are dropped by the Lynx encoder, specs/02 §7). */\n.g9-picker__swatch {\n margin-right: 8px;\n}\n\n.g9-dir-rtl .g9-picker__swatch {\n margin-right: 0px;\n margin-left: 8px;\n}\n\n.g9-picker__icon {\n display: flex;\n margin-right: 8px;\n}\n\n.g9-dir-rtl .g9-picker__icon {\n margin-right: 0px;\n margin-left: 8px;\n}\n\n.g9-combo__chip .g9-picker__icon {\n margin-right: 6px;\n}\n\n.g9-dir-rtl .g9-combo__chip .g9-picker__icon {\n margin-right: 0px;\n margin-left: 6px;\n}\n\n.g9-combo__value {\n display: flex;\n flex-direction: row;\n align-items: center;\n height: 100%;\n}\n\n.g9-combo__chips {\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n\n.g9-combo__chip {\n display: flex;\n flex-direction: row;\n align-items: center;\n height: 28px;\n padding-left: 9px;\n padding-right: 9px;\n margin-right: 6px;\n border-radius: 6px;\n background-color: var(--g9-primary);\n}\n\n.g9-dir-rtl .g9-combo__chip {\n margin-right: 0px;\n margin-left: 6px;\n}\n\n.g9-combo__chip--more {\n background: var(--g9-surface-variant);\n border-width: 1px;\n border-style: solid;\n border-color: var(--g9-outline-variant);\n}\n\n.g9-combo__chip-text {\n font-size: 13px;\n font-weight: 700;\n color: var(--g9-on-primary);\n}\n\n.g9-combo__chip--more .g9-combo__chip-text {\n color: var(--g9-text-secondary);\n}\n\n.g9-picker-sheet {\n display: flex;\n flex-direction: column;\n padding-bottom: 10px;\n background-color: var(--g9-surface);\n}\n\n.g9-picker-sheet__header {\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 10px 16px;\n}\n\n.g9-picker-sheet__title {\n flex: 1;\n text-align: center;\n font-size: 15px;\n font-weight: 700;\n color: var(--g9-text-primary);\n}\n\n/* MAUI: the live preview 13 bold Primary, Padding (16, 4, 16, 8). */\n.g9-picker-sheet__preview {\n text-align: center;\n font-size: 13px;\n font-weight: 700;\n color: var(--g9-primary);\n padding: 4px 16px 8px 16px;\n}\n\n/* Colours inline (Primary at 8 % / 30 %). */\n.g9-picker-sheet__today {\n align-self: center;\n padding: 6px 12px;\n column-gap: 6px;\n border-radius: 16px;\n border-width: 1px;\n border-style: solid;\n display: flex;\n align-items: center;\n justify-content: center;\n margin: 2px 0px 6px 0px;\n}\n\n.g9-picker-sheet__today-text {\n font-size: 12px;\n font-weight: 700;\n color: var(--g9-primary);\n}\n\n.g9-picker-sheet__wheels {\n display: flex;\n flex-direction: row;\n padding-left: 8px;\n padding-right: 8px;\n}\n\n/* Mirrored explicitly; the row's own direction stays ltr so an engine that honours `direction` does not reverse it\n again (Lynxtron ignores `direction`, E22). */\n.g9-picker-sheet__wheels.g9-dir-rtl {\n direction: ltr;\n flex-direction: row-reverse;\n}\n\n.g9-wheel {\n flex: 1;\n display: flex;\n flex-direction: column;\n}\n\n/* MAUI DrumLabelFontSize 10, bold, TextTertiary. */\n.g9-wheel__label {\n text-align: center;\n font-size: 10px;\n font-weight: 700;\n color: var(--g9-text-tertiary);\n margin-bottom: 4px;\n}\n\n.g9-wheel__viewport {\n position: relative;\n overflow: hidden;\n}\n\n/* Colours set inline from the palette (Primary at 6 % / 55 %): CSS cannot take an alpha off a colour variable. */\n.g9-wheel__band {\n position: absolute;\n left: 8px;\n right: 8px;\n border-radius: 12px;\n border-width: 1.2px;\n border-style: solid;\n}\n\n.g9-wheel__fade {\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n}\n\n.g9-wheel__row {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n/* MAUI G9DrumColumn.Apply: 16 TextTertiary; the selected row 17 bold TextPrimary. */\n.g9-wheel__text {\n font-size: 16px;\n color: var(--g9-text-tertiary);\n}\n\n.g9-wheel__row--selected .g9-wheel__text {\n font-size: 17px;\n color: var(--g9-text-primary);\n font-weight: 700;\n}\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack://./src/pickers/pickers.css"],"names":[],"mappings":"AAAA;EACE,mBAAmB;EACnB,mBAAmB;EACnB,YAAY;EACZ,aAAa;AACf;;AAEA;EACE,6BAA6B;EAC7B,cAAc;EACd,eAAe;AACjB;;AAEA;EACE,8BAA8B;AAChC;;AAGA;EAAE,iBAAiB;AACnB;;AAGA;EAAE,gBAAgB;EAChB,eAAe;AACjB;;AAGA;EAAE,iBAAiB;EACjB,aAAa;AACf;;AAGA;EAAE,gBAAgB;EAChB,eAAe;AACjB;;AAGA;EAAE,iBAAiB;AACnB;;AAGA;EAAE,gBAAgB;EAChB,eAAe;AACjB;;AAGA;EAAE,mBAAmB;EACnB,mBAAmB;EACnB,YAAY;EACZ,aAAa;AACf;;AAIA;EADE,mBAAmB;EACnB,iBAAiB;EACjB,uCAAuC;EACvC,iDAAiD;EACjD,mBAAmB;EACnB,mBAAmB;EACnB,mBAAmB;EACnB,eAAe;EACf,YAAY;EACZ,aAAa;AACf;;AAIA;EADE,6BAA6B;EAC7B,uBAAuB;EACvB,eAAe;AACjB;;AAIA;EADE,uBAAuB;EACvB,mBAAmB;EACnB,WAAW;EACX,YAAY;EACZ,aAAa;AACf;;AAIA;EADE,mBAAmB;EACnB,mBAAmB;EACnB,aAAa;AACf;;AAIA;EADE,mCAAmC;EACnC,kBAAkB;EAClB,mBAAmB;EACnB,mBAAmB;EACnB,YAAY;EACZ,iBAAiB;EACjB,iBAAiB;EACjB,kBAAkB;EAClB,aAAa;AACf;;AAIA;EADE,gBAAgB;EAChB,eAAe;AACjB;;AAIA;EADE,qCAAqC;EACrC,mBAAmB;EACnB,iBAAiB;EACjB,uCAAuC;AACzC;;AAIA;EADE,2BAA2B;EAC3B,eAAe;EACf,gBAAgB;AAClB;;AAIA;EADE,+BAA+B;AACjC;;AAIA;EADE,mCAAmC;EACnC,sBAAsB;EACtB,oBAAoB;EACpB,aAAa;AACf;;AAIA;EADE,mBAAmB;EACnB,mBAAmB;EACnB,kBAAkB;EAClB,aAAa;AACf;;AAIA;EADE,kBAAkB;EAClB,6BAA6B;EAC7B,OAAO;EACP,eAAe;EACf,gBAAgB;AAClB;;AAKA;EAFE,kBAAkB;EAClB,wBAAwB;EACxB,qBAAqB;EACrB,eAAe;EACf,gBAAgB;AAClB;;AAMA;EAHE,mBAAmB;EACnB,iBAAiB;EACjB,mBAAmB;EACnB,uBAAuB;EACvB,kBAAkB;EAClB,mBAAmB;EACnB,eAAe;EACf,iBAAiB;EACjB,iBAAiB;EACjB,aAAa;AACf;;AAMA;EAHE,wBAAwB;EACxB,eAAe;EACf,gBAAgB;AAClB;;AAMA;EAHE,mBAAmB;EACnB,iBAAiB;EACjB,kBAAkB;EAClB,aAAa;AACf;;AAQA;EALE,cAAc;EACd,2BAA2B;AAC7B;;AAQA;EALE,sBAAsB;EACtB,OAAO;EACP,aAAa;AACf;;AASA;EANE,kBAAkB;EAClB,8BAA8B;EAC9B,kBAAkB;EAClB,eAAe;EACf,gBAAgB;AAClB;;AASA;EANE,kBAAkB;EAClB,gBAAgB;AAClB;;AAUA;EAPE,mBAAmB;EACnB,mBAAmB;EACnB,mBAAmB;EACnB,kBAAkB;EAClB,SAAS;EACT,UAAU;AACZ;;AAUA;EAPE,kBAAkB;EAClB,MAAM;EACN,SAAS;EACT,OAAO;EACP,QAAQ;AACV;;AAUA;EAPE,uBAAuB;EACvB,mBAAmB;EACnB,aAAa;AACf;;AAWA;EARE,8BAA8B;EAC9B,eAAe;AACjB;;AAWA;EARE,6BAA6B;EAC7B,eAAe;EACf,gBAAgB;AAClB","sourcesContent":[".g9-picker__value {\n display: flex;\n flex-direction: row;\n align-items: center;\n height: 100%;\n}\n\n.g9-picker__text {\n font-size: 15px;\n color: var(--g9-text-primary);\n flex-shrink: 1;\n}\n\n.g9-picker__text--placeholder {\n color: var(--g9-text-tertiary);\n}\n\n/* Gap after the swatch on the reading side (logical margins are dropped by the Lynx encoder, specs/02 §7). */\n.g9-picker__swatch {\n margin-right: 8px;\n}\n\n.g9-dir-rtl .g9-picker__swatch {\n margin-right: 0px;\n margin-left: 8px;\n}\n\n.g9-picker__icon {\n display: flex;\n margin-right: 8px;\n}\n\n.g9-dir-rtl .g9-picker__icon {\n margin-right: 0px;\n margin-left: 8px;\n}\n\n.g9-combo__chip .g9-picker__icon {\n margin-right: 6px;\n}\n\n.g9-dir-rtl .g9-combo__chip .g9-picker__icon {\n margin-right: 0px;\n margin-left: 6px;\n}\n\n.g9-combo__value {\n display: flex;\n flex-direction: row;\n align-items: center;\n height: 100%;\n}\n\n/* MAUI 1.4.10 ChipStyle.Tonal: a light pill per chosen item with its own close mark. */\n.g9-combo__tonal {\n display: flex;\n flex-direction: row;\n align-items: center;\n column-gap: 8px;\n height: 34px;\n border-radius: 17px;\n border-width: 1px;\n border-style: solid;\n border-color: var(--g9-outline-variant);\n background-color: var(--g9-surface-container-low);\n}\n\n.g9-combo__tonal-text {\n font-size: 14px;\n color: var(--g9-text-primary);\n text-overflow: ellipsis;\n}\n\n.g9-combo__tonal-close {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n}\n\n.g9-combo__chips {\n display: flex;\n flex-direction: row;\n align-items: center;\n}\n\n.g9-combo__chip {\n display: flex;\n flex-direction: row;\n align-items: center;\n height: 28px;\n padding-left: 9px;\n padding-right: 9px;\n margin-right: 6px;\n border-radius: 6px;\n background-color: var(--g9-primary);\n}\n\n.g9-dir-rtl .g9-combo__chip {\n margin-right: 0px;\n margin-left: 6px;\n}\n\n.g9-combo__chip--more {\n background: var(--g9-surface-variant);\n border-width: 1px;\n border-style: solid;\n border-color: var(--g9-outline-variant);\n}\n\n.g9-combo__chip-text {\n font-size: 13px;\n font-weight: 700;\n color: var(--g9-on-primary);\n}\n\n.g9-combo__chip--more .g9-combo__chip-text {\n color: var(--g9-text-secondary);\n}\n\n.g9-picker-sheet {\n display: flex;\n flex-direction: column;\n padding-bottom: 10px;\n background-color: var(--g9-surface);\n}\n\n.g9-picker-sheet__header {\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 10px 16px;\n}\n\n.g9-picker-sheet__title {\n flex: 1;\n text-align: center;\n font-size: 15px;\n font-weight: 700;\n color: var(--g9-text-primary);\n}\n\n/* MAUI: the live preview 13 bold Primary, Padding (16, 4, 16, 8). */\n.g9-picker-sheet__preview {\n text-align: center;\n font-size: 13px;\n font-weight: 700;\n color: var(--g9-primary);\n padding: 4px 16px 8px 16px;\n}\n\n/* Colours inline (Primary at 8 % / 30 %). */\n.g9-picker-sheet__today {\n align-self: center;\n padding: 6px 12px;\n column-gap: 6px;\n border-radius: 16px;\n border-width: 1px;\n border-style: solid;\n display: flex;\n align-items: center;\n justify-content: center;\n margin: 2px 0px 6px 0px;\n}\n\n.g9-picker-sheet__today-text {\n font-size: 12px;\n font-weight: 700;\n color: var(--g9-primary);\n}\n\n.g9-picker-sheet__wheels {\n display: flex;\n flex-direction: row;\n padding-left: 8px;\n padding-right: 8px;\n}\n\n/* Mirrored explicitly; the row's own direction stays ltr so an engine that honours `direction` does not reverse it\n again (Lynxtron ignores `direction`, E22). */\n.g9-picker-sheet__wheels.g9-dir-rtl {\n direction: ltr;\n flex-direction: row-reverse;\n}\n\n.g9-wheel {\n flex: 1;\n display: flex;\n flex-direction: column;\n}\n\n/* MAUI DrumLabelFontSize 10, bold, TextTertiary. */\n.g9-wheel__label {\n text-align: center;\n font-size: 10px;\n font-weight: 700;\n color: var(--g9-text-tertiary);\n margin-bottom: 4px;\n}\n\n.g9-wheel__viewport {\n position: relative;\n overflow: hidden;\n}\n\n/* Colours set inline from the palette (Primary at 6 % / 55 %): CSS cannot take an alpha off a colour variable. */\n.g9-wheel__band {\n position: absolute;\n left: 8px;\n right: 8px;\n border-radius: 12px;\n border-width: 1.2px;\n border-style: solid;\n}\n\n.g9-wheel__fade {\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n}\n\n.g9-wheel__row {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n/* MAUI G9DrumColumn.Apply: 16 TextTertiary; the selected row 17 bold TextPrimary. */\n.g9-wheel__text {\n font-size: 16px;\n color: var(--g9-text-tertiary);\n}\n\n.g9-wheel__row--selected .g9-wheel__text {\n font-size: 17px;\n color: var(--g9-text-primary);\n font-weight: 700;\n}\n"],"sourceRoot":""}
@@ -1 +1 @@
1
- {"version":3,"file":"timespan-picker.d.ts","sourceRoot":"","sources":["../../src/pickers/timespan-picker.tsx"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,SAAS,EAA+B,MAAM,+BAA+B,CAAC;AAC5F,OAAO,EAAE,KAAK,SAAS,EAAoB,MAAM,gBAAgB,CAAC;AAMlE,OAAO,EAIL,oBAAoB,EAKrB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,KAAK,kBAAkB,EAA8B,MAAM,WAAW,CAAC;AAGhF,yCAAyC;AACzC,MAAM,WAAW,qBAAsB,SAAQ,kBAAkB;IAC/D,0GAA0G;IAC1G,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACrD,qDAAqD;IACrD,QAAQ,CAAC,IAAI,CAAC,EAAE,oBAAoB,CAAC;IACrC,qFAAqF;IACrF,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,2DAA2D;IAC3D,QAAQ,CAAC,kBAAkB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACpD;AAQD,yGAAyG;AACzG,wBAAgB,iBAAiB,CAAC,KAAK,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D;IAC3D,QAAQ,CAAC,kBAAkB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACpD;AAQD,yGAAyG;AACzG,wBAAgB,iBAAiB,CAAC,KAAK,EAAE;IACvC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,oBAAoB,CAAC;IACpC,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;IAC5B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,QAAQ,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC;CAC7B,GAAG,SAAS,CAoEZ;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,SAAS,CA2CxE"}
@@ -1,3 +1,4 @@
1
+ import { resolveRestingPlaceholder } from "../fields/outlined-field.jsx";
1
2
  import "./pickers.css";
2
3
  import { G9StringKey, toNativeDigits } from "@g9tm/lynxcontrols-foundation";
3
4
  import { useRef, useState } from "@lynx-js/react";
@@ -52,7 +53,7 @@ function TimeSpanSheetBody(props) {
52
53
  </view>;
53
54
  }
54
55
  function G9TimeSpanPicker(props) {
55
- var _props_mode, _props_defaultValue, _props_placeholder;
56
+ var _props_mode, _props_defaultValue, _resolveRestingPlaceholder;
56
57
  const sheets = useG9Sheets();
57
58
  const culture = useG9Culture();
58
59
  const strings = useG9Strings();
@@ -90,7 +91,7 @@ function G9TimeSpanPicker(props) {
90
91
  ...props
91
92
  }} hasValue={null !== value} onOpen={onOpen}>
92
93
  <text className={`g9-picker__text${null !== value ? '' : ' g9-picker__text--placeholder'}`} text-maxline="1">
93
- {null !== value ? formatTimeSpan(value, mode, strings, culture) : props.label ? '' : null != (_props_placeholder = props.placeholder) ? _props_placeholder : ''}
94
+ {null !== value ? formatTimeSpan(value, mode, strings, culture) : null != (_resolveRestingPlaceholder = resolveRestingPlaceholder(props)) ? _resolveRestingPlaceholder : ''}
94
95
  </text>
95
96
  </PickerField>;
96
97
  }
@@ -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,IA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AACR,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,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,e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AK;YAC9B,MAAMuC,QAAQH,AAAAA,SAAAA,CAAAA,WAAAA,EAAE,KAAK,AAAD,IAANA,KAAAA,IAAAA,SAAS,IAAI,EAAC,IAAIE,EAAE,KAAK,GAAG9C,QAAQ,GAAG,CAACgB,YAAY,cAAc;YAChF,MAAMgC,SAAS,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 { G9SelectionItem } from '../base/selection-item.js';
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,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC9D,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,EAA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AAK,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"}
@@ -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"/>;