@flanksource/clicky-ui 0.3.83 → 0.3.85
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/components/Combobox.cjs +8 -6
- package/dist/components/Combobox.cjs.map +1 -1
- package/dist/components/Combobox.d.ts.map +1 -1
- package/dist/components/Combobox.js +8 -6
- package/dist/components/Combobox.js.map +1 -1
- package/dist/components/ComboboxMenu.cjs +7 -4
- package/dist/components/ComboboxMenu.cjs.map +1 -1
- package/dist/components/ComboboxMenu.d.ts +3 -2
- package/dist/components/ComboboxMenu.d.ts.map +1 -1
- package/dist/components/ComboboxMenu.js +7 -4
- package/dist/components/ComboboxMenu.js.map +1 -1
- package/dist/components/DateField.cjs.map +1 -1
- package/dist/components/DateField.d.ts +3 -2
- package/dist/components/DateField.d.ts.map +1 -1
- package/dist/components/DateField.js.map +1 -1
- package/dist/components/DatePicker.cjs +9 -61
- package/dist/components/DatePicker.cjs.map +1 -1
- package/dist/components/DatePicker.d.ts +5 -19
- package/dist/components/DatePicker.d.ts.map +1 -1
- package/dist/components/DatePicker.js +11 -63
- package/dist/components/DatePicker.js.map +1 -1
- package/dist/components/DateTimePicker.cjs +9 -78
- package/dist/components/DateTimePicker.cjs.map +1 -1
- package/dist/components/DateTimePicker.d.ts +5 -19
- package/dist/components/DateTimePicker.d.ts.map +1 -1
- package/dist/components/DateTimePicker.js +11 -80
- package/dist/components/DateTimePicker.js.map +1 -1
- package/dist/components/FilterBar.cjs +64 -47
- package/dist/components/FilterBar.cjs.map +1 -1
- package/dist/components/FilterBar.d.ts +20 -2
- package/dist/components/FilterBar.d.ts.map +1 -1
- package/dist/components/FilterBar.js +63 -46
- package/dist/components/FilterBar.js.map +1 -1
- package/dist/components/TimeRange.cjs +156 -128
- package/dist/components/TimeRange.cjs.map +1 -1
- package/dist/components/TimeRange.d.ts +8 -1
- package/dist/components/TimeRange.d.ts.map +1 -1
- package/dist/components/TimeRange.js +156 -128
- package/dist/components/TimeRange.js.map +1 -1
- package/dist/components/calendar-grid.cjs +83 -0
- package/dist/components/calendar-grid.cjs.map +1 -0
- package/dist/components/calendar-grid.d.ts +9 -0
- package/dist/components/calendar-grid.d.ts.map +1 -0
- package/dist/components/calendar-grid.js +83 -0
- package/dist/components/calendar-grid.js.map +1 -0
- package/dist/components/combobox-types.d.ts +5 -0
- package/dist/components/combobox-types.d.ts.map +1 -1
- package/dist/components/date-input-field.cjs +88 -0
- package/dist/components/date-input-field.cjs.map +1 -0
- package/dist/components/date-input-field.d.ts +37 -0
- package/dist/components/date-input-field.d.ts.map +1 -0
- package/dist/components/date-input-field.js +88 -0
- package/dist/components/date-input-field.js.map +1 -0
- package/dist/components/date-math.cjs +67 -0
- package/dist/components/date-math.cjs.map +1 -0
- package/dist/components/date-math.d.ts +33 -0
- package/dist/components/date-math.d.ts.map +1 -0
- package/dist/components/date-math.js +60 -0
- package/dist/components/date-math.js.map +1 -0
- package/dist/components/date-picker-menu.cjs +129 -0
- package/dist/components/date-picker-menu.cjs.map +1 -0
- package/dist/components/date-picker-menu.d.ts +18 -0
- package/dist/components/date-picker-menu.d.ts.map +1 -0
- package/dist/components/date-picker-menu.js +129 -0
- package/dist/components/date-picker-menu.js.map +1 -0
- package/dist/components/filter-bar-context.cjs.map +1 -1
- package/dist/components/filter-bar-context.d.ts +2 -0
- package/dist/components/filter-bar-context.d.ts.map +1 -1
- package/dist/components/filter-bar-context.js.map +1 -1
- package/dist/components/filter-bar-field-utils.cjs +18 -4
- package/dist/components/filter-bar-field-utils.cjs.map +1 -1
- package/dist/components/filter-bar-field-utils.d.ts +3 -2
- package/dist/components/filter-bar-field-utils.d.ts.map +1 -1
- package/dist/components/filter-bar-field-utils.js +19 -5
- package/dist/components/filter-bar-field-utils.js.map +1 -1
- package/dist/components/filter-bar-menu.cjs +189 -0
- package/dist/components/filter-bar-menu.cjs.map +1 -0
- package/dist/components/filter-bar-menu.d.ts +25 -0
- package/dist/components/filter-bar-menu.d.ts.map +1 -0
- package/dist/components/filter-bar-menu.js +189 -0
- package/dist/components/filter-bar-menu.js.map +1 -0
- package/dist/components/filter-bar-multi.cjs +1 -1
- package/dist/components/filter-bar-multi.cjs.map +1 -1
- package/dist/components/filter-bar-multi.js +2 -2
- package/dist/components/filter-bar-multi.js.map +1 -1
- package/dist/components/filter-bar-popup.cjs +37 -0
- package/dist/components/filter-bar-popup.cjs.map +1 -0
- package/dist/components/filter-bar-popup.d.ts +32 -0
- package/dist/components/filter-bar-popup.d.ts.map +1 -0
- package/dist/components/filter-bar-popup.js +37 -0
- package/dist/components/filter-bar-popup.js.map +1 -0
- package/dist/components/filter-bar-tree.cjs +1 -1
- package/dist/components/filter-bar-tree.cjs.map +1 -1
- package/dist/components/filter-bar-tree.js +2 -2
- package/dist/components/filter-bar-tree.js.map +1 -1
- package/dist/components/json-schema-form-date-math.cjs +15 -11
- package/dist/components/json-schema-form-date-math.cjs.map +1 -1
- package/dist/components/json-schema-form-date-math.d.ts +3 -0
- package/dist/components/json-schema-form-date-math.d.ts.map +1 -1
- package/dist/components/json-schema-form-date-math.js +15 -12
- package/dist/components/json-schema-form-date-math.js.map +1 -1
- package/dist/components/json-schema-form-table-array.cjs +5 -3
- package/dist/components/json-schema-form-table-array.cjs.map +1 -1
- package/dist/components/json-schema-form-table-array.d.ts.map +1 -1
- package/dist/components/json-schema-form-table-array.js +5 -3
- package/dist/components/json-schema-form-table-array.js.map +1 -1
- package/dist/components.cjs +1 -1
- package/dist/components.d.ts +1 -0
- package/dist/components.d.ts.map +1 -1
- package/dist/components.js +1 -1
- package/dist/connections/ConnectionPicker.cjs +6 -2
- package/dist/connections/ConnectionPicker.cjs.map +1 -1
- package/dist/connections/ConnectionPicker.d.ts.map +1 -1
- package/dist/connections/ConnectionPicker.js +6 -2
- package/dist/connections/ConnectionPicker.js.map +1 -1
- package/dist/connections/CreateConnectionDialog.cjs +8 -21
- package/dist/connections/CreateConnectionDialog.cjs.map +1 -1
- package/dist/connections/CreateConnectionDialog.d.ts +2 -1
- package/dist/connections/CreateConnectionDialog.d.ts.map +1 -1
- package/dist/connections/CreateConnectionDialog.js +8 -21
- package/dist/connections/CreateConnectionDialog.js.map +1 -1
- package/dist/data/ExpandableMarkdown.cjs +59 -0
- package/dist/data/ExpandableMarkdown.cjs.map +1 -0
- package/dist/data/ExpandableMarkdown.d.ts +17 -0
- package/dist/data/ExpandableMarkdown.d.ts.map +1 -0
- package/dist/data/ExpandableMarkdown.js +59 -0
- package/dist/data/ExpandableMarkdown.js.map +1 -0
- package/dist/data/MultiGaugeBar.cjs +49 -21
- package/dist/data/MultiGaugeBar.cjs.map +1 -1
- package/dist/data/MultiGaugeBar.d.ts +5 -2
- package/dist/data/MultiGaugeBar.d.ts.map +1 -1
- package/dist/data/MultiGaugeBar.js +49 -21
- package/dist/data/MultiGaugeBar.js.map +1 -1
- package/dist/data/PromptDialog.cjs +19 -5
- package/dist/data/PromptDialog.cjs.map +1 -1
- package/dist/data/PromptDialog.d.ts +15 -1
- package/dist/data/PromptDialog.d.ts.map +1 -1
- package/dist/data/PromptDialog.js +19 -5
- package/dist/data/PromptDialog.js.map +1 -1
- package/dist/data/PromptIndicator.cjs +3 -2
- package/dist/data/PromptIndicator.cjs.map +1 -1
- package/dist/data/PromptIndicator.d.ts +4 -1
- package/dist/data/PromptIndicator.d.ts.map +1 -1
- package/dist/data/PromptIndicator.js +3 -2
- package/dist/data/PromptIndicator.js.map +1 -1
- package/dist/data/diagnostics/ErrorDetails.cjs +155 -110
- package/dist/data/diagnostics/ErrorDetails.cjs.map +1 -1
- package/dist/data/diagnostics/ErrorDetails.d.ts.map +1 -1
- package/dist/data/diagnostics/ErrorDetails.js +155 -110
- package/dist/data/diagnostics/ErrorDetails.js.map +1 -1
- package/dist/data/flow-node/BoxNode.cjs +45 -0
- package/dist/data/flow-node/BoxNode.cjs.map +1 -0
- package/dist/data/flow-node/BoxNode.d.ts +28 -0
- package/dist/data/flow-node/BoxNode.d.ts.map +1 -0
- package/dist/data/flow-node/BoxNode.js +45 -0
- package/dist/data/flow-node/BoxNode.js.map +1 -0
- package/dist/data/flow-node/FlowMetrics.cjs +208 -0
- package/dist/data/flow-node/FlowMetrics.cjs.map +1 -0
- package/dist/data/flow-node/FlowMetrics.d.ts +60 -0
- package/dist/data/flow-node/FlowMetrics.d.ts.map +1 -0
- package/dist/data/flow-node/FlowMetrics.js +206 -0
- package/dist/data/flow-node/FlowMetrics.js.map +1 -0
- package/dist/data/flow-node/WorkloadNode.cjs +63 -0
- package/dist/data/flow-node/WorkloadNode.cjs.map +1 -0
- package/dist/data/flow-node/WorkloadNode.d.ts +42 -0
- package/dist/data/flow-node/WorkloadNode.d.ts.map +1 -0
- package/dist/data/flow-node/WorkloadNode.js +63 -0
- package/dist/data/flow-node/WorkloadNode.js.map +1 -0
- package/dist/data/flow-node/index.d.ts +5 -0
- package/dist/data/flow-node/index.d.ts.map +1 -0
- package/dist/data/flow-node/latency.cjs +37 -0
- package/dist/data/flow-node/latency.cjs.map +1 -0
- package/dist/data/flow-node/latency.d.ts +13 -0
- package/dist/data/flow-node/latency.d.ts.map +1 -0
- package/dist/data/flow-node/latency.js +35 -0
- package/dist/data/flow-node/latency.js.map +1 -0
- package/dist/data/test-runner/TestDetailPanel.cjs +109 -46
- package/dist/data/test-runner/TestDetailPanel.cjs.map +1 -1
- package/dist/data/test-runner/TestDetailPanel.d.ts.map +1 -1
- package/dist/data/test-runner/TestDetailPanel.js +110 -47
- package/dist/data/test-runner/TestDetailPanel.js.map +1 -1
- package/dist/data/test-runner/TestTreeNode.cjs +84 -63
- package/dist/data/test-runner/TestTreeNode.cjs.map +1 -1
- package/dist/data/test-runner/TestTreeNode.d.ts.map +1 -1
- package/dist/data/test-runner/TestTreeNode.js +84 -63
- package/dist/data/test-runner/TestTreeNode.js.map +1 -1
- package/dist/data/test-runner/adapter.cjs.map +1 -1
- package/dist/data/test-runner/adapter.d.ts +2 -2
- package/dist/data/test-runner/adapter.d.ts.map +1 -1
- package/dist/data/test-runner/adapter.js.map +1 -1
- package/dist/data/test-runner/copy.cjs +62 -10
- package/dist/data/test-runner/copy.cjs.map +1 -1
- package/dist/data/test-runner/copy.d.ts +52 -9
- package/dist/data/test-runner/copy.d.ts.map +1 -1
- package/dist/data/test-runner/copy.js +60 -11
- package/dist/data/test-runner/copy.js.map +1 -1
- package/dist/data/test-runner/index.d.ts +1 -1
- package/dist/data/test-runner/index.d.ts.map +1 -1
- package/dist/data/traces/index.d.ts +1 -0
- package/dist/data/traces/index.d.ts.map +1 -1
- package/dist/data/traces/otel/OtelTraceDetail.cjs +4 -7
- package/dist/data/traces/otel/OtelTraceDetail.cjs.map +1 -1
- package/dist/data/traces/otel/OtelTraceDetail.js +4 -7
- package/dist/data/traces/otel/OtelTraceDetail.js.map +1 -1
- package/dist/data/traces/otel/OtelTraceSearch.cjs +90 -56
- package/dist/data/traces/otel/OtelTraceSearch.cjs.map +1 -1
- package/dist/data/traces/otel/OtelTraceSearch.d.ts.map +1 -1
- package/dist/data/traces/otel/OtelTraceSearch.js +91 -57
- package/dist/data/traces/otel/OtelTraceSearch.js.map +1 -1
- package/dist/data/traces/otel/QueryBar.cjs +83 -10
- package/dist/data/traces/otel/QueryBar.cjs.map +1 -1
- package/dist/data/traces/otel/QueryBar.d.ts.map +1 -1
- package/dist/data/traces/otel/QueryBar.js +83 -10
- package/dist/data/traces/otel/QueryBar.js.map +1 -1
- package/dist/data/traces/otel/TraceResults.cjs +81 -13
- package/dist/data/traces/otel/TraceResults.cjs.map +1 -1
- package/dist/data/traces/otel/TraceResults.d.ts +11 -3
- package/dist/data/traces/otel/TraceResults.d.ts.map +1 -1
- package/dist/data/traces/otel/TraceResults.js +81 -13
- package/dist/data/traces/otel/TraceResults.js.map +1 -1
- package/dist/data/traces/otel/api.cjs.map +1 -1
- package/dist/data/traces/otel/api.d.ts +14 -0
- package/dist/data/traces/otel/api.d.ts.map +1 -1
- package/dist/data/traces/otel/api.js.map +1 -1
- package/dist/data/traces/otel/query.cjs +2 -2
- package/dist/data/traces/otel/query.cjs.map +1 -1
- package/dist/data/traces/otel/query.d.ts +1 -1
- package/dist/data/traces/otel/query.d.ts.map +1 -1
- package/dist/data/traces/otel/query.js +2 -2
- package/dist/data/traces/otel/query.js.map +1 -1
- package/dist/data/verification/StepFilesView.cjs +90 -0
- package/dist/data/verification/StepFilesView.cjs.map +1 -0
- package/dist/data/verification/StepFilesView.d.ts +9 -0
- package/dist/data/verification/StepFilesView.d.ts.map +1 -0
- package/dist/data/verification/StepFilesView.js +90 -0
- package/dist/data/verification/StepFilesView.js.map +1 -0
- package/dist/data/verification/adapterViews.cjs +129 -69
- package/dist/data/verification/adapterViews.cjs.map +1 -1
- package/dist/data/verification/adapterViews.d.ts +3 -1
- package/dist/data/verification/adapterViews.d.ts.map +1 -1
- package/dist/data/verification/adapterViews.js +130 -70
- package/dist/data/verification/adapterViews.js.map +1 -1
- package/dist/data/verification/adapters.cjs +9 -0
- package/dist/data/verification/adapters.cjs.map +1 -1
- package/dist/data/verification/adapters.d.ts +2 -0
- package/dist/data/verification/adapters.d.ts.map +1 -1
- package/dist/data/verification/adapters.js +11 -2
- package/dist/data/verification/adapters.js.map +1 -1
- package/dist/data/verification/index.d.ts +2 -1
- package/dist/data/verification/index.d.ts.map +1 -1
- package/dist/data/verification/stepKind.cjs +63 -7
- package/dist/data/verification/stepKind.cjs.map +1 -1
- package/dist/data/verification/stepKind.d.ts +55 -6
- package/dist/data/verification/stepKind.d.ts.map +1 -1
- package/dist/data/verification/stepKind.js +62 -8
- package/dist/data/verification/stepKind.js.map +1 -1
- package/dist/data/verification/stepKindViews.cjs +318 -106
- package/dist/data/verification/stepKindViews.cjs.map +1 -1
- package/dist/data/verification/stepKindViews.d.ts +17 -6
- package/dist/data/verification/stepKindViews.d.ts.map +1 -1
- package/dist/data/verification/stepKindViews.js +319 -108
- package/dist/data/verification/stepKindViews.js.map +1 -1
- package/dist/data/version-info.cjs +3 -3
- package/dist/data/version-info.cjs.map +1 -1
- package/dist/data/version-info.js +3 -3
- package/dist/data/version-info.js.map +1 -1
- package/dist/data/workload-panel/MemoryStack.cjs +38 -1
- package/dist/data/workload-panel/MemoryStack.cjs.map +1 -1
- package/dist/data/workload-panel/MemoryStack.d.ts.map +1 -1
- package/dist/data/workload-panel/MemoryStack.js +38 -1
- package/dist/data/workload-panel/MemoryStack.js.map +1 -1
- package/dist/data.cjs +22 -1
- package/dist/data.d.ts +3 -1
- package/dist/data.d.ts.map +1 -1
- package/dist/data.js +10 -3
- package/dist/file-findings/AnnotatedCode.cjs +18 -2
- package/dist/file-findings/AnnotatedCode.cjs.map +1 -1
- package/dist/file-findings/AnnotatedCode.d.ts +2 -0
- package/dist/file-findings/AnnotatedCode.d.ts.map +1 -1
- package/dist/file-findings/AnnotatedCode.js +18 -2
- package/dist/file-findings/AnnotatedCode.js.map +1 -1
- package/dist/file-findings/FileFindingsView.cjs.map +1 -1
- package/dist/file-findings/FileFindingsView.d.ts +2 -0
- package/dist/file-findings/FileFindingsView.d.ts.map +1 -1
- package/dist/file-findings/FileFindingsView.js.map +1 -1
- package/dist/file-findings/file-review/FileReview.cjs +2 -1
- package/dist/file-findings/file-review/FileReview.cjs.map +1 -1
- package/dist/file-findings/file-review/FileReview.d.ts +3 -1
- package/dist/file-findings/file-review/FileReview.d.ts.map +1 -1
- package/dist/file-findings/file-review/FileReview.js +2 -1
- package/dist/file-findings/file-review/FileReview.js.map +1 -1
- package/dist/hooks/use-prompts.cjs +52 -30
- package/dist/hooks/use-prompts.cjs.map +1 -1
- package/dist/hooks/use-prompts.d.ts +6 -0
- package/dist/hooks/use-prompts.d.ts.map +1 -1
- package/dist/hooks/use-prompts.js +52 -30
- package/dist/hooks/use-prompts.js.map +1 -1
- package/dist/index.cjs +23 -2
- package/dist/index.js +11 -4
- package/dist/profiles/editor/profileEditor.cjs +29 -30
- package/dist/profiles/editor/profileEditor.cjs.map +1 -1
- package/dist/profiles/editor/profileEditor.d.ts.map +1 -1
- package/dist/profiles/editor/profileEditor.js +29 -30
- package/dist/profiles/editor/profileEditor.js.map +1 -1
- package/dist/profiles/editor/profileEditorPreview.cjs +44 -43
- package/dist/profiles/editor/profileEditorPreview.cjs.map +1 -1
- package/dist/profiles/editor/profileEditorPreview.d.ts +10 -5
- package/dist/profiles/editor/profileEditorPreview.d.ts.map +1 -1
- package/dist/profiles/editor/profileEditorPreview.js +44 -43
- package/dist/profiles/editor/profileEditorPreview.js.map +1 -1
- package/dist/profiles/editor/profileMappingPreview.cjs +153 -48
- package/dist/profiles/editor/profileMappingPreview.cjs.map +1 -1
- package/dist/profiles/editor/profileMappingPreview.d.ts +16 -2
- package/dist/profiles/editor/profileMappingPreview.d.ts.map +1 -1
- package/dist/profiles/editor/profileMappingPreview.js +155 -50
- package/dist/profiles/editor/profileMappingPreview.js.map +1 -1
- package/dist/profiles/editor/sampleError.cjs +29 -0
- package/dist/profiles/editor/sampleError.cjs.map +1 -0
- package/dist/profiles/editor/sampleError.d.ts +16 -0
- package/dist/profiles/editor/sampleError.d.ts.map +1 -0
- package/dist/profiles/editor/sampleError.js +27 -0
- package/dist/profiles/editor/sampleError.js.map +1 -0
- package/dist/profiles/query/profileSampleResult.cjs.map +1 -1
- package/dist/profiles/query/profileSampleResult.d.ts +2 -0
- package/dist/profiles/query/profileSampleResult.d.ts.map +1 -1
- package/dist/profiles/query/profileSampleResult.js.map +1 -1
- package/dist/profiles/wizard/profileWizardQueryStep.cjs +1 -0
- package/dist/profiles/wizard/profileWizardQueryStep.cjs.map +1 -1
- package/dist/profiles/wizard/profileWizardQueryStep.d.ts +2 -0
- package/dist/profiles/wizard/profileWizardQueryStep.d.ts.map +1 -1
- package/dist/profiles/wizard/profileWizardQueryStep.js +1 -0
- package/dist/profiles/wizard/profileWizardQueryStep.js.map +1 -1
- package/dist/react-grab/core/index.js +1 -1
- package/dist/react-grab/{core-BERtFDWh.js → core-BK5CU6Lb.js} +2 -2
- package/dist/react-grab/index.js +1 -1
- package/dist/react-grab/{renderer-KT3FY3K2.js → renderer-DcHrsQ8k.js} +1 -1
- package/dist/rpc/apiClient.cjs +12 -15
- package/dist/rpc/apiClient.cjs.map +1 -1
- package/dist/rpc/apiClient.js +12 -15
- package/dist/rpc/apiClient.js.map +1 -1
- package/dist/runtime/barrels.json +6507 -6460
- package/dist/runtime/importmap.json +2198 -2185
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComboboxMenu.js","names":["_Fragment"],"sources":["../../src/components/ComboboxMenu.tsx"],"sourcesContent":["import { Fragment, type ReactNode, type RefObject } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { FilterPill } from \"../data/FilterPill\";\nimport { Icon, LabelIcon } from \"../data/Icon\";\nimport { UiCheck } from \"../icons\";\nimport { cn } from \"../lib/utils\";\nimport type { ComboboxOption, ComboboxTriStateMode } from \"./combobox-types\";\nimport type { ComboboxMenuPosition } from \"../lib/combobox\";\n\nexport function ComboboxMenu({\n customEntry,\n filtered,\n floatingZ,\n footer,\n header,\n ariaLabel,\n hasOptions,\n highlighted,\n isSelected,\n listId,\n listRef,\n loading,\n menuPos,\n modes,\n multiple,\n onHighlight,\n onSelect,\n onSetMode,\n tristate,\n}: {\n customEntry: ComboboxOption | null;\n filtered: ComboboxOption[];\n floatingZ: number;\n footer: ReactNode;\n header?: ReactNode;\n ariaLabel?: string | undefined;\n /** Whether the control has an option set at all (before filtering). */\n hasOptions: boolean;\n highlighted: number;\n isSelected: (value: string) => boolean;\n listId: string | undefined;\n listRef: RefObject<HTMLDivElement | null>;\n loading: boolean | undefined;\n menuPos: ComboboxMenuPosition;\n modes: Record<string, ComboboxTriStateMode>;\n multiple: boolean;\n onHighlight: (index: number) => void;\n onSelect: (option: ComboboxOption) => void;\n onSetMode: (value: string, mode: string) => void;\n tristate: boolean;\n}) {\n const mobile = menuPos.strategy === \"mobile\";\n const listbox = (\n <div\n id={header ? undefined : listId}\n ref={listRef}\n role={header ? undefined : \"listbox\"}\n aria-label={header ? undefined : ariaLabel}\n aria-multiselectable={!header && multiple ? true : undefined}\n style={{\n position: mobile ? \"absolute\" : \"fixed\",\n ...(menuPos.top != null\n ? { top: menuPos.top }\n : { bottom: menuPos.bottom }),\n left: menuPos.left,\n ...(mobile ? { width: menuPos.width } : { minWidth: menuPos.width }),\n maxWidth: menuPos.maxWidth,\n maxHeight: menuPos.maxHeight,\n zIndex: mobile ? undefined : floatingZ,\n pointerEvents: mobile ? \"auto\" : undefined,\n }}\n className={cn(\n \"overflow-auto rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-lg shadow-black/5\",\n !mobile && \"w-max\",\n )}\n >\n {header}\n <div\n className={cn(filtered.some(option => option.layout === \"responsive\") && \"@container/combobox-options\")}\n id={header ? listId : undefined}\n role={header ? \"listbox\" : undefined}\n aria-label={header ? ariaLabel : undefined}\n aria-multiselectable={header && multiple ? true : undefined}\n >\n {loading && filtered.length === 0 && (\n <div className=\"px-2 py-4 text-center text-sm text-muted-foreground\">\n Loading…\n </div>\n )}\n {/* \"No results\" answers \"did my query match anything?\" — a control with\n no option set at all (a free tag list) was never asked the question, so\n it says nothing rather than reporting an empty search. */}\n {!loading && filtered.length === 0 && !customEntry && hasOptions && (\n <div className=\"px-2 py-4 text-center text-sm text-muted-foreground\">\n No results\n </div>\n )}\n {filtered.map((option, index) => {\n const selected = isSelected(option.value);\n const mode = tristate && Object.hasOwn(modes, option.value) ? modes[option.value] : undefined;\n const showHeader =\n option.group != null && option.group !== filtered[index - 1]?.group;\n const selectionIndicator = (\n <span\n data-slot=\"combobox-selection-indicator\"\n aria-hidden\n className={cn(\n \"shrink-0 text-xs\",\n option.description && option.descriptionLayout !== \"inline\" && \"mt-1\",\n selected ? \"opacity-100\" : \"opacity-0\",\n )}\n >\n <Icon icon={UiCheck} />\n </span>\n );\n return (\n <Fragment key={option.value}>\n {showHeader && (\n <div\n role=\"presentation\"\n className=\"select-none px-2 pb-1 pt-2 text-[10px] font-medium uppercase tracking-wide text-muted-foreground\"\n >\n {option.group}\n </div>\n )}\n <div\n id={listId ? `${listId}-${index}` : undefined}\n role=\"option\"\n aria-selected={tristate ? mode != null : selected}\n aria-disabled={option.disabled}\n {...(mode != null\n ? {\n \"aria-label\": `${option.label}, ${\n mode === \"include\" ? \"included\" : \"excluded\"\n }`,\n }\n : {})}\n {...(option.title !== undefined ? { title: option.title } : {})}\n {...(tristate ? { \"data-filter-option\": option.value } : {})}\n onMouseDown={(event) => {\n event.preventDefault();\n if (!tristate && !option.disabled) onSelect(option);\n }}\n {...(tristate\n ? {\n onClick: () => {\n if (!option.disabled) onSelect(option);\n },\n }\n : {})}\n onMouseEnter={() => onHighlight(index)}\n className={cn(\n \"flex cursor-pointer rounded-sm py-1.5 text-sm\",\n multiple ? \"gap-2 px-2\" : \"gap-1.5 px-1.5\",\n option.layout === \"responsive\" ? \"items-start @min-[28rem]/combobox-options:items-center\" : option.description && option.descriptionLayout !== \"inline\" ? \"items-start\" : \"items-center\",\n index === highlighted && \"bg-accent\",\n selected && !tristate && \"font-medium\",\n option.disabled && \"cursor-not-allowed opacity-50\",\n )}\n >\n {tristate ? (\n <div className=\"min-w-0 flex-1\">\n <FilterPill\n mode={mode ?? \"neutral\"}\n togglePosition=\"right\"\n interactive={false}\n label={\n <span className=\"inline-flex min-w-0 items-center gap-1.5\">\n <LabelIcon\n icon={option.icon}\n className=\"shrink-0 text-sm text-muted-foreground\"\n />\n <span className=\"truncate\">{option.label}</span>\n </span>\n }\n onModeChange={(next) => onSetMode(option.value, next)}\n className=\"w-full justify-between\"\n {...(option.count !== undefined\n ? { count: option.count }\n : {})}\n />\n <ComboboxOptionDescription\n description={option.description}\n />\n </div>\n ) : (\n <>\n {multiple && selectionIndicator}\n <LabelIcon\n icon={option.icon}\n className={cn(\n \"shrink-0 text-sm text-muted-foreground\",\n option.description && option.descriptionLayout !== \"inline\" && \"mt-1\",\n )}\n />\n <ComboboxOptionText option={option} />\n {option.trailing != null && option.layout !== \"responsive\" && (\n // Capped and truncating rather than `shrink-0`: in a menu\n // clamped by the viewport edge the label is what identifies\n // the option, so the preview yields first.\n <span className=\"ml-auto min-w-0 max-w-[55%] truncate pl-2 text-right text-xs text-muted-foreground\">\n {option.trailing}\n </span>\n )}\n {!multiple && selectionIndicator}\n </>\n )}\n </div>\n </Fragment>\n );\n })}\n {customEntry && (\n <div\n id={listId ? `${listId}-${filtered.length}` : undefined}\n role=\"option\"\n aria-selected={false}\n data-filter-add-custom={customEntry.value}\n title={customEntry.title}\n onMouseDown={(event) => event.preventDefault()}\n onClick={() => onSelect(customEntry)}\n onMouseEnter={() => onHighlight(filtered.length)}\n className={cn(\n \"flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-primary\",\n highlighted === filtered.length && \"bg-accent\",\n )}\n >\n <LabelIcon\n icon={customEntry.icon}\n className=\"text-sm text-muted-foreground\"\n />\n <span className=\"min-w-0 truncate\">{customEntry.label}</span>\n </div>\n )}\n {footer != null && (\n <div className=\"select-none px-2 py-1.5 text-[11px] text-muted-foreground\">\n {footer}\n </div>\n )}\n </div>\n </div>\n );\n return createPortal(\n mobile ? (\n <div\n data-slot=\"combobox-viewport-layer\"\n style={{\n position: \"fixed\",\n inset: 0,\n zIndex: floatingZ,\n pointerEvents: \"none\",\n }}\n >\n {listbox}\n </div>\n ) : (\n listbox\n ),\n document.body,\n );\n}\n\nfunction ComboboxOptionText({ option }: { option: ComboboxOption }) {\n const responsive = option.layout === \"responsive\";\n return (\n <span data-slot=\"combobox-option-text\" className={cn(\"min-w-0 flex-1\", responsive ? \"flex flex-col gap-1 @min-[28rem]/combobox-options:flex-row @min-[28rem]/combobox-options:items-center @min-[28rem]/combobox-options:gap-2\" : option.descriptionLayout === \"inline\" && \"flex items-center gap-2\")}>\n <span className={cn(\"block min-w-0\", responsive ? \"whitespace-normal [overflow-wrap:anywhere] @min-[28rem]/combobox-options:flex-1 @min-[28rem]/combobox-options:truncate\" : \"truncate\")}>{option.label}</span>\n <ComboboxOptionDescription description={option.description} inline={option.descriptionLayout === \"inline\"} responsive={responsive} />\n {responsive && option.trailing != null && (\n <span className=\"min-w-0 text-xs font-normal text-muted-foreground @min-[28rem]/combobox-options:ml-auto @min-[28rem]/combobox-options:max-w-[55%] @min-[28rem]/combobox-options:truncate @min-[28rem]/combobox-options:pl-2 @min-[28rem]/combobox-options:text-right\">\n {option.trailing}\n </span>\n )}\n </span>\n );\n}\n\nfunction ComboboxOptionDescription({\n description,\n inline = false,\n responsive = false,\n}: {\n description: string | undefined;\n inline?: boolean;\n responsive?: boolean;\n}) {\n return description ? (\n <span className={cn(\"text-xs font-normal leading-4 text-muted-foreground\", responsive ? \"min-w-0 whitespace-normal [overflow-wrap:anywhere] @min-[28rem]/combobox-options:max-w-[55%] @min-[28rem]/combobox-options:shrink-0 @min-[28rem]/combobox-options:truncate\" : inline ? \"min-w-0 truncate\" : \"mt-0.5 block whitespace-pre-line\")}>\n {description}\n </span>\n ) : null;\n}\n"],"mappings":";;;;;;;;AASA,SAAgB,aAAa,EAC3B,aACA,UACA,WACA,QACA,QACA,WACA,YACA,aACA,YACA,QACA,SACA,SACA,SACA,OACA,UACA,aACA,UACA,WACA,YAsBC;CACD,MAAM,SAAS,QAAQ,aAAa;CACpC,MAAM,UACJ,qBAAC,OAAD;EACE,IAAI,SAAS,KAAA,IAAY;EACzB,KAAK;EACL,MAAM,SAAS,KAAA,IAAY;EAC3B,cAAY,SAAS,KAAA,IAAY;EACjC,wBAAsB,CAAC,UAAU,WAAW,OAAO,KAAA;EACnD,OAAO;GACL,UAAU,SAAS,aAAa;GAChC,GAAI,QAAQ,OAAO,OACf,EAAE,KAAK,QAAQ,IAAI,IACnB,EAAE,QAAQ,QAAQ,OAAO;GAC7B,MAAM,QAAQ;GACd,GAAI,SAAS,EAAE,OAAO,QAAQ,MAAM,IAAI,EAAE,UAAU,QAAQ,MAAM;GAClE,UAAU,QAAQ;GAClB,WAAW,QAAQ;GACnB,QAAQ,SAAS,KAAA,IAAY;GAC7B,eAAe,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AChC,oBAAC,QAAD;IAAM,WAAU;IACb,UAAA,OAAO;GACJ,CAAA;EAEJ;;AAEV;AAEA,SAAS,0BAA0B,EACjC,aACA,SAAS,OACT,aAAa,SAKZ;CACD,OAAO,cACL,oBAAC,QAAD;EAAM,WAAW,GAAG,uDAAuD,aAAa,+KAA+K,SAAS,qBAAqB,kCAAkC;EACpU,UAAA;CACG,CAAA,IACJ;AACN"}
|
|
1
|
+
{"version":3,"file":"ComboboxMenu.js","names":["_Fragment"],"sources":["../../src/components/ComboboxMenu.tsx"],"sourcesContent":["import { Fragment, type ReactNode, type RefObject } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { FilterPill } from \"../data/FilterPill\";\nimport { Icon, LabelIcon } from \"../data/Icon\";\nimport { UiCheck } from \"../icons\";\nimport { cn } from \"../lib/utils\";\nimport type { ComboboxOption, ComboboxTriStateMode } from \"./combobox-types\";\nimport type { ComboboxMenuPosition } from \"../lib/combobox\";\n\nexport function ComboboxMenu({\n customEntry,\n filtered,\n floatingZ,\n footer,\n header,\n ariaLabel,\n hasOptions,\n highlighted,\n isSelected,\n listId,\n listRef,\n loading,\n menuPos,\n modes,\n multiple,\n onHighlight,\n onSelect,\n onSetMode,\n tristate,\n}: {\n customEntry: ComboboxOption | null;\n filtered: ComboboxOption[];\n floatingZ: number;\n footer: ReactNode;\n header?: ReactNode;\n ariaLabel?: string | undefined;\n /** Whether the control has an option set at all (before filtering). */\n hasOptions: boolean;\n highlighted: number;\n isSelected: (value: string) => boolean;\n listId: string | undefined;\n listRef: RefObject<HTMLDivElement | null>;\n loading: boolean | undefined;\n /** Floating position; omit to render the list inline in the normal flow below the control. */\n menuPos?: ComboboxMenuPosition | null;\n modes: Record<string, ComboboxTriStateMode>;\n multiple: boolean;\n onHighlight: (index: number) => void;\n onSelect: (option: ComboboxOption) => void;\n onSetMode: (value: string, mode: string) => void;\n tristate: boolean;\n}) {\n const inline = menuPos == null;\n const mobile = menuPos?.strategy === \"mobile\";\n const isEmpty =\n filtered.length === 0 && !customEntry && !loading && !hasOptions && footer == null && !header;\n const listbox = (\n <div\n id={header ? undefined : listId}\n ref={listRef}\n role={header ? undefined : \"listbox\"}\n aria-label={header ? undefined : ariaLabel}\n aria-multiselectable={!header && multiple ? true : undefined}\n {...(menuPos != null\n ? {\n style: {\n position: mobile ? \"absolute\" : \"fixed\",\n ...(menuPos.top != null\n ? { top: menuPos.top }\n : { bottom: menuPos.bottom }),\n left: menuPos.left,\n ...(mobile ? { width: menuPos.width } : { minWidth: menuPos.width }),\n maxWidth: menuPos.maxWidth,\n maxHeight: menuPos.maxHeight,\n zIndex: mobile ? undefined : floatingZ,\n pointerEvents: mobile ? \"auto\" : undefined,\n } as const,\n }\n : {})}\n className={cn(\n \"text-popover-foreground\",\n // Inline is headless: the host panel owns the chrome, sizing and scrolling.\n inline\n ? \"mt-1 w-full\"\n : \"overflow-auto rounded-md border border-border bg-popover p-1 shadow-lg shadow-black/5\",\n !inline && !mobile && \"w-max\",\n )}\n >\n {header}\n <div\n className={cn(filtered.some(option => option.layout === \"responsive\") && \"@container/combobox-options\")}\n id={header ? listId : undefined}\n role={header ? \"listbox\" : undefined}\n aria-label={header ? ariaLabel : undefined}\n aria-multiselectable={header && multiple ? true : undefined}\n >\n {loading && filtered.length === 0 && (\n <div className=\"px-2 py-4 text-center text-sm text-muted-foreground\">\n Loading…\n </div>\n )}\n {/* \"No results\" answers \"did my query match anything?\" — a control with\n no option set at all (a free tag list) was never asked the question, so\n it says nothing rather than reporting an empty search. */}\n {!loading && filtered.length === 0 && !customEntry && hasOptions && (\n <div className=\"px-2 py-4 text-center text-sm text-muted-foreground\">\n No results\n </div>\n )}\n {filtered.map((option, index) => {\n const selected = isSelected(option.value);\n const mode = tristate && Object.hasOwn(modes, option.value) ? modes[option.value] : undefined;\n const showHeader =\n option.group != null && option.group !== filtered[index - 1]?.group;\n const selectionIndicator = (\n <span\n data-slot=\"combobox-selection-indicator\"\n aria-hidden\n className={cn(\n \"shrink-0 text-xs\",\n option.description && option.descriptionLayout !== \"inline\" && \"mt-1\",\n selected ? \"opacity-100\" : \"opacity-0\",\n )}\n >\n <Icon icon={UiCheck} />\n </span>\n );\n return (\n <Fragment key={option.value}>\n {showHeader && (\n <div\n role=\"presentation\"\n className=\"select-none px-2 pb-1 pt-2 text-[10px] font-medium uppercase tracking-wide text-muted-foreground\"\n >\n {option.group}\n </div>\n )}\n <div\n id={listId ? `${listId}-${index}` : undefined}\n role=\"option\"\n aria-selected={tristate ? mode != null : selected}\n aria-disabled={option.disabled}\n {...(mode != null\n ? {\n \"aria-label\": `${option.label}, ${\n mode === \"include\" ? \"included\" : \"excluded\"\n }`,\n }\n : {})}\n {...(option.title !== undefined ? { title: option.title } : {})}\n {...(tristate ? { \"data-filter-option\": option.value } : {})}\n onMouseDown={(event) => {\n event.preventDefault();\n if (!tristate && !option.disabled) onSelect(option);\n }}\n {...(tristate\n ? {\n onClick: () => {\n if (!option.disabled) onSelect(option);\n },\n }\n : {})}\n onMouseEnter={() => onHighlight(index)}\n className={cn(\n \"flex cursor-pointer rounded-sm py-1.5 text-sm\",\n multiple ? \"gap-2 px-2\" : \"gap-1.5 px-1.5\",\n option.layout === \"responsive\" ? \"items-start @min-[28rem]/combobox-options:items-center\" : option.description && option.descriptionLayout !== \"inline\" ? \"items-start\" : \"items-center\",\n index === highlighted && \"bg-accent\",\n selected && !tristate && \"font-medium\",\n option.disabled && \"cursor-not-allowed opacity-50\",\n )}\n >\n {tristate ? (\n <div className=\"min-w-0 flex-1\">\n <FilterPill\n mode={mode ?? \"neutral\"}\n togglePosition=\"right\"\n interactive={false}\n label={\n <span className=\"inline-flex min-w-0 items-center gap-1.5\">\n <LabelIcon\n icon={option.icon}\n className=\"shrink-0 text-sm text-muted-foreground\"\n />\n <span className=\"truncate\">{option.label}</span>\n </span>\n }\n onModeChange={(next) => onSetMode(option.value, next)}\n className=\"w-full justify-between\"\n {...(option.count !== undefined\n ? { count: option.count }\n : {})}\n />\n <ComboboxOptionDescription\n description={option.description}\n />\n </div>\n ) : (\n <>\n {multiple && selectionIndicator}\n <LabelIcon\n icon={option.icon}\n className={cn(\n \"shrink-0 text-sm text-muted-foreground\",\n option.description && option.descriptionLayout !== \"inline\" && \"mt-1\",\n )}\n />\n <ComboboxOptionText option={option} />\n {option.trailing != null && option.layout !== \"responsive\" && (\n // Capped and truncating rather than `shrink-0`: in a menu\n // clamped by the viewport edge the label is what identifies\n // the option, so the preview yields first.\n <span className=\"ml-auto min-w-0 max-w-[55%] truncate pl-2 text-right text-xs text-muted-foreground\">\n {option.trailing}\n </span>\n )}\n {!multiple && selectionIndicator}\n </>\n )}\n </div>\n </Fragment>\n );\n })}\n {customEntry && (\n <div\n id={listId ? `${listId}-${filtered.length}` : undefined}\n role=\"option\"\n aria-selected={false}\n data-filter-add-custom={customEntry.value}\n title={customEntry.title}\n onMouseDown={(event) => event.preventDefault()}\n onClick={() => onSelect(customEntry)}\n onMouseEnter={() => onHighlight(filtered.length)}\n className={cn(\n \"flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-primary\",\n highlighted === filtered.length && \"bg-accent\",\n )}\n >\n <LabelIcon\n icon={customEntry.icon}\n className=\"text-sm text-muted-foreground\"\n />\n <span className=\"min-w-0 truncate\">{customEntry.label}</span>\n </div>\n )}\n {footer != null && (\n <div className=\"select-none px-2 py-1.5 text-[11px] text-muted-foreground\">\n {footer}\n </div>\n )}\n </div>\n </div>\n );\n if (inline) return isEmpty ? null : listbox;\n return createPortal(\n mobile ? (\n <div\n data-slot=\"combobox-viewport-layer\"\n style={{\n position: \"fixed\",\n inset: 0,\n zIndex: floatingZ,\n pointerEvents: \"none\",\n }}\n >\n {listbox}\n </div>\n ) : (\n listbox\n ),\n document.body,\n );\n}\n\nfunction ComboboxOptionText({ option }: { option: ComboboxOption }) {\n const responsive = option.layout === \"responsive\";\n return (\n <span data-slot=\"combobox-option-text\" className={cn(\"min-w-0 flex-1\", responsive ? \"flex flex-col gap-1 @min-[28rem]/combobox-options:flex-row @min-[28rem]/combobox-options:items-center @min-[28rem]/combobox-options:gap-2\" : option.descriptionLayout === \"inline\" && \"flex items-center gap-2\")}>\n <span className={cn(\"block min-w-0\", responsive ? \"whitespace-normal [overflow-wrap:anywhere] @min-[28rem]/combobox-options:flex-1 @min-[28rem]/combobox-options:truncate\" : \"truncate\")}>{option.label}</span>\n <ComboboxOptionDescription description={option.description} inline={option.descriptionLayout === \"inline\"} responsive={responsive} />\n {responsive && option.trailing != null && (\n <span className=\"min-w-0 text-xs font-normal text-muted-foreground @min-[28rem]/combobox-options:ml-auto @min-[28rem]/combobox-options:max-w-[55%] @min-[28rem]/combobox-options:truncate @min-[28rem]/combobox-options:pl-2 @min-[28rem]/combobox-options:text-right\">\n {option.trailing}\n </span>\n )}\n </span>\n );\n}\n\nfunction ComboboxOptionDescription({\n description,\n inline = false,\n responsive = false,\n}: {\n description: string | undefined;\n inline?: boolean;\n responsive?: boolean;\n}) {\n return description ? (\n <span className={cn(\"text-xs font-normal leading-4 text-muted-foreground\", responsive ? \"min-w-0 whitespace-normal [overflow-wrap:anywhere] @min-[28rem]/combobox-options:max-w-[55%] @min-[28rem]/combobox-options:shrink-0 @min-[28rem]/combobox-options:truncate\" : inline ? \"min-w-0 truncate\" : \"mt-0.5 block whitespace-pre-line\")}>\n {description}\n </span>\n ) : null;\n}\n"],"mappings":";;;;;;;;AASA,SAAgB,aAAa,EAC3B,aACA,UACA,WACA,QACA,QACA,WACA,YACA,aACA,YACA,QACA,SACA,SACA,SACA,OACA,UACA,aACA,UACA,WACA,YAuBC;CACD,MAAM,SAAS,WAAW;CAC1B,MAAM,SAAS,SAAS,aAAa;CACrC,MAAM,UACJ,SAAS,WAAW,KAAK,CAAC,eAAe,CAAC,WAAW,CAAC,cAAc,UAAU,QAAQ,CAAC;CACzF,MAAM,UACJ,qBAAC,OAAD;EACE,IAAI,SAAS,KAAA,IAAY;EACzB,KAAK;EACL,MAAM,SAAS,KAAA,IAAY;EAC3B,cAAY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O;GACP,QAAQ;GACR,eAAe;EACjB;EAEC,UAAA;CACE,CAAA,IAEL,SAEF,SAAS,IACX;AACF;AAEA,SAAS,mBAAmB,EAAE,UAAsC;CAClE,MAAM,aAAa,OAAO,WAAW;CACrC,OACE,qBAAC,QAAD;EAAM,aAAU;EAAuB,WAAW,GAAG,kBAAkB,aAAa,8IAA8I,OAAO,sBAAsB,YAAY,yBAAyB;EAApS,UAAA;GACE,oBAAC,QAAD;IAAM,WAAW,GAAG,iBAAiB,aAAa,2HAA2H,UAAU;IAAI,UAAA,OAAO;GAAY,CAAA;GAC9M,oBAAC,2BAAD;IAA2B,aAAa,OAAO;IAAa,QAAQ,OAAO,sBAAsB;IAAsB;GAAa,CAAA;GACnI,cAAc,OAAO,YAAY,QAChC,oBAAC,QAAD;IAAM,WAAU;IACb,UAAA,OAAO;GACJ,CAAA;EAEJ;;AAEV;AAEA,SAAS,0BAA0B,EACjC,aACA,SAAS,OACT,aAAa,SAKZ;CACD,OAAO,cACL,oBAAC,QAAD;EAAM,WAAW,GAAG,uDAAuD,aAAa,+KAA+K,SAAS,qBAAqB,kCAAkC;EACpU,UAAA;CACG,CAAA,IACJ;AACN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateField.cjs","names":["forwardRef","DateTimePicker","DatePicker"],"sources":["../../src/components/DateField.tsx"],"sourcesContent":["import { forwardRef, type InputHTMLAttributes, type ReactNode } from \"react\";\nimport { DatePicker } from \"./DatePicker\";\nimport { DateTimePicker } from \"./DateTimePicker\";\nimport type { ClearableFieldProps } from \"./field-clear-button\";\n\nexport type DateFieldMode = \"date\" | \"datetime\";\n\nexport type DateFieldProps = Omit<\n InputHTMLAttributes<HTMLInputElement>,\n // `prefix` is a global HTML attribute typed as string; omit it so our\n // ReactNode adornment prop below is not intersected down to `string & ReactNode`.\n \"type\" | \"value\" | \"onChange\" | \"prefix\"\n> & ClearableFieldProps & {\n /** Selects native date input or date-time input behavior. */\n mode?: DateFieldMode;\n /** ISO date or datetime-local string shown in the input. */\n value?: string;\n /** Called with the next ISO-like value whenever the input changes. */\n onChange?: (value: string) => void;\n /** Classes applied to the outer picker wrapper. */\n className?: string;\n /** Classes applied to the text input. */\n inputClassName?: string;\n /** Classes applied to the calendar/open button. */\n buttonClassName?: string;\n /** Accessible label for the calendar/open button. */\n openButtonLabel?: string;\n /** Trailing in-field adornment, rendered left of the calendar button. */\n suffix?: ReactNode;\n /** Leading in-field adornment, rendered at the left edge of the input. */\n prefix?: ReactNode;\n};\n\nexport const DateField = forwardRef<HTMLInputElement, DateFieldProps>(\n ({ mode = \"date\", ...props }, ref) => {\n if (mode === \"datetime\") {\n return <DateTimePicker ref={ref} {...props} />;\n }\n\n return <DatePicker ref={ref} {...props} />;\n },\n);\n\nDateField.displayName = \"DateField\";\n"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"DateField.cjs","names":["forwardRef","DateTimePicker","DatePicker"],"sources":["../../src/components/DateField.tsx"],"sourcesContent":["import { forwardRef, type InputHTMLAttributes, type ReactNode } from \"react\";\nimport { DatePicker } from \"./DatePicker\";\nimport { DateTimePicker } from \"./DateTimePicker\";\nimport type { DateMathProps } from \"./date-math\";\nimport type { ClearableFieldProps } from \"./field-clear-button\";\n\nexport type DateFieldMode = \"date\" | \"datetime\";\n\nexport type DateFieldProps = Omit<\n InputHTMLAttributes<HTMLInputElement>,\n // `prefix` is a global HTML attribute typed as string; omit it so our\n // ReactNode adornment prop below is not intersected down to `string & ReactNode`.\n \"type\" | \"value\" | \"onChange\" | \"prefix\"\n> & ClearableFieldProps & DateMathProps & {\n /** Selects native date input or date-time input behavior. */\n mode?: DateFieldMode;\n /** ISO date or datetime-local string shown in the input. */\n value?: string;\n /** Called with the next ISO-like value whenever the input changes. */\n onChange?: (value: string) => void;\n /** Classes applied to the outer picker wrapper. */\n className?: string;\n /** Classes applied to the text input. */\n inputClassName?: string;\n /** Classes applied to the calendar/open button. */\n buttonClassName?: string;\n /** Accessible label for the calendar/open button. */\n openButtonLabel?: string;\n /** Trailing in-field adornment, rendered left of the calendar button. */\n suffix?: ReactNode;\n /** Leading in-field adornment, rendered at the left edge of the input. */\n prefix?: ReactNode;\n};\n\nexport const DateField = forwardRef<HTMLInputElement, DateFieldProps>(\n ({ mode = \"date\", ...props }, ref) => {\n if (mode === \"datetime\") {\n return <DateTimePicker ref={ref} {...props} />;\n }\n\n return <DatePicker ref={ref} {...props} />;\n },\n);\n\nDateField.displayName = \"DateField\";\n"],"mappings":";;;;;AAkCA,IAAa,aAAA,GAAYA,MAAAA,WAAAA,EACtB,EAAE,OAAO,QAAQ,GAAG,SAAS,QAAQ;CACpC,IAAI,SAAS,YACX,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACC,uBAAAA,gBAAD;EAAqB;EAAK,GAAI;CAAQ,CAAA;CAG/C,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACC,mBAAAA,YAAD;EAAiB;EAAK,GAAI;CAAQ,CAAA;AAC3C,CACF;AAEA,UAAU,cAAc"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { InputHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { DateMathProps } from './date-math.js';
|
|
2
3
|
import { ClearableFieldProps } from './field-clear-button.js';
|
|
3
4
|
export type DateFieldMode = "date" | "datetime";
|
|
4
|
-
export type DateFieldProps = Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "value" | "onChange" | "prefix"> & ClearableFieldProps & {
|
|
5
|
+
export type DateFieldProps = Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "value" | "onChange" | "prefix"> & ClearableFieldProps & DateMathProps & {
|
|
5
6
|
/** Selects native date input or date-time input behavior. */
|
|
6
7
|
mode?: DateFieldMode;
|
|
7
8
|
/** ISO date or datetime-local string shown in the input. */
|
|
@@ -21,7 +22,7 @@ export type DateFieldProps = Omit<InputHTMLAttributes<HTMLInputElement>, "type"
|
|
|
21
22
|
/** Leading in-field adornment, rendered at the left edge of the input. */
|
|
22
23
|
prefix?: ReactNode;
|
|
23
24
|
};
|
|
24
|
-
export declare const DateField: import('react').ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "prefix" | "type" | "value" | "onChange"> & ClearableFieldProps & {
|
|
25
|
+
export declare const DateField: import('react').ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "prefix" | "type" | "value" | "onChange"> & ClearableFieldProps & DateMathProps & {
|
|
25
26
|
/** Selects native date input or date-time input behavior. */
|
|
26
27
|
mode?: DateFieldMode;
|
|
27
28
|
/** ISO date or datetime-local string shown in the input. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateField.d.ts","sourceRoot":"","sources":["../../src/components/DateField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,mBAAmB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAG7E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,UAAU,CAAC;AAEhD,MAAM,MAAM,cAAc,GAAG,IAAI,CAC/B,mBAAmB,CAAC,gBAAgB,CAAC,EAGrC,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,QAAQ,CACzC,GAAG,mBAAmB,GAAG;
|
|
1
|
+
{"version":3,"file":"DateField.d.ts","sourceRoot":"","sources":["../../src/components/DateField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,mBAAmB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAG7E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,UAAU,CAAC;AAEhD,MAAM,MAAM,cAAc,GAAG,IAAI,CAC/B,mBAAmB,CAAC,gBAAgB,CAAC,EAGrC,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,QAAQ,CACzC,GAAG,mBAAmB,GAAG,aAAa,GAAG;IACxC,6DAA6D;IAC7D,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,4DAA4D;IAC5D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sEAAsE;IACtE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,mDAAmD;IACnD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yCAAyC;IACzC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mDAAmD;IACnD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qDAAqD;IACrD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,yEAAyE;IACzE,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,0EAA0E;IAC1E,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,SAAS;IApBpB,6DAA6D;WACtD,aAAa;IACpB,4DAA4D;YACpD,MAAM;IACd,sEAAsE;eAC3D,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI;IAClC,mDAAmD;gBACvC,MAAM;IAClB,yCAAyC;qBACxB,MAAM;IACvB,mDAAmD;sBACjC,MAAM;IACxB,qDAAqD;sBACnC,MAAM;IACxB,yEAAyE;aAChE,SAAS;IAClB,0EAA0E;aACjE,SAAS;oDAWnB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateField.js","names":[],"sources":["../../src/components/DateField.tsx"],"sourcesContent":["import { forwardRef, type InputHTMLAttributes, type ReactNode } from \"react\";\nimport { DatePicker } from \"./DatePicker\";\nimport { DateTimePicker } from \"./DateTimePicker\";\nimport type { ClearableFieldProps } from \"./field-clear-button\";\n\nexport type DateFieldMode = \"date\" | \"datetime\";\n\nexport type DateFieldProps = Omit<\n InputHTMLAttributes<HTMLInputElement>,\n // `prefix` is a global HTML attribute typed as string; omit it so our\n // ReactNode adornment prop below is not intersected down to `string & ReactNode`.\n \"type\" | \"value\" | \"onChange\" | \"prefix\"\n> & ClearableFieldProps & {\n /** Selects native date input or date-time input behavior. */\n mode?: DateFieldMode;\n /** ISO date or datetime-local string shown in the input. */\n value?: string;\n /** Called with the next ISO-like value whenever the input changes. */\n onChange?: (value: string) => void;\n /** Classes applied to the outer picker wrapper. */\n className?: string;\n /** Classes applied to the text input. */\n inputClassName?: string;\n /** Classes applied to the calendar/open button. */\n buttonClassName?: string;\n /** Accessible label for the calendar/open button. */\n openButtonLabel?: string;\n /** Trailing in-field adornment, rendered left of the calendar button. */\n suffix?: ReactNode;\n /** Leading in-field adornment, rendered at the left edge of the input. */\n prefix?: ReactNode;\n};\n\nexport const DateField = forwardRef<HTMLInputElement, DateFieldProps>(\n ({ mode = \"date\", ...props }, ref) => {\n if (mode === \"datetime\") {\n return <DateTimePicker ref={ref} {...props} />;\n }\n\n return <DatePicker ref={ref} {...props} />;\n },\n);\n\nDateField.displayName = \"DateField\";\n"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"DateField.js","names":[],"sources":["../../src/components/DateField.tsx"],"sourcesContent":["import { forwardRef, type InputHTMLAttributes, type ReactNode } from \"react\";\nimport { DatePicker } from \"./DatePicker\";\nimport { DateTimePicker } from \"./DateTimePicker\";\nimport type { DateMathProps } from \"./date-math\";\nimport type { ClearableFieldProps } from \"./field-clear-button\";\n\nexport type DateFieldMode = \"date\" | \"datetime\";\n\nexport type DateFieldProps = Omit<\n InputHTMLAttributes<HTMLInputElement>,\n // `prefix` is a global HTML attribute typed as string; omit it so our\n // ReactNode adornment prop below is not intersected down to `string & ReactNode`.\n \"type\" | \"value\" | \"onChange\" | \"prefix\"\n> & ClearableFieldProps & DateMathProps & {\n /** Selects native date input or date-time input behavior. */\n mode?: DateFieldMode;\n /** ISO date or datetime-local string shown in the input. */\n value?: string;\n /** Called with the next ISO-like value whenever the input changes. */\n onChange?: (value: string) => void;\n /** Classes applied to the outer picker wrapper. */\n className?: string;\n /** Classes applied to the text input. */\n inputClassName?: string;\n /** Classes applied to the calendar/open button. */\n buttonClassName?: string;\n /** Accessible label for the calendar/open button. */\n openButtonLabel?: string;\n /** Trailing in-field adornment, rendered left of the calendar button. */\n suffix?: ReactNode;\n /** Leading in-field adornment, rendered at the left edge of the input. */\n prefix?: ReactNode;\n};\n\nexport const DateField = forwardRef<HTMLInputElement, DateFieldProps>(\n ({ mode = \"date\", ...props }, ref) => {\n if (mode === \"datetime\") {\n return <DateTimePicker ref={ref} {...props} />;\n }\n\n return <DatePicker ref={ref} {...props} />;\n },\n);\n\nDateField.displayName = \"DateField\";\n"],"mappings":";;;;;AAkCA,IAAa,YAAY,YACtB,EAAE,OAAO,QAAQ,GAAG,SAAS,QAAQ;CACpC,IAAI,SAAS,YACX,OAAO,oBAAC,gBAAD;EAAqB;EAAK,GAAI;CAAQ,CAAA;CAG/C,OAAO,oBAAC,YAAD;EAAiB;EAAK,GAAI;CAAQ,CAAA;AAC3C,CACF;AAEA,UAAU,cAAc"}
|
|
@@ -1,67 +1,15 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
const require_utils = require("../lib/utils.cjs");
|
|
4
|
-
const require_field_clear_button = require("./field-clear-button.cjs");
|
|
1
|
+
const require_date_math = require("./date-math.cjs");
|
|
2
|
+
const require_date_input_field = require("./date-input-field.cjs");
|
|
5
3
|
let react = require("react");
|
|
6
4
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
5
|
// src/components/DatePicker.tsx
|
|
8
|
-
var DatePicker = (0, react.forwardRef)(({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
17
|
-
"data-jsf-control": true,
|
|
18
|
-
"data-clearable-field": true,
|
|
19
|
-
className: require_utils.cn("relative", className),
|
|
20
|
-
children: [
|
|
21
|
-
prefix && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
22
|
-
className: "absolute inset-y-0 left-1.5 flex items-center",
|
|
23
|
-
children: prefix
|
|
24
|
-
}),
|
|
25
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
26
|
-
...props,
|
|
27
|
-
ref: assignRef,
|
|
28
|
-
type: "date",
|
|
29
|
-
value,
|
|
30
|
-
className: require_utils.cn("h-control-h w-full rounded-md border border-input bg-background px-control-px pr-8 text-sm outline-none focus-visible:ring-2 focus-visible:ring-ring", "[&::-webkit-calendar-picker-indicator]:hidden [&::-webkit-calendar-picker-indicator]:appearance-none", prefix && "pl-8", inputClassName, (showClear || suffix) && "pr-16", showClear && suffix && "pr-24"),
|
|
31
|
-
onChange: (event) => onChange?.(event.target.value)
|
|
32
|
-
}),
|
|
33
|
-
suffix && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
34
|
-
className: require_utils.cn("absolute inset-y-0 flex items-center", showClear ? "right-14" : "right-7"),
|
|
35
|
-
children: suffix
|
|
36
|
-
}),
|
|
37
|
-
showClear && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
38
|
-
className: "absolute inset-y-0 right-7 flex items-center",
|
|
39
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_field_clear_button.FieldClearButton, {
|
|
40
|
-
...clearLabel ? { clearLabel } : {},
|
|
41
|
-
onClear: () => {
|
|
42
|
-
if (onClear) onClear();
|
|
43
|
-
else onChange?.("");
|
|
44
|
-
localRef.current?.focus();
|
|
45
|
-
}
|
|
46
|
-
})
|
|
47
|
-
}),
|
|
48
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
49
|
-
type: "button",
|
|
50
|
-
"aria-label": openButtonLabel,
|
|
51
|
-
disabled: props.disabled || props.readOnly,
|
|
52
|
-
className: require_utils.cn("absolute inset-y-0 right-1 inline-flex items-center text-muted-foreground", buttonClassName),
|
|
53
|
-
onClick: () => {
|
|
54
|
-
localRef.current?.focus();
|
|
55
|
-
localRef.current?.showPicker?.();
|
|
56
|
-
},
|
|
57
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icon.Icon, {
|
|
58
|
-
icon: require_UiCalendar.UiCalendar,
|
|
59
|
-
className: "text-sm"
|
|
60
|
-
})
|
|
61
|
-
})
|
|
62
|
-
]
|
|
63
|
-
});
|
|
64
|
-
});
|
|
6
|
+
var DatePicker = (0, react.forwardRef)(({ openButtonLabel = "Open date picker", dateMathPresets = require_date_math.DATE_PICKER_DATE_MATH_PRESETS, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_date_input_field.DateInputField, {
|
|
7
|
+
...props,
|
|
8
|
+
ref,
|
|
9
|
+
openButtonLabel,
|
|
10
|
+
dateMathPresets,
|
|
11
|
+
withTime: false
|
|
12
|
+
}));
|
|
65
13
|
DatePicker.displayName = "DatePicker";
|
|
66
14
|
exports.DatePicker = DatePicker;
|
|
67
15
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.cjs","names":["forwardRef","
|
|
1
|
+
{"version":3,"file":"DatePicker.cjs","names":["forwardRef","DATE_PICKER_DATE_MATH_PRESETS","DateInputField"],"sources":["../../src/components/DatePicker.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport { DATE_PICKER_DATE_MATH_PRESETS } from \"./date-math\";\nimport { DateInputField, type DateFieldProps } from \"./date-input-field\";\n\nexport type DatePickerProps = DateFieldProps;\n\nexport const DatePicker = forwardRef<HTMLInputElement, DatePickerProps>(\n (\n {\n openButtonLabel = \"Open date picker\",\n dateMathPresets = DATE_PICKER_DATE_MATH_PRESETS,\n ...props\n },\n ref,\n ) => (\n <DateInputField\n {...props}\n ref={ref}\n openButtonLabel={openButtonLabel}\n dateMathPresets={dateMathPresets}\n withTime={false}\n />\n ),\n);\n\nDatePicker.displayName = \"DatePicker\";\n"],"mappings":";;;;;AAMA,IAAa,cAAA,GAAaA,MAAAA,WAAAA,EAEtB,EACE,kBAAkB,oBAClB,kBAAkBC,kBAAAA,+BAClB,GAAG,SAEL,QAEA,iBAAA,GAAA,kBAAA,IAAA,CAACC,yBAAAA,gBAAD;CACE,GAAI;CACC;CACY;CACA;CACjB,UAAU;AACX,CAAA,CAEL;AAEA,WAAW,cAAc"}
|
|
@@ -1,27 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export
|
|
1
|
+
import { DateFieldProps } from './date-input-field.js';
|
|
2
|
+
export type DatePickerProps = DateFieldProps;
|
|
3
|
+
export declare const DatePicker: import('react').ForwardRefExoticComponent<Omit<import('react').InputHTMLAttributes<HTMLInputElement>, "prefix" | "type" | "value" | "onChange"> & import('./field-clear-button.js').ClearableFieldProps & import('./date-math.js').DateMathProps & {
|
|
4
4
|
value?: string;
|
|
5
5
|
onChange?: (value: string) => void;
|
|
6
6
|
className?: string;
|
|
7
7
|
inputClassName?: string;
|
|
8
8
|
buttonClassName?: string;
|
|
9
9
|
openButtonLabel?: string;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
/** Leading in-field adornment, rendered at the left edge of the input. */
|
|
13
|
-
prefix?: ReactNode;
|
|
14
|
-
};
|
|
15
|
-
export declare const DatePicker: import('react').ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "prefix" | "type" | "value" | "onChange"> & ClearableFieldProps & {
|
|
16
|
-
value?: string;
|
|
17
|
-
onChange?: (value: string) => void;
|
|
18
|
-
className?: string;
|
|
19
|
-
inputClassName?: string;
|
|
20
|
-
buttonClassName?: string;
|
|
21
|
-
openButtonLabel?: string;
|
|
22
|
-
/** Trailing in-field adornment, rendered left of the calendar button. */
|
|
23
|
-
suffix?: ReactNode;
|
|
24
|
-
/** Leading in-field adornment, rendered at the left edge of the input. */
|
|
25
|
-
prefix?: ReactNode;
|
|
10
|
+
suffix?: import('react').ReactNode;
|
|
11
|
+
prefix?: import('react').ReactNode;
|
|
26
12
|
} & import('react').RefAttributes<HTMLInputElement>>;
|
|
27
13
|
//# sourceMappingURL=DatePicker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../src/components/DatePicker.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../src/components/DatePicker.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzE,MAAM,MAAM,eAAe,GAAG,cAAc,CAAC;AAE7C,eAAO,MAAM,UAAU;;;;;;;;;oDAiBtB,CAAC"}
|
|
@@ -1,67 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { forwardRef, useRef } from "react";
|
|
6
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { DATE_PICKER_DATE_MATH_PRESETS } from "./date-math.js";
|
|
2
|
+
import { DateInputField } from "./date-input-field.js";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
5
|
// src/components/DatePicker.tsx
|
|
8
|
-
var DatePicker = forwardRef(({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
17
|
-
"data-jsf-control": true,
|
|
18
|
-
"data-clearable-field": true,
|
|
19
|
-
className: cn("relative", className),
|
|
20
|
-
children: [
|
|
21
|
-
prefix && /* @__PURE__ */ jsx("div", {
|
|
22
|
-
className: "absolute inset-y-0 left-1.5 flex items-center",
|
|
23
|
-
children: prefix
|
|
24
|
-
}),
|
|
25
|
-
/* @__PURE__ */ jsx("input", {
|
|
26
|
-
...props,
|
|
27
|
-
ref: assignRef,
|
|
28
|
-
type: "date",
|
|
29
|
-
value,
|
|
30
|
-
className: cn("h-control-h w-full rounded-md border border-input bg-background px-control-px pr-8 text-sm outline-none focus-visible:ring-2 focus-visible:ring-ring", "[&::-webkit-calendar-picker-indicator]:hidden [&::-webkit-calendar-picker-indicator]:appearance-none", prefix && "pl-8", inputClassName, (showClear || suffix) && "pr-16", showClear && suffix && "pr-24"),
|
|
31
|
-
onChange: (event) => onChange?.(event.target.value)
|
|
32
|
-
}),
|
|
33
|
-
suffix && /* @__PURE__ */ jsx("div", {
|
|
34
|
-
className: cn("absolute inset-y-0 flex items-center", showClear ? "right-14" : "right-7"),
|
|
35
|
-
children: suffix
|
|
36
|
-
}),
|
|
37
|
-
showClear && /* @__PURE__ */ jsx("span", {
|
|
38
|
-
className: "absolute inset-y-0 right-7 flex items-center",
|
|
39
|
-
children: /* @__PURE__ */ jsx(FieldClearButton, {
|
|
40
|
-
...clearLabel ? { clearLabel } : {},
|
|
41
|
-
onClear: () => {
|
|
42
|
-
if (onClear) onClear();
|
|
43
|
-
else onChange?.("");
|
|
44
|
-
localRef.current?.focus();
|
|
45
|
-
}
|
|
46
|
-
})
|
|
47
|
-
}),
|
|
48
|
-
/* @__PURE__ */ jsx("button", {
|
|
49
|
-
type: "button",
|
|
50
|
-
"aria-label": openButtonLabel,
|
|
51
|
-
disabled: props.disabled || props.readOnly,
|
|
52
|
-
className: cn("absolute inset-y-0 right-1 inline-flex items-center text-muted-foreground", buttonClassName),
|
|
53
|
-
onClick: () => {
|
|
54
|
-
localRef.current?.focus();
|
|
55
|
-
localRef.current?.showPicker?.();
|
|
56
|
-
},
|
|
57
|
-
children: /* @__PURE__ */ jsx(Icon, {
|
|
58
|
-
icon: UiCalendar,
|
|
59
|
-
className: "text-sm"
|
|
60
|
-
})
|
|
61
|
-
})
|
|
62
|
-
]
|
|
63
|
-
});
|
|
64
|
-
});
|
|
6
|
+
var DatePicker = forwardRef(({ openButtonLabel = "Open date picker", dateMathPresets = DATE_PICKER_DATE_MATH_PRESETS, ...props }, ref) => /* @__PURE__ */ jsx(DateInputField, {
|
|
7
|
+
...props,
|
|
8
|
+
ref,
|
|
9
|
+
openButtonLabel,
|
|
10
|
+
dateMathPresets,
|
|
11
|
+
withTime: false
|
|
12
|
+
}));
|
|
65
13
|
DatePicker.displayName = "DatePicker";
|
|
66
14
|
export { DatePicker };
|
|
67
15
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.js","names":[],"sources":["../../src/components/DatePicker.tsx"],"sourcesContent":["import { forwardRef
|
|
1
|
+
{"version":3,"file":"DatePicker.js","names":[],"sources":["../../src/components/DatePicker.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport { DATE_PICKER_DATE_MATH_PRESETS } from \"./date-math\";\nimport { DateInputField, type DateFieldProps } from \"./date-input-field\";\n\nexport type DatePickerProps = DateFieldProps;\n\nexport const DatePicker = forwardRef<HTMLInputElement, DatePickerProps>(\n (\n {\n openButtonLabel = \"Open date picker\",\n dateMathPresets = DATE_PICKER_DATE_MATH_PRESETS,\n ...props\n },\n ref,\n ) => (\n <DateInputField\n {...props}\n ref={ref}\n openButtonLabel={openButtonLabel}\n dateMathPresets={dateMathPresets}\n withTime={false}\n />\n ),\n);\n\nDatePicker.displayName = \"DatePicker\";\n"],"mappings":";;;;;AAMA,IAAa,aAAa,YAEtB,EACE,kBAAkB,oBAClB,kBAAkB,+BAClB,GAAG,SAEL,QAEA,oBAAC,gBAAD;CACE,GAAI;CACC;CACY;CACA;CACjB,UAAU;AACX,CAAA,CAEL;AAEA,WAAW,cAAc"}
|
|
@@ -1,85 +1,16 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
const require_utils = require("../lib/utils.cjs");
|
|
4
|
-
const require_field_clear_button = require("./field-clear-button.cjs");
|
|
1
|
+
const require_date_math = require("./date-math.cjs");
|
|
2
|
+
const require_date_input_field = require("./date-input-field.cjs");
|
|
5
3
|
let react = require("react");
|
|
6
4
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
5
|
// src/components/DateTimePicker.tsx
|
|
8
|
-
var DateTimePicker = (0, react.forwardRef)(({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
else if (ref) ref.current = node;
|
|
16
|
-
}
|
|
17
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
18
|
-
"data-jsf-control": true,
|
|
19
|
-
"data-clearable-field": true,
|
|
20
|
-
className: require_utils.cn("relative", className),
|
|
21
|
-
children: [
|
|
22
|
-
prefix && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
23
|
-
className: "absolute inset-y-0 left-1.5 flex items-center",
|
|
24
|
-
children: prefix
|
|
25
|
-
}),
|
|
26
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
27
|
-
...props,
|
|
28
|
-
ref: assignRef,
|
|
29
|
-
type: "text",
|
|
30
|
-
value,
|
|
31
|
-
className: require_utils.cn("h-control-h w-full rounded-md border border-input bg-background px-control-px pr-8 text-sm outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50", prefix && "pl-8", inputClassName, (showClear || suffix) && "pr-16", showClear && suffix && "pr-24"),
|
|
32
|
-
onChange: (event) => onChange?.(event.target.value)
|
|
33
|
-
}),
|
|
34
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
35
|
-
ref: pickerRef,
|
|
36
|
-
type: "datetime-local",
|
|
37
|
-
tabIndex: -1,
|
|
38
|
-
"aria-hidden": "true",
|
|
39
|
-
className: "pointer-events-none absolute left-0 top-0 h-0 w-0 opacity-0",
|
|
40
|
-
value: toDateTimeLocalValue(value),
|
|
41
|
-
onChange: (event) => onChange?.(event.target.value)
|
|
42
|
-
}),
|
|
43
|
-
suffix && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
44
|
-
className: require_utils.cn("absolute inset-y-0 flex items-center", showClear ? "right-14" : "right-7"),
|
|
45
|
-
children: suffix
|
|
46
|
-
}),
|
|
47
|
-
showClear && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
48
|
-
className: "absolute inset-y-0 right-7 flex items-center",
|
|
49
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_field_clear_button.FieldClearButton, {
|
|
50
|
-
...clearLabel ? { clearLabel } : {},
|
|
51
|
-
onClear: () => {
|
|
52
|
-
if (onClear) onClear();
|
|
53
|
-
else onChange?.("");
|
|
54
|
-
visibleRef.current?.focus();
|
|
55
|
-
}
|
|
56
|
-
})
|
|
57
|
-
}),
|
|
58
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
59
|
-
type: "button",
|
|
60
|
-
"aria-label": openButtonLabel,
|
|
61
|
-
disabled: props.disabled || props.readOnly,
|
|
62
|
-
className: require_utils.cn("absolute inset-y-0 right-1 inline-flex items-center text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50", buttonClassName),
|
|
63
|
-
onClick: () => {
|
|
64
|
-
visibleRef.current?.focus();
|
|
65
|
-
pickerRef.current?.showPicker?.();
|
|
66
|
-
},
|
|
67
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icon.Icon, {
|
|
68
|
-
icon: require_UiCalendar.UiCalendar,
|
|
69
|
-
className: "text-sm"
|
|
70
|
-
})
|
|
71
|
-
})
|
|
72
|
-
]
|
|
73
|
-
});
|
|
74
|
-
});
|
|
6
|
+
var DateTimePicker = (0, react.forwardRef)(({ openButtonLabel = "Open time picker", dateMathPresets = require_date_math.DATE_TIME_PICKER_DATE_MATH_PRESETS, ...props }, ref) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_date_input_field.DateInputField, {
|
|
7
|
+
...props,
|
|
8
|
+
ref,
|
|
9
|
+
openButtonLabel,
|
|
10
|
+
dateMathPresets,
|
|
11
|
+
withTime: true
|
|
12
|
+
}));
|
|
75
13
|
DateTimePicker.displayName = "DateTimePicker";
|
|
76
|
-
function toDateTimeLocalValue(value) {
|
|
77
|
-
const trimmed = value.trim();
|
|
78
|
-
if (!trimmed) return "";
|
|
79
|
-
if (trimmed === "now" || trimmed.startsWith("now")) return "";
|
|
80
|
-
const withTime = /^\d{4}-\d{2}-\d{2}$/.test(trimmed) ? `${trimmed}T00:00` : trimmed;
|
|
81
|
-
return /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/.test(withTime) ? withTime.slice(0, 16) : "";
|
|
82
|
-
}
|
|
83
14
|
exports.DateTimePicker = DateTimePicker;
|
|
84
15
|
|
|
85
16
|
//# sourceMappingURL=DateTimePicker.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimePicker.cjs","names":["forwardRef","
|
|
1
|
+
{"version":3,"file":"DateTimePicker.cjs","names":["forwardRef","DATE_TIME_PICKER_DATE_MATH_PRESETS","DateInputField"],"sources":["../../src/components/DateTimePicker.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport { DATE_TIME_PICKER_DATE_MATH_PRESETS } from \"./date-math\";\nimport { DateInputField, type DateFieldProps } from \"./date-input-field\";\n\nexport type DateTimePickerProps = DateFieldProps;\n\nexport const DateTimePicker = forwardRef<HTMLInputElement, DateTimePickerProps>(\n (\n {\n openButtonLabel = \"Open time picker\",\n dateMathPresets = DATE_TIME_PICKER_DATE_MATH_PRESETS,\n ...props\n },\n ref,\n ) => (\n <DateInputField\n {...props}\n ref={ref}\n openButtonLabel={openButtonLabel}\n dateMathPresets={dateMathPresets}\n withTime\n />\n ),\n);\n\nDateTimePicker.displayName = \"DateTimePicker\";\n"],"mappings":";;;;;AAMA,IAAa,kBAAA,GAAiBA,MAAAA,WAAAA,EAE1B,EACE,kBAAkB,oBAClB,kBAAkBC,kBAAAA,oCAClB,GAAG,SAEL,QAEA,iBAAA,GAAA,kBAAA,IAAA,CAACC,yBAAAA,gBAAD;CACE,GAAI;CACC;CACY;CACA;CACjB,UAAA;AACD,CAAA,CAEL;AAEA,eAAe,cAAc"}
|
|
@@ -1,27 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export
|
|
1
|
+
import { DateFieldProps } from './date-input-field.js';
|
|
2
|
+
export type DateTimePickerProps = DateFieldProps;
|
|
3
|
+
export declare const DateTimePicker: import('react').ForwardRefExoticComponent<Omit<import('react').InputHTMLAttributes<HTMLInputElement>, "prefix" | "type" | "value" | "onChange"> & import('./field-clear-button.js').ClearableFieldProps & import('./date-math.js').DateMathProps & {
|
|
4
4
|
value?: string;
|
|
5
5
|
onChange?: (value: string) => void;
|
|
6
6
|
className?: string;
|
|
7
7
|
inputClassName?: string;
|
|
8
8
|
buttonClassName?: string;
|
|
9
9
|
openButtonLabel?: string;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
/** Leading in-field adornment, rendered at the left edge of the input. */
|
|
13
|
-
prefix?: ReactNode;
|
|
14
|
-
};
|
|
15
|
-
export declare const DateTimePicker: import('react').ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "prefix" | "type" | "value" | "onChange"> & ClearableFieldProps & {
|
|
16
|
-
value?: string;
|
|
17
|
-
onChange?: (value: string) => void;
|
|
18
|
-
className?: string;
|
|
19
|
-
inputClassName?: string;
|
|
20
|
-
buttonClassName?: string;
|
|
21
|
-
openButtonLabel?: string;
|
|
22
|
-
/** Trailing in-field adornment, rendered left of the calendar button. */
|
|
23
|
-
suffix?: ReactNode;
|
|
24
|
-
/** Leading in-field adornment, rendered at the left edge of the input. */
|
|
25
|
-
prefix?: ReactNode;
|
|
10
|
+
suffix?: import('react').ReactNode;
|
|
11
|
+
prefix?: import('react').ReactNode;
|
|
26
12
|
} & import('react').RefAttributes<HTMLInputElement>>;
|
|
27
13
|
//# sourceMappingURL=DateTimePicker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateTimePicker.d.ts","sourceRoot":"","sources":["../../src/components/DateTimePicker.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DateTimePicker.d.ts","sourceRoot":"","sources":["../../src/components/DateTimePicker.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzE,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC;AAEjD,eAAO,MAAM,cAAc;;;;;;;;;oDAiB1B,CAAC"}
|