@osdk/react-components 0.2.0-beta.22 → 0.2.0-beta.23
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/CHANGELOG.md +16 -0
- package/README.md +22 -6
- package/build/browser/action-form/FormFieldApi.js.map +1 -1
- package/build/browser/action-form/fields/DateCalendar.js +70 -0
- package/build/browser/action-form/fields/DateCalendar.js.map +1 -0
- package/build/browser/action-form/fields/DateCalendar.module.css +136 -0
- package/build/browser/action-form/fields/DateCalendar.module.css.js +22 -0
- package/build/browser/action-form/fields/DatetimePickerField.js +98 -0
- package/build/browser/action-form/fields/DatetimePickerField.js.map +1 -0
- package/build/browser/action-form/fields/DatetimePickerField.module.css +66 -0
- package/build/browser/action-form/fields/DatetimePickerField.module.css.js +10 -0
- package/build/browser/action-form/fields/FormFieldRenderer.js +10 -1
- package/build/browser/action-form/fields/FormFieldRenderer.js.map +1 -1
- package/build/browser/action-form/fields/LazyDateCalendar.js +27 -0
- package/build/browser/action-form/fields/LazyDateCalendar.js.map +1 -0
- package/build/browser/filter-list/FilterList.js +9 -5
- package/build/browser/filter-list/FilterList.js.map +1 -1
- package/build/browser/filter-list/FilterListApi.js.map +1 -1
- package/build/browser/filter-list/base/BaseFilterList.js +3 -1
- package/build/browser/filter-list/base/BaseFilterList.js.map +1 -1
- package/build/browser/filter-list/base/BaseFilterListApi.js.map +1 -1
- package/build/browser/filter-list/base/FilterListHeader.js +3 -2
- package/build/browser/filter-list/base/FilterListHeader.js.map +1 -1
- package/build/browser/filter-list/base/inputs/DateRangeInput.js +1 -1
- package/build/browser/filter-list/base/inputs/DateRangeInput.js.map +1 -1
- package/build/browser/filter-list/base/inputs/MultiDateInput.js +1 -1
- package/build/browser/filter-list/base/inputs/MultiDateInput.js.map +1 -1
- package/build/browser/filter-list/base/inputs/SingleDateInput.js +1 -1
- package/build/browser/filter-list/base/inputs/SingleDateInput.js.map +1 -1
- package/build/browser/filter-list/base/inputs/TimelineInput.js +1 -1
- package/build/browser/filter-list/base/inputs/TimelineInput.js.map +1 -1
- package/build/browser/filter-list/base/inputs/index.js +1 -1
- package/build/browser/filter-list/base/inputs/index.js.map +1 -1
- package/build/browser/filter-list/hooks/useFilterListState.js +3 -0
- package/build/browser/filter-list/hooks/useFilterListState.js.map +1 -1
- package/build/browser/filter-list/hooks/useFilterVisibility.js +7 -1
- package/build/browser/filter-list/hooks/useFilterVisibility.js.map +1 -1
- package/build/browser/filter-list/utils/filterStateToWhereClause.js +1 -1
- package/build/browser/filter-list/utils/filterStateToWhereClause.js.map +1 -1
- package/build/browser/object-table/LoadingCell.js +2 -1
- package/build/browser/object-table/LoadingCell.js.map +1 -1
- package/build/browser/object-table/LoadingCell.module.css +3 -20
- package/build/browser/object-table/LoadingCell.module.css.js +1 -2
- package/build/browser/object-table/LoadingStateTable.js +2 -1
- package/build/browser/object-table/LoadingStateTable.js.map +1 -1
- package/build/browser/pdf-viewer/PdfRenderer.js +1 -1
- package/build/browser/pdf-viewer/PdfRenderer.js.map +1 -1
- package/build/browser/pdf-viewer/PdfViewer.js +59 -118
- package/build/browser/pdf-viewer/PdfViewer.js.map +1 -1
- package/build/browser/pdf-viewer/components/PdfViewerAnnotationLayer.js.map +1 -0
- package/build/browser/pdf-viewer/components/PdfViewerAnnotationLayer.module.css.js +11 -0
- package/build/browser/pdf-viewer/components/PdfViewerContent.js +113 -0
- package/build/browser/pdf-viewer/components/PdfViewerContent.js.map +1 -0
- package/build/browser/pdf-viewer/components/PdfViewerOutlineSidebar.js +98 -0
- package/build/browser/pdf-viewer/components/PdfViewerOutlineSidebar.js.map +1 -0
- package/build/browser/pdf-viewer/components/PdfViewerOutlineSidebar.module.css +89 -0
- package/build/browser/pdf-viewer/components/PdfViewerOutlineSidebar.module.css.js +15 -0
- package/build/browser/pdf-viewer/components/PdfViewerSearchBar.js.map +1 -0
- package/build/browser/pdf-viewer/components/PdfViewerSearchBar.module.css.js +10 -0
- package/build/browser/pdf-viewer/{PdfViewerSidebar.js → components/PdfViewerSidebar.js} +9 -5
- package/build/browser/pdf-viewer/components/PdfViewerSidebar.js.map +1 -0
- package/build/{esm/pdf-viewer → browser/pdf-viewer/components}/PdfViewerSidebar.module.css +0 -9
- package/build/browser/pdf-viewer/{PdfViewerSidebar.module.css.js → components/PdfViewerSidebar.module.css.js} +5 -6
- package/build/browser/pdf-viewer/components/PdfViewerSidebarHeader.js +54 -0
- package/build/browser/pdf-viewer/components/PdfViewerSidebarHeader.js.map +1 -0
- package/build/browser/pdf-viewer/components/PdfViewerSidebarHeader.module.css +70 -0
- package/build/browser/pdf-viewer/components/PdfViewerSidebarHeader.module.css.js +8 -0
- package/build/browser/pdf-viewer/{PdfViewerThumbnail.js → components/PdfViewerThumbnail.js} +1 -1
- package/build/browser/pdf-viewer/components/PdfViewerThumbnail.js.map +1 -0
- package/build/browser/pdf-viewer/{PdfViewerThumbnail.module.css.js → components/PdfViewerThumbnail.module.css.js} +3 -3
- package/build/browser/pdf-viewer/{PdfViewerToolbar.js → components/PdfViewerToolbar.js} +39 -12
- package/build/browser/pdf-viewer/components/PdfViewerToolbar.js.map +1 -0
- package/build/browser/pdf-viewer/{PdfViewerToolbar.module.css → components/PdfViewerToolbar.module.css} +2 -2
- package/build/browser/pdf-viewer/components/PdfViewerToolbar.module.css.js +12 -0
- package/build/browser/pdf-viewer/constants.js +7 -5
- package/build/browser/pdf-viewer/constants.js.map +1 -1
- package/build/browser/pdf-viewer/hooks/usePdfDocument.js +2 -3
- package/build/browser/pdf-viewer/hooks/usePdfDocument.js.map +1 -1
- package/build/browser/pdf-viewer/hooks/usePdfOutline.js +268 -0
- package/build/browser/pdf-viewer/hooks/usePdfOutline.js.map +1 -0
- package/build/browser/pdf-viewer/hooks/usePdfViewer.js +12 -1
- package/build/browser/pdf-viewer/hooks/usePdfViewer.js.map +1 -1
- package/build/browser/pdf-viewer/hooks/usePdfViewerCore.js +80 -0
- package/build/browser/pdf-viewer/hooks/usePdfViewerCore.js.map +1 -0
- package/build/browser/pdf-viewer/hooks/usePdfViewerState.js +135 -0
- package/build/browser/pdf-viewer/hooks/usePdfViewerState.js.map +1 -0
- package/build/browser/pdf-viewer/types.js.map +1 -1
- package/build/browser/public/experimental.js +21 -2
- package/build/browser/public/experimental.js.map +1 -1
- package/build/browser/public/primitives.js +20 -0
- package/build/browser/public/primitives.js.map +1 -0
- package/build/browser/{filter-list/base/inputs → shared}/dateUtils.js +38 -2
- package/build/browser/shared/dateUtils.js.map +1 -0
- package/build/browser/styles.css +421 -74
- package/build/cjs/DateCalendar-QWGFKD6J.css +113 -0
- package/build/cjs/DateCalendar-QWGFKD6J.css.map +1 -0
- package/build/cjs/DateCalendar-R44GMN3O.cjs +67 -0
- package/build/cjs/DateCalendar-R44GMN3O.cjs.map +1 -0
- package/build/cjs/chunk-GT6IV6LV.cjs +163 -0
- package/build/cjs/chunk-GT6IV6LV.cjs.map +1 -0
- package/build/cjs/chunk-HMQTYQEX.cjs +9 -0
- package/build/cjs/chunk-HMQTYQEX.cjs.map +1 -0
- package/build/cjs/chunk-UZ2E5NRX.cjs +8 -0
- package/build/cjs/chunk-UZ2E5NRX.cjs.map +1 -0
- package/build/cjs/index.cjs +2 -0
- package/build/cjs/public/experimental.cjs +2157 -1592
- package/build/cjs/public/experimental.cjs.map +1 -1
- package/build/cjs/public/experimental.css +388 -116
- package/build/cjs/public/experimental.css.map +1 -1
- package/build/cjs/public/experimental.d.cts +273 -14
- package/build/cjs/public/primitives.cjs +25 -0
- package/build/cjs/public/primitives.cjs.map +1 -0
- package/build/cjs/public/primitives.css +154 -0
- package/build/cjs/public/primitives.css.map +1 -0
- package/build/cjs/public/primitives.d.cts +49 -0
- package/build/esm/action-form/FormFieldApi.js.map +1 -1
- package/build/esm/action-form/fields/DateCalendar.js +70 -0
- package/build/esm/action-form/fields/DateCalendar.js.map +1 -0
- package/build/esm/action-form/fields/DateCalendar.module.css +136 -0
- package/build/esm/action-form/fields/DatetimePickerField.js +98 -0
- package/build/esm/action-form/fields/DatetimePickerField.js.map +1 -0
- package/build/esm/action-form/fields/DatetimePickerField.module.css +66 -0
- package/build/esm/action-form/fields/FormFieldRenderer.js +10 -1
- package/build/esm/action-form/fields/FormFieldRenderer.js.map +1 -1
- package/build/esm/action-form/fields/LazyDateCalendar.js +27 -0
- package/build/esm/action-form/fields/LazyDateCalendar.js.map +1 -0
- package/build/esm/filter-list/FilterList.js +9 -5
- package/build/esm/filter-list/FilterList.js.map +1 -1
- package/build/esm/filter-list/FilterListApi.js.map +1 -1
- package/build/esm/filter-list/base/BaseFilterList.js +3 -1
- package/build/esm/filter-list/base/BaseFilterList.js.map +1 -1
- package/build/esm/filter-list/base/BaseFilterListApi.js.map +1 -1
- package/build/esm/filter-list/base/FilterListHeader.js +3 -2
- package/build/esm/filter-list/base/FilterListHeader.js.map +1 -1
- package/build/esm/filter-list/base/inputs/DateRangeInput.js +1 -1
- package/build/esm/filter-list/base/inputs/DateRangeInput.js.map +1 -1
- package/build/esm/filter-list/base/inputs/MultiDateInput.js +1 -1
- package/build/esm/filter-list/base/inputs/MultiDateInput.js.map +1 -1
- package/build/esm/filter-list/base/inputs/SingleDateInput.js +1 -1
- package/build/esm/filter-list/base/inputs/SingleDateInput.js.map +1 -1
- package/build/esm/filter-list/base/inputs/TimelineInput.js +1 -1
- package/build/esm/filter-list/base/inputs/TimelineInput.js.map +1 -1
- package/build/esm/filter-list/base/inputs/index.js +1 -1
- package/build/esm/filter-list/base/inputs/index.js.map +1 -1
- package/build/esm/filter-list/hooks/useFilterListState.js +3 -0
- package/build/esm/filter-list/hooks/useFilterListState.js.map +1 -1
- package/build/esm/filter-list/hooks/useFilterVisibility.js +7 -1
- package/build/esm/filter-list/hooks/useFilterVisibility.js.map +1 -1
- package/build/esm/filter-list/utils/filterStateToWhereClause.js +1 -1
- package/build/esm/filter-list/utils/filterStateToWhereClause.js.map +1 -1
- package/build/esm/object-table/LoadingCell.js +2 -1
- package/build/esm/object-table/LoadingCell.js.map +1 -1
- package/build/esm/object-table/LoadingCell.module.css +3 -20
- package/build/esm/object-table/LoadingStateTable.js +2 -1
- package/build/esm/object-table/LoadingStateTable.js.map +1 -1
- package/build/esm/pdf-viewer/PdfRenderer.js +1 -1
- package/build/esm/pdf-viewer/PdfRenderer.js.map +1 -1
- package/build/esm/pdf-viewer/PdfViewer.js +59 -118
- package/build/esm/pdf-viewer/PdfViewer.js.map +1 -1
- package/build/esm/pdf-viewer/components/PdfViewerAnnotationLayer.js.map +1 -0
- package/build/esm/pdf-viewer/components/PdfViewerContent.js +113 -0
- package/build/esm/pdf-viewer/components/PdfViewerContent.js.map +1 -0
- package/build/esm/pdf-viewer/components/PdfViewerOutlineSidebar.js +98 -0
- package/build/esm/pdf-viewer/components/PdfViewerOutlineSidebar.js.map +1 -0
- package/build/esm/pdf-viewer/components/PdfViewerOutlineSidebar.module.css +89 -0
- package/build/esm/pdf-viewer/components/PdfViewerSearchBar.js.map +1 -0
- package/build/esm/pdf-viewer/{PdfViewerSidebar.js → components/PdfViewerSidebar.js} +9 -5
- package/build/esm/pdf-viewer/components/PdfViewerSidebar.js.map +1 -0
- package/build/{browser/pdf-viewer → esm/pdf-viewer/components}/PdfViewerSidebar.module.css +0 -9
- package/build/esm/pdf-viewer/components/PdfViewerSidebarHeader.js +54 -0
- package/build/esm/pdf-viewer/components/PdfViewerSidebarHeader.js.map +1 -0
- package/build/esm/pdf-viewer/components/PdfViewerSidebarHeader.module.css +70 -0
- package/build/esm/pdf-viewer/{PdfViewerThumbnail.js → components/PdfViewerThumbnail.js} +1 -1
- package/build/esm/pdf-viewer/components/PdfViewerThumbnail.js.map +1 -0
- package/build/esm/pdf-viewer/{PdfViewerToolbar.js → components/PdfViewerToolbar.js} +39 -12
- package/build/esm/pdf-viewer/components/PdfViewerToolbar.js.map +1 -0
- package/build/esm/pdf-viewer/{PdfViewerToolbar.module.css → components/PdfViewerToolbar.module.css} +2 -2
- package/build/esm/pdf-viewer/constants.js +7 -5
- package/build/esm/pdf-viewer/constants.js.map +1 -1
- package/build/esm/pdf-viewer/hooks/usePdfDocument.js +2 -3
- package/build/esm/pdf-viewer/hooks/usePdfDocument.js.map +1 -1
- package/build/esm/pdf-viewer/hooks/usePdfOutline.js +268 -0
- package/build/esm/pdf-viewer/hooks/usePdfOutline.js.map +1 -0
- package/build/esm/pdf-viewer/hooks/usePdfViewer.js +12 -1
- package/build/esm/pdf-viewer/hooks/usePdfViewer.js.map +1 -1
- package/build/esm/pdf-viewer/hooks/usePdfViewerCore.js +80 -0
- package/build/esm/pdf-viewer/hooks/usePdfViewerCore.js.map +1 -0
- package/build/esm/pdf-viewer/hooks/usePdfViewerState.js +135 -0
- package/build/esm/pdf-viewer/hooks/usePdfViewerState.js.map +1 -0
- package/build/esm/pdf-viewer/types.js.map +1 -1
- package/build/esm/public/experimental.js +21 -2
- package/build/esm/public/experimental.js.map +1 -1
- package/build/esm/public/primitives.js +20 -0
- package/build/esm/public/primitives.js.map +1 -0
- package/build/esm/{filter-list/base/inputs → shared}/dateUtils.js +38 -2
- package/build/esm/shared/dateUtils.js.map +1 -0
- package/build/types/action-form/FormFieldApi.d.ts +21 -7
- package/build/types/action-form/FormFieldApi.d.ts.map +1 -1
- package/build/types/action-form/fields/DateCalendar.d.ts +9 -0
- package/build/types/action-form/fields/DateCalendar.d.ts.map +1 -0
- package/build/types/action-form/fields/DatetimePickerField.d.ts +3 -0
- package/build/types/action-form/fields/DatetimePickerField.d.ts.map +1 -0
- package/build/types/action-form/fields/FormFieldRenderer.d.ts.map +1 -1
- package/build/types/action-form/fields/LazyDateCalendar.d.ts +3 -0
- package/build/types/action-form/fields/LazyDateCalendar.d.ts.map +1 -0
- package/build/types/filter-list/FilterListApi.d.ts +2 -1
- package/build/types/filter-list/FilterListApi.d.ts.map +1 -1
- package/build/types/filter-list/base/BaseFilterListApi.d.ts +2 -1
- package/build/types/filter-list/base/BaseFilterListApi.d.ts.map +1 -1
- package/build/types/filter-list/base/FilterListHeader.d.ts +3 -2
- package/build/types/filter-list/base/FilterListHeader.d.ts.map +1 -1
- package/build/types/filter-list/base/inputs/DateRangeInput.d.ts.map +1 -1
- package/build/types/filter-list/base/inputs/SingleDateInput.d.ts.map +1 -1
- package/build/types/filter-list/base/inputs/index.d.ts +1 -1
- package/build/types/filter-list/base/inputs/index.d.ts.map +1 -1
- package/build/types/filter-list/hooks/useFilterVisibility.d.ts +2 -0
- package/build/types/filter-list/hooks/useFilterVisibility.d.ts.map +1 -1
- package/build/types/object-table/LoadingCell.d.ts.map +1 -1
- package/build/types/object-table/LoadingStateTable.d.ts.map +1 -1
- package/build/types/pdf-viewer/PdfRenderer.d.ts +2 -2
- package/build/types/pdf-viewer/PdfRenderer.d.ts.map +1 -1
- package/build/types/pdf-viewer/PdfViewer.d.ts +1 -1
- package/build/types/pdf-viewer/PdfViewer.d.ts.map +1 -1
- package/build/types/pdf-viewer/{PdfViewerAnnotationLayer.d.ts → components/PdfViewerAnnotationLayer.d.ts} +2 -3
- package/build/types/pdf-viewer/components/PdfViewerAnnotationLayer.d.ts.map +1 -0
- package/build/types/pdf-viewer/components/PdfViewerContent.d.ts +22 -0
- package/build/types/pdf-viewer/components/PdfViewerContent.d.ts.map +1 -0
- package/build/types/pdf-viewer/components/PdfViewerOutlineSidebar.d.ts +11 -0
- package/build/types/pdf-viewer/components/PdfViewerOutlineSidebar.d.ts.map +1 -0
- package/build/types/pdf-viewer/{PdfViewerSearchBar.d.ts → components/PdfViewerSearchBar.d.ts} +1 -2
- package/build/types/pdf-viewer/components/PdfViewerSearchBar.d.ts.map +1 -0
- package/build/types/pdf-viewer/components/PdfViewerSidebar.d.ts +12 -0
- package/build/types/pdf-viewer/components/PdfViewerSidebar.d.ts.map +1 -0
- package/build/types/pdf-viewer/components/PdfViewerSidebarHeader.d.ts +7 -0
- package/build/types/pdf-viewer/components/PdfViewerSidebarHeader.d.ts.map +1 -0
- package/build/types/pdf-viewer/{PdfViewerThumbnail.d.ts.map → components/PdfViewerThumbnail.d.ts.map} +1 -1
- package/build/types/pdf-viewer/{PdfViewerToolbar.d.ts → components/PdfViewerToolbar.d.ts} +5 -3
- package/build/types/pdf-viewer/components/PdfViewerToolbar.d.ts.map +1 -0
- package/build/types/pdf-viewer/constants.d.ts +5 -0
- package/build/types/pdf-viewer/constants.d.ts.map +1 -1
- package/build/types/pdf-viewer/hooks/usePdfDocument.d.ts.map +1 -1
- package/build/types/pdf-viewer/hooks/usePdfOutline.d.ts +3 -0
- package/build/types/pdf-viewer/hooks/usePdfOutline.d.ts.map +1 -0
- package/build/types/pdf-viewer/hooks/usePdfViewer.d.ts +1 -1
- package/build/types/pdf-viewer/hooks/usePdfViewer.d.ts.map +1 -1
- package/build/types/pdf-viewer/hooks/usePdfViewerCore.d.ts +43 -0
- package/build/types/pdf-viewer/hooks/usePdfViewerCore.d.ts.map +1 -0
- package/build/types/pdf-viewer/hooks/usePdfViewerState.d.ts +39 -0
- package/build/types/pdf-viewer/hooks/usePdfViewerState.d.ts.map +1 -0
- package/build/types/pdf-viewer/types.d.ts +42 -0
- package/build/types/pdf-viewer/types.d.ts.map +1 -1
- package/build/types/public/experimental.d.ts +17 -2
- package/build/types/public/experimental.d.ts.map +1 -1
- package/build/types/public/primitives.d.ts +3 -0
- package/build/types/public/primitives.d.ts.map +1 -0
- package/build/types/shared/dateUtils.d.ts +31 -0
- package/build/types/shared/dateUtils.d.ts.map +1 -0
- package/package.json +14 -4
- package/primitives.d.ts +17 -0
- package/build/browser/filter-list/base/inputs/dateUtils.js.map +0 -1
- package/build/browser/pdf-viewer/PdfViewerAnnotationLayer.js.map +0 -1
- package/build/browser/pdf-viewer/PdfViewerAnnotationLayer.module.css.js +0 -11
- package/build/browser/pdf-viewer/PdfViewerSearchBar.js.map +0 -1
- package/build/browser/pdf-viewer/PdfViewerSearchBar.module.css.js +0 -10
- package/build/browser/pdf-viewer/PdfViewerSidebar.js.map +0 -1
- package/build/browser/pdf-viewer/PdfViewerThumbnail.js.map +0 -1
- package/build/browser/pdf-viewer/PdfViewerToolbar.js.map +0 -1
- package/build/browser/pdf-viewer/PdfViewerToolbar.module.css.js +0 -12
- package/build/esm/filter-list/base/inputs/dateUtils.js.map +0 -1
- package/build/esm/pdf-viewer/PdfViewerAnnotationLayer.js.map +0 -1
- package/build/esm/pdf-viewer/PdfViewerSearchBar.js.map +0 -1
- package/build/esm/pdf-viewer/PdfViewerSidebar.js.map +0 -1
- package/build/esm/pdf-viewer/PdfViewerThumbnail.js.map +0 -1
- package/build/esm/pdf-viewer/PdfViewerToolbar.js.map +0 -1
- package/build/types/filter-list/base/inputs/dateUtils.d.ts +0 -17
- package/build/types/filter-list/base/inputs/dateUtils.d.ts.map +0 -1
- package/build/types/pdf-viewer/PdfViewerAnnotationLayer.d.ts.map +0 -1
- package/build/types/pdf-viewer/PdfViewerSearchBar.d.ts.map +0 -1
- package/build/types/pdf-viewer/PdfViewerSidebar.d.ts +0 -10
- package/build/types/pdf-viewer/PdfViewerSidebar.d.ts.map +0 -1
- package/build/types/pdf-viewer/PdfViewerToolbar.d.ts.map +0 -1
- /package/build/browser/pdf-viewer/{PdfViewerAnnotationLayer.js → components/PdfViewerAnnotationLayer.js} +0 -0
- /package/build/browser/pdf-viewer/{PdfViewerAnnotationLayer.module.css → components/PdfViewerAnnotationLayer.module.css} +0 -0
- /package/build/browser/pdf-viewer/{PdfViewerSearchBar.js → components/PdfViewerSearchBar.js} +0 -0
- /package/build/browser/pdf-viewer/{PdfViewerSearchBar.module.css → components/PdfViewerSearchBar.module.css} +0 -0
- /package/build/browser/pdf-viewer/{PdfViewerThumbnail.module.css → components/PdfViewerThumbnail.module.css} +0 -0
- /package/build/esm/pdf-viewer/{PdfViewerAnnotationLayer.js → components/PdfViewerAnnotationLayer.js} +0 -0
- /package/build/esm/pdf-viewer/{PdfViewerAnnotationLayer.module.css → components/PdfViewerAnnotationLayer.module.css} +0 -0
- /package/build/esm/pdf-viewer/{PdfViewerSearchBar.js → components/PdfViewerSearchBar.js} +0 -0
- /package/build/esm/pdf-viewer/{PdfViewerSearchBar.module.css → components/PdfViewerSearchBar.module.css} +0 -0
- /package/build/esm/pdf-viewer/{PdfViewerThumbnail.module.css → components/PdfViewerThumbnail.module.css} +0 -0
- /package/build/types/pdf-viewer/{PdfViewerThumbnail.d.ts → components/PdfViewerThumbnail.d.ts} +0 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { useCallback, useRef, useState } from "react";
|
|
18
|
+
import { usePdfAnnotationPortals } from "./usePdfAnnotationPortals.js";
|
|
19
|
+
import { usePdfDocument } from "./usePdfDocument.js";
|
|
20
|
+
import { usePdfViewer } from "./usePdfViewer.js";
|
|
21
|
+
import { usePdfViewerSync } from "./usePdfViewerSync.js";
|
|
22
|
+
export function usePdfViewerCore({
|
|
23
|
+
src,
|
|
24
|
+
initialPage = 1,
|
|
25
|
+
initialScale = 1.0
|
|
26
|
+
}) {
|
|
27
|
+
const {
|
|
28
|
+
document,
|
|
29
|
+
numPages,
|
|
30
|
+
loading,
|
|
31
|
+
error
|
|
32
|
+
} = usePdfDocument(src);
|
|
33
|
+
const [scale, setScale] = useState(initialScale);
|
|
34
|
+
const [currentPage, setCurrentPage] = useState(initialPage);
|
|
35
|
+
const containerRef = useRef(null);
|
|
36
|
+
const viewerRef = useRef(null);
|
|
37
|
+
const {
|
|
38
|
+
pdfViewerRef,
|
|
39
|
+
eventBusRef,
|
|
40
|
+
findControllerRef
|
|
41
|
+
} = usePdfViewer(containerRef, viewerRef, document, initialScale, initialPage);
|
|
42
|
+
const handleScaleChange = useCallback(newScale => {
|
|
43
|
+
setScale(newScale);
|
|
44
|
+
}, []);
|
|
45
|
+
const handlePageChange = useCallback(page => {
|
|
46
|
+
setCurrentPage(page);
|
|
47
|
+
}, []);
|
|
48
|
+
const {
|
|
49
|
+
scrollToPage: syncScrollToPage
|
|
50
|
+
} = usePdfViewerSync({
|
|
51
|
+
pdfViewerRef,
|
|
52
|
+
eventBusRef,
|
|
53
|
+
document,
|
|
54
|
+
scale,
|
|
55
|
+
onScaleChange: handleScaleChange,
|
|
56
|
+
onPageChange: handlePageChange
|
|
57
|
+
});
|
|
58
|
+
const scrollToPage = useCallback(page => {
|
|
59
|
+
setCurrentPage(page);
|
|
60
|
+
syncScrollToPage(page);
|
|
61
|
+
}, [syncScrollToPage]);
|
|
62
|
+
const portalTargets = usePdfAnnotationPortals(pdfViewerRef, eventBusRef, document);
|
|
63
|
+
return {
|
|
64
|
+
document,
|
|
65
|
+
numPages,
|
|
66
|
+
loading,
|
|
67
|
+
error,
|
|
68
|
+
containerRef,
|
|
69
|
+
viewerRef,
|
|
70
|
+
currentPage,
|
|
71
|
+
scrollToPage,
|
|
72
|
+
scale,
|
|
73
|
+
setScale,
|
|
74
|
+
portalTargets,
|
|
75
|
+
pdfViewerRef,
|
|
76
|
+
eventBusRef,
|
|
77
|
+
findControllerRef
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=usePdfViewerCore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePdfViewerCore.js","names":["useCallback","useRef","useState","usePdfAnnotationPortals","usePdfDocument","usePdfViewer","usePdfViewerSync","usePdfViewerCore","src","initialPage","initialScale","document","numPages","loading","error","scale","setScale","currentPage","setCurrentPage","containerRef","viewerRef","pdfViewerRef","eventBusRef","findControllerRef","handleScaleChange","newScale","handlePageChange","page","scrollToPage","syncScrollToPage","onScaleChange","onPageChange","portalTargets"],"sources":["usePdfViewerCore.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { PDFDocumentProxy } from \"pdfjs-dist\";\nimport type {\n EventBus,\n PDFFindController,\n PDFViewer,\n} from \"pdfjs-dist/web/pdf_viewer.mjs\";\nimport type { RefObject } from \"react\";\nimport { useCallback, useRef, useState } from \"react\";\nimport type { AnnotationPortalTarget } from \"./usePdfAnnotationPortals.js\";\nimport { usePdfAnnotationPortals } from \"./usePdfAnnotationPortals.js\";\nimport { usePdfDocument } from \"./usePdfDocument.js\";\nimport { usePdfViewer } from \"./usePdfViewer.js\";\nimport { usePdfViewerSync } from \"./usePdfViewerSync.js\";\n\nexport interface UsePdfViewerCoreOptions {\n /** PDF source — URL string or ArrayBuffer */\n src: string | ArrayBuffer;\n /** Initial page number (1-indexed, default 1) */\n initialPage?: number;\n /** Initial zoom scale (default 1.0) */\n initialScale?: number;\n}\n\nexport interface UsePdfViewerCoreResult {\n /** The loaded PDF document, or undefined while loading */\n document: PDFDocumentProxy | undefined;\n /** Total number of pages in the document */\n numPages: number;\n /** Whether the document is currently loading */\n loading: boolean;\n /** Error encountered while loading the document */\n error: Error | undefined;\n\n /** Ref to attach to the scroll-container div */\n containerRef: RefObject<HTMLDivElement>;\n /** Ref to attach to the inner viewer div (className=\"pdfViewer\") */\n viewerRef: RefObject<HTMLDivElement>;\n\n /** Current page number (1-indexed) */\n currentPage: number;\n /** Navigate to a specific page (updates state and scrolls the viewer) */\n scrollToPage: (page: number) => void;\n\n /** Current zoom scale */\n scale: number;\n /** Set the zoom scale directly */\n setScale: (scale: number) => void;\n\n /** Portal targets for rendering annotation overlays on each page */\n portalTargets: AnnotationPortalTarget[];\n\n /** Ref to the internal pdfjs PDFViewer instance */\n pdfViewerRef: RefObject<PDFViewer | null>;\n /** Ref to the internal pdfjs EventBus instance */\n eventBusRef: RefObject<EventBus | null>;\n /** Ref to the internal pdfjs PDFFindController instance */\n findControllerRef: RefObject<PDFFindController | null>;\n}\n\nexport function usePdfViewerCore({\n src,\n initialPage = 1,\n initialScale = 1.0,\n}: UsePdfViewerCoreOptions): UsePdfViewerCoreResult {\n const { document, numPages, loading, error } = usePdfDocument(src);\n const [scale, setScale] = useState(initialScale);\n const [currentPage, setCurrentPage] = useState(initialPage);\n const containerRef = useRef<HTMLDivElement>(null);\n const viewerRef = useRef<HTMLDivElement>(null);\n\n const { pdfViewerRef, eventBusRef, findControllerRef } = usePdfViewer(\n containerRef,\n viewerRef,\n document,\n initialScale,\n initialPage,\n );\n\n const handleScaleChange = useCallback((newScale: number) => {\n setScale(newScale);\n }, []);\n\n const handlePageChange = useCallback((page: number) => {\n setCurrentPage(page);\n }, []);\n\n const { scrollToPage: syncScrollToPage } = usePdfViewerSync({\n pdfViewerRef,\n eventBusRef,\n document,\n scale,\n onScaleChange: handleScaleChange,\n onPageChange: handlePageChange,\n });\n\n const scrollToPage = useCallback(\n (page: number) => {\n setCurrentPage(page);\n syncScrollToPage(page);\n },\n [syncScrollToPage],\n );\n\n const portalTargets = usePdfAnnotationPortals(\n pdfViewerRef,\n eventBusRef,\n document,\n );\n\n return {\n document,\n numPages,\n loading,\n error,\n containerRef,\n viewerRef,\n currentPage,\n scrollToPage,\n scale,\n setScale,\n portalTargets,\n pdfViewerRef,\n eventBusRef,\n findControllerRef,\n };\n}\n"],"mappings":"AAAA;AAC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;IACRI,KAAK;IACLe,aAAa,EAAEN,iBAAiB;IAChCO,YAAY,EAAEL;EAChB,CAAC,CAAC;EAEF,MAAME,YAAY,GAAG5B,WAAW,CAC7B2B,IAAY,IAAK;IAChBT,cAAc,CAACS,IAAI,CAAC;IACpBE,gBAAgB,CAACF,IAAI,CAAC;EACxB,CAAC,EACD,CAACE,gBAAgB,CACnB,CAAC;EAED,MAAMG,aAAa,GAAG7B,uBAAuB,CAC3CkB,YAAY,EACZC,WAAW,EACXX,QACF,CAAC;EAED,OAAO;IACLA,QAAQ;IACRC,QAAQ;IACRC,OAAO;IACPC,KAAK;IACLK,YAAY;IACZC,SAAS;IACTH,WAAW;IACXW,YAAY;IACZb,KAAK;IACLC,QAAQ;IACRgB,aAAa;IACbX,YAAY;IACZC,WAAW;IACXC;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { useCallback, useEffect, useState } from "react";
|
|
18
|
+
import { MAX_SCALE, MIN_SCALE, SCALE_STEP } from "../constants.js";
|
|
19
|
+
import { usePdfOutline } from "./usePdfOutline.js";
|
|
20
|
+
import { usePdfViewerCore } from "./usePdfViewerCore.js";
|
|
21
|
+
import { usePdfViewerSearch } from "./usePdfViewerSearch.js";
|
|
22
|
+
export function usePdfViewerState({
|
|
23
|
+
src,
|
|
24
|
+
initialPage,
|
|
25
|
+
initialScale,
|
|
26
|
+
initialSidebarOpen = false,
|
|
27
|
+
sidebarMode: sidebarModeProp = "thumbnails",
|
|
28
|
+
onDownload
|
|
29
|
+
}) {
|
|
30
|
+
const core = usePdfViewerCore({
|
|
31
|
+
src,
|
|
32
|
+
initialPage,
|
|
33
|
+
initialScale
|
|
34
|
+
});
|
|
35
|
+
const [rotation, setRotation] = useState(0);
|
|
36
|
+
const [sidebarOpen, setSidebarOpen] = useState(initialSidebarOpen);
|
|
37
|
+
const [sidebarMode, setSidebarMode] = useState(sidebarModeProp);
|
|
38
|
+
const search = usePdfViewerSearch(core.eventBusRef, core.findControllerRef, core.document);
|
|
39
|
+
const outlineItems = usePdfOutline(core.document);
|
|
40
|
+
|
|
41
|
+
// Sync sidebarMode prop changes to state
|
|
42
|
+
useEffect(function () {
|
|
43
|
+
setSidebarMode(sidebarModeProp);
|
|
44
|
+
}, [sidebarModeProp]);
|
|
45
|
+
|
|
46
|
+
// Sync rotation → PDFViewer
|
|
47
|
+
useEffect(function () {
|
|
48
|
+
const pdfViewer = core.pdfViewerRef.current;
|
|
49
|
+
if (pdfViewer != null) {
|
|
50
|
+
pdfViewer.pagesRotation = rotation;
|
|
51
|
+
}
|
|
52
|
+
}, [core.pdfViewerRef, rotation]);
|
|
53
|
+
|
|
54
|
+
// Ctrl+F keyboard shortcut
|
|
55
|
+
useEffect(function () {
|
|
56
|
+
const handleKeyDown = e => {
|
|
57
|
+
if ((e.ctrlKey || e.metaKey) && e.key === "f") {
|
|
58
|
+
e.preventDefault();
|
|
59
|
+
search.openSearch();
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
63
|
+
return () => {
|
|
64
|
+
window.removeEventListener("keydown", handleKeyDown);
|
|
65
|
+
};
|
|
66
|
+
}, [search.openSearch]);
|
|
67
|
+
const zoomIn = useCallback(() => {
|
|
68
|
+
core.setScale(Math.min(core.scale + SCALE_STEP, MAX_SCALE));
|
|
69
|
+
}, [core.scale, core.setScale]);
|
|
70
|
+
const zoomOut = useCallback(() => {
|
|
71
|
+
core.setScale(Math.max(core.scale - SCALE_STEP, MIN_SCALE));
|
|
72
|
+
}, [core.scale, core.setScale]);
|
|
73
|
+
const rotateLeft = useCallback(() => {
|
|
74
|
+
setRotation(prev => (prev - 90 + 360) % 360);
|
|
75
|
+
}, []);
|
|
76
|
+
const rotateRight = useCallback(() => {
|
|
77
|
+
setRotation(prev => (prev + 90) % 360);
|
|
78
|
+
}, []);
|
|
79
|
+
const toggleSidebar = useCallback(() => {
|
|
80
|
+
setSidebarOpen(prev => !prev);
|
|
81
|
+
}, []);
|
|
82
|
+
const download = useCallback(filename => {
|
|
83
|
+
if (core.document == null) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
void core.document.getData().then(data => {
|
|
87
|
+
const blob = new Blob([data.buffer], {
|
|
88
|
+
type: "application/pdf"
|
|
89
|
+
});
|
|
90
|
+
const url = URL.createObjectURL(blob);
|
|
91
|
+
const resolvedFilename = resolveDownloadFilename(src, filename);
|
|
92
|
+
const a = globalThis.document.createElement("a");
|
|
93
|
+
a.href = url;
|
|
94
|
+
a.download = resolvedFilename;
|
|
95
|
+
a.click();
|
|
96
|
+
URL.revokeObjectURL(url);
|
|
97
|
+
onDownload?.({
|
|
98
|
+
success: true,
|
|
99
|
+
filename: resolvedFilename
|
|
100
|
+
});
|
|
101
|
+
}).catch(err => {
|
|
102
|
+
onDownload?.({
|
|
103
|
+
success: false,
|
|
104
|
+
error: err instanceof Error ? err : new Error("Failed to download PDF")
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
}, [core.document, src, onDownload]);
|
|
108
|
+
return {
|
|
109
|
+
...core,
|
|
110
|
+
zoomIn,
|
|
111
|
+
zoomOut,
|
|
112
|
+
rotation,
|
|
113
|
+
rotateLeft,
|
|
114
|
+
rotateRight,
|
|
115
|
+
sidebarOpen,
|
|
116
|
+
sidebarMode,
|
|
117
|
+
setSidebarMode,
|
|
118
|
+
toggleSidebar,
|
|
119
|
+
search,
|
|
120
|
+
outlineItems,
|
|
121
|
+
download
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/** Derive a download filename from an explicit name, the src URL, or a fallback. */
|
|
126
|
+
function resolveDownloadFilename(src, filename) {
|
|
127
|
+
if (filename != null) {
|
|
128
|
+
return filename;
|
|
129
|
+
}
|
|
130
|
+
if (typeof src === "string") {
|
|
131
|
+
return src.split("/").pop()?.split("?")[0] || "document.pdf";
|
|
132
|
+
}
|
|
133
|
+
return "document.pdf";
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=usePdfViewerState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePdfViewerState.js","names":["useCallback","useEffect","useState","MAX_SCALE","MIN_SCALE","SCALE_STEP","usePdfOutline","usePdfViewerCore","usePdfViewerSearch","usePdfViewerState","src","initialPage","initialScale","initialSidebarOpen","sidebarMode","sidebarModeProp","onDownload","core","rotation","setRotation","sidebarOpen","setSidebarOpen","setSidebarMode","search","eventBusRef","findControllerRef","document","outlineItems","pdfViewer","pdfViewerRef","current","pagesRotation","handleKeyDown","e","ctrlKey","metaKey","key","preventDefault","openSearch","window","addEventListener","removeEventListener","zoomIn","setScale","Math","min","scale","zoomOut","max","rotateLeft","prev","rotateRight","toggleSidebar","download","filename","getData","then","data","blob","Blob","buffer","type","url","URL","createObjectURL","resolvedFilename","resolveDownloadFilename","a","globalThis","createElement","href","click","revokeObjectURL","success","catch","err","error","Error","split","pop"],"sources":["usePdfViewerState.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useCallback, useEffect, useState } from \"react\";\nimport { MAX_SCALE, MIN_SCALE, SCALE_STEP } from \"../constants.js\";\nimport type { PdfDownloadResult, SidebarMode } from \"../types.js\";\nimport { usePdfOutline } from \"./usePdfOutline.js\";\nimport type {\n UsePdfViewerCoreOptions,\n UsePdfViewerCoreResult,\n} from \"./usePdfViewerCore.js\";\nimport { usePdfViewerCore } from \"./usePdfViewerCore.js\";\nimport type { UsePdfViewerSearchResult } from \"./usePdfViewerSearch.js\";\nimport { usePdfViewerSearch } from \"./usePdfViewerSearch.js\";\n\nexport interface UsePdfViewerStateOptions extends UsePdfViewerCoreOptions {\n /** Whether the sidebar is initially open (default false) */\n initialSidebarOpen?: boolean;\n /** Which sidebar panel to show (default \"thumbnails\") */\n sidebarMode?: SidebarMode;\n /** Callback fired when a download completes or fails */\n onDownload?: (result: PdfDownloadResult) => void;\n}\n\nexport interface UsePdfViewerStateResult extends UsePdfViewerCoreResult {\n /** Zoom in by one step */\n zoomIn: () => void;\n /** Zoom out by one step */\n zoomOut: () => void;\n\n /** Current rotation in degrees (0, 90, 180, 270) */\n rotation: number;\n /** Rotate 90 degrees counter-clockwise */\n rotateLeft: () => void;\n /** Rotate 90 degrees clockwise */\n rotateRight: () => void;\n\n /** Whether the sidebar panel is open */\n sidebarOpen: boolean;\n /** Which sidebar panel is active */\n sidebarMode: SidebarMode;\n /** Change the active sidebar panel */\n setSidebarMode: (mode: SidebarMode) => void;\n /** Toggle sidebar open/closed */\n toggleSidebar: () => void;\n\n /** Search state and actions */\n search: UsePdfViewerSearchResult;\n\n /** Document outline items (from bookmarks or text extraction) */\n outlineItems: ReturnType<typeof usePdfOutline>;\n\n /** Download the PDF as a file */\n download: (filename?: string) => void;\n}\n\nexport function usePdfViewerState({\n src,\n initialPage,\n initialScale,\n initialSidebarOpen = false,\n sidebarMode: sidebarModeProp = \"thumbnails\",\n onDownload,\n}: UsePdfViewerStateOptions): UsePdfViewerStateResult {\n const core = usePdfViewerCore({ src, initialPage, initialScale });\n\n const [rotation, setRotation] = useState(0);\n const [sidebarOpen, setSidebarOpen] = useState(initialSidebarOpen);\n const [sidebarMode, setSidebarMode] = useState<SidebarMode>(sidebarModeProp);\n\n const search = usePdfViewerSearch(\n core.eventBusRef,\n core.findControllerRef,\n core.document,\n );\n\n const outlineItems = usePdfOutline(core.document);\n\n // Sync sidebarMode prop changes to state\n useEffect(function syncSidebarMode() {\n setSidebarMode(sidebarModeProp);\n }, [sidebarModeProp]);\n\n // Sync rotation → PDFViewer\n useEffect(function syncRotationToViewer() {\n const pdfViewer = core.pdfViewerRef.current;\n if (pdfViewer != null) {\n pdfViewer.pagesRotation = rotation;\n }\n }, [core.pdfViewerRef, rotation]);\n\n // Ctrl+F keyboard shortcut\n useEffect(function registerSearchShortcut() {\n const handleKeyDown = (e: KeyboardEvent) => {\n if ((e.ctrlKey || e.metaKey) && e.key === \"f\") {\n e.preventDefault();\n search.openSearch();\n }\n };\n window.addEventListener(\"keydown\", handleKeyDown);\n return () => {\n window.removeEventListener(\"keydown\", handleKeyDown);\n };\n }, [search.openSearch]);\n\n const zoomIn = useCallback(() => {\n core.setScale(Math.min(core.scale + SCALE_STEP, MAX_SCALE));\n }, [core.scale, core.setScale]);\n\n const zoomOut = useCallback(() => {\n core.setScale(Math.max(core.scale - SCALE_STEP, MIN_SCALE));\n }, [core.scale, core.setScale]);\n\n const rotateLeft = useCallback(() => {\n setRotation((prev) => (prev - 90 + 360) % 360);\n }, []);\n\n const rotateRight = useCallback(() => {\n setRotation((prev) => (prev + 90) % 360);\n }, []);\n\n const toggleSidebar = useCallback(() => {\n setSidebarOpen((prev) => !prev);\n }, []);\n\n const download = useCallback((filename?: string) => {\n if (core.document == null) {\n return;\n }\n void core.document.getData().then((data) => {\n const blob = new Blob([data.buffer as ArrayBuffer], {\n type: \"application/pdf\",\n });\n const url = URL.createObjectURL(blob);\n const resolvedFilename = resolveDownloadFilename(src, filename);\n const a = globalThis.document.createElement(\"a\");\n a.href = url;\n a.download = resolvedFilename;\n a.click();\n URL.revokeObjectURL(url);\n onDownload?.({ success: true, filename: resolvedFilename });\n }).catch((err: unknown) => {\n onDownload?.({\n success: false,\n error: err instanceof Error\n ? err\n : new Error(\"Failed to download PDF\"),\n });\n });\n }, [core.document, src, onDownload]);\n\n return {\n ...core,\n zoomIn,\n zoomOut,\n rotation,\n rotateLeft,\n rotateRight,\n sidebarOpen,\n sidebarMode,\n setSidebarMode,\n toggleSidebar,\n search,\n outlineItems,\n download,\n };\n}\n\n/** Derive a download filename from an explicit name, the src URL, or a fallback. */\nfunction resolveDownloadFilename(\n src: string | ArrayBuffer,\n filename: string | undefined,\n): string {\n if (filename != null) {\n return filename;\n }\n if (typeof src === \"string\") {\n return src.split(\"/\").pop()?.split(\"?\")[0] || \"document.pdf\";\n }\n return \"document.pdf\";\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AACxD,SAASC,SAAS,EAAEC,SAAS,EAAEC,UAAU,QAAQ,iBAAiB;AAElE,SAASC,aAAa,QAAQ,oBAAoB;AAKlD,SAASC,gBAAgB,QAAQ,uBAAuB;AAExD,SAASC,kBAAkB,QAAQ,yBAAyB;AA2C5D,OAAO,SAASC,iBAAiBA,CAAC;EAChCC,GAAG;EACHC,WAAW;EACXC,YAAY;EACZC,kBAAkB,GAAG,KAAK;EAC1BC,WAAW,EAAEC,eAAe,GAAG,YAAY;EAC3CC;AACwB,CAAC,EAA2B;EACpD,MAAMC,IAAI,GAAGV,gBAAgB,CAAC;IAAEG,GAAG;IAAEC,WAAW;IAAEC;EAAa,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AOA,GAAG,CAACoE,KAAK,CAAC,GAAG,CAAC,CAACC,GAAG,CAAC,CAAC,EAAED,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,cAAc;EAC9D;EACA,OAAO,cAAc;AACvB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["types.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** The visual style of an annotation rendered on the PDF. */\nexport type AnnotationType = \"highlight\" | \"underline\" | \"comment\" | \"pin\";\n\n/** A single annotation positioned on a specific page of the PDF. */\nexport interface PdfAnnotation {\n /** Unique identifier for this annotation */\n id: string;\n /** The type of annotation to render */\n type: AnnotationType;\n /** Page number (1-indexed) */\n page: number;\n /** Coordinates in PDF points (origin: bottom-left of page) */\n rect: { x: number; y: number; width: number; height: number };\n /** Optional label or tooltip text */\n label?: string;\n /** Optional color override (CSS color string) */\n color?: string;\n}\n\n/** Props for the {@link PdfViewer} component. */\nexport interface PdfViewerProps {\n /** PDF source — URL string or ArrayBuffer */\n src: string | ArrayBuffer;\n /** Annotations to overlay on the PDF, keyed by page number (1-indexed) */\n annotations?: Record<number, PdfAnnotation[]>;\n /**\n * Callback fired when an annotation is clicked.\n *\n * @param annotation - The annotation that was clicked\n * @returns void\n */\n onAnnotationClick?: (annotation: PdfAnnotation) => void;\n /** Initial page number (1-indexed, default 1) */\n initialPage?: number;\n /** Initial zoom scale (default 1.0) */\n initialScale?: number;\n /** Whether the sidebar is initially open (default false) */\n initialSidebarOpen?: boolean;\n /** Additional CSS class name for the root element */\n className?: string;\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["types.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type React from \"react\";\n\n/** Which sidebar panel to display when the sidebar is open. */\nexport type SidebarMode = \"thumbnails\" | \"outline\";\n\n/** A single item in the PDF document outline (table of contents). */\nexport interface OutlineItem {\n title: string;\n depth: number;\n pageNumber: number;\n bold: boolean;\n italic: boolean;\n}\n\n/** The visual style of an annotation rendered on the PDF. */\nexport type AnnotationType = \"highlight\" | \"underline\" | \"comment\" | \"pin\";\n\n/** A single annotation positioned on a specific page of the PDF. */\nexport interface PdfAnnotation {\n /** Unique identifier for this annotation */\n id: string;\n /** The type of annotation to render */\n type: AnnotationType;\n /** Page number (1-indexed) */\n page: number;\n /** Coordinates in PDF points (origin: bottom-left of page) */\n rect: { x: number; y: number; width: number; height: number };\n /** Optional label or tooltip text */\n label?: string;\n /** Optional color override (CSS color string) */\n color?: string;\n}\n\n/** Result passed to the {@link PdfViewerProps.onDownload} callback. */\nexport type PdfDownloadResult =\n | { success: true; filename: string }\n | { success: false; error: Error };\n\n/** Props for the {@link PdfViewer} component. */\nexport interface PdfViewerProps {\n /** PDF source — URL string or ArrayBuffer */\n src: string | ArrayBuffer;\n /** Annotations to overlay on the PDF, keyed by page number (1-indexed) */\n annotations?: Record<number, PdfAnnotation[]>;\n /**\n * Callback fired when an annotation is clicked.\n *\n * @param annotation - The annotation that was clicked\n * @returns void\n */\n onAnnotationClick?: (annotation: PdfAnnotation) => void;\n /**\n * Callback fired when a download completes or fails.\n *\n * @param result - The download result indicating success with the filename, or failure with an error\n * @returns void\n */\n onDownload?: (result: PdfDownloadResult) => void;\n /** Initial page number (1-indexed, default 1) */\n initialPage?: number;\n /** Initial zoom scale (default 1.0) */\n initialScale?: number;\n /** Whether the sidebar is initially open (default false) */\n initialSidebarOpen?: boolean;\n /**\n * Whether the download button is shown in the toolbar.\n * @default false\n */\n enableDownload?: boolean;\n /**\n * Which sidebar panel to show: thumbnails or document outline.\n * @default \"thumbnails\"\n */\n sidebarMode?: SidebarMode;\n /**\n * Custom icon components for each outline depth level (0-indexed).\n * Key 0 = top-level items, 1 = first nesting level, etc.\n * If omitted, no icons are rendered.\n */\n outlineIcons?: Partial<Record<number, React.ComponentType>>;\n /** Additional CSS class name for the root element */\n className?: string;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -27,8 +27,27 @@ export { BaseTable } from "../object-table/Table.js";
|
|
|
27
27
|
export { ColumnConfigDialog } from "../object-table/ColumnConfigDialog.js";
|
|
28
28
|
// PdfViewer
|
|
29
29
|
export { BasePdfViewer } from "../pdf-viewer/PdfViewer.js";
|
|
30
|
-
//
|
|
31
|
-
export {
|
|
30
|
+
// PdfViewer building blocks
|
|
31
|
+
export { PdfViewerAnnotationLayer } from "../pdf-viewer/components/PdfViewerAnnotationLayer.js";
|
|
32
|
+
export { PdfViewerContent } from "../pdf-viewer/components/PdfViewerContent.js";
|
|
33
|
+
export { PdfViewerOutlineSidebar } from "../pdf-viewer/components/PdfViewerOutlineSidebar.js";
|
|
34
|
+
export { PdfViewerSearchBar } from "../pdf-viewer/components/PdfViewerSearchBar.js";
|
|
35
|
+
export { PdfViewerSidebar } from "../pdf-viewer/components/PdfViewerSidebar.js";
|
|
36
|
+
export { PdfViewerToolbar } from "../pdf-viewer/components/PdfViewerToolbar.js";
|
|
37
|
+
|
|
38
|
+
// PdfViewer hooks — primitive
|
|
39
|
+
export { usePdfAnnotationPortals } from "../pdf-viewer/hooks/usePdfAnnotationPortals.js";
|
|
40
|
+
export { usePdfDocument } from "../pdf-viewer/hooks/usePdfDocument.js";
|
|
41
|
+
export { usePdfOutline } from "../pdf-viewer/hooks/usePdfOutline.js";
|
|
42
|
+
export { usePdfViewer } from "../pdf-viewer/hooks/usePdfViewer.js";
|
|
43
|
+
export { usePdfViewerSearch } from "../pdf-viewer/hooks/usePdfViewerSearch.js";
|
|
44
|
+
export { usePdfViewerSync } from "../pdf-viewer/hooks/usePdfViewerSync.js";
|
|
45
|
+
// PdfViewer hooks — composition
|
|
46
|
+
export { usePdfViewerCore } from "../pdf-viewer/hooks/usePdfViewerCore.js";
|
|
47
|
+
export { usePdfViewerState } from "../pdf-viewer/hooks/usePdfViewerState.js";
|
|
48
|
+
|
|
49
|
+
// PdfViewer (Media wrapper)
|
|
50
|
+
export { PdfViewer } from "../pdf-viewer/PdfRenderer.js";
|
|
32
51
|
export { ActionForm } from "../action-form/ActionForm.js";
|
|
33
52
|
export { BaseForm } from "../action-form/BaseForm.js";
|
|
34
53
|
//# sourceMappingURL=experimental.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"experimental.js","names":["BaseFilterList","FilterList","deserializeFilterStates","serializeFilterStates","ObjectTable","BaseTable","ColumnConfigDialog","BasePdfViewer","
|
|
1
|
+
{"version":3,"file":"experimental.js","names":["BaseFilterList","FilterList","deserializeFilterStates","serializeFilterStates","ObjectTable","BaseTable","ColumnConfigDialog","BasePdfViewer","PdfViewerAnnotationLayer","PdfViewerContent","PdfViewerOutlineSidebar","PdfViewerSearchBar","PdfViewerSidebar","PdfViewerToolbar","usePdfAnnotationPortals","usePdfDocument","usePdfOutline","usePdfViewer","usePdfViewerSearch","usePdfViewerSync","usePdfViewerCore","usePdfViewerState","PdfViewer","ActionForm","BaseForm"],"sources":["experimental.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { BaseFilterList } from \"../filter-list/base/BaseFilterList.js\";\nexport type {\n BaseFilterListProps,\n RenderFilterInput,\n} from \"../filter-list/base/BaseFilterListApi.js\";\nexport { FilterList } from \"../filter-list/FilterList.js\";\n\nexport type {\n FilterDefinitionUnion,\n FilterListProps,\n} from \"../filter-list/FilterListApi.js\";\nexport type {\n FilterComponentType,\n FilterListItemProps,\n FilterState,\n PropertyFilterDefinition,\n} from \"../filter-list/FilterListItemApi.js\";\nexport {\n deserializeFilterStates,\n serializeFilterStates,\n} from \"../filter-list/utils/filterStateSerialization.js\";\n\n// ObjectTable that loads and displays data for a given objectSet\nexport { ObjectTable } from \"../object-table/ObjectTable.js\";\nexport type {\n ColumnDefinition,\n ColumnDefinitionLocator,\n CustomColumnLocator,\n FunctionColumnLocator,\n ObjectTableProps,\n PropertyColumnLocator,\n RdpColumnLocator,\n} from \"../object-table/ObjectTableApi.js\";\nexport type { CellEditInfo } from \"../object-table/utils/types.js\";\n\n// BaseTable that does not handle data fetching\nexport type { BaseTableProps } from \"../object-table/Table.js\";\nexport { BaseTable } from \"../object-table/Table.js\";\n\nexport { ColumnConfigDialog } from \"../object-table/ColumnConfigDialog.js\";\nexport type {\n ColumnConfigDialogProps,\n ColumnConfigOptions,\n} from \"../object-table/ColumnConfigDialog.js\";\n\n// PdfViewer\nexport { BasePdfViewer } from \"../pdf-viewer/PdfViewer.js\";\nexport type {\n AnnotationType,\n PdfAnnotation,\n PdfDownloadResult,\n PdfViewerProps,\n SidebarMode,\n} from \"../pdf-viewer/types.js\";\n\n// PdfViewer building blocks\nexport {\n PdfViewerAnnotationLayer,\n type PdfViewerAnnotationLayerProps,\n} from \"../pdf-viewer/components/PdfViewerAnnotationLayer.js\";\nexport {\n PdfViewerContent,\n type PdfViewerContentProps,\n} from \"../pdf-viewer/components/PdfViewerContent.js\";\nexport {\n PdfViewerOutlineSidebar,\n type PdfViewerOutlineSidebarProps,\n} from \"../pdf-viewer/components/PdfViewerOutlineSidebar.js\";\nexport {\n PdfViewerSearchBar,\n type PdfViewerSearchBarProps,\n} from \"../pdf-viewer/components/PdfViewerSearchBar.js\";\nexport {\n PdfViewerSidebar,\n type PdfViewerSidebarProps,\n} from \"../pdf-viewer/components/PdfViewerSidebar.js\";\nexport {\n PdfViewerToolbar,\n type PdfViewerToolbarProps,\n} from \"../pdf-viewer/components/PdfViewerToolbar.js\";\n\n// PdfViewer hooks — primitive\nexport {\n type AnnotationPortalTarget,\n usePdfAnnotationPortals,\n} from \"../pdf-viewer/hooks/usePdfAnnotationPortals.js\";\nexport { usePdfDocument } from \"../pdf-viewer/hooks/usePdfDocument.js\";\nexport { usePdfOutline } from \"../pdf-viewer/hooks/usePdfOutline.js\";\nexport {\n usePdfViewer,\n type UsePdfViewerResult,\n} from \"../pdf-viewer/hooks/usePdfViewer.js\";\nexport {\n usePdfViewerSearch,\n type UsePdfViewerSearchResult,\n} from \"../pdf-viewer/hooks/usePdfViewerSearch.js\";\nexport { usePdfViewerSync } from \"../pdf-viewer/hooks/usePdfViewerSync.js\";\nexport { type OutlineItem } from \"../pdf-viewer/types.js\";\n\n// PdfViewer hooks — composition\nexport {\n usePdfViewerCore,\n type UsePdfViewerCoreOptions,\n type UsePdfViewerCoreResult,\n} from \"../pdf-viewer/hooks/usePdfViewerCore.js\";\nexport {\n usePdfViewerState,\n type UsePdfViewerStateOptions,\n type UsePdfViewerStateResult,\n} from \"../pdf-viewer/hooks/usePdfViewerState.js\";\n\n// PdfViewer (Media wrapper)\nexport {\n PdfViewer,\n type PdfViewerMediaProps,\n} from \"../pdf-viewer/PdfRenderer.js\";\n\nexport { ActionForm } from \"../action-form/ActionForm.js\";\nexport type {\n ActionFormProps,\n BaseFormProps,\n FormError,\n FormState,\n} from \"../action-form/ActionFormApi.js\";\nexport { BaseForm } from \"../action-form/BaseForm.js\";\nexport type {\n ActionParameters,\n BaseFormFieldProps,\n CustomFieldProps,\n DatetimePickerFieldProps,\n DropdownFieldProps,\n FieldComponent,\n FieldValueType,\n FilePickerProps,\n FormFieldDefinition,\n FormFieldPropsByType,\n NumberInputFieldProps,\n ObjectSetFieldProps,\n Option,\n RadioButtonsFieldProps,\n RendererFieldDefinition,\n TextAreaFieldProps,\n TextInputFieldProps,\n} from \"../action-form/FormFieldApi.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,cAAc,QAAQ,uCAAuC;AAKtE,SAASC,UAAU,QAAQ,8BAA8B;AAYzD,SACEC,uBAAuB,EACvBC,qBAAqB,QAChB,kDAAkD;;AAEzD;AACA,SAASC,WAAW,QAAQ,gCAAgC;;AAY5D;;AAEA,SAASC,SAAS,QAAQ,0BAA0B;AAEpD,SAASC,kBAAkB,QAAQ,uCAAuC;AAM1E;AACA,SAASC,aAAa,QAAQ,4BAA4B;AAS1D;AACA,SACEC,wBAAwB,QAEnB,sDAAsD;AAC7D,SACEC,gBAAgB,QAEX,8CAA8C;AACrD,SACEC,uBAAuB,QAElB,qDAAqD;AAC5D,SACEC,kBAAkB,QAEb,gDAAgD;AACvD,SACEC,gBAAgB,QAEX,8CAA8C;AACrD,SACEC,gBAAgB,QAEX,8CAA8C;;AAErD;AACA,SAEEC,uBAAuB,QAClB,gDAAgD;AACvD,SAASC,cAAc,QAAQ,uCAAuC;AACtE,SAASC,aAAa,QAAQ,sCAAsC;AACpE,SACEC,YAAY,QAEP,qCAAqC;AAC5C,SACEC,kBAAkB,QAEb,2CAA2C;AAClD,SAASC,gBAAgB,QAAQ,yCAAyC;AAG1E;AACA,SACEC,gBAAgB,QAGX,yCAAyC;AAChD,SACEC,iBAAiB,QAGZ,0CAA0C;;AAEjD;AACA,SACEC,SAAS,QAEJ,8BAA8B;AAErC,SAASC,UAAU,QAAQ,8BAA8B;AAOzD,SAASC,QAAQ,QAAQ,4BAA4B","ignoreList":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
export { ActionButton } from "../base-components/action-button/ActionButton.js";
|
|
18
|
+
export { Dialog } from "../base-components/dialog/Dialog.js";
|
|
19
|
+
export { Tooltip, TooltipArrow } from "../base-components/tooltip/index.js";
|
|
20
|
+
//# sourceMappingURL=primitives.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primitives.js","names":["ActionButton","Dialog","Tooltip","TooltipArrow"],"sources":["primitives.ts"],"sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport {\n ActionButton,\n type ButtonProps,\n} from \"../base-components/action-button/ActionButton.js\";\nexport { Dialog, type DialogProps } from \"../base-components/dialog/Dialog.js\";\nexport {\n Tooltip,\n TooltipArrow,\n type TooltipProps,\n} from \"../base-components/tooltip/index.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,YAAY,QAEP,kDAAkD;AACzD,SAASC,MAAM,QAA0B,qCAAqC;AAC9E,SACEC,OAAO,EACPC,YAAY,QAEP,qCAAqC","ignoreList":[]}
|
|
@@ -29,25 +29,61 @@
|
|
|
29
29
|
*/
|
|
30
30
|
|
|
31
31
|
export function formatDateForInput(date) {
|
|
32
|
-
if (
|
|
32
|
+
if (date == null) return "";
|
|
33
33
|
const year = date.getFullYear();
|
|
34
34
|
const month = String(date.getMonth() + 1).padStart(2, "0");
|
|
35
35
|
const day = String(date.getDate()).padStart(2, "0");
|
|
36
36
|
return `${year}-${month}-${day}`;
|
|
37
37
|
}
|
|
38
|
+
|
|
39
|
+
/** Formats the time portion of a Date as "HH:mm". */
|
|
40
|
+
export function formatTime(date) {
|
|
41
|
+
const hours = String(date.getHours()).padStart(2, "0");
|
|
42
|
+
const minutes = String(date.getMinutes()).padStart(2, "0");
|
|
43
|
+
return `${hours}:${minutes}`;
|
|
44
|
+
}
|
|
38
45
|
export function parseDateFromInput(value) {
|
|
39
46
|
if (!value) return undefined;
|
|
40
47
|
const date = new Date(value + "T00:00:00");
|
|
41
48
|
return isNaN(date.getTime()) ? undefined : date;
|
|
42
49
|
}
|
|
50
|
+
export function formatDatetimeForInput(date) {
|
|
51
|
+
if (date == null) return "";
|
|
52
|
+
return `${formatDateForInput(date)}T${formatTime(date)}`;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Parses a datetime-local input string (e.g. "2024-01-15T14:30") into a Date.
|
|
57
|
+
* Delegates to `parseDateFromISO` since the parsing logic is identical for
|
|
58
|
+
* string inputs — datetime-local strings already include the time component
|
|
59
|
+
* and have no "Z" suffix, so `new Date()` parses them as local time.
|
|
60
|
+
*/
|
|
61
|
+
export function parseDatetimeFromInput(value) {
|
|
62
|
+
if (!value) return undefined;
|
|
63
|
+
return parseDateFromISO(value);
|
|
64
|
+
}
|
|
43
65
|
export function formatDateForDisplay(date, fallback = "") {
|
|
44
|
-
if (
|
|
66
|
+
if (date == null) return fallback;
|
|
45
67
|
return date.toLocaleDateString(undefined, {
|
|
46
68
|
year: "numeric",
|
|
47
69
|
month: "short",
|
|
48
70
|
day: "numeric"
|
|
49
71
|
});
|
|
50
72
|
}
|
|
73
|
+
|
|
74
|
+
/** Formats a Date as "2024-06-15 14:30" — space-separated, more readable than T. */
|
|
75
|
+
export function formatDatetimeForDisplay(date) {
|
|
76
|
+
if (date == null) return "";
|
|
77
|
+
return `${formatDateForInput(date)} ${formatTime(date)}`;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** Parses space-separated ("2024-06-15 14:30") or T-separated datetime strings. */
|
|
81
|
+
export function parseDatetimeFromDisplay(value) {
|
|
82
|
+
if (!value) return undefined;
|
|
83
|
+
const normalized = value.includes("T") ? value : value.replace(" ", "T");
|
|
84
|
+
const date = new Date(normalized);
|
|
85
|
+
return isNaN(date.getTime()) ? undefined : date;
|
|
86
|
+
}
|
|
51
87
|
export function parseDateFromISO(value) {
|
|
52
88
|
if (value == null) return undefined;
|
|
53
89
|
if (value instanceof Date) return value;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dateUtils.js","names":["formatDateForInput","date","year","getFullYear","month","String","getMonth","padStart","day","getDate","formatTime","hours","getHours","minutes","getMinutes","parseDateFromInput","value","undefined","Date","isNaN","getTime","formatDatetimeForInput","parseDatetimeFromInput","parseDateFromISO","formatDateForDisplay","fallback","toLocaleDateString","formatDatetimeForDisplay","parseDatetimeFromDisplay","normalized","includes","replace"],"sources":["dateUtils.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Date utilities for HTML date inputs.\n *\n * These functions operate on local time by design. HTML <input type=\"date\">\n * returns and expects values in \"YYYY-MM-DD\" format without timezone info.\n *\n * `parseDateFromInput` appends \"T00:00:00\" (no \"Z\") so the date is parsed as\n * local midnight rather than UTC midnight. Without this, negative-offset\n * timezones (e.g. US timezones) would shift \"2024-01-15\" to Jan 14 locally.\n *\n * Consumers providing dates from an API (typically UTC) should handle\n * UTC-to-local conversion before passing values to these functions.\n */\n\nexport function formatDateForInput(date: Date | undefined | null): string {\n if (date == null) return \"\";\n const year = date.getFullYear();\n const month = String(date.getMonth() + 1).padStart(2, \"0\");\n const day = String(date.getDate()).padStart(2, \"0\");\n return `${year}-${month}-${day}`;\n}\n\n/** Formats the time portion of a Date as \"HH:mm\". */\nexport function formatTime(date: Date): string {\n const hours = String(date.getHours()).padStart(2, \"0\");\n const minutes = String(date.getMinutes()).padStart(2, \"0\");\n return `${hours}:${minutes}`;\n}\n\nexport function parseDateFromInput(\n value: string | undefined | null,\n): Date | undefined {\n if (!value) return undefined;\n const date = new Date(value + \"T00:00:00\");\n return isNaN(date.getTime()) ? undefined : date;\n}\n\nexport function formatDatetimeForInput(\n date: Date | undefined | null,\n): string {\n if (date == null) return \"\";\n return `${formatDateForInput(date)}T${formatTime(date)}`;\n}\n\n/**\n * Parses a datetime-local input string (e.g. \"2024-01-15T14:30\") into a Date.\n * Delegates to `parseDateFromISO` since the parsing logic is identical for\n * string inputs — datetime-local strings already include the time component\n * and have no \"Z\" suffix, so `new Date()` parses them as local time.\n */\nexport function parseDatetimeFromInput(\n value: string | undefined | null,\n): Date | undefined {\n if (!value) return undefined;\n return parseDateFromISO(value);\n}\n\nexport function formatDateForDisplay(\n date: Date | undefined | null,\n fallback: string = \"\",\n): string {\n if (date == null) return fallback;\n return date.toLocaleDateString(undefined, {\n year: \"numeric\",\n month: \"short\",\n day: \"numeric\",\n });\n}\n\n/** Formats a Date as \"2024-06-15 14:30\" — space-separated, more readable than T. */\nexport function formatDatetimeForDisplay(\n date: Date | undefined | null,\n): string {\n if (date == null) return \"\";\n return `${formatDateForInput(date)} ${formatTime(date)}`;\n}\n\n/** Parses space-separated (\"2024-06-15 14:30\") or T-separated datetime strings. */\nexport function parseDatetimeFromDisplay(\n value: string | undefined | null,\n): Date | undefined {\n if (!value) return undefined;\n const normalized = value.includes(\"T\") ? value : value.replace(\" \", \"T\");\n const date = new Date(normalized);\n return isNaN(date.getTime()) ? undefined : date;\n}\n\nexport function parseDateFromISO(\n value: string | Date | undefined | null,\n): Date | undefined {\n if (value == null) return undefined;\n if (value instanceof Date) return value;\n const date = new Date(value);\n return isNaN(date.getTime()) ? undefined : date;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,SAASA,kBAAkBA,CAACC,IAA6B,EAAU;EACxE,IAAIA,IAAI,IAAI,IAAI,EAAE,OAAO,EAAE;EAC3B,MAAMC,IAAI,GAAGD,IAAI,CAACE,WAAW,CAAC,CAAC;EAC/B,MAAMC,KAAK,GAAGC,MAAM,CAACJ,IAAI,CAACK,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;EAC1D,MAAM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IAAI,IAAI,EAAE,OAAOwB,QAAQ;EACjC,OAAOxB,IAAI,CAACyB,kBAAkB,CAACT,SAAS,EAAE;IACxCf,IAAI,EAAE,SAAS;IACfE,KAAK,EAAE,OAAO;IACdI,GAAG,EAAE;EACP,CAAC,CAAC;AACJ;;AAEA;AACA,OAAO,SAASmB,wBAAwBA,CACtC1B,IAA6B,EACrB;EACR,IAAIA,IAAI,IAAI,IAAI,EAAE,OAAO,EAAE;EAC3B,OAAO,GAAGD,kBAAkB,CAACC,IAAI,CAAC,IAAIS,UAAU,CAACT,IAAI,CAAC,EAAE;AAC1D;;AAEA;AACA,OAAO,SAAS2B,wBAAwBA,CACtCZ,KAAgC,EACd;EAClB,IAAI,CAACA,KAAK,EAAE,OAAOC,SAAS;EAC5B,MAAMY,UAAU,GAAGb,KAAK,CAACc,QAAQ,CAAC,GAAG,CAAC,GAAGd,KAAK,GAAGA,KAAK,CAACe,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC;EACxE,MAAM9B,IAAI,GAAG,IAAIiB,IAAI,CAACW,UAAU,CAAC;EACjC,OAAOV,KAAK,CAAClB,IAAI,CAACmB,OAAO,CAAC,CAAC,CAAC,GAAGH,SAAS,GAAGhB,IAAI;AACjD;AAEA,OAAO,SAASsB,gBAAgBA,CAC9BP,KAAuC,EACrB;EAClB,IAAIA,KAAK,IAAI,IAAI,EAAE,OAAOC,SAAS;EACnC,IAAID,KAAK,YAAYE,IAAI,EAAE,OAAOF,KAAK;EACvC,MAAMf,IAAI,GAAG,IAAIiB,IAAI,CAACF,KAAK,CAAC;EAC5B,OAAOG,KAAK,CAAClB,IAAI,CAACmB,OAAO,CAAC,CAAC,CAAC,GAAGH,SAAS,GAAGhB,IAAI;AACjD","ignoreList":[]}
|
|
@@ -87,26 +87,35 @@ export interface FormFieldPropsByType {
|
|
|
87
87
|
CUSTOM: CustomFieldProps<unknown>;
|
|
88
88
|
}
|
|
89
89
|
/**
|
|
90
|
-
* Datetime picker field props
|
|
90
|
+
* Datetime picker field props.
|
|
91
|
+
*
|
|
92
|
+
* When `formatDate` is omitted, ISO-like format is used (YYYY-MM-DD / YYYY-MM-DD HH:mm).
|
|
91
93
|
*/
|
|
92
94
|
export interface DatetimePickerFieldProps extends BaseFormFieldProps<Date> {
|
|
93
95
|
/**
|
|
94
|
-
* The earliest date the user can select
|
|
95
|
-
* If provided, this will be added to the field validation
|
|
96
|
+
* The earliest date the user can select.
|
|
97
|
+
* If provided, this will be added to the field validation.
|
|
96
98
|
*/
|
|
97
99
|
min?: Date;
|
|
98
100
|
/**
|
|
99
|
-
* The latest date the user can select
|
|
100
|
-
* If provided, this will be added to the field validation
|
|
101
|
+
* The latest date the user can select.
|
|
102
|
+
* If provided, this will be added to the field validation.
|
|
101
103
|
*/
|
|
102
104
|
max?: Date;
|
|
103
105
|
/**
|
|
104
|
-
* Whether to show time picker
|
|
106
|
+
* Whether to show time picker.
|
|
105
107
|
*/
|
|
106
108
|
showTime?: boolean;
|
|
107
109
|
/**
|
|
108
|
-
*
|
|
110
|
+
* Whether to close the popover after selecting a date.
|
|
111
|
+
* @default true when `showTime` is false, false when `showTime` is true
|
|
112
|
+
*/
|
|
113
|
+
closeOnSelection?: boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Placeholder text shown when no value is selected.
|
|
109
116
|
*/
|
|
117
|
+
placeholder?: string;
|
|
118
|
+
/** Formats a Date for display in the trigger button. */
|
|
110
119
|
formatDate?: (date: Date) => string;
|
|
111
120
|
}
|
|
112
121
|
/**
|
|
@@ -204,6 +213,11 @@ export interface CustomFieldProps<V> extends BaseFormFieldProps<V> {
|
|
|
204
213
|
customRenderer: (props: BaseFormFieldProps<V>) => React.ReactNode;
|
|
205
214
|
}
|
|
206
215
|
export interface BaseFormFieldProps<V> {
|
|
216
|
+
/**
|
|
217
|
+
* The HTML `id` attribute for the field input element.
|
|
218
|
+
* Used for `<label htmlFor>` association.
|
|
219
|
+
*/
|
|
220
|
+
id?: string;
|
|
207
221
|
/**
|
|
208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cACpC,UAAU,aAAa,cAAc,oBACrC,UACE,WACA,YACA,SACA,UACA,UACA,SACA,YAAY","names":["error: ValidationError","value: FieldValueType<Q, K>","date: Date","item: V","a: V","b: V","props: BaseFormFieldProps<V>","value: V | null"],"sources":["../../../src/action-form/FormFieldApi.ts"],"version":3,"file":"FormFieldApi.d.ts"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface DateCalendarProps {
|
|
3
|
+
dateSelected: Date | undefined;
|
|
4
|
+
onSelect: (date: Date | undefined) => void;
|
|
5
|
+
min?: Date;
|
|
6
|
+
max?: Date;
|
|
7
|
+
footer?: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export default function DateCalendar({ dateSelected, onSelect, min, max, footer }: DateCalendarProps): React.ReactElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAgBA,OAAO,WAAwB,OAAQ;AA8BvC,iBAAiB,kBAAkB;CACjC,cAAc;CACd,WAAWA,MAAM;CACjB,MAAM;CACN,MAAM;CACN,SAAS,MAAM;AAChB;eAEc,SAAS,aAAa,EACnC,cACA,UACA,KACA,KACA,QACkB,EAAjB,oBAAoB,MAAM","names":["date: Date | undefined"],"sources":["../../../../src/action-form/fields/DateCalendar.tsx"],"version":3,"file":"DateCalendar.d.ts"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { DatetimePickerFieldProps } from "../FormFieldApi.js";
|
|
3
|
+
export declare function DatetimePickerField({ id, value, onChange, min, max, placeholder, formatDate, showTime, closeOnSelection }: DatetimePickerFieldProps): React.ReactElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAmBA,OAAO,WAA+C,OAAQ;AAM9D,cAAc,gCAAgC,oBAAqB;AAWnE,OAAO,iBAAS,oBAAoB,EAClC,IACA,OACA,UACA,KACA,KACA,aACA,YACA,UACA,kBACyB,EAAxB,2BAA2B,MAAM","names":[],"sources":["../../../../src/action-form/fields/DatetimePickerField.tsx"],"version":3,"file":"DatetimePickerField.d.ts"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAgBA,OAAO,WAAqB,OAAQ;AAEpC,cAAc,+BAA+B,oBAAqB;
|
|
1
|
+
{"mappings":"AAgBA,OAAO,WAAqB,OAAQ;AAEpC,cAAc,+BAA+B,oBAAqB;AAOlE,iBAAiB,uBAAuB;CACtC,iBAAiB;CACjB;CACA,qBAAqBA;AACtB;AAED,OAAO,cAAMC,mBAAmB,MAAM,GAAG","names":["value: unknown","FormFieldRenderer: React.FC<FormFieldRendererProps>"],"sources":["../../../../src/action-form/fields/FormFieldRenderer.tsx"],"version":3,"file":"FormFieldRenderer.d.ts"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AAgBA,OAAO,WAAyB,OAAQ;AACxC,cAAc,yBAAyB,mBAAoB;AAK3D,OAAO,iBAAS,iBAAiBA,OAAO,oBAAoB,MAAM","names":["props: DateCalendarProps"],"sources":["../../../../src/action-form/fields/LazyDateCalendar.tsx"],"version":3,"file":"LazyDateCalendar.d.ts"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { LinkNames, ObjectSet, ObjectTypeDefinition, WhereClause } from "@osdk/api";
|
|
2
2
|
import type React from "react";
|
|
3
|
+
import type { ReactNode } from "react";
|
|
3
4
|
import type { FilterState as FilterStateType, PropertyFilterDefinition } from "./FilterListItemApi.js";
|
|
4
5
|
import type { CustomFilterDefinition } from "./types/CustomRendererTypes.js";
|
|
5
6
|
import type { KeywordSearchFilterDefinition } from "./types/KeywordSearchTypes.js";
|
|
@@ -35,7 +36,7 @@ export interface FilterListProps<Q extends ObjectTypeDefinition> {
|
|
|
35
36
|
/**
|
|
36
37
|
* Optional title to display in the filter list header
|
|
37
38
|
*/
|
|
38
|
-
title?:
|
|
39
|
+
title?: ReactNode;
|
|
39
40
|
/**
|
|
40
41
|
* Optional icon to display next to the title
|
|
41
42
|
*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AU,wBAChC,sBAAsB,iBAAiB,IACnC,UAAU;CAAE,mBAAmB;AAAG,IAAG;;;;;AAQ3C,YAAY,gBAAgB,UAAU,wBAAwB,IAC5D,sBAAsB,IACtB;AAGF,iBAAiB,gBAAgB,UAAU,sBAAsB;;;;CAI/D,WAAW,UAAU;;;;CAKrB,QAAQ;;;;CAKR,YAAY,MAAM;;;;;CAMlB,oBAAoB,MAAM,sBAAsB;;;;;CAMhD,eAAe,YAAY;;;;;;;;CAS3B,yBAAyBA,WAAW,YAAY;;;;;;CAOhD,iBAAiB,QAAQ;;;;;;;CAQzB,wBACEC,YAAY,sBAAsB,IAClCC,UAAU;;;;;;;;;;;;;CAeZ,gBAAgB,eAAe;;;;;;;;;;CAW/B,iBACEC,WAAW,UAAU,IACrBC,gBAAgB,MAAM,sBAAsB;;;;;;;;;CAW9C,mBAAmBD,WAAW,UAAU;;;;;;;CAQxC;;;;CAKA;;;;CAKA,qBAAqBE;;;;;;CAOrB,sBAAsB,YAAY;;;;CAKlC;;;;CAKA;;;;CAKA;;;;CAKA;;;;;;;;;CAUA,8BAA8B,MAAM;AACrC","names":["newClause: WhereClause<Q>","definition: FilterDefinitionUnion<Q>","newState: FilterStateType","filterKey: FilterKey<Q>","newDefinitions: Array<FilterDefinitionUnion<Q>>","collapsed: boolean"],"sources":["../../../src/filter-list/FilterListApi.ts"],"version":3,"file":"FilterListApi.d.ts"}
|
|
@@ -21,10 +21,11 @@ export interface BaseFilterListProps<D> {
|
|
|
21
21
|
onFilterRemoved?: (filterKey: string) => void;
|
|
22
22
|
collapsed?: boolean;
|
|
23
23
|
onCollapsedChange?: (collapsed: boolean) => void;
|
|
24
|
-
title?:
|
|
24
|
+
title?: React.ReactNode;
|
|
25
25
|
titleIcon?: React.ReactNode;
|
|
26
26
|
showResetButton?: boolean;
|
|
27
27
|
showActiveFilterCount?: boolean;
|
|
28
|
+
hasVisibilityChanges?: boolean;
|
|
28
29
|
enableSorting?: boolean;
|
|
29
30
|
className?: string;
|
|
30
31
|
renderAddFilterButton?: () => React.ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAgBA,YAAY,WAAW,OAAQ;AAC/B,cAAc,mBAAmB,yBAA0B;AAE3D,YAAY,kBAAkB,MAAMA,OAAO;CACzC,YAAY;CACZ;CACA,aAAa;CACb,uBAAuBC,OAAO;CAC9B;CACA;AACD,MAAK,MAAM;AAEZ,iBAAiB,oBAAoB,GAAG;CACtC,oBAAoB,MAAM;CAC1B,cAAc,YAAY;CAC1B,uBAAuBC,mBAAmBD,OAAO;CACjD,aAAa,kBAAkB;CAC/B,eAAeE,YAAY;CAC3B,iBAAiBA,YAAY;CAC7B;CACA;CACA;CACA,mBAAmBD;CAEnB;CACA,qBAAqBE;CACrB;
|
|
1
|
+
{"mappings":"AAgBA,YAAY,WAAW,OAAQ;AAC/B,cAAc,mBAAmB,yBAA0B;AAE3D,YAAY,kBAAkB,MAAMA,OAAO;CACzC,YAAY;CACZ;CACA,aAAa;CACb,uBAAuBC,OAAO;CAC9B;CACA;AACD,MAAK,MAAM;AAEZ,iBAAiB,oBAAoB,GAAG;CACtC,oBAAoB,MAAM;CAC1B,cAAc,YAAY;CAC1B,uBAAuBC,mBAAmBD,OAAO;CACjD,aAAa,kBAAkB;CAC/B,eAAeE,YAAY;CAC3B,iBAAiBA,YAAY;CAC7B;CACA;CACA;CACA,mBAAmBD;CAEnB;CACA,qBAAqBE;CACrB,QAAQ,MAAM;CACd,YAAY,MAAM;CAClB;CACA;CACA;CACA;CACA;CACA,8BAA8B,MAAM;AACrC","names":["props: {\n definition: D;\n filterKey: string;\n filterState: FilterState | undefined;\n onFilterStateChanged: (state: FilterState) => void;\n searchQuery?: string;\n excludeRowOpen?: boolean;\n}","state: FilterState","filterKey: string","definition: D","collapsed: boolean"],"sources":["../../../../src/filter-list/base/BaseFilterListApi.ts"],"version":3,"file":"BaseFilterListApi.d.ts"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { type ReactNode } from "react";
|
|
2
2
|
interface FilterListHeaderProps {
|
|
3
|
-
title?:
|
|
3
|
+
title?: ReactNode;
|
|
4
4
|
titleIcon?: ReactNode;
|
|
5
5
|
collapsed?: boolean;
|
|
6
6
|
onCollapsedChange?: (collapsed: boolean) => void;
|
|
@@ -8,7 +8,8 @@ interface FilterListHeaderProps {
|
|
|
8
8
|
onReset?: () => void;
|
|
9
9
|
showActiveFilterCount?: boolean;
|
|
10
10
|
activeFilterCount?: number;
|
|
11
|
+
hasVisibilityChanges?: boolean;
|
|
11
12
|
}
|
|
12
|
-
declare function FilterListHeaderInner({ title, titleIcon, collapsed, onCollapsedChange, showResetButton, onReset, showActiveFilterCount, activeFilterCount }: FilterListHeaderProps): React.ReactElement;
|
|
13
|
+
declare function FilterListHeaderInner({ title, titleIcon, collapsed, onCollapsedChange, showResetButton, onReset, showActiveFilterCount, activeFilterCount, hasVisibilityChanges }: FilterListHeaderProps): React.ReactElement;
|
|
13
14
|
export declare const FilterListHeader: React.MemoExoticComponent<typeof FilterListHeaderInner>;
|
|
14
15
|
export {};
|