@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.
- package/dist/.tsbuildinfo +1 -1
- package/dist/base/index.d.ts +1 -1
- package/dist/base/index.d.ts.map +1 -1
- package/dist/base/index.jsx +1 -1
- package/dist/base/selection-item.d.ts +9 -1
- package/dist/base/selection-item.d.ts.map +1 -1
- package/dist/base/selection-item.jsx +10 -1
- package/dist/base/selection-item.jsx.map +1 -1
- package/dist/button/button.css +20 -0
- package/dist/button/button.css.map +1 -1
- package/dist/button/header-action-button.d.ts +5 -0
- package/dist/button/header-action-button.d.ts.map +1 -1
- package/dist/button/header-action-button.jsx +6 -1
- package/dist/button/header-action-button.jsx.map +1 -1
- package/dist/button/visuals.d.ts.map +1 -1
- package/dist/button/visuals.jsx +1 -1
- package/dist/button/visuals.jsx.map +1 -1
- package/dist/fields/editor.d.ts.map +1 -1
- package/dist/fields/editor.jsx +2 -2
- package/dist/fields/editor.jsx.map +1 -1
- package/dist/fields/fields.css +21 -0
- package/dist/fields/fields.css.map +1 -1
- package/dist/fields/index.d.ts +1 -1
- package/dist/fields/index.d.ts.map +1 -1
- package/dist/fields/index.jsx +1 -1
- package/dist/fields/outlined-field.d.ts +27 -1
- package/dist/fields/outlined-field.d.ts.map +1 -1
- package/dist/fields/outlined-field.jsx +29 -2
- package/dist/fields/outlined-field.jsx.map +1 -1
- package/dist/fields/text-entry.d.ts.map +1 -1
- package/dist/fields/text-entry.jsx +2 -2
- package/dist/fields/text-entry.jsx.map +1 -1
- package/dist/pickers/combo-box.d.ts +8 -0
- package/dist/pickers/combo-box.d.ts.map +1 -1
- package/dist/pickers/combo-box.jsx +51 -9
- package/dist/pickers/combo-box.jsx.map +1 -1
- package/dist/pickers/date-time-picker.d.ts +2 -2
- package/dist/pickers/date-time-picker.d.ts.map +1 -1
- package/dist/pickers/date-time-picker.jsx +4 -3
- package/dist/pickers/date-time-picker.jsx.map +1 -1
- package/dist/pickers/date-time.d.ts +5 -2
- package/dist/pickers/date-time.d.ts.map +1 -1
- package/dist/pickers/date-time.jsx +1 -1
- package/dist/pickers/date-time.jsx.map +1 -1
- package/dist/pickers/picker-sheet.d.ts +6 -2
- package/dist/pickers/picker-sheet.d.ts.map +1 -1
- package/dist/pickers/picker-sheet.jsx +2 -3
- package/dist/pickers/picker-sheet.jsx.map +1 -1
- package/dist/pickers/picker.d.ts.map +1 -1
- package/dist/pickers/picker.jsx +3 -2
- package/dist/pickers/picker.jsx.map +1 -1
- package/dist/pickers/pickers.css +27 -0
- package/dist/pickers/pickers.css.map +1 -1
- package/dist/pickers/timespan-picker.d.ts.map +1 -1
- package/dist/pickers/timespan-picker.jsx +3 -2
- package/dist/pickers/timespan-picker.jsx.map +1 -1
- package/dist/pickers/trigger.d.ts +3 -1
- package/dist/pickers/trigger.d.ts.map +1 -1
- package/dist/pickers/trigger.jsx +6 -1
- package/dist/pickers/trigger.jsx.map +1 -1
- package/dist/provider/settings.d.ts +12 -0
- package/dist/provider/settings.d.ts.map +1 -1
- package/dist/provider/settings.jsx +6 -3
- package/dist/provider/settings.jsx.map +1 -1
- package/dist/provider/theme.css +4 -0
- package/dist/provider/theme.css.map +1 -1
- package/dist/range-slider/math.d.ts +14 -4
- package/dist/range-slider/math.d.ts.map +1 -1
- package/dist/range-slider/math.jsx +16 -4
- package/dist/range-slider/math.jsx.map +1 -1
- package/dist/range-slider/range-slider.css +17 -0
- package/dist/range-slider/range-slider.css.map +1 -1
- package/dist/range-slider/range-slider.d.ts +11 -0
- package/dist/range-slider/range-slider.d.ts.map +1 -1
- package/dist/range-slider/range-slider.jsx +35 -13
- package/dist/range-slider/range-slider.jsx.map +1 -1
- package/dist/selection/index.d.ts +2 -1
- package/dist/selection/index.d.ts.map +1 -1
- package/dist/selection/index.jsx +2 -1
- package/dist/selection/selection-sheet.d.ts +3 -1
- package/dist/selection/selection-sheet.d.ts.map +1 -1
- package/dist/selection/selection-sheet.jsx +57 -8
- package/dist/selection/selection-sheet.jsx.map +1 -1
- package/dist/selection/selection.css +7 -0
- package/dist/selection/selection.css.map +1 -1
- package/dist/selection/window.d.ts +29 -0
- package/dist/selection/window.d.ts.map +1 -0
- package/dist/selection/window.jsx +24 -0
- package/dist/selection/window.jsx.map +1 -0
- package/dist/sheet/frame.d.ts.map +1 -1
- package/dist/sheet/frame.jsx +8 -4
- package/dist/sheet/frame.jsx.map +1 -1
- package/dist/sheet/header.d.ts.map +1 -1
- package/dist/sheet/header.jsx +3 -1
- package/dist/sheet/header.jsx.map +1 -1
- package/dist/sheet/index.d.ts +1 -1
- package/dist/sheet/index.d.ts.map +1 -1
- package/dist/sheet/index.jsx +1 -1
- package/dist/sheet/options.d.ts +20 -0
- package/dist/sheet/options.d.ts.map +1 -1
- package/dist/sheet/options.jsx +2 -1
- package/dist/sheet/options.jsx.map +1 -1
- package/dist/sheet/service.d.ts +8 -0
- package/dist/sheet/service.d.ts.map +1 -1
- package/dist/sheet/service.jsx +15 -4
- package/dist/sheet/service.jsx.map +1 -1
- package/dist/sheet/sizing.d.ts +2 -0
- package/dist/sheet/sizing.d.ts.map +1 -1
- package/dist/sheet/sizing.jsx +2 -1
- package/dist/sheet/sizing.jsx.map +1 -1
- package/dist/toggle/chip-group.d.ts +9 -1
- package/dist/toggle/chip-group.d.ts.map +1 -1
- package/dist/toggle/chip-group.jsx +51 -12
- package/dist/toggle/chip-group.jsx.map +1 -1
- package/dist/toggle/switch.d.ts +1 -1
- package/dist/toggle/switch.d.ts.map +1 -1
- package/dist/toggle/switch.jsx +3 -2
- package/dist/toggle/switch.jsx.map +1 -1
- package/dist/toggle/toggle.css +20 -0
- package/dist/toggle/toggle.css.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fields/outlined-field.jsx","sources":["../../src/fields/outlined-field.tsx"],"sourcesContent":["import './fields.css';\nimport { G9FilledValueHighlight, type G9ImageSource, G9Metrics } from '@g9tm/lynxcontrols-foundation';\nimport { type ReactNode, useState } from '@lynx-js/react';\nimport { g9IdProps, g9RowStyle } from '../base/control';\nimport { g9KeyboardTargetProps } from '../host/keyboard';\nimport type { G9IconInput } from '../icon/icon';\nimport { G9IconSlot, hasIconSlot } from '../icon/slot';\nimport { useG9Direction, useG9Settings } from '../provider/hooks';\nimport { type G9PhysicalPadding, resolveFieldSlotLayout } from './slot-layout';\n\n// MAUI `G9OutlinedFieldBase` (Controls/Shared/G9OutlinedFieldBase.cs) as composition (plan/specs/03 §5): the\n// props every outlined input shares, a pure state resolver, `useOutlinedField`, and the `<G9OutlinedField>` frame the\n// inputs put their element into.\n\n/** Props every outlined field shares (the public members of MAUI `G9OutlinedFieldBase`). */\nexport interface G9OutlinedFieldProps {\n /**\n * Element `id` of the field root (MAUI `AutomationId`; automation taps its bounds to focus it). Used verbatim: keep\n * it to `[A-Za-z0-9_-]`.\n */\n readonly id?: string;\n /** Floating label. Without it the placeholder is the label (MAUI `Label ?? Placeholder`). */\n readonly label?: string | null;\n /** Placeholder; shown as the label when `label` is not set. */\n readonly placeholder?: string | null;\n /** Helper line under the field; replaced by `errorText` while the field has an error. */\n readonly helperText?: string | null;\n /** Error message, shown (in the error colour) while `hasError`. */\n readonly errorText?: string | null;\n /** Error state: error outline, label and helper colour. Validation can also set it (`validate()`). Default false. */\n readonly hasError?: boolean;\n /** Keep the label floated even when empty and unfocused. Default false. */\n readonly alwaysFloat?: boolean;\n /** Value visible and selectable but not editable (MAUI `IsReadOnly`). Default false. */\n readonly readOnly?: boolean;\n /** Not interactive and dimmed (MAUI `IsEnabled = false`). Default false. */\n readonly disabled?: boolean;\n /** Maximum characters; `-1` (default) or `0` means unlimited. */\n readonly maxLength?: number;\n /** Show the `n / max` counter (only when `maxLength > 0`). Default false. */\n readonly showCharacterCounter?: boolean;\n /** Status colour (any CSS colour or `g9Token(...)`); used while `useStatusColor`. Default the primary colour. */\n readonly statusColor?: string | null;\n /** Draw the outline in `statusColor` (emphasised) whatever the focus. Default false. */\n readonly useStatusColor?: boolean;\n /** Soft inner halo while focused (no error, no status colour). Default false. */\n readonly showFocusHalo?: boolean;\n /** Filled-value accent of this field; `'inherit'` (default) takes `settings.fields.highlightFilledValue`. */\n readonly filledValueHighlight?: G9FilledValueHighlight;\n readonly leadingEmoji?: string | null;\n readonly leadingIcon?: G9IconInput;\n readonly leadingImagePath?: string | null;\n readonly leadingImage?: G9ImageSource | null;\n readonly trailingEmoji?: string | null;\n readonly trailingIcon?: G9IconInput;\n readonly trailingImagePath?: string | null;\n readonly trailingImage?: G9ImageSource | null;\n /** Spinner in the trailing slot (wins over every trailing icon). Default false. */\n readonly isTrailingBusy?: boolean;\n /** Keep the trailing icon on the physical right in RTL too. Default false. */\n readonly forceTrailingIconRight?: boolean;\n /** Keep the leading icon on the physical left in RTL too. Default false. */\n readonly forceLeadingIconLeft?: boolean;\n /** Box height; `0` (default) uses `G9Metrics.ControlHeight` (52). */\n readonly fieldHeight?: number;\n /** Reserve the floated label's overhang above the box (MAUI `FloatingLabelClearance`, 6). Default false. */\n readonly reserveFloatingLabelClearance?: boolean;\n /** Leading icon tap (MAUI `LeadingCommand` + `CommandParameter`). Makes the icon actionable. */\n readonly onLeadingPress?: () => void;\n /** Trailing icon tap when no built-in affordance claims it (MAUI `TrailingCommand`). */\n readonly onTrailingPress?: () => void;\n /** Extra padding of the inner content (MAUI `InnerContentPadding`), physical sides. */\n readonly innerContentPadding?: Partial<G9PhysicalPadding>;\n /** Class of the root element. */\n readonly className?: string;\n}\n\n/** What {@link resolveOutlinedFieldState} needs besides the props. */\nexport interface G9OutlinedFieldStateInput {\n readonly focused: boolean;\n readonly hasValue: boolean;\n /** A value the field shows without text (a picker's selection): floats the label like a value. */\n readonly valueFloated?: boolean;\n /** App-wide filled-value accent (`settings.fields.highlightFilledValue`). */\n readonly highlightFilledValue: boolean;\n /** Characters of the value, for the counter. */\n readonly textLength: number;\n /** Resting chrome tone: `'outline'` (default) or `'placeholder'` (search). */\n readonly restingTone?: 'outline' | 'placeholder';\n}\n\n/** The resolved look of an outlined field (colours are CSS colour values). */\nexport interface G9OutlinedFieldState {\n readonly floated: boolean;\n /** Outline, floated label and trailing icon colour. */\n readonly stateColor: string;\n readonly labelColor: string;\n /** Leading icon and resting label colour. */\n readonly restingContentColor: string;\n readonly labelText: string;\n /** Helper line text (`errorText` while in error), `''` when hidden. */\n readonly helperText: string;\n readonly helperColor: string;\n /** Counter text (`'n / max'`), `''` when hidden. */\n readonly counterText: string;\n readonly footerVisible: boolean;\n readonly strokeWidth: number;\n /** Focus halo thickness, 0 when off. */\n readonly haloWidth: number;\n readonly fieldHeight: number;\n}\n\nconst v = (token: string): string => `var(--g9-${token})`;\n\n/**\n * Resolves the field's state colours and footer (MAUI `ResolveStateColor`, `ResolveFloatingLabelColor`, the footer\n * part of `Refresh`). Precedence: error > status colour > focus > accented filled value > resting.\n */\nexport function resolveOutlinedFieldState(\n props: G9OutlinedFieldProps,\n input: G9OutlinedFieldStateInput,\n): G9OutlinedFieldState {\n const hasError = props.hasError === true;\n const useStatus = props.useStatusColor === true;\n const filled = input.hasValue || input.valueFloated === true;\n const highlight = props.filledValueHighlight ?? G9FilledValueHighlight.Inherit;\n const accentFilled =\n highlight === G9FilledValueHighlight.Accent\n ? true\n : highlight === G9FilledValueHighlight.Neutral\n ? false\n : input.highlightFilledValue;\n const placeholderTone = input.restingTone === 'placeholder';\n const restingOutline = placeholderTone ? v('input-placeholder') : v('outline');\n const restingContentColor = placeholderTone ? v('input-placeholder') : v('text-tertiary');\n let stateColor: string;\n if (hasError) stateColor = v('error');\n else if (useStatus) stateColor = props.statusColor ?? v('primary');\n else if (input.focused) stateColor = v('primary');\n else stateColor = filled && accentFilled ? v('primary') : restingOutline;\n\n const floated = props.alwaysFloat === true || input.valueFloated === true || input.focused || input.hasValue;\n const neutralFilledRest = filled && !input.focused && !hasError && !useStatus && !accentFilled;\n const labelColor = floated && !neutralFilledRest ? stateColor : restingContentColor;\n\n const helperRaw = hasError ? (props.errorText ?? '') : (props.helperText ?? '');\n const helperText = helperRaw.trim() === '' ? '' : helperRaw;\n const maxLength = props.maxLength ?? -1;\n const counterText = props.showCharacterCounter === true && maxLength > 0 ? `${input.textLength} / ${maxLength}` : '';\n const emphasis = input.focused || hasError || useStatus;\n const halo = props.showFocusHalo === true && input.focused && !hasError && !useStatus;\n const labelRaw = props.label ?? props.placeholder ?? '';\n return {\n floated,\n stateColor,\n labelColor,\n restingContentColor,\n labelText: labelRaw.trim() === '' ? '' : labelRaw,\n helperText,\n helperColor: hasError ? v('error') : v('text-tertiary'),\n counterText,\n footerVisible: helperText !== '' || counterText !== '',\n strokeWidth: emphasis ? G9Metrics.OutlinedFieldEmphasisStrokeThickness : G9Metrics.OutlinedFieldStrokeThickness,\n haloWidth: halo ? G9Metrics.OutlinedFieldFocusHaloThickness : 0,\n fieldHeight: props.fieldHeight && props.fieldHeight > 0 ? props.fieldHeight : G9Metrics.ControlHeight,\n };\n}\n\n/** {@link resolveOutlinedFieldState} with the app-wide settings read from the provider. */\nexport function useOutlinedField(\n props: G9OutlinedFieldProps,\n input: Omit<G9OutlinedFieldStateInput, 'highlightFilledValue'>,\n): G9OutlinedFieldState {\n const settings = useG9Settings();\n return resolveOutlinedFieldState(props, { ...input, highlightFilledValue: settings.fields.highlightFilledValue });\n}\n\n/** A built-in trailing affordance an input puts in the trailing slot (password eye, microphone, clear). */\nexport interface G9TrailingAffordance {\n /** What it shows. */\n readonly icon: G9IconInput;\n /** Icon colour; default the state colour. */\n readonly color?: string;\n /** Accessibility label. */\n readonly label?: string;\n /** Stable key (MAUI `ResolveTrailingIconSignature`): the slot is rebuilt only when it changes. */\n readonly signature: string;\n readonly onPress: () => void;\n}\n\n/** Props of {@link G9OutlinedField}: the shared props plus what the composing input supplies. */\nexport interface G9OutlinedFieldFrameProps extends G9OutlinedFieldProps {\n readonly focused: boolean;\n readonly hasValue: boolean;\n readonly valueFloated?: boolean;\n readonly textLength?: number;\n /** The input element (or any content) inside the box. */\n readonly children?: ReactNode;\n /** A built-in trailing affordance; replaces the trailing icon props (busy still wins). */\n readonly trailingAffordance?: G9TrailingAffordance | null;\n /** Tapping the box (outside the icons) focuses the content (MAUI `FocusTarget`). */\n readonly onFocusRequest?: () => void;\n /** Resting tone (`'placeholder'` for search, MAUI `ResolveRestingOutlineColor` override). */\n readonly restingTone?: 'outline' | 'placeholder';\n /** Vertical placement of the icons and the resting label: centred (entries) or top/bottom (editor). */\n readonly multiline?: boolean;\n /** Accessibility label of the box (defaults to the label text). */\n readonly accessibilityLabel?: string;\n}\n\nfunction physicalSide(column: 0 | 2): 'left' | 'right' {\n return column === 0 ? 'left' : 'right';\n}\n\n/**\n * The outlined field frame (MAUI `G9OutlinedFieldBase`): outline with a notched floating label, leading and\n * trailing icon slots, helper/error line and counter. Inputs (`G9TextEntry`, `G9Editor`, `G9SearchEntry`, the pickers)\n * put their element in `children`. Direction is set on the root from the culture (labels, icons, helper follow it;\n * the input decides its own text direction). A tap on an icon never focuses the content; a tap elsewhere on the box\n * calls `onFocusRequest`.\n *\n * Look: colours come from the theme variables (`--g9-primary`, `--g9-outline`, `--g9-error`, …). The floated label\n * sits on the outline with the background `--g9-field-notch-background` (default `--g9-background`; set it on a\n * container of another colour with `g9FieldNotchStyle`, G9 sheets and popups do), which hides the\n * outline under it.\n */\nexport function G9OutlinedField(props: G9OutlinedFieldFrameProps): ReactNode {\n const direction = useG9Direction();\n const isRtl = direction === 'rtl';\n const state = useOutlinedField(props, {\n focused: props.focused,\n hasValue: props.hasValue,\n valueFloated: props.valueFloated ?? false,\n textLength: props.textLength ?? 0,\n restingTone: props.restingTone ?? 'outline',\n });\n const leading = {\n emoji: props.leadingEmoji ?? null,\n icon: props.leadingIcon,\n imagePath: props.leadingImagePath ?? null,\n image: props.leadingImage ?? null,\n };\n const trailing = {\n emoji: props.trailingEmoji ?? null,\n icon: props.trailingIcon,\n imagePath: props.trailingImagePath ?? null,\n image: props.trailingImage ?? null,\n };\n const busy = props.isTrailingBusy === true;\n const affordance = props.trailingAffordance ?? null;\n const hasLeading = hasIconSlot(leading);\n const hasTrailing = busy || affordance !== null || hasIconSlot(trailing);\n const pad = props.innerContentPadding ?? {};\n const slot = resolveFieldSlotLayout(\n {\n hasLeadingIcon: hasLeading,\n hasTrailingIcon: hasTrailing,\n isRtl,\n forceTrailingIconRight: props.forceTrailingIconRight === true,\n forceLeadingIconLeft: props.forceLeadingIconLeft === true,\n },\n { left: pad.left ?? 0, top: pad.top ?? 0, right: pad.right ?? 0, bottom: pad.bottom ?? 0 },\n );\n const disabled = props.disabled === true;\n const leadingActionable = props.onLeadingPress !== undefined;\n const trailingActionable = affordance !== null || props.onTrailingPress !== undefined;\n const onLeadingTap = () => {\n if (disabled || !leadingActionable) return;\n props.onLeadingPress?.();\n };\n const onTrailingTap = () => {\n if (disabled || busy || !trailingActionable) return;\n if (affordance) affordance.onPress();\n else props.onTrailingPress?.();\n };\n const onBoxTap = () => {\n if (!disabled) props.onFocusRequest?.();\n };\n\n const multiline = props.multiline === true;\n const labelHeight = G9Metrics.FloatingLabelHeight;\n // MAUI rests the label in the middle of the box's MEASURED height (ResolveFieldHeight → _box.Height): an empty\n // editor of 110 dp shows «شرح» halfway down it, not on its first line. Before the first layout: the control height.\n const [boxHeight, setBoxHeight] = useState(0);\n const restTop =\n ((multiline && boxHeight > 8 ? boxHeight : multiline ? G9Metrics.ControlHeight : state.fieldHeight) - labelHeight) /\n 2;\n const labelX = slot.labelRestX + (state.floated ? slot.labelFloatedX : 0);\n const labelAnchor = isRtl ? 'right' : 'left';\n const iconSize = G9Metrics.InputIconSize;\n const slotStyle = (column: 0 | 2, width: number, bottomAligned: boolean) => ({\n [physicalSide(column)]: '0px',\n width: `${width}px`,\n ...(bottomAligned\n ? { bottom: '0px', height: `${G9Metrics.EditorTrailingSlotHeight}px` }\n : { top: '0px', bottom: '0px' }),\n });\n\n const trailingContent = busy ? (\n <view className=\"g9-field__busy\" style={{ borderColor: state.stateColor, borderTopColor: 'transparent' }} />\n ) : affordance ? (\n <G9IconSlot icon={affordance.icon} color={affordance.color ?? state.stateColor} size={iconSize} />\n ) : (\n <G9IconSlot {...trailing} color={state.stateColor} size={iconSize} />\n );\n\n return (\n <view\n className={`g9-field g9-dir-${direction}${disabled ? ' g9-field--disabled' : ''}${props.className ? ` ${props.className}` : ''}`}\n {...g9IdProps(props.id)}\n >\n <view\n {...g9KeyboardTargetProps}\n className={`g9-field__box${state.floated ? ' g9-field__box--floated' : ''}${props.focused ? ' g9-field__box--focused' : ''}`}\n accessibility-element={false}\n style={{\n height: multiline ? undefined : `${state.fieldHeight}px`,\n minHeight: multiline ? `${state.fieldHeight}px` : undefined,\n marginTop: props.reserveFloatingLabelClearance ? `${G9Metrics.FloatingLabelClearance}px` : '0px',\n }}\n bindtap={onBoxTap}\n {...(multiline\n ? {\n bindlayoutchange: (e: { detail?: { height?: number } }) => {\n const h = e.detail?.height ?? 0;\n if (Math.abs(h - boxHeight) > 0.5) setBoxHeight(h);\n },\n }\n : {})}\n >\n {/* The outline is its own view (MAUI paints it on a canvas): a stroke change never moves the content, and a\n disabled field dims it without an opacity layer on the box, which clipped the floated label on Android. */}\n <view\n className=\"g9-field__outline\"\n style={{\n borderColor: state.stateColor,\n borderWidth: `${state.strokeWidth}px`,\n borderRadius: `${G9Metrics.RadiusMd}px`,\n }}\n />\n {state.haloWidth > 0 ? (\n <view\n className=\"g9-field__halo\"\n style={{\n borderColor: state.stateColor,\n borderWidth: `${state.haloWidth}px`,\n opacity: G9Metrics.FocusRingOpacity,\n borderRadius: `${G9Metrics.RadiusMd}px`,\n }}\n />\n ) : null}\n <view\n className=\"g9-field__content\"\n style={{\n paddingLeft: `${slot.innerPadding.left + (hasLeading && slot.leadingColumn === 0 ? G9Metrics.LeadingIconSlotWidth : 0) + (hasTrailing && slot.trailingColumn === 0 ? G9Metrics.TrailingIconSlotWidth : 0)}px`,\n paddingRight: `${slot.innerPadding.right + (hasLeading && slot.leadingColumn === 2 ? G9Metrics.LeadingIconSlotWidth : 0) + (hasTrailing && slot.trailingColumn === 2 ? G9Metrics.TrailingIconSlotWidth : 0)}px`,\n paddingTop: `${slot.innerPadding.top}px`,\n paddingBottom: `${slot.innerPadding.bottom}px`,\n }}\n >\n {props.children}\n </view>\n {hasLeading ? (\n <view\n className=\"g9-field__slot g9-field__slot--leading\"\n style={slotStyle(slot.leadingColumn, G9Metrics.LeadingIconSlotWidth, false)}\n catchtap={onLeadingTap}\n {...(leadingActionable ? { 'accessibility-element': true, 'accessibility-traits': 'button' } : {})}\n >\n <G9IconSlot {...leading} color={state.restingContentColor} size={iconSize} />\n </view>\n ) : null}\n {hasTrailing ? (\n <view\n key={busy ? 'busy' : affordance ? affordance.signature : 'icon'}\n className=\"g9-field__slot g9-field__slot--trailing\"\n style={slotStyle(slot.trailingColumn, G9Metrics.TrailingIconSlotWidth, multiline && !busy)}\n catchtap={onTrailingTap}\n {...(trailingActionable\n ? {\n 'accessibility-element': true,\n 'accessibility-traits': 'button',\n ...(affordance?.label ? { 'accessibility-label': affordance.label } : {}),\n }\n : {})}\n >\n {trailingContent}\n </view>\n ) : null}\n {state.labelText ? (\n <text\n className={`g9-field__label${state.floated ? ' g9-field__label--floated' : ''}`}\n style={{\n [labelAnchor]: `${G9Metrics.InputHorizontalPadding}px`,\n top: `${state.floated ? G9Metrics.FloatingLabelFloatedY : restTop}px`,\n fontSize: `${state.floated ? G9Metrics.FloatingLabelFontSizeFloat : G9Metrics.FloatingLabelFontSizeRest}px`,\n color: disabled ? 'var(--g9-text-disabled)' : state.labelColor,\n transform: `translateX(${labelX}px)`,\n }}\n >\n {state.labelText}\n </text>\n ) : null}\n </view>\n {state.footerVisible ? (\n <view className=\"g9-field__footer\" style={g9RowStyle(direction)}>\n {state.helperText ? (\n <text\n className=\"g9-field__helper\"\n style={{ color: state.helperColor, textAlign: isRtl ? 'right' : 'left' }}\n >\n {state.helperText}\n </text>\n ) : (\n <view className=\"g9-field__helper\" />\n )}\n {/* RLM first in a right-to-left field: «0 / 4000» has no strong letter, so it would lay out left-to-right; MAUI's\n label inherits the RTL flow and reads «۴۰۰۰ / ۰». */}\n {state.counterText ? (\n <text className=\"g9-field__counter\">{`${isRtl ? '\\u200F' : ''}${state.counterText}`}</text>\n ) : null}\n </view>\n ) : null}\n </view>\n );\n}\n"],"names":["v","token","resolveOutlinedFieldState","props","input","_props_filledValueHighlight","_props_statusColor","_props_errorText","_props_helperText","_props_maxLength","_ref","hasError","useStatus","filled","highlight","G9FilledValueHighlight","accentFilled","placeholderTone","restingOutline","restingContentColor","stateColor","floated","neutralFilledRest","labelColor","helperRaw","helperText","maxLength","counterText","emphasis","halo","labelRaw","G9Metrics","useOutlinedField","settings","useG9Settings","physicalSide","column","G9OutlinedField","_props_valueFloated","_props_textLength","_props_restingTone","_props_leadingEmoji","_props_leadingImagePath","_props_leadingImage","_props_trailingEmoji","_props_trailingImagePath","_props_trailingImage","_props_trailingAffordance","_props_innerContentPadding","_pad_left","_pad_top","_pad_right","_pad_bottom","_affordance_color","direction","useG9Direction","isRtl","state","leading","trailing","busy","affordance","hasLeading","hasIconSlot","hasTrailing","pad","slot","resolveFieldSlotLayout","disabled","leadingActionable","undefined","trailingActionable","onLeadingTap","onTrailingTap","onBoxTap","multiline","labelHeight","boxHeight","setBoxHeight","useState","restTop","labelX","labelAnchor","iconSize","slotStyle","width","bottomAligned","trailingContent","view","G9IconSlot","g9IdProps","g9KeyboardTargetProps","e","_e_detail","h","Math","text","g9RowStyle"],"mappings":";;;;;;;;AAgHA,MAAMA,IAAI,CAACC,QAA0B,CAAC,SAAS,EAAEA,MAAM,CAAC,CAAC;AAMlD,SAASC,0BACdC,KAA2B,EAC3BC,KAAgC;QAKdC,6BAYeC,oBAQHC,kBAA0BC,mBAEtCC,kBAIDC,MAAAA;IA7BjB,MAAMC,WAAWR,AAAmB,SAAnBA,MAAM,QAAQ;IAC/B,MAAMS,YAAYT,AAAyB,SAAzBA,MAAM,cAAc;IACtC,MAAMU,SA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AAC;QAC3G,OAAOqC,WAAW,4BAA4BX,MAAM,UAAU;QAC9D,WAAW,CAAC,WAAW,EAAEwB,OAAO,GAAG,CAAC;IACtC,GACD;YACC,CAACxB,MAAM,SAAS,CAAC;UACnB,EAAEuC,QACA,KAAK;MACX,EAAER,KAAK;MACP,CAAC/B,MAAM,aAAa,IACjB+B,KAAK,UAAU,mBAAmB,OAAOS,WAAW3C,YAAY;UAC/D,CAACG,MAAM,UAAU,IACduC,KACC,UAAU,mBACV,OAAO;QAAE,OAAOvC,MAAM,WAAW;QAAE,WAAWD,QAAQ,UAAU;IAAO,GACxE;cACC,CAACC,MAAM,UAAU,CAAC;YACpB,EAAEuC,SAEDR,KAAK,UAAU,qBAChB;UACF,EACyD;UACzD,CAAC/B,MAAM,WAAW,IACfuC,KAAK,UAAU,qBAAqB,GAAGxC,QAAQ,WAAW,KAAKC,MAAM,WAAW,EAAE,GAAGuC,QACpF,KAAK;QACX,EAAER,QACA,KAAK;IACX,EAAEA;AAEN"}
|
|
1
|
+
{"version":3,"file":"fields/outlined-field.jsx","sources":["../../src/fields/outlined-field.tsx"],"sourcesContent":["import './fields.css';\nimport { G9FilledValueHighlight, type G9ImageSource, G9Metrics } from '@g9tm/lynxcontrols-foundation';\nimport { type ReactNode, useState } from '@lynx-js/react';\nimport { g9IdProps, g9RowStyle } from '../base/control';\nimport { g9KeyboardTargetProps } from '../host/keyboard';\nimport type { G9IconInput } from '../icon/icon';\nimport { G9IconSlot, hasIconSlot } from '../icon/slot';\nimport { useG9Direction, useG9Settings } from '../provider/hooks';\nimport { type G9PhysicalPadding, resolveFieldSlotLayout } from './slot-layout';\n\n// MAUI `G9OutlinedFieldBase` (Controls/Shared/G9OutlinedFieldBase.cs) as composition (plan/specs/03 §5): the\n// props every outlined input shares, a pure state resolver, `useOutlinedField`, and the `<G9OutlinedField>` frame the\n// inputs put their element into.\n\n/** Props every outlined field shares (the public members of MAUI `G9OutlinedFieldBase`). */\nexport interface G9OutlinedFieldProps {\n /**\n * Element `id` of the field root (MAUI `AutomationId`; automation taps its bounds to focus it). Used verbatim: keep\n * it to `[A-Za-z0-9_-]`.\n */\n readonly id?: string;\n /** Floating label. Without it the placeholder is the label (MAUI `Label ?? Placeholder`). */\n readonly label?: string | null;\n /** Placeholder; shown as the label when `label` is not set. */\n readonly placeholder?: string | null;\n /** Helper line under the field; replaced by `errorText` while the field has an error. */\n readonly helperText?: string | null;\n /** Error message, shown (in the error colour) while `hasError`. */\n readonly errorText?: string | null;\n /** Error state: error outline, label and helper colour. Validation can also set it (`validate()`). Default false. */\n readonly hasError?: boolean;\n /**\n * Keep the label floated even when empty and unfocused. Default false. With a `label` AND a `placeholder` the\n * placeholder is then drawn inside the empty box under the floated label (MAUI 1.4.9: «عنوان» floated with «عنوان کار\n * را وارد کنید» inside).\n */\n readonly alwaysFloat?: boolean;\n /**\n * The `placeholder` is the box's own hint (MAUI 1.4.9 `PlaceholderInside`): inside while the field is empty, gone with\n * a value, never lifted into the notch as a label — a chat composer's «یادداشت خود را بنویسید...». A `label`, if set,\n * still floats as usual. Default false: without a label the placeholder is the floating label's text.\n */\n readonly placeholderInside?: boolean;\n /** Value visible and selectable but not editable (MAUI `IsReadOnly`). Default false. */\n readonly readOnly?: boolean;\n /** Not interactive and dimmed (MAUI `IsEnabled = false`). Default false. */\n readonly disabled?: boolean;\n /** Maximum characters; `-1` (default) or `0` means unlimited. */\n readonly maxLength?: number;\n /** Show the `n / max` counter (only when `maxLength > 0`). Default false. */\n readonly showCharacterCounter?: boolean;\n /** Status colour (any CSS colour or `g9Token(...)`); used while `useStatusColor`. Default the primary colour. */\n readonly statusColor?: string | null;\n /** Draw the outline in `statusColor` (emphasised) whatever the focus. Default false. */\n readonly useStatusColor?: boolean;\n /** Soft inner halo while focused (no error, no status colour). Default false. */\n readonly showFocusHalo?: boolean;\n /** Filled-value accent of this field; `'inherit'` (default) takes `settings.fields.highlightFilledValue`. */\n readonly filledValueHighlight?: G9FilledValueHighlight;\n readonly leadingEmoji?: string | null;\n readonly leadingIcon?: G9IconInput;\n readonly leadingImagePath?: string | null;\n readonly leadingImage?: G9ImageSource | null;\n readonly trailingEmoji?: string | null;\n readonly trailingIcon?: G9IconInput;\n readonly trailingImagePath?: string | null;\n readonly trailingImage?: G9ImageSource | null;\n /** Spinner in the trailing slot (wins over every trailing icon). Default false. */\n readonly isTrailingBusy?: boolean;\n /** Keep the trailing icon on the physical right in RTL too. Default false. */\n readonly forceTrailingIconRight?: boolean;\n /** Keep the leading icon on the physical left in RTL too. Default false. */\n readonly forceLeadingIconLeft?: boolean;\n /** Box height; `0` (default) uses `G9Metrics.ControlHeight` (52). */\n readonly fieldHeight?: number;\n /** Reserve the floated label's overhang above the box (MAUI `FloatingLabelClearance`, 6). Default false. */\n readonly reserveFloatingLabelClearance?: boolean;\n /** Leading icon tap (MAUI `LeadingCommand` + `CommandParameter`). Makes the icon actionable. */\n readonly onLeadingPress?: () => void;\n /** Trailing icon tap when no built-in affordance claims it (MAUI `TrailingCommand`). */\n readonly onTrailingPress?: () => void;\n /** Extra padding of the inner content (MAUI `InnerContentPadding`), physical sides. */\n readonly innerContentPadding?: Partial<G9PhysicalPadding>;\n /** Class of the root element. */\n readonly className?: string;\n}\n\n/** What {@link resolveOutlinedFieldState} needs besides the props. */\nexport interface G9OutlinedFieldStateInput {\n readonly focused: boolean;\n readonly hasValue: boolean;\n /** A value the field shows without text (a picker's selection): floats the label like a value. */\n readonly valueFloated?: boolean;\n /** App-wide filled-value accent (`settings.fields.highlightFilledValue`). */\n readonly highlightFilledValue: boolean;\n /** Characters of the value, for the counter. */\n readonly textLength: number;\n /** Resting chrome tone: `'outline'` (default) or `'placeholder'` (search). */\n readonly restingTone?: 'outline' | 'placeholder';\n}\n\n/** The resolved look of an outlined field (colours are CSS colour values). */\nexport interface G9OutlinedFieldState {\n readonly floated: boolean;\n /** Outline, floated label and trailing icon colour. */\n readonly stateColor: string;\n readonly labelColor: string;\n /** Leading icon and resting label colour. */\n readonly restingContentColor: string;\n readonly labelText: string;\n /** Helper line text (`errorText` while in error), `''` when hidden. */\n readonly helperText: string;\n readonly helperColor: string;\n /** Counter text (`'n / max'`), `''` when hidden. */\n readonly counterText: string;\n readonly footerVisible: boolean;\n readonly strokeWidth: number;\n /** Focus halo thickness, 0 when off. */\n readonly haloWidth: number;\n readonly fieldHeight: number;\n}\n\nconst v = (token: string): string => `var(--g9-${token})`;\nconst blank = (s: string | null | undefined): boolean => s == null || s.trim() === '';\n\n/**\n * The hint a field draws INSIDE its box while it is empty, or `null` (MAUI 1.4.9 `RestingPlaceholder`). Without a `label`\n * (or with `placeholderInside`) it is the `placeholder`. With a label it is drawn only when `alwaysFloat` keeps the label\n * up in the notch — otherwise the resting label sits where the hint would be — and never when it repeats the label.\n */\nexport function resolveRestingPlaceholder(\n props: Pick<G9OutlinedFieldProps, 'label' | 'placeholder' | 'alwaysFloat' | 'placeholderInside'>,\n): string | null {\n if (blank(props.placeholder)) return null;\n const placeholder = props.placeholder as string;\n if (props.placeholderInside === true || blank(props.label)) return placeholder;\n return props.alwaysFloat === true && props.label !== placeholder ? placeholder : null;\n}\n\n/**\n * The hint a TEXT input draws itself (MAUI 1.4.9 `G9TextEntry` / `G9Editor`): only while the field owns it — a label is\n * set, or `placeholderInside` — since without a label the floating label already is the placeholder.\n */\nexport function resolveInnerHint(\n props: Pick<G9OutlinedFieldProps, 'label' | 'placeholder' | 'alwaysFloat' | 'placeholderInside'>,\n): string | null {\n const owns = props.placeholderInside === true || !blank(props.label);\n return owns ? resolveRestingPlaceholder(props) : null;\n}\n\n/**\n * Resolves the field's state colours and footer (MAUI `ResolveStateColor`, `ResolveFloatingLabelColor`, the footer\n * part of `Refresh`). Precedence: error > status colour > focus > accented filled value > resting.\n */\nexport function resolveOutlinedFieldState(\n props: G9OutlinedFieldProps,\n input: G9OutlinedFieldStateInput,\n): G9OutlinedFieldState {\n const hasError = props.hasError === true;\n const useStatus = props.useStatusColor === true;\n const filled = input.hasValue || input.valueFloated === true;\n const highlight = props.filledValueHighlight ?? G9FilledValueHighlight.Inherit;\n const accentFilled =\n highlight === G9FilledValueHighlight.Accent\n ? true\n : highlight === G9FilledValueHighlight.Neutral\n ? false\n : input.highlightFilledValue;\n const placeholderTone = input.restingTone === 'placeholder';\n const restingOutline = placeholderTone ? v('input-placeholder') : v('outline');\n const restingContentColor = placeholderTone ? v('input-placeholder') : v('text-tertiary');\n let stateColor: string;\n if (hasError) stateColor = v('error');\n else if (useStatus) stateColor = props.statusColor ?? v('primary');\n else if (input.focused) stateColor = v('primary');\n else stateColor = filled && accentFilled ? v('primary') : restingOutline;\n\n const floated = props.alwaysFloat === true || input.valueFloated === true || input.focused || input.hasValue;\n const neutralFilledRest = filled && !input.focused && !hasError && !useStatus && !accentFilled;\n const labelColor = floated && !neutralFilledRest ? stateColor : restingContentColor;\n\n const helperRaw = hasError ? (props.errorText ?? '') : (props.helperText ?? '');\n const helperText = helperRaw.trim() === '' ? '' : helperRaw;\n const maxLength = props.maxLength ?? -1;\n const counterText = props.showCharacterCounter === true && maxLength > 0 ? `${input.textLength} / ${maxLength}` : '';\n const emphasis = input.focused || hasError || useStatus;\n const halo = props.showFocusHalo === true && input.focused && !hasError && !useStatus;\n // MAUI 1.4.9: `Label ?? (PlaceholderInside ? null : Placeholder)` — a placeholder inside the box never floats.\n const labelRaw = props.label ?? (props.placeholderInside === true ? null : props.placeholder) ?? '';\n return {\n floated,\n stateColor,\n labelColor,\n restingContentColor,\n labelText: labelRaw.trim() === '' ? '' : labelRaw,\n helperText,\n helperColor: hasError ? v('error') : v('text-tertiary'),\n counterText,\n footerVisible: helperText !== '' || counterText !== '',\n strokeWidth: emphasis ? G9Metrics.OutlinedFieldEmphasisStrokeThickness : G9Metrics.OutlinedFieldStrokeThickness,\n haloWidth: halo ? G9Metrics.OutlinedFieldFocusHaloThickness : 0,\n fieldHeight: props.fieldHeight && props.fieldHeight > 0 ? props.fieldHeight : G9Metrics.ControlHeight,\n };\n}\n\n/** {@link resolveOutlinedFieldState} with the app-wide settings read from the provider. */\nexport function useOutlinedField(\n props: G9OutlinedFieldProps,\n input: Omit<G9OutlinedFieldStateInput, 'highlightFilledValue'>,\n): G9OutlinedFieldState {\n const settings = useG9Settings();\n return resolveOutlinedFieldState(props, { ...input, highlightFilledValue: settings.fields.highlightFilledValue });\n}\n\n/** A built-in trailing affordance an input puts in the trailing slot (password eye, microphone, clear). */\nexport interface G9TrailingAffordance {\n /** What it shows. */\n readonly icon: G9IconInput;\n /** Icon colour; default the state colour. */\n readonly color?: string;\n /** Accessibility label. */\n readonly label?: string;\n /** Stable key (MAUI `ResolveTrailingIconSignature`): the slot is rebuilt only when it changes. */\n readonly signature: string;\n readonly onPress: () => void;\n}\n\n/** Props of {@link G9OutlinedField}: the shared props plus what the composing input supplies. */\nexport interface G9OutlinedFieldFrameProps extends G9OutlinedFieldProps {\n readonly focused: boolean;\n readonly hasValue: boolean;\n readonly valueFloated?: boolean;\n readonly textLength?: number;\n /** The input element (or any content) inside the box. */\n readonly children?: ReactNode;\n /** A built-in trailing affordance; replaces the trailing icon props (busy still wins). */\n readonly trailingAffordance?: G9TrailingAffordance | null;\n /** Tapping the box (outside the icons) focuses the content (MAUI `FocusTarget`). */\n readonly onFocusRequest?: () => void;\n /** Resting tone (`'placeholder'` for search, MAUI `ResolveRestingOutlineColor` override). */\n readonly restingTone?: 'outline' | 'placeholder';\n /** Vertical placement of the icons and the resting label: centred (entries) or top/bottom (editor). */\n readonly multiline?: boolean;\n /** Accessibility label of the box (defaults to the label text). */\n readonly accessibilityLabel?: string;\n /**\n * A hint the frame draws over the content while the field is empty (`resolveInnerHint`, MAUI 1.4.9): text inputs pass\n * it; the pickers draw their own value text. TextTertiary, the input's 15 px, never taking a touch.\n */\n readonly hint?: string | null;\n}\n\nfunction physicalSide(column: 0 | 2): 'left' | 'right' {\n return column === 0 ? 'left' : 'right';\n}\n\n/**\n * The outlined field frame (MAUI `G9OutlinedFieldBase`): outline with a notched floating label, leading and\n * trailing icon slots, helper/error line and counter. Inputs (`G9TextEntry`, `G9Editor`, `G9SearchEntry`, the pickers)\n * put their element in `children`. Direction is set on the root from the culture (labels, icons, helper follow it;\n * the input decides its own text direction). A tap on an icon never focuses the content; a tap elsewhere on the box\n * calls `onFocusRequest`.\n *\n * Look: colours come from the theme variables (`--g9-primary`, `--g9-outline`, `--g9-error`, …). The floated label\n * sits on the outline with the background `--g9-field-notch-background` (default `--g9-background`; set it on a\n * container of another colour with `g9FieldNotchStyle`, G9 sheets and popups do), which hides the\n * outline under it.\n */\nexport function G9OutlinedField(props: G9OutlinedFieldFrameProps): ReactNode {\n const direction = useG9Direction();\n const isRtl = direction === 'rtl';\n const state = useOutlinedField(props, {\n focused: props.focused,\n hasValue: props.hasValue,\n valueFloated: props.valueFloated ?? false,\n textLength: props.textLength ?? 0,\n restingTone: props.restingTone ?? 'outline',\n });\n const leading = {\n emoji: props.leadingEmoji ?? null,\n icon: props.leadingIcon,\n imagePath: props.leadingImagePath ?? null,\n image: props.leadingImage ?? null,\n };\n const trailing = {\n emoji: props.trailingEmoji ?? null,\n icon: props.trailingIcon,\n imagePath: props.trailingImagePath ?? null,\n image: props.trailingImage ?? null,\n };\n const busy = props.isTrailingBusy === true;\n const affordance = props.trailingAffordance ?? null;\n const hasLeading = hasIconSlot(leading);\n const hasTrailing = busy || affordance !== null || hasIconSlot(trailing);\n const pad = props.innerContentPadding ?? {};\n const slot = resolveFieldSlotLayout(\n {\n hasLeadingIcon: hasLeading,\n hasTrailingIcon: hasTrailing,\n isRtl,\n forceTrailingIconRight: props.forceTrailingIconRight === true,\n forceLeadingIconLeft: props.forceLeadingIconLeft === true,\n },\n { left: pad.left ?? 0, top: pad.top ?? 0, right: pad.right ?? 0, bottom: pad.bottom ?? 0 },\n );\n const disabled = props.disabled === true;\n const leadingActionable = props.onLeadingPress !== undefined;\n const trailingActionable = affordance !== null || props.onTrailingPress !== undefined;\n const onLeadingTap = () => {\n if (disabled || !leadingActionable) return;\n props.onLeadingPress?.();\n };\n const onTrailingTap = () => {\n if (disabled || busy || !trailingActionable) return;\n if (affordance) affordance.onPress();\n else props.onTrailingPress?.();\n };\n const onBoxTap = () => {\n if (!disabled) props.onFocusRequest?.();\n };\n\n const multiline = props.multiline === true;\n const labelHeight = G9Metrics.FloatingLabelHeight;\n // MAUI rests the label in the middle of the box's MEASURED height (ResolveFieldHeight → _box.Height): an empty\n // editor of 110 dp shows «شرح» halfway down it, not on its first line. Before the first layout: the control height.\n const [boxHeight, setBoxHeight] = useState(0);\n const restTop =\n ((multiline && boxHeight > 8 ? boxHeight : multiline ? G9Metrics.ControlHeight : state.fieldHeight) - labelHeight) /\n 2;\n const labelX = slot.labelRestX + (state.floated ? slot.labelFloatedX : 0);\n const labelAnchor = isRtl ? 'right' : 'left';\n const iconSize = G9Metrics.InputIconSize;\n const slotStyle = (column: 0 | 2, width: number, bottomAligned: boolean) => ({\n [physicalSide(column)]: '0px',\n width: `${width}px`,\n ...(bottomAligned\n ? { bottom: '0px', height: `${G9Metrics.EditorTrailingSlotHeight}px` }\n : { top: '0px', bottom: '0px' }),\n });\n\n const trailingContent = busy ? (\n <view className=\"g9-field__busy\" style={{ borderColor: state.stateColor, borderTopColor: 'transparent' }} />\n ) : affordance ? (\n <G9IconSlot icon={affordance.icon} color={affordance.color ?? state.stateColor} size={iconSize} />\n ) : (\n <G9IconSlot {...trailing} color={state.stateColor} size={iconSize} />\n );\n\n return (\n <view\n className={`g9-field g9-dir-${direction}${disabled ? ' g9-field--disabled' : ''}${props.className ? ` ${props.className}` : ''}`}\n {...g9IdProps(props.id)}\n >\n <view\n {...g9KeyboardTargetProps}\n className={`g9-field__box${state.floated ? ' g9-field__box--floated' : ''}${props.focused ? ' g9-field__box--focused' : ''}`}\n accessibility-element={false}\n style={{\n height: multiline ? undefined : `${state.fieldHeight}px`,\n minHeight: multiline ? `${state.fieldHeight}px` : undefined,\n marginTop: props.reserveFloatingLabelClearance ? `${G9Metrics.FloatingLabelClearance}px` : '0px',\n }}\n bindtap={onBoxTap}\n {...(multiline\n ? {\n bindlayoutchange: (e: { detail?: { height?: number } }) => {\n const h = e.detail?.height ?? 0;\n if (Math.abs(h - boxHeight) > 0.5) setBoxHeight(h);\n },\n }\n : {})}\n >\n {/* The outline is its own view (MAUI paints it on a canvas): a stroke change never moves the content, and a\n disabled field dims it without an opacity layer on the box, which clipped the floated label on Android. */}\n <view\n className=\"g9-field__outline\"\n style={{\n borderColor: state.stateColor,\n borderWidth: `${state.strokeWidth}px`,\n borderRadius: `${G9Metrics.RadiusMd}px`,\n }}\n />\n {state.haloWidth > 0 ? (\n <view\n className=\"g9-field__halo\"\n style={{\n borderColor: state.stateColor,\n borderWidth: `${state.haloWidth}px`,\n opacity: G9Metrics.FocusRingOpacity,\n borderRadius: `${G9Metrics.RadiusMd}px`,\n }}\n />\n ) : null}\n <view\n className=\"g9-field__content\"\n style={{\n paddingLeft: `${slot.innerPadding.left + (hasLeading && slot.leadingColumn === 0 ? G9Metrics.LeadingIconSlotWidth : 0) + (hasTrailing && slot.trailingColumn === 0 ? G9Metrics.TrailingIconSlotWidth : 0)}px`,\n paddingRight: `${slot.innerPadding.right + (hasLeading && slot.leadingColumn === 2 ? G9Metrics.LeadingIconSlotWidth : 0) + (hasTrailing && slot.trailingColumn === 2 ? G9Metrics.TrailingIconSlotWidth : 0)}px`,\n paddingTop: `${slot.innerPadding.top}px`,\n paddingBottom: `${slot.innerPadding.bottom}px`,\n }}\n >\n {props.children}\n {props.hint && !props.hasValue && props.valueFloated !== true ? (\n <view\n className={`g9-field__hint${multiline ? ' g9-field__hint--multiline' : ''}`}\n user-interaction-enabled={false}\n style={{\n left: `${slot.innerPadding.left + (hasLeading && slot.leadingColumn === 0 ? G9Metrics.LeadingIconSlotWidth : 0) + (hasTrailing && slot.trailingColumn === 0 ? G9Metrics.TrailingIconSlotWidth : 0)}px`,\n right: `${slot.innerPadding.right + (hasLeading && slot.leadingColumn === 2 ? G9Metrics.LeadingIconSlotWidth : 0) + (hasTrailing && slot.trailingColumn === 2 ? G9Metrics.TrailingIconSlotWidth : 0)}px`,\n ...(multiline ? { top: `${slot.innerPadding.top}px` } : {}),\n }}\n >\n <text\n className=\"g9-field__hint-text\"\n {...(multiline ? {} : { 'text-maxline': '1' })}\n style={{\n textAlign: isRtl ? 'right' : 'left',\n color: disabled ? 'var(--g9-text-disabled)' : 'var(--g9-text-tertiary)',\n }}\n >\n {props.hint}\n </text>\n </view>\n ) : null}\n </view>\n {hasLeading ? (\n <view\n className=\"g9-field__slot g9-field__slot--leading\"\n style={slotStyle(slot.leadingColumn, G9Metrics.LeadingIconSlotWidth, false)}\n catchtap={onLeadingTap}\n {...(leadingActionable ? { 'accessibility-element': true, 'accessibility-traits': 'button' } : {})}\n >\n <G9IconSlot {...leading} color={state.restingContentColor} size={iconSize} />\n </view>\n ) : null}\n {hasTrailing ? (\n <view\n key={busy ? 'busy' : affordance ? affordance.signature : 'icon'}\n className=\"g9-field__slot g9-field__slot--trailing\"\n style={slotStyle(slot.trailingColumn, G9Metrics.TrailingIconSlotWidth, multiline && !busy)}\n catchtap={onTrailingTap}\n {...(trailingActionable\n ? {\n 'accessibility-element': true,\n 'accessibility-traits': 'button',\n ...(affordance?.label ? { 'accessibility-label': affordance.label } : {}),\n }\n : {})}\n >\n {trailingContent}\n </view>\n ) : null}\n {state.labelText ? (\n <text\n className={`g9-field__label${state.floated ? ' g9-field__label--floated' : ''}`}\n style={{\n [labelAnchor]: `${G9Metrics.InputHorizontalPadding}px`,\n top: `${state.floated ? G9Metrics.FloatingLabelFloatedY : restTop}px`,\n fontSize: `${state.floated ? G9Metrics.FloatingLabelFontSizeFloat : G9Metrics.FloatingLabelFontSizeRest}px`,\n color: disabled ? 'var(--g9-text-disabled)' : state.labelColor,\n transform: `translateX(${labelX}px)`,\n }}\n >\n {state.labelText}\n </text>\n ) : null}\n </view>\n {state.footerVisible ? (\n <view className=\"g9-field__footer\" style={g9RowStyle(direction)}>\n {state.helperText ? (\n <text\n className=\"g9-field__helper\"\n style={{ color: state.helperColor, textAlign: isRtl ? 'right' : 'left' }}\n >\n {state.helperText}\n </text>\n ) : (\n <view className=\"g9-field__helper\" />\n )}\n {/* RLM first in a right-to-left field: «0 / 4000» has no strong letter, so it would lay out left-to-right; MAUI's\n label inherits the RTL flow and reads «۴۰۰۰ / ۰». */}\n {state.counterText ? (\n <text className=\"g9-field__counter\">{`${isRtl ? '\\u200F' : ''}${state.counterText}`}</text>\n ) : null}\n </view>\n ) : null}\n </view>\n );\n}\n"],"names":["v","token","blank","s","resolveRestingPlaceholder","props","placeholder","resolveInnerHint","owns","resolveOutlinedFieldState","input","_props_filledValueHighlight","_props_statusColor","_props_errorText","_props_helperText","_props_maxLength","_ref","hasError","useStatus","filled","highlight","G9FilledValueHighlight","accentFilled","placeholderTone","restingOutline","restingContentColor","stateColor","floated","neutralFilledRest","labelColor","helperRaw","helperText","maxLength","counterText","emphasis","halo","labelRaw","G9Metrics","useOutlinedField","settings","useG9Settings","physicalSide","column","G9OutlinedField","_props_valueFloated","_props_textLength","_props_restingTone","_props_leadingEmoji","_props_leadingImagePath","_props_leadingImage","_props_trailingEmoji","_props_trailingImagePath","_props_trailingImage","_props_trailingAffordance","_props_innerContentPadding","_pad_left","_pad_top","_pad_right","_pad_bottom","_affordance_color","direction","useG9Direction","isRtl","state","leading","trailing","busy","affordance","hasLeading","hasIconSlot","hasTrailing","pad","slot","resolveFieldSlotLayout","disabled","leadingActionable","undefined","trailingActionable","onLeadingTap","onTrailingTap","onBoxTap","multiline","labelHeight","boxHeight","setBoxHeight","useState","restTop","labelX","labelAnchor","iconSize","slotStyle","width","bottomAligned","trailingContent","view","G9IconSlot","g9IdProps","g9KeyboardTargetProps","e","_e_detail","h","Math","text","g9RowStyle"],"mappings":";;;;;;;;AA0HA,MAAMA,IAAI,CAACC,QAA0B,CAAC,SAAS,EAAEA,MAAM,CAAC,CAAC;AACzD,MAAMC,QAAQ,CAACC,IAA0CA,AAAK,QAALA,KAAaA,AAAa,OAAbA,EA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S,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;CAClC,GAAG,OAAO,CAEV;AAED,4DAA4D;AAC5D,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,GAAG,aAAa,CAAC;IACjD,QAAQ,CAAC,WAAW,CAAC,EAAE,gBAAgB,CAAC,aAAa,CAAC,CAAC;IACvD,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C;AAED,UAAU,SAAU,SAAQ,gBAAgB;IAC1C,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;CAClC;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa,yGA0FzB,CAAC;AAIF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,WAAW,gHAEtB,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { G9KeyboardType, G9StringKey } from "@g9tm/lynxcontrols-foundation";
|
|
|
2
2
|
import { forwardRef, useImperativeHandle } from "@lynx-js/react";
|
|
3
3
|
import { useG9Settings, useG9Strings } from "../provider/hooks.jsx";
|
|
4
4
|
import { resolveEffectiveKeyboard, resolveInputElementType } from "./input-policy.jsx";
|
|
5
|
-
import { G9OutlinedField } from "./outlined-field.jsx";
|
|
5
|
+
import { G9OutlinedField, resolveInnerHint } from "./outlined-field.jsx";
|
|
6
6
|
import { useTextInput } from "./use-text-input.jsx";
|
|
7
7
|
function shouldShowEntryMic(state) {
|
|
8
8
|
return state.available && !(state.passwordToggle && state.hasValue) && (state.listening || !state.hasValue);
|
|
@@ -50,7 +50,7 @@ const TextEntryBody = forwardRef(function(props, ref) {
|
|
|
50
50
|
};
|
|
51
51
|
const masked = true === props.isPassword && !core.passwordVisible;
|
|
52
52
|
const keyboard = resolveEffectiveKeyboard(core.inputType, null != (_props_keyboardType = props.keyboardType) ? _props_keyboardType : G9KeyboardType.Default);
|
|
53
|
-
return <G9OutlinedField {...props} hasError={core.hasError} errorText={null != (_core_errorText = core.errorText) ? _core_errorText : null} forceTrailingIconRight={true === props.forceTrailingIconRight || passwordToggle} focused={core.focused} hasValue={core.hasValue} textLength={core.text.length} trailingAffordance={affordance} restingTone={null != (_props_variant_restingTone = props.variant.restingTone) ? _props_variant_restingTone : 'outline'} onFocusRequest={core.focus}>
|
|
53
|
+
return <G9OutlinedField {...props} hint={resolveInnerHint(props)} hasError={core.hasError} errorText={null != (_core_errorText = core.errorText) ? _core_errorText : null} forceTrailingIconRight={true === props.forceTrailingIconRight || passwordToggle} focused={core.focused} hasValue={core.hasValue} textLength={core.text.length} trailingAffordance={affordance} restingTone={null != (_props_variant_restingTone = props.variant.restingTone) ? _props_variant_restingTone : 'outline'} onFocusRequest={core.focus}>
|
|
54
54
|
{}
|
|
55
55
|
{true === props.readOnly && !masked ? <text className="g9-field__input g9-field__input--readonly" text-maxline="1" style={{
|
|
56
56
|
direction: core.textDirection,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fields/text-entry.jsx","sources":["../../src/fields/text-entry.tsx"],"sourcesContent":["import { G9KeyboardType, G9StringKey } from '@g9tm/lynxcontrols-foundation';\nimport { forwardRef, type ReactNode, useImperativeHandle } from '@lynx-js/react';\nimport { useG9Settings, useG9Strings } from '../provider/hooks';\nimport { resolveEffectiveKeyboard, resolveInputElementType } from './input-policy';\nimport { G9OutlinedField, type G9TrailingAffordance } from './outlined-field';\nimport { type G9TextInputHandle, type G9TextInputProps, useTextInput } from './use-text-input';\nimport type { G9TextValidator } from './validator';\n\n/** Props of {@link G9TextEntry} (MAUI `G9TextEntry`). */\nexport interface G9TextEntryProps extends G9TextInputProps {\n /** Eye toggle in the trailing slot while there is a value; pins the trailing icon right. Default false. */\n readonly passwordToggle?: boolean;\n /** Mask the value (until the eye reveals it); the text is pinned LTR. Default false. */\n readonly isPassword?: boolean;\n /** Clear (×) button in the trailing slot while there is a value. Default false. */\n readonly clearButton?: boolean;\n /** Extra validation, run before the input-type rule (on blur, `validateOnTextChanged`, `validate()`). */\n readonly validator?: G9TextValidator | null;\n /** Validate on every change, not only on blur. Default false. */\n readonly validateOnTextChanged?: boolean;\n /** Keyboard confirm key. Default `'done'`. */\n readonly confirmType?: 'send' | 'search' | 'go' | 'done' | 'next';\n /** iOS spell checking (`ios-spell-check`; Android has no attribute). Default true. */\n readonly isSpellCheckEnabled?: boolean;\n /** iOS auto-correct / prediction (`ios-auto-correct`). Default true. */\n readonly isTextPredictionEnabled?: boolean;\n}\n\n/** Imperative handle of {@link G9TextEntry}. */\nexport type G9TextEntryHandle = G9TextInputHandle;\n\n/**\n * Whether the trailing slot shows the microphone (MAUI `ShouldShowVoiceMic`): dictation available, not while the\n * password eye owns the slot, and only on an empty field or during a session (the clear button owns a filled field).\n */\nexport function shouldShowEntryMic(state: {\n readonly available: boolean;\n readonly listening: boolean;\n readonly hasValue: boolean;\n readonly passwordToggle: boolean;\n}): boolean {\n return state.available && !(state.passwordToggle && state.hasValue) && (state.listening || !state.hasValue);\n}\n\n/** What `G9SearchEntry` changes in the entry (internal). */\nexport interface G9EntryVariant {\n readonly name: string;\n readonly restingTone?: 'outline' | 'placeholder';\n readonly confirmType?: G9TextEntryProps['confirmType'];\n readonly onConfirm?: (value: string) => void;\n}\n\ninterface BodyProps extends G9TextEntryProps {\n readonly variant: G9EntryVariant;\n}\n\n/**\n * The entry body shared by `G9TextEntry` and `G9SearchEntry` (internal). The inner name must differ from the binding\n * (E20, scripts/check-dist-jsx.mjs): `G9TextEntry` renders it in this module.\n */\nexport const TextEntryBody = forwardRef<G9TextEntryHandle, BodyProps>(\n function TextEntryBodyRender(props, ref): ReactNode {\n const glyphs = useG9Settings().glyphs;\n const strings = useG9Strings();\n const passwordToggle = props.passwordToggle === true;\n const core = useTextInput(\n { ...props, ...(props.variant.onConfirm ? { onConfirm: props.variant.onConfirm } : {}) },\n {\n name: props.variant.name,\n validator: props.validator ?? null,\n validateOnTextChanged: props.validateOnTextChanged === true,\n isPassword: props.isPassword === true,\n showMic: (s) => shouldShowEntryMic({ ...s, passwordToggle }),\n },\n );\n useImperativeHandle(ref, () => core.handle);\n\n let affordance: G9TrailingAffordance | null = null;\n if (passwordToggle && core.hasValue) {\n affordance = {\n icon: core.passwordVisible ? glyphs.eyeClosed : glyphs.eyeOpen,\n signature: core.passwordVisible ? 'eye-closed' : 'eye-open',\n onPress: () => core.setPasswordVisible(!core.passwordVisible),\n };\n } else if (core.showMic) {\n affordance = {\n icon: core.dictation.listening ? glyphs.micOff : glyphs.mic,\n color: core.dictation.listening ? 'var(--g9-error)' : 'var(--g9-primary)',\n signature: 'voice',\n onPress: core.pressMic,\n };\n } else if (props.clearButton === true && core.hasValue) {\n affordance = {\n icon: glyphs.clear,\n label: strings.get(G9StringKey.Clear),\n signature: 'clear',\n onPress: () => core.setText('', { source: 'clear' }),\n };\n }\n\n const masked = props.isPassword === true && !core.passwordVisible;\n const keyboard = resolveEffectiveKeyboard(core.inputType, props.keyboardType ?? G9KeyboardType.Default);\n return (\n <G9OutlinedField\n {...props}\n hasError={core.hasError}\n errorText={core.errorText ?? null}\n forceTrailingIconRight={props.forceTrailingIconRight === true || passwordToggle}\n focused={core.focused}\n hasValue={core.hasValue}\n textLength={core.text.length}\n trailingAffordance={affordance}\n restingTone={props.variant.restingTone ?? 'outline'}\n onFocusRequest={core.focus}\n >\n {/* A read-only (unmasked) field shows its value as text: nobody types into it, and a native read-only\n EditText ignored the value pushed into it (a scan-only barcode field stayed blank). */}\n {props.readOnly === true && !masked ? (\n <text\n className=\"g9-field__input g9-field__input--readonly\"\n text-maxline=\"1\"\n style={{\n direction: core.textDirection,\n textAlign: core.textDirection === 'rtl' ? 'right' : 'left',\n ...(core.font ? { fontFamily: core.font } : {}),\n color: props.disabled ? 'var(--g9-text-disabled)' : 'var(--g9-text-primary)',\n }}\n >\n {core.text}\n </text>\n ) : (\n <input\n {...core.elementProps}\n className=\"g9-field__input\"\n type={resolveInputElementType(core.inputType, keyboard, masked)}\n confirm-type={props.variant.confirmType ?? props.confirmType ?? 'done'}\n ios-spell-check={props.isSpellCheckEnabled !== false}\n ios-auto-correct={props.isTextPredictionEnabled !== false}\n style={{\n direction: core.textDirection,\n textAlign: core.textDirection === 'rtl' ? 'right' : 'left',\n ...(core.font ? { fontFamily: core.font } : {}),\n color: props.disabled ? 'var(--g9-text-disabled)' : 'var(--g9-text-primary)',\n }}\n />\n )}\n </G9OutlinedField>\n );\n },\n);\n\nconst entryVariant: G9EntryVariant = { name: 'G9TextEntry.value' };\n\n/**\n * Single-line outlined text field (MAUI `G9TextEntry`): floating label, input-type keyboard/filter/validation,\n * password eye, clear button, optional dictation (`voiceEnabled` + `services.speech`).\n *\n * - Value: `value`/`defaultValue`/`onValueChange(value, { source })`; one call per change.\n * - Validation: on blur when there is a rule (`validator`, email/url, custom pattern), on every change with\n * `validateOnTextChanged`, or through the handle's `validate()`. An error set through `hasError`/`errorText`\n * survives blur on a field without a rule.\n * - Requires the host's `xelement-input` registration (plan/specs/02 §2). Keyboard avoidance: put the form inside\n * lynx-ui `KeyboardAwareRoot`/`KeyboardAwareResponder`; the field reports focus to it.\n */\nexport const G9TextEntry = forwardRef<G9TextEntryHandle, G9TextEntryProps>(function G9TextEntry(props, ref) {\n return <TextEntryBody {...props} variant={entryVariant} ref={ref} />;\n});\n"],"names":["shouldShowEntryMic","state","TextEntryBody","forwardRef","props","ref","_props_validator","_props_keyboardType","_core_errorText","_props_variant_restingTone","_ref","glyphs","useG9Settings","strings","useG9Strings","passwordToggle","core","useTextInput","s","useImperativeHandle","affordance","G9StringKey","masked","keyboard","resolveEffectiveKeyboard","G9KeyboardType","G9OutlinedField","text","input","resolveInputElementType","entryVariant","G9TextEntry"],"mappings":";;;;;;AAmCO,SAASA,mBAAmBC,KAKlC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AEDC,OACE,GAAGZ,KAAK,YAAY,EACrB,UAAU,kBACV,MAAMa,wBAAwBb,KAAK,SAAS,EAAEO,UAAUD,SACxD,cAAc,QAAAZ,CAAAA,OAAAA,QAAAA,CAAAA,6BAAAA,MAAM,OAAO,CAAC,WAAW,AAAD,IAAxBA,6BAA6BN,MAAM,WAAW,AAAD,IAA7CM,OAAkD,QAChE,iBAAiBN,AAA8B,UAA9BA,MAAM,mBAAmB,EAC1C,kBAAkBA,AAAkC,UAAlCA,MAAM,uBAAuB,EAC/C,OAAO;QACL,WAAWY,KAAK,aAAa;QAC7B,WAAWA,AAAuB,UAAvBA,KAAK,aAAa,GAAa,UAAU;QACpD,GAAIA,KAAK,IAAI,GAAG;YAAE,YAAYA,KAAK,IAAI;QAAC,IAAI,CAAC,CAAC;QAC9C,OAAOZ,MAAM,QAAQ,GAAG,4BAA4B;IACtD,KAEF;MACJ,EAAEsB;AAEN;AAGF,MAAMI,eAA+B;IAAE,MAAM;AAAoB;AAa1D,MAAMC,yBAAc5B,WAAgD,SAAqBC,KAAK,EAAEC,GAAG;IACxG,QAAQH,eAAe,GAAGE,KAAK,EAAE,SAAS0B,cAAc,KAAKzB;AAC/D"}
|
|
1
|
+
{"version":3,"file":"fields/text-entry.jsx","sources":["../../src/fields/text-entry.tsx"],"sourcesContent":["import { G9KeyboardType, G9StringKey } from '@g9tm/lynxcontrols-foundation';\nimport { forwardRef, type ReactNode, useImperativeHandle } from '@lynx-js/react';\nimport { useG9Settings, useG9Strings } from '../provider/hooks';\nimport { resolveEffectiveKeyboard, resolveInputElementType } from './input-policy';\nimport { G9OutlinedField, type G9TrailingAffordance, resolveInnerHint } from './outlined-field';\nimport { type G9TextInputHandle, type G9TextInputProps, useTextInput } from './use-text-input';\nimport type { G9TextValidator } from './validator';\n\n/** Props of {@link G9TextEntry} (MAUI `G9TextEntry`). */\nexport interface G9TextEntryProps extends G9TextInputProps {\n /** Eye toggle in the trailing slot while there is a value; pins the trailing icon right. Default false. */\n readonly passwordToggle?: boolean;\n /** Mask the value (until the eye reveals it); the text is pinned LTR. Default false. */\n readonly isPassword?: boolean;\n /** Clear (×) button in the trailing slot while there is a value. Default false. */\n readonly clearButton?: boolean;\n /** Extra validation, run before the input-type rule (on blur, `validateOnTextChanged`, `validate()`). */\n readonly validator?: G9TextValidator | null;\n /** Validate on every change, not only on blur. Default false. */\n readonly validateOnTextChanged?: boolean;\n /** Keyboard confirm key. Default `'done'`. */\n readonly confirmType?: 'send' | 'search' | 'go' | 'done' | 'next';\n /** iOS spell checking (`ios-spell-check`; Android has no attribute). Default true. */\n readonly isSpellCheckEnabled?: boolean;\n /** iOS auto-correct / prediction (`ios-auto-correct`). Default true. */\n readonly isTextPredictionEnabled?: boolean;\n}\n\n/** Imperative handle of {@link G9TextEntry}. */\nexport type G9TextEntryHandle = G9TextInputHandle;\n\n/**\n * Whether the trailing slot shows the microphone (MAUI `ShouldShowVoiceMic`): dictation available, not while the\n * password eye owns the slot, and only on an empty field or during a session (the clear button owns a filled field).\n */\nexport function shouldShowEntryMic(state: {\n readonly available: boolean;\n readonly listening: boolean;\n readonly hasValue: boolean;\n readonly passwordToggle: boolean;\n}): boolean {\n return state.available && !(state.passwordToggle && state.hasValue) && (state.listening || !state.hasValue);\n}\n\n/** What `G9SearchEntry` changes in the entry (internal). */\nexport interface G9EntryVariant {\n readonly name: string;\n readonly restingTone?: 'outline' | 'placeholder';\n readonly confirmType?: G9TextEntryProps['confirmType'];\n readonly onConfirm?: (value: string) => void;\n}\n\ninterface BodyProps extends G9TextEntryProps {\n readonly variant: G9EntryVariant;\n}\n\n/**\n * The entry body shared by `G9TextEntry` and `G9SearchEntry` (internal). The inner name must differ from the binding\n * (E20, scripts/check-dist-jsx.mjs): `G9TextEntry` renders it in this module.\n */\nexport const TextEntryBody = forwardRef<G9TextEntryHandle, BodyProps>(\n function TextEntryBodyRender(props, ref): ReactNode {\n const glyphs = useG9Settings().glyphs;\n const strings = useG9Strings();\n const passwordToggle = props.passwordToggle === true;\n const core = useTextInput(\n { ...props, ...(props.variant.onConfirm ? { onConfirm: props.variant.onConfirm } : {}) },\n {\n name: props.variant.name,\n validator: props.validator ?? null,\n validateOnTextChanged: props.validateOnTextChanged === true,\n isPassword: props.isPassword === true,\n showMic: (s) => shouldShowEntryMic({ ...s, passwordToggle }),\n },\n );\n useImperativeHandle(ref, () => core.handle);\n\n let affordance: G9TrailingAffordance | null = null;\n if (passwordToggle && core.hasValue) {\n affordance = {\n icon: core.passwordVisible ? glyphs.eyeClosed : glyphs.eyeOpen,\n signature: core.passwordVisible ? 'eye-closed' : 'eye-open',\n onPress: () => core.setPasswordVisible(!core.passwordVisible),\n };\n } else if (core.showMic) {\n affordance = {\n icon: core.dictation.listening ? glyphs.micOff : glyphs.mic,\n color: core.dictation.listening ? 'var(--g9-error)' : 'var(--g9-primary)',\n signature: 'voice',\n onPress: core.pressMic,\n };\n } else if (props.clearButton === true && core.hasValue) {\n affordance = {\n icon: glyphs.clear,\n label: strings.get(G9StringKey.Clear),\n signature: 'clear',\n onPress: () => core.setText('', { source: 'clear' }),\n };\n }\n\n const masked = props.isPassword === true && !core.passwordVisible;\n const keyboard = resolveEffectiveKeyboard(core.inputType, props.keyboardType ?? G9KeyboardType.Default);\n return (\n <G9OutlinedField\n {...props}\n hint={resolveInnerHint(props)}\n hasError={core.hasError}\n errorText={core.errorText ?? null}\n forceTrailingIconRight={props.forceTrailingIconRight === true || passwordToggle}\n focused={core.focused}\n hasValue={core.hasValue}\n textLength={core.text.length}\n trailingAffordance={affordance}\n restingTone={props.variant.restingTone ?? 'outline'}\n onFocusRequest={core.focus}\n >\n {/* A read-only (unmasked) field shows its value as text: nobody types into it, and a native read-only\n EditText ignored the value pushed into it (a scan-only barcode field stayed blank). */}\n {props.readOnly === true && !masked ? (\n <text\n className=\"g9-field__input g9-field__input--readonly\"\n text-maxline=\"1\"\n style={{\n direction: core.textDirection,\n textAlign: core.textDirection === 'rtl' ? 'right' : 'left',\n ...(core.font ? { fontFamily: core.font } : {}),\n color: props.disabled ? 'var(--g9-text-disabled)' : 'var(--g9-text-primary)',\n }}\n >\n {core.text}\n </text>\n ) : (\n <input\n {...core.elementProps}\n className=\"g9-field__input\"\n type={resolveInputElementType(core.inputType, keyboard, masked)}\n confirm-type={props.variant.confirmType ?? props.confirmType ?? 'done'}\n ios-spell-check={props.isSpellCheckEnabled !== false}\n ios-auto-correct={props.isTextPredictionEnabled !== false}\n style={{\n direction: core.textDirection,\n textAlign: core.textDirection === 'rtl' ? 'right' : 'left',\n ...(core.font ? { fontFamily: core.font } : {}),\n color: props.disabled ? 'var(--g9-text-disabled)' : 'var(--g9-text-primary)',\n }}\n />\n )}\n </G9OutlinedField>\n );\n },\n);\n\nconst entryVariant: G9EntryVariant = { name: 'G9TextEntry.value' };\n\n/**\n * Single-line outlined text field (MAUI `G9TextEntry`): floating label, input-type keyboard/filter/validation,\n * password eye, clear button, optional dictation (`voiceEnabled` + `services.speech`).\n *\n * - Value: `value`/`defaultValue`/`onValueChange(value, { source })`; one call per change.\n * - Validation: on blur when there is a rule (`validator`, email/url, custom pattern), on every change with\n * `validateOnTextChanged`, or through the handle's `validate()`. An error set through `hasError`/`errorText`\n * survives blur on a field without a rule.\n * - Requires the host's `xelement-input` registration (plan/specs/02 §2). Keyboard avoidance: put the form inside\n * lynx-ui `KeyboardAwareRoot`/`KeyboardAwareResponder`; the field reports focus to it.\n */\nexport const G9TextEntry = forwardRef<G9TextEntryHandle, G9TextEntryProps>(function G9TextEntry(props, ref) {\n return <TextEntryBody {...props} variant={entryVariant} ref={ref} />;\n});\n"],"names":["shouldShowEntryMic","state","TextEntryBody","forwardRef","props","ref","_props_validator","_props_keyboardType","_core_errorText","_props_variant_restingTone","_ref","glyphs","useG9Settings","strings","useG9Strings","passwordToggle","core","useTextInput","s","useImperativeHandle","affordance","G9StringKey","masked","keyboard","resolveEffectiveKeyboard","G9KeyboardType","G9OutlinedField","resolveInnerHint","text","input","resolveInputElementType","entryVariant","G9TextEntry"],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,GAAG,4BAA4B;IACtD,GACD;YACC,CAACY,KAAK,IAAI,CAAC;UACb,EAAEY,SAEDC,OACE,GAAGb,KAAK,YAAY,EACrB,UAAU,kBACV,MAAMc,wBAAwBd,KAAK,SAAS,EAAEO,UAAUD,SACxD,cAAc,QAAAZ,CAAAA,OAAAA,QAAAA,CAAAA,6BAAAA,MAAM,OAAO,CAAC,WAAW,AAAD,IAAxBA,6BAA6BN,MAAM,WAAW,AAAD,IAA7CM,OAAkD,QAChE,iBAAiBN,AAA8B,UAA9BA,MAAM,mBAAmB,EAC1C,kBAAkBA,AAAkC,UAAlCA,MAAM,uBAAuB,EAC/C,OAAO;QACL,WAAWY,KAAK,aAAa;QAC7B,WAAWA,AAAuB,UAAvBA,KAAK,aAAa,GAAa,UAAU;QACpD,GAAIA,KAAK,IAAI,GAAG;YAAE,YAAYA,KAAK,IAAI;QAAC,IAAI,CAAC,CAAC;QAC9C,OAAOZ,MAAM,QAAQ,GAAG,4BAA4B;IACtD,KAEF;MACJ,EAAEsB;AAEN;AAGF,MAAMK,eAA+B;IAAE,MAAM;AAAoB;AAa1D,MAAMC,yBAAc7B,WAAgD,SAAqBC,KAAK,EAAEC,GAAG;IACxG,QAAQH,eAAe,GAAGE,KAAK,EAAE,SAAS2B,cAAc,KAAK1B;AAC/D"}
|
|
@@ -27,7 +27,15 @@ export interface G9ComboBoxProps<T extends G9SelectionItem = G9SelectionItem> ex
|
|
|
27
27
|
readonly clearButton?: boolean;
|
|
28
28
|
/** Direction of the value/chips and the sheet rows (MAUI `ValueTextDirection`). Default follows the culture. */
|
|
29
29
|
readonly valueTextDirection?: G9TextInputDirection;
|
|
30
|
+
/**
|
|
31
|
+
* How a multi-select field draws its chosen items (MAUI 1.4.10 `ChipStyle`): `'filled'` (default — primary chips) or
|
|
32
|
+
* `'tonal'` — light pills (SurfaceContainerLow, an OutlineVariant hairline, TextPrimary 14) each with its own «×» that
|
|
33
|
+
* removes that one item without opening the sheet. Pair with `clearButton={false}` to keep the trailing glyph (AgriPad).
|
|
34
|
+
*/
|
|
35
|
+
readonly chipStyle?: G9ComboBoxChipStyle;
|
|
30
36
|
}
|
|
37
|
+
/** MAUI `G9ComboBoxChipStyle`. */
|
|
38
|
+
export type G9ComboBoxChipStyle = 'filled' | 'tonal';
|
|
31
39
|
/** Two key lists hold the same keys in the same order. */
|
|
32
40
|
export declare function sameSelectionKeys(a: ReadonlyArray<string>, b: ReadonlyArray<string>): boolean;
|
|
33
41
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combo-box.d.ts","sourceRoot":"","sources":["../../src/pickers/combo-box.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"combo-box.d.ts","sourceRoot":"","sources":["../../src/pickers/combo-box.tsx"],"names":[],"mappings":"AACA,OAAO,eAAe,CAAC;AACvB,OAAO,EAAgD,KAAK,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACxH,OAAO,EAAE,KAAK,SAAS,EAAU,MAAM,gBAAgB,CAAC;AAExD,OAAO,EAAE,KAAK,eAAe,EAA+B,MAAM,wBAAwB,CAAC;AAM3F,OAAO,EACL,KAAK,kBAAkB,EAMxB,MAAM,WAAW,CAAC;AAEnB,yEAAyE;AACzE,eAAO,MAAM,eAAe,IAAI,CAAC;AAEjC,mCAAmC;AACnC,MAAM,WAAW,eAAe,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe,CAAE,SAAQ,kBAAkB;IACtG,sGAAsG;IACtG,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IACjC,iHAAiH;IACjH,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IACjC,2DAA2D;IAC3D,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,GAAG,EAAE,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ynxcontrols-foundation";
|
|
3
4
|
import { useRef } from "@lynx-js/react";
|
|
4
5
|
import { g9RowStyle } from "../base/control.jsx";
|
|
5
|
-
import { selectionKey } from "../base/selection-item.jsx";
|
|
6
|
+
import { isAvatarImage, selectionKey } from "../base/selection-item.jsx";
|
|
6
7
|
import { useControllableState } from "../base/use-controllable-state.jsx";
|
|
8
|
+
import { G9IconSlot, hasIconSlot } from "../icon/slot.jsx";
|
|
7
9
|
import { useG9Direction, useG9Settings, useG9Strings, useG9Theme } from "../provider/hooks.jsx";
|
|
8
10
|
import { showSelectionSheet } from "../selection/selection-sheet.jsx";
|
|
9
11
|
import { useG9Sheets } from "../sheet/service.jsx";
|
|
@@ -14,7 +16,7 @@ function sameSelectionKeys(a, b) {
|
|
|
14
16
|
}
|
|
15
17
|
const sameKeys = sameSelectionKeys;
|
|
16
18
|
function G9ComboBox(props) {
|
|
17
|
-
var _props_defaultValue, _props_defaultValues,
|
|
19
|
+
var _props_defaultValue, _props_defaultValues, _resolveRestingPlaceholder;
|
|
18
20
|
const sheets = useG9Sheets();
|
|
19
21
|
const glyphs = useG9Settings().glyphs;
|
|
20
22
|
const strings = useG9Strings();
|
|
@@ -55,6 +57,13 @@ function G9ComboBox(props) {
|
|
|
55
57
|
if (multiple) setKeys([], []);
|
|
56
58
|
else setKey(null, null);
|
|
57
59
|
};
|
|
60
|
+
const removeOne = (item)=>{
|
|
61
|
+
if (blocked) return;
|
|
62
|
+
const k = selectionKey(item);
|
|
63
|
+
const next = latest.current.keys.filter((x)=>x !== k);
|
|
64
|
+
if (next.length !== latest.current.keys.length) setKeys(next, byKey(next));
|
|
65
|
+
};
|
|
66
|
+
const tonal = 'tonal' === props.chipStyle;
|
|
58
67
|
const onOpen = ()=>open(async (isCurrent)=>{
|
|
59
68
|
var _ref, _p_label, _p_emptyStateText;
|
|
60
69
|
var _p_sheetTitle;
|
|
@@ -103,27 +112,60 @@ function G9ComboBox(props) {
|
|
|
103
112
|
} : null}>
|
|
104
113
|
<view className={`g9-combo__value ${dir}`} style={row}>
|
|
105
114
|
{multiple && hasValue ? <view className="g9-combo__chips" style={row}>
|
|
106
|
-
{selected.slice(0, g9ComboMaxChips).map((item)
|
|
115
|
+
{selected.slice(0, g9ComboMaxChips).map((item)=>tonal ? <TonalChip key={selectionKey(item)} item={item} row={row} rtl={'rtl' === valueDirection(props.valueTextDirection, culture)} removable={!blocked} onRemove={()=>removeOne(item)}/> : <view key={selectionKey(item)} className="g9-combo__chip" style={{
|
|
107
116
|
...row,
|
|
108
117
|
background: fillToCss(buildSolidOrGradient(primary, true))
|
|
109
118
|
}}>
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
119
|
+
<SelectionValueIcon item={item} color="var(--g9-on-primary)" inChip/>
|
|
120
|
+
<text className="g9-combo__chip-text" text-maxline="1">
|
|
121
|
+
{item.text}
|
|
122
|
+
</text>
|
|
123
|
+
</view>)}
|
|
115
124
|
{selected.length > g9ComboMaxChips ? <view className="g9-combo__chip g9-combo__chip--more">
|
|
116
125
|
<text className="g9-combo__chip-text">{`+${selected.length - g9ComboMaxChips}`}</text>
|
|
117
126
|
</view> : null}
|
|
118
127
|
</view> : [
|
|
119
128
|
hasValue ? <SelectionValueIcon key="i" item={selected[0]}/> : null,
|
|
120
129
|
<text key="t" className={`g9-picker__text${hasValue ? '' : ' g9-picker__text--placeholder'}`} text-maxline="1">
|
|
121
|
-
{hasValue ? selected[0].text :
|
|
130
|
+
{hasValue ? selected[0].text : null != (_resolveRestingPlaceholder = resolveRestingPlaceholder(props)) ? _resolveRestingPlaceholder : ''}
|
|
122
131
|
</text>
|
|
123
132
|
]}
|
|
124
133
|
</view>
|
|
125
134
|
</PickerField>;
|
|
126
135
|
}
|
|
136
|
+
function TonalChip(props) {
|
|
137
|
+
var _item_emoji, _item_iconPath, _item_iconImage, _item_iconTintColor;
|
|
138
|
+
const glyphs = useG9Settings().glyphs;
|
|
139
|
+
const { item } = props;
|
|
140
|
+
const icon = {
|
|
141
|
+
emoji: null != (_item_emoji = item.emoji) ? _item_emoji : null,
|
|
142
|
+
icon: item.icon,
|
|
143
|
+
imagePath: null != (_item_iconPath = item.iconPath) ? _item_iconPath : null,
|
|
144
|
+
image: null != (_item_iconImage = item.iconImage) ? _item_iconImage : null
|
|
145
|
+
};
|
|
146
|
+
return <view className="g9-combo__tonal" style={{
|
|
147
|
+
...props.row,
|
|
148
|
+
...props.rtl ? {
|
|
149
|
+
paddingRight: '10px',
|
|
150
|
+
paddingLeft: '6px',
|
|
151
|
+
marginLeft: '4px'
|
|
152
|
+
} : {
|
|
153
|
+
paddingLeft: '10px',
|
|
154
|
+
paddingRight: '6px',
|
|
155
|
+
marginRight: '4px'
|
|
156
|
+
}
|
|
157
|
+
}}>
|
|
158
|
+
{!isAvatarImage(item) && hasIconSlot(icon) ? <G9IconSlot {...icon} size={14} color={null != (_item_iconTintColor = item.iconTintColor) ? _item_iconTintColor : 'var(--g9-on-surface-variant)'}/> : null}
|
|
159
|
+
<text className="g9-combo__tonal-text" text-maxline="1">
|
|
160
|
+
{item.text}
|
|
161
|
+
</text>
|
|
162
|
+
<view className="g9-combo__tonal-close" accessibility-element={true} accessibility-traits="button" accessibility-label={item.text} {...props.removable ? {
|
|
163
|
+
catchtap: props.onRemove
|
|
164
|
+
} : {}}>
|
|
165
|
+
<G9IconSlot icon={glyphs.clear} size={16} color="var(--g9-text-tertiary)"/>
|
|
166
|
+
</view>
|
|
167
|
+
</view>;
|
|
168
|
+
}
|
|
127
169
|
export { G9ComboBox, g9ComboMaxChips, sameSelectionKeys };
|
|
128
170
|
|
|
129
171
|
//# sourceMappingURL=combo-box.jsx.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pickers/combo-box.jsx","sources":["../../src/pickers/combo-box.tsx"],"sourcesContent":["import './pickers.css';\nimport { buildSolidOrGradient, fillToCss, G9StringKey, type G9TextInputDirection } from '@g9tm/lynxcontrols-foundation';\nimport { type ReactNode, useRef } from '@lynx-js/react';\nimport { g9RowStyle } from '../base/control';\nimport { type G9SelectionItem, selectionKey } from '../base/selection-item';\nimport { useControllableState } from '../base/use-controllable-state';\nimport { useG9Direction, useG9Settings, useG9Strings, useG9Theme } from '../provider/hooks';\nimport { showSelectionSheet } from '../selection/selection-sheet';\nimport { useG9Sheets } from '../sheet/service';\nimport {\n type G9PickerFieldProps,\n PickerField,\n SelectionValueIcon,\n usePickerOpen,\n valueDirection,\n valueDirectionClass,\n} from './trigger';\n\n/** Chips shown in the box before the `+N` overflow chip (MAUI combo). */\nexport const g9ComboMaxChips = 2;\n\n/** Props of {@link G9ComboBox}. */\nexport interface G9ComboBoxProps<T extends G9SelectionItem = G9SelectionItem> extends G9PickerFieldProps {\n /** The rows (MAUI `ItemsSource`). Disabled items are left out except selected ones (shown dimmed). */\n readonly items: ReadonlyArray<T>;\n /** Multi-selection (MAUI `AllowMultipleSelection`): `values` instead of `value`, Done commits. Default false. */\n readonly allowMultiple?: boolean;\n /** Single mode: the selected key (MAUI `SelectedItem`). */\n readonly value?: string | null;\n readonly defaultValue?: string | null;\n readonly onValueChange?: (key: string | null, item: T | null) => void;\n /** Multi mode: the selected keys, in list order (MAUI `SelectedItems`). */\n readonly values?: ReadonlyArray<string>;\n readonly defaultValues?: ReadonlyArray<string>;\n readonly onValuesChange?: (keys: ReadonlyArray<string>, items: ReadonlyArray<T>) => void;\n /** Sheet title; default the label, else the placeholder. */\n readonly sheetTitle?: string | null;\n /** Text when the search finds nothing (MAUI `EmptyStateText`, default localized \"No results\"). */\n readonly emptyStateText?: string | null;\n /** A × in the trailing slot clears the selection while there is one (MAUI `ClearButton`). Default true. */\n readonly clearButton?: boolean;\n /** Direction of the value/chips and the sheet rows (MAUI `ValueTextDirection`). Default follows the culture. */\n readonly valueTextDirection?: G9TextInputDirection;\n}\n\n/** Two key lists hold the same keys in the same order. */\nexport function sameSelectionKeys(a: ReadonlyArray<string>, b: ReadonlyArray<string>): boolean {\n return a.length === b.length && a.every((k, i) => k === b[i]);\n}\nconst sameKeys = sameSelectionKeys;\n\n/**\n * Searchable single or multi selection in an outlined box (MAUI `G9ComboBox`). The sheet always has search. Single:\n * only a pick writes the value; a dismissal leaves it. Multi: Done commits, and so does dismissing a sheet whose\n * selection changed; an untouched dismissal writes nothing. The box shows the value (icon or swatch + text), or up\n * to two chips and a `+N` chip; with `clearButton` the trailing search glyph becomes × while there is a value and a\n * tap on it clears without opening. A result that arrives after the field unmounted, or after a newer open, is\n * dropped.\n */\nexport function G9ComboBox<T extends G9SelectionItem = G9SelectionItem>(props: G9ComboBoxProps<T>): ReactNode {\n const sheets = useG9Sheets();\n const glyphs = useG9Settings().glyphs;\n const strings = useG9Strings();\n const culture = useG9Direction();\n const primary = useG9Theme().palette.Primary;\n const open = usePickerOpen();\n const multiple = props.allowMultiple === true;\n const byKey = (keys: ReadonlyArray<string>) =>\n keys.map((k) => props.items.find((i) => selectionKey(i) === k)).filter((i): i is T => i !== undefined);\n const [key, setKey] = useControllableState<string | null, [T | null]>({\n value: props.value,\n defaultValue: props.defaultValue ?? null,\n onChange: props.onValueChange,\n name: 'G9ComboBox.value',\n });\n const [keys, setKeys] = useControllableState<ReadonlyArray<string>, [ReadonlyArray<T>]>({\n value: props.values,\n defaultValue: props.defaultValues ?? [],\n onChange: props.onValuesChange,\n name: 'G9ComboBox.values',\n equals: sameKeys,\n });\n const latest = useRef({ props, key, keys });\n latest.current = { props, key, keys };\n\n const selected = multiple ? byKey(keys) : byKey(key === null ? [] : [key]);\n const hasValue = selected.length > 0;\n const blocked = props.disabled === true || props.readOnly === true;\n\n const clear = () => {\n if (multiple) setKeys([], []);\n else setKey(null, null);\n };\n\n const onOpen = () =>\n open(async (isCurrent) => {\n const { props: p, key: k, keys: ks } = latest.current;\n const current = p.allowMultiple ? ks : k === null ? [] : [k];\n const picked = current\n .map((c) => p.items.find((i) => selectionKey(i) === c))\n .filter((i): i is T => i !== undefined);\n const items = p.items.filter((i) => i.isEnabled !== false || picked.includes(i));\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: picked,\n allowMultiple: p.allowMultiple === true,\n closeOnSingleSelection: p.allowMultiple !== true,\n showSearch: true,\n emptyText: p.emptyStateText ?? strings.get(G9StringKey.NoResults),\n ...(p.valueTextDirection ? { itemTextDirection: p.valueTextDirection } : {}),\n });\n if (!isCurrent()) return;\n if (p.allowMultiple) {\n if (!result.wasAccepted && !result.selectionChanged) return;\n const next = result.items.map(selectionKey);\n if (sameKeys(next, latest.current.keys)) return;\n setKeys(next, result.items);\n } else if (result.wasAccepted) {\n const item = result.items[0] ?? null;\n setKey(item ? selectionKey(item) : null, item);\n }\n });\n\n const showClear = props.clearButton !== false && hasValue && !blocked;\n const dir = valueDirectionClass(props.valueTextDirection, culture);\n const row = g9RowStyle(valueDirection(props.valueTextDirection, culture));\n return (\n <PickerField\n field={{ trailingIcon: glyphs.search, ...props }}\n hasValue={hasValue}\n onOpen={onOpen}\n trailingAffordance={\n showClear\n ? { icon: glyphs.clear, signature: 'clear', label: strings.get(G9StringKey.Clear), onPress: clear }\n : null\n }\n >\n <view className={`g9-combo__value ${dir}`} style={row}>\n {multiple && hasValue ? (\n <view className=\"g9-combo__chips\" style={row}>\n {selected.slice(0, g9ComboMaxChips).map((item) => (\n // MAUI G9Colors.BuildSolidOrGradient(palette.Primary, useGradient: true).\n <view\n key={selectionKey(item)}\n className=\"g9-combo__chip\"\n style={{ ...row, background: fillToCss(buildSolidOrGradient(primary, true)) }}\n >\n <SelectionValueIcon item={item} color=\"var(--g9-on-primary)\" />\n <text className=\"g9-combo__chip-text\" text-maxline=\"1\">\n {item.text}\n </text>\n </view>\n ))}\n {selected.length > g9ComboMaxChips ? (\n <view className=\"g9-combo__chip g9-combo__chip--more\">\n <text className=\"g9-combo__chip-text\">{`+${selected.length - g9ComboMaxChips}`}</text>\n </view>\n ) : null}\n </view>\n ) : (\n [\n hasValue ? <SelectionValueIcon key=\"i\" item={selected[0] as T} /> : null,\n <text\n key=\"t\"\n className={`g9-picker__text${hasValue ? '' : ' g9-picker__text--placeholder'}`}\n text-maxline=\"1\"\n >\n {hasValue ? (selected[0] as T).text : props.label ? '' : (props.placeholder ?? '')}\n </text>,\n ]\n )}\n </view>\n </PickerField>\n );\n}\n"],"names":["g9ComboMaxChips","sameSelectionKeys","a","b","k","i","sameKeys","G9ComboBox","props","_props_defaultValue","_props_defaultValues","_props_placeholder","sheets","useG9Sheets","glyphs","useG9Settings","strings","useG9Strings","culture","useG9Direction","primary","useG9Theme","open","usePickerOpen","multiple","byKey","keys","selectionKey","undefined","key","setKey","useControllableState","setKeys","latest","useRef","selected","hasValue","blocked","clear","onOpen","isCurrent","_ref","_p_emptyStateText","_p_sheetTitle","p","ks","current","picked","c","items","result","showSelectionSheet","G9StringKey","next","_result_items_","item","showClear","dir","valueDirectionClass","row","g9RowStyle","valueDirection","PickerField","view","fillToCss","buildSolidOrGradient","SelectionValueIcon","text"],"mappings":";;;;;;;;;;AAmBO,MAAMA,kBAAkB;AA2BxB,SAASC,kBAAkBC,CAAwB,EAAEC,CAAwB;IAClF,OAAOD,EAAE,MAAM,KAAKC,EAAE,MAAM,IAAID,EAAE,KAAK,CAAC,CAACE,GAAGC,IAAMD,MAAMD,CAAC,CAACE,EAAE;AAC9D;AACA,MAAMC,WAAWL;AAUV,SAASM,WAAwDC,KAAyB;QAY/EC,qBAMAC,sBA4FsDC;IA7GtE,MAAMC,SAASC;IACf,MAAMC,SAASC,gBAAgB,MAAM;IACrC,MAAMC,UAAUC;IAChB,MAAMC,UAAUC;IAChB,MAAMC,UAAUC,aAAa,OAAO,CAAC,OAAO;IAC5C,MAAMC,OAAOC;IACb,MAAMC,WAAWhB,AAAwB,SAAxBA,MAAM,aAAa;IACpC,MAAMiB,QAAQ,CAACC,OACbA,KAAK,GAAG,CAAC,CAACtB,IAAMI,MAAM,KAAK,CAAC,IAAI,C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AAY8B,mBAAmB,IAAI,IAAI,MAAM/B,QAAQ,CAAC,EAAE,MAAY;SACnEgC,KACC,IAAI,IACJ,WAAW,CAAC,eAAe,EAAE/B,WAAW,KAAK,iCAAiC,EAC9E,aAAa,IACd;cACC,CAACA,WAAYD,QAAQ,CAAC,EAAE,CAAO,IAAI,GAAG3B,MAAM,KAAK,GAAG,KAAK,QAACG,CAAAA,qBAAAA,MAAM,WAAW,AAAD,IAAhBA,qBAAqB,GAAI;YACrF,EAAEwD;KACH,CACD;MACJ,EAAEJ,KAAK;IACT,EAAED;AAEN"}
|
|
1
|
+
{"version":3,"file":"pickers/combo-box.jsx","sources":["../../src/pickers/combo-box.tsx"],"sourcesContent":["import { resolveRestingPlaceholder } from '../fields/outlined-field';\nimport './pickers.css';\nimport { buildSolidOrGradient, fillToCss, G9StringKey, type G9TextInputDirection } from '@g9tm/lynxcontrols-foundation';\nimport { type ReactNode, useRef } from '@lynx-js/react';\nimport { g9RowStyle } from '../base/control';\nimport { type G9SelectionItem, isAvatarImage, selectionKey } from '../base/selection-item';\nimport { useControllableState } from '../base/use-controllable-state';\nimport { G9IconSlot, hasIconSlot } from '../icon/slot';\nimport { useG9Direction, useG9Settings, useG9Strings, useG9Theme } from '../provider/hooks';\nimport { showSelectionSheet } from '../selection/selection-sheet';\nimport { useG9Sheets } from '../sheet/service';\nimport {\n type G9PickerFieldProps,\n PickerField,\n SelectionValueIcon,\n usePickerOpen,\n valueDirection,\n valueDirectionClass,\n} from './trigger';\n\n/** Chips shown in the box before the `+N` overflow chip (MAUI combo). */\nexport const g9ComboMaxChips = 2;\n\n/** Props of {@link G9ComboBox}. */\nexport interface G9ComboBoxProps<T extends G9SelectionItem = G9SelectionItem> extends G9PickerFieldProps {\n /** The rows (MAUI `ItemsSource`). Disabled items are left out except selected ones (shown dimmed). */\n readonly items: ReadonlyArray<T>;\n /** Multi-selection (MAUI `AllowMultipleSelection`): `values` instead of `value`, Done commits. Default false. */\n readonly allowMultiple?: boolean;\n /** Single mode: the selected key (MAUI `SelectedItem`). */\n readonly value?: string | null;\n readonly defaultValue?: string | null;\n readonly onValueChange?: (key: string | null, item: T | null) => void;\n /** Multi mode: the selected keys, in list order (MAUI `SelectedItems`). */\n readonly values?: ReadonlyArray<string>;\n readonly defaultValues?: ReadonlyArray<string>;\n readonly onValuesChange?: (keys: ReadonlyArray<string>, items: ReadonlyArray<T>) => void;\n /** Sheet title; default the label, else the placeholder. */\n readonly sheetTitle?: string | null;\n /** Text when the search finds nothing (MAUI `EmptyStateText`, default localized \"No results\"). */\n readonly emptyStateText?: string | null;\n /** A × in the trailing slot clears the selection while there is one (MAUI `ClearButton`). Default true. */\n readonly clearButton?: boolean;\n /** Direction of the value/chips and the sheet rows (MAUI `ValueTextDirection`). Default follows the culture. */\n readonly valueTextDirection?: G9TextInputDirection;\n /**\n * How a multi-select field draws its chosen items (MAUI 1.4.10 `ChipStyle`): `'filled'` (default — primary chips) or\n * `'tonal'` — light pills (SurfaceContainerLow, an OutlineVariant hairline, TextPrimary 14) each with its own «×» that\n * removes that one item without opening the sheet. Pair with `clearButton={false}` to keep the trailing glyph (AgriPad).\n */\n readonly chipStyle?: G9ComboBoxChipStyle;\n}\n\n/** MAUI `G9ComboBoxChipStyle`. */\nexport type G9ComboBoxChipStyle = 'filled' | 'tonal';\n\n/** Two key lists hold the same keys in the same order. */\nexport function sameSelectionKeys(a: ReadonlyArray<string>, b: ReadonlyArray<string>): boolean {\n return a.length === b.length && a.every((k, i) => k === b[i]);\n}\nconst sameKeys = sameSelectionKeys;\n\n/**\n * Searchable single or multi selection in an outlined box (MAUI `G9ComboBox`). The sheet always has search. Single:\n * only a pick writes the value; a dismissal leaves it. Multi: Done commits, and so does dismissing a sheet whose\n * selection changed; an untouched dismissal writes nothing. The box shows the value (icon or swatch + text), or up\n * to two chips and a `+N` chip; with `clearButton` the trailing search glyph becomes × while there is a value and a\n * tap on it clears without opening. A result that arrives after the field unmounted, or after a newer open, is\n * dropped.\n */\nexport function G9ComboBox<T extends G9SelectionItem = G9SelectionItem>(props: G9ComboBoxProps<T>): ReactNode {\n const sheets = useG9Sheets();\n const glyphs = useG9Settings().glyphs;\n const strings = useG9Strings();\n const culture = useG9Direction();\n const primary = useG9Theme().palette.Primary;\n const open = usePickerOpen();\n const multiple = props.allowMultiple === true;\n const byKey = (keys: ReadonlyArray<string>) =>\n keys.map((k) => props.items.find((i) => selectionKey(i) === k)).filter((i): i is T => i !== undefined);\n const [key, setKey] = useControllableState<string | null, [T | null]>({\n value: props.value,\n defaultValue: props.defaultValue ?? null,\n onChange: props.onValueChange,\n name: 'G9ComboBox.value',\n });\n const [keys, setKeys] = useControllableState<ReadonlyArray<string>, [ReadonlyArray<T>]>({\n value: props.values,\n defaultValue: props.defaultValues ?? [],\n onChange: props.onValuesChange,\n name: 'G9ComboBox.values',\n equals: sameKeys,\n });\n const latest = useRef({ props, key, keys });\n latest.current = { props, key, keys };\n\n const selected = multiple ? byKey(keys) : byKey(key === null ? [] : [key]);\n const hasValue = selected.length > 0;\n const blocked = props.disabled === true || props.readOnly === true;\n\n const clear = () => {\n if (multiple) setKeys([], []);\n else setKey(null, null);\n };\n // A tonal chip's «×» (MAUI RemoveSelected): one item out, the sheet stays closed (catchtap keeps the box's tap away).\n const removeOne = (item: T) => {\n if (blocked) return;\n const k = selectionKey(item);\n const next = latest.current.keys.filter((x) => x !== k);\n if (next.length !== latest.current.keys.length) setKeys(next, byKey(next));\n };\n const tonal = props.chipStyle === 'tonal';\n\n const onOpen = () =>\n open(async (isCurrent) => {\n const { props: p, key: k, keys: ks } = latest.current;\n const current = p.allowMultiple ? ks : k === null ? [] : [k];\n const picked = current\n .map((c) => p.items.find((i) => selectionKey(i) === c))\n .filter((i): i is T => i !== undefined);\n const items = p.items.filter((i) => i.isEnabled !== false || picked.includes(i));\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: picked,\n allowMultiple: p.allowMultiple === true,\n closeOnSingleSelection: p.allowMultiple !== true,\n showSearch: true,\n emptyText: p.emptyStateText ?? strings.get(G9StringKey.NoResults),\n ...(p.valueTextDirection ? { itemTextDirection: p.valueTextDirection } : {}),\n });\n if (!isCurrent()) return;\n if (p.allowMultiple) {\n if (!result.wasAccepted && !result.selectionChanged) return;\n const next = result.items.map(selectionKey);\n if (sameKeys(next, latest.current.keys)) return;\n setKeys(next, result.items);\n } else if (result.wasAccepted) {\n const item = result.items[0] ?? null;\n setKey(item ? selectionKey(item) : null, item);\n }\n });\n\n const showClear = props.clearButton !== false && hasValue && !blocked;\n const dir = valueDirectionClass(props.valueTextDirection, culture);\n const row = g9RowStyle(valueDirection(props.valueTextDirection, culture));\n return (\n <PickerField\n field={{ trailingIcon: glyphs.search, ...props }}\n hasValue={hasValue}\n onOpen={onOpen}\n trailingAffordance={\n showClear\n ? { icon: glyphs.clear, signature: 'clear', label: strings.get(G9StringKey.Clear), onPress: clear }\n : null\n }\n >\n <view className={`g9-combo__value ${dir}`} style={row}>\n {multiple && hasValue ? (\n <view className=\"g9-combo__chips\" style={row}>\n {selected.slice(0, g9ComboMaxChips).map((item) =>\n tonal ? (\n <TonalChip\n key={selectionKey(item)}\n item={item}\n row={row}\n rtl={valueDirection(props.valueTextDirection, culture) === 'rtl'}\n removable={!blocked}\n onRemove={() => removeOne(item)}\n />\n ) : (\n // MAUI G9Colors.BuildSolidOrGradient(palette.Primary, useGradient: true).\n <view\n key={selectionKey(item)}\n className=\"g9-combo__chip\"\n style={{ ...row, background: fillToCss(buildSolidOrGradient(primary, true)) }}\n >\n <SelectionValueIcon item={item} color=\"var(--g9-on-primary)\" inChip />\n <text className=\"g9-combo__chip-text\" text-maxline=\"1\">\n {item.text}\n </text>\n </view>\n ),\n )}\n {selected.length > g9ComboMaxChips ? (\n <view className=\"g9-combo__chip g9-combo__chip--more\">\n <text className=\"g9-combo__chip-text\">{`+${selected.length - g9ComboMaxChips}`}</text>\n </view>\n ) : null}\n </view>\n ) : (\n [\n hasValue ? <SelectionValueIcon key=\"i\" item={selected[0] as T} /> : null,\n <text\n key=\"t\"\n className={`g9-picker__text${hasValue ? '' : ' g9-picker__text--placeholder'}`}\n text-maxline=\"1\"\n >\n {hasValue ? (selected[0] as T).text : (resolveRestingPlaceholder(props) ?? '')}\n </text>,\n ]\n )}\n </view>\n </PickerField>\n );\n}\n\n/**\n * A `chipStyle: 'tonal'` chip (MAUI 1.4.10 `CreateTonalChip`): 34 high, fully rounded, SurfaceContainerLow on a 1 px\n * OutlineVariant hairline, padding 10 at the start and 6 at the end, 4 after it; an icon (never an avatar) at 14, the text\n * in TextPrimary 14, then a 24 px «×» (TextTertiary 16) that removes this item. Only the «×» takes the tap — the rest of\n * the chip lets it through to the field, which opens the sheet.\n */\nfunction TonalChip(props: {\n readonly item: G9SelectionItem;\n readonly row: ReturnType<typeof g9RowStyle>;\n readonly rtl: boolean;\n readonly removable: boolean;\n readonly onRemove: () => void;\n}): ReactNode {\n const glyphs = useG9Settings().glyphs;\n const { item } = props;\n const icon = {\n emoji: item.emoji ?? null,\n icon: item.icon,\n imagePath: item.iconPath ?? null,\n image: item.iconImage ?? null,\n };\n return (\n // Physical sides from the row's direction (a row never relies on CSS `direction` — Lynxtron ignores it).\n <view\n className=\"g9-combo__tonal\"\n style={{\n ...props.row,\n ...(props.rtl\n ? { paddingRight: '10px', paddingLeft: '6px', marginLeft: '4px' }\n : { paddingLeft: '10px', paddingRight: '6px', marginRight: '4px' }),\n }}\n >\n {!isAvatarImage(item) && hasIconSlot(icon) ? (\n <G9IconSlot {...icon} size={14} color={item.iconTintColor ?? 'var(--g9-on-surface-variant)'} />\n ) : null}\n <text className=\"g9-combo__tonal-text\" text-maxline=\"1\">\n {item.text}\n </text>\n <view\n className=\"g9-combo__tonal-close\"\n accessibility-element={true}\n accessibility-traits=\"button\"\n accessibility-label={item.text}\n {...(props.removable ? { catchtap: props.onRemove } : {})}\n >\n <G9IconSlot icon={glyphs.clear} size={16} color=\"var(--g9-text-tertiary)\" />\n </view>\n </view>\n );\n}\n"],"names":["g9ComboMaxChips","sameSelectionKeys","a","b","k","i","sameKeys","G9ComboBox","props","_props_defaultValue","_props_defaultValues","_resolveRestingPlaceholder","sheets","useG9Sheets","glyphs","useG9Settings","strings","useG9Strings","culture","useG9Direction","primary","useG9Theme","open","usePickerOpen","multiple","byKey","keys","selectionKey","undefined","key","setKey","useControllableState","setKeys","latest","useRef","selected","hasValue","blocked","clear","removeOne","item","next","x","tonal","onOpen","isCurrent","_ref","_p_emptyStateText","_p_sheetTitle","p","ks","current","picked","c","items","result","showSelectionSheet","G9StringKey","_result_items_","showClear","dir","valueDirectionClass","row","g9RowStyle","valueDirection","PickerField","view","TonalChip","fillToCss","buildSolidOrGradient","SelectionValueIcon","text","_item_emoji","_item_iconPath","_item_iconImage","_item_iconTintColor","icon","isAvatarImage","hasIconSlot","G9IconSlot"],"mappings":";;;;;;;;;;;;AAqBO,MAAMA,kBAAkB;AAoCxB,SAASC,kBAAkBC,CAAwB,EAAEC,CAAwB;IAClF,OAAOD,EAAE,MAAM,KAAKC,EAAE,MAAM,IAAID,EAAE,KAAK,CAAC,CAACE,GAAGC,IAAMD,MAAMD,CAAC,CAACE,EAAE;AAC9D;AACA,MAAMC,WAAWL;AAUV,SAASM,WAAwDC,KAAyB;QAY/EC,qBAMAC,sBA+GmCC;IAhInD,MAAMC,SAASC;IACf,MAAMC,SAASC,gBAAgB,MAAM;IACrC,MAAMC,UAAUC;IAChB,MAAMC,UAAUC;IAChB,MAAMC,UAAUC,aAAa,OAAO,CAAC,OAAO;IAC5C,MAAMC,OAAOC;IACb,MAAMC,WAAWhB,AAAwB,SAAxBA,MAAM,aAAa;IACpC,MAAMiB,QAAQ,CAACC,OACbA,KAAK,GAAG,CAAC,CAACtB,IAAMI,MAAM,KAAK,CAAC,IAAI,CAAC,CAACH,IAAMsB,aAAatB,OAAOD,IAAI,MAAM,CAAC,CAACC,IAAcA,AAAMu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;YAAE,cAAc;YAAQ,aAAa;YAAO,YAAY;QAAM,IAC9D;YAAE,aAAa;YAAQ,cAAc;YAAO,aAAa;QAAM,CAAC;IACtE,GACD;MACC,CAAC,CAACqE,cAAcrC,SAASsC,YAAYF,SAClCG,YAAY,GAAGH,IAAI,EAAE,MAAM,IAAI,OAAO,QAAAD,CAAAA,sBAAAA,KAAK,aAAa,AAAD,IAAjBA,sBAAsB,oCAC3D,KAAK;MACT,CAACJ,KAAK,UAAU,uBAAuB,aAAa,IAAI;QACtD,CAAC/B,KAAK,IAAI,CAAC;MACb,EAAE+B,KAAK;MACP,CAACL,KACC,UAAU,wBACV,uBAAuB,MACvB,qBAAqB,SACrB,qBAAqB1B,KAAK,IAAI,GAC7B,GAAIhC,MAAM,SAAS,GAAG;QAAE,UAAUA,MAAM,QAAQ;IAAC,IAAI,CAAC,CAAC,EACzD;QACC,CAACuE,WAAW,MAAMjE,OAAO,KAAK,EAAE,MAAM,IAAI,MAAM,2BAA4B;MAC9E,EAAEoD,KAAK;IACT,EAAEA;AAEN"}
|
|
@@ -2,8 +2,8 @@ import './pickers.css';
|
|
|
2
2
|
import { type G9CalendarSystem, type G9Culture, G9DateTimeDisplayFormat, G9DateTimePickerMode, type G9LocalDate, type G9LocalDateTime } from '@g9tm/lynxcontrols-foundation';
|
|
3
3
|
import { type ReactNode } from '@lynx-js/react';
|
|
4
4
|
import { type G9PickerFieldProps } from './trigger.js';
|
|
5
|
-
/** Years the year window grows by at an edge (MAUI `YearWindowStep
|
|
6
|
-
export declare const g9YearWindowStep =
|
|
5
|
+
/** Years the year window grows by at an edge (MAUI `YearWindowStep`: 12 since 1.4.11, was 25). */
|
|
6
|
+
export declare const g9YearWindowStep = 12;
|
|
7
7
|
/** Props of {@link G9DateTimePicker}. */
|
|
8
8
|
export interface G9DateTimePickerProps extends G9PickerFieldProps {
|
|
9
9
|
/** The value, always Gregorian (MAUI `SelectedDateTime`); `null` = none. Controlled with `onValueChange`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-time-picker.d.ts","sourceRoot":"","sources":["../../src/pickers/date-time-picker.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"date-time-picker.d.ts","sourceRoot":"","sources":["../../src/pickers/date-time-picker.tsx"],"names":[],"mappings":"AACA,OAAO,eAAe,CAAC;AACvB,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,uBAAuB,EACvB,oBAAoB,EACpB,KAAK,WAAW,EAChB,KAAK,eAAe,EAIrB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,KAAK,SAAS,EAAoB,MAAM,gBAAgB,CAAC;AAuBlE,OAAO,EAAE,KAAK,kBAAkB,EAA8B,MAAM,WAAW,CAAC;AAGhF,kGAAkG;AAClG,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC,yCAAyC;AACzC,MAAM,WAAW,qBAAsB,SAAQ,kBAAkB;IAC/D,6GAA6G;IAC7G,QAAQ,CAAC,KAAK,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IACxC,QAAQ,CAAC,YAAY,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IAC/C,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,KAAK,IAAI,CAAC;IACjE,wBAAwB;IACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,oBAAoB,CAAC;IACrC,6BAA6B;IAC7B,QAAQ,CAAC,aAAa,CAAC,EAAE,uBAAuB,CAAC;IACjD,mEAAmE;IACnE,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9C,QAAQ,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IACtC,QAAQ,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IACtC,0DAA0D;IAC1D,QAAQ,CAAC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IACzC;;;OAG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holder } from "../fields/outlined-field.jsx";
|
|
1
2
|
import "./pickers.css";
|
|
2
3
|
import { G9DateTimeDisplayFormat, G9DateTimePickerMode, G9StringKey, daysInMonth, formatColor, localDateTimeFromDate, withAlpha } from "@g9tm/lynxcontrols-foundation";
|
|
3
4
|
import { useRef, useState } from "@lynx-js/react";
|
|
@@ -11,7 +12,7 @@ import { asDateTime, clampPickerValue, composePickerValue, dayWheelItems, format
|
|
|
11
12
|
import { PickerSheetHeader, showPickerSheet } from "./picker-sheet.jsx";
|
|
12
13
|
import { PickerField, usePickerOpen } from "./trigger.jsx";
|
|
13
14
|
import { G9WheelColumn } from "./wheel-column.jsx";
|
|
14
|
-
const g9YearWindowStep =
|
|
15
|
+
const g9YearWindowStep = 12;
|
|
15
16
|
function DateTimeSheetBody(props) {
|
|
16
17
|
const strings = useG9Strings();
|
|
17
18
|
const palette = useG9Theme().palette;
|
|
@@ -88,7 +89,7 @@ function DateTimeSheetBody(props) {
|
|
|
88
89
|
</view>;
|
|
89
90
|
}
|
|
90
91
|
function G9DateTimePicker(props) {
|
|
91
|
-
var _props_defaultValue, _props_mode,
|
|
92
|
+
var _props_defaultValue, _props_mode, _resolveRestingPlaceholder;
|
|
92
93
|
const sheets = useG9Sheets();
|
|
93
94
|
const culture = useG9Culture();
|
|
94
95
|
const strings = useG9Strings();
|
|
@@ -141,7 +142,7 @@ function G9DateTimePicker(props) {
|
|
|
141
142
|
...props
|
|
142
143
|
}} hasValue={null !== value} onOpen={onOpen}>
|
|
143
144
|
<text className={`g9-picker__text${value ? '' : ' g9-picker__text--placeholder'}`} text-maxline="1">
|
|
144
|
-
{value ? format(value) :
|
|
145
|
+
{value ? format(value) : null != (_resolveRestingPlaceholder = resolveRestingPlaceholder(props)) ? _resolveRestingPlaceholder : ''}
|
|
145
146
|
</text>
|
|
146
147
|
</PickerField>;
|
|
147
148
|
}
|