@ryuzaki13/react-foundation-lib 2.31.1 → 2.31.3
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/README.md +17 -5
- package/dist/analytical-table/definition/analyticalDefinitionConstants.d.ts +17 -0
- package/dist/analytical-table/definition/analyticalDefinitionConstants.d.ts.map +1 -0
- package/dist/analytical-table/definition/compileAnalyticalTableDefinition.d.ts.map +1 -1
- package/dist/analytical-table/definition/types.d.ts +6 -5
- package/dist/analytical-table/definition/types.d.ts.map +1 -1
- package/dist/analytical-table/dynamic-columns/analyticalDateColumnConstants.d.ts +7 -0
- package/dist/analytical-table/dynamic-columns/analyticalDateColumnConstants.d.ts.map +1 -0
- package/dist/analytical-table/dynamic-columns/dateColumns.d.ts.map +1 -1
- package/dist/analytical-table/dynamic-columns/types.d.ts +2 -1
- package/dist/analytical-table/dynamic-columns/types.d.ts.map +1 -1
- package/dist/analytical-table/index.js +124 -114
- package/dist/analytical-table/index.js.map +1 -1
- package/dist/analytical-table/projections/analyticalExportConstants.d.ts +7 -0
- package/dist/analytical-table/projections/analyticalExportConstants.d.ts.map +1 -0
- package/dist/analytical-table/projections/expansion.d.ts +2 -1
- package/dist/analytical-table/projections/expansion.d.ts.map +1 -1
- package/dist/analytical-table/projections/exportProjection.d.ts.map +1 -1
- package/dist/analytical-table/projections/types.d.ts +3 -2
- package/dist/analytical-table/projections/types.d.ts.map +1 -1
- package/dist/analytical-table/runtime/aggregation.d.ts.map +1 -1
- package/dist/analytical-table/runtime/analyticalRowConstants.d.ts +4 -0
- package/dist/analytical-table/runtime/analyticalRowConstants.d.ts.map +1 -0
- package/dist/analytical-table/runtime/analyticalViewConstants.d.ts +16 -0
- package/dist/analytical-table/runtime/analyticalViewConstants.d.ts.map +1 -0
- package/dist/analytical-table/runtime/buildGroupedModel.d.ts.map +1 -1
- package/dist/analytical-table/runtime/filtering.d.ts.map +1 -1
- package/dist/analytical-table/runtime/grouping.d.ts.map +1 -1
- package/dist/analytical-table/runtime/hierarchy.d.ts +2 -1
- package/dist/analytical-table/runtime/hierarchy.d.ts.map +1 -1
- package/dist/analytical-table/runtime/totals.d.ts +2 -2
- package/dist/analytical-table/runtime/totals.d.ts.map +1 -1
- package/dist/analytical-table/runtime/types.d.ts +5 -3
- package/dist/analytical-table/runtime/types.d.ts.map +1 -1
- package/dist/analytical-table/runtime/valueComparison.d.ts.map +1 -1
- package/dist/array/index.js +1 -1
- package/dist/array/reorder.d.ts +6 -1
- package/dist/array/reorder.d.ts.map +1 -1
- package/dist/async-task-runner/createCoalescingTaskRunner.d.ts.map +1 -1
- package/dist/async-task-runner/createDeadlineTimer.d.ts.map +1 -1
- package/dist/async-task-runner/index.js +39 -36
- package/dist/async-task-runner/index.js.map +1 -1
- package/dist/async-task-runner/nativeTimerConstants.d.ts +3 -0
- package/dist/async-task-runner/nativeTimerConstants.d.ts.map +1 -0
- package/dist/binary/base64Constants.d.ts +6 -0
- package/dist/binary/base64Constants.d.ts.map +1 -0
- package/dist/binary/binaryToBlob.d.ts.map +1 -1
- package/dist/binary/getBase64DecodedSize.d.ts.map +1 -1
- package/dist/binary/index.js +95 -70
- package/dist/binary/index.js.map +1 -1
- package/dist/browser-notifications/browserNotificationConstants.d.ts +3 -0
- package/dist/browser-notifications/browserNotificationConstants.d.ts.map +1 -0
- package/dist/browser-notifications/browserNotificationTypes.d.ts +2 -1
- package/dist/browser-notifications/browserNotificationTypes.d.ts.map +1 -1
- package/dist/browser-notifications/createBrowserNotificationPresenter.d.ts.map +1 -1
- package/dist/browser-notifications/index.js +38 -37
- package/dist/browser-notifications/index.js.map +1 -1
- package/dist/chunks/{array-D-_yMMUK.js → array-bd7LYFto.js} +1 -3
- package/dist/chunks/{array-D-_yMMUK.js.map → array-bd7LYFto.js.map} +1 -1
- package/dist/chunks/{dom-BK22UmgF.js → dom-ZSeWZ0Gg.js} +103 -98
- package/dist/chunks/dom-ZSeWZ0Gg.js.map +1 -0
- package/dist/chunks/formatDate-CNPcfNte.js +133 -0
- package/dist/chunks/formatDate-CNPcfNte.js.map +1 -0
- package/dist/chunks/{formatters-rxriDRPk.js → formatters-CO40zvVB.js} +496 -497
- package/dist/chunks/formatters-CO40zvVB.js.map +1 -0
- package/dist/chunks/{formulas-BXT_XBWI.js → formulas-Y0HOcFhe.js} +90 -86
- package/dist/chunks/formulas-Y0HOcFhe.js.map +1 -0
- package/dist/chunks/hasSignatureBytes-D2wO_Myl.js +11 -0
- package/dist/chunks/hasSignatureBytes-D2wO_Myl.js.map +1 -0
- package/dist/chunks/keyboardConstants-BZKskWsm.js +6 -0
- package/dist/chunks/keyboardConstants-BZKskWsm.js.map +1 -0
- package/dist/chunks/media-imBOXWwa.js +192 -0
- package/dist/chunks/media-imBOXWwa.js.map +1 -0
- package/dist/chunks/mimeTypeConstants-BzONV-b1.js +6 -0
- package/dist/chunks/mimeTypeConstants-BzONV-b1.js.map +1 -0
- package/dist/chunks/{query-client-CVRfrYZM.js → query-client-D0HQZ84w.js} +142 -142
- package/dist/chunks/query-client-D0HQZ84w.js.map +1 -0
- package/dist/chunks/scalarTypeClassification-D4YcGxtQ.js +766 -0
- package/dist/chunks/scalarTypeClassification-D4YcGxtQ.js.map +1 -0
- package/dist/chunks/scalarTypeConstants-CnSsjpGO.js +6 -0
- package/dist/chunks/scalarTypeConstants-CnSsjpGO.js.map +1 -0
- package/dist/chunks/utils-DW0Yso1Q.js +210 -0
- package/dist/chunks/utils-DW0Yso1Q.js.map +1 -0
- package/dist/chunks/{uuid-CUJPAbRY.js → uuid-izDzLv18.js} +1 -2
- package/dist/chunks/uuid-izDzLv18.js.map +1 -0
- package/dist/chunks/validate-8URYKKly.js +613 -0
- package/dist/chunks/validate-8URYKKly.js.map +1 -0
- package/dist/copy/index.js +5 -5
- package/dist/copy/index.js.map +1 -1
- package/dist/copy/useCopyFeedback.d.ts.map +1 -1
- package/dist/crypto/hashString.d.ts.map +1 -1
- package/dist/crypto/hexadecimalConstants.d.ts +3 -0
- package/dist/crypto/hexadecimalConstants.d.ts.map +1 -0
- package/dist/crypto/index.js +25 -24
- package/dist/crypto/index.js.map +1 -1
- package/dist/crypto/uuid.d.ts.map +1 -1
- package/dist/date-segments/index.js +81 -81
- package/dist/date-segments/index.js.map +1 -1
- package/dist/date-segments/mask.d.ts +13 -3
- package/dist/date-segments/mask.d.ts.map +1 -1
- package/dist/decimal/decimalConstants.d.ts +3 -0
- package/dist/decimal/decimalConstants.d.ts.map +1 -0
- package/dist/decimal/index.js +0 -2
- package/dist/decimal/index.js.map +1 -1
- package/dist/decimal/normalizeDecimal.d.ts.map +1 -1
- package/dist/decimal/normalizeDecimalLiteral.d.ts.map +1 -1
- package/dist/decimal/resolveDecimalMaxLength.d.ts.map +1 -1
- package/dist/decimal/sumDecimals.d.ts.map +1 -1
- package/dist/decimal/writeDecimalParts.d.ts.map +1 -1
- package/dist/dom/document-scroll/acquireDocumentScrollLock.d.ts.map +1 -1
- package/dist/dom/document-scroll/attachDocumentTouchScrollGuard.d.ts.map +1 -1
- package/dist/dom/document-scroll/canConsumeVerticalTouchScroll.d.ts.map +1 -1
- package/dist/dom/domEventConstants.d.ts +4 -0
- package/dist/dom/domEventConstants.d.ts.map +1 -0
- package/dist/dom/domScrollConstants.d.ts +3 -0
- package/dist/dom/domScrollConstants.d.ts.map +1 -0
- package/dist/dom/index.js +1 -1
- package/dist/dom/installFaviconOverride.d.ts.map +1 -1
- package/dist/dom/overlayFocusConstants.d.ts +4 -0
- package/dist/dom/overlayFocusConstants.d.ts.map +1 -0
- package/dist/dom/scroll-anchor/captureScrollAnchor.d.ts.map +1 -1
- package/dist/dom/useClickOutside.d.ts +1 -1
- package/dist/dom/useClickOutside.d.ts.map +1 -1
- package/dist/dom/useEscapeDismiss.d.ts +1 -1
- package/dist/dom/useEscapeDismiss.d.ts.map +1 -1
- package/dist/dom/useFocusTrap.d.ts.map +1 -1
- package/dist/dom/useIsTouchDevice.d.ts.map +1 -1
- package/dist/dom/useOverlayFocus.d.ts +3 -2
- package/dist/dom/useOverlayFocus.d.ts.map +1 -1
- package/dist/dom/visual-viewport/attachVisualViewportFrame.d.ts.map +1 -1
- package/dist/error-report/breadcrumbs.d.ts.map +1 -1
- package/dist/error-report/capture.d.ts.map +1 -1
- package/dist/error-report/captureOptions.d.ts +3 -2
- package/dist/error-report/captureOptions.d.ts.map +1 -1
- package/dist/error-report/capturePolicyConstants.d.ts +4 -0
- package/dist/error-report/capturePolicyConstants.d.ts.map +1 -0
- package/dist/error-report/dataPreview.d.ts.map +1 -1
- package/dist/error-report/diagnostics.d.ts.map +1 -1
- package/dist/error-report/drafts.d.ts.map +1 -1
- package/dist/error-report/environment.d.ts.map +1 -1
- package/dist/error-report/errorInfo.d.ts.map +1 -1
- package/dist/error-report/errorReportCaptureLimits.d.ts +26 -0
- package/dist/error-report/errorReportCaptureLimits.d.ts.map +1 -0
- package/dist/error-report/errorReportContractConstants.d.ts +32 -0
- package/dist/error-report/errorReportContractConstants.d.ts.map +1 -0
- package/dist/error-report/index.js +586 -587
- package/dist/error-report/index.js.map +1 -1
- package/dist/error-report/payload.d.ts.map +1 -1
- package/dist/error-report/queue.d.ts.map +1 -1
- package/dist/error-report/queueContract.d.ts +7 -6
- package/dist/error-report/queueContract.d.ts.map +1 -1
- package/dist/error-report/queueRecord.d.ts.map +1 -1
- package/dist/error-report/queueResultConstants.d.ts +14 -0
- package/dist/error-report/queueResultConstants.d.ts.map +1 -0
- package/dist/error-report/runtimeDeduplication.d.ts +2 -1
- package/dist/error-report/runtimeDeduplication.d.ts.map +1 -1
- package/dist/error-report/safeValue.d.ts.map +1 -1
- package/dist/error-report/safeValueMarkerConstants.d.ts +16 -0
- package/dist/error-report/safeValueMarkerConstants.d.ts.map +1 -0
- package/dist/error-report/schema.d.ts.map +1 -1
- package/dist/error-report/types.d.ts +10 -8
- package/dist/error-report/types.d.ts.map +1 -1
- package/dist/error-report-source-maps/archive.d.ts.map +1 -1
- package/dist/error-report-source-maps/artifact.d.ts.map +1 -1
- package/dist/error-report-source-maps/index.js +238 -238
- package/dist/error-report-source-maps/index.js.map +1 -1
- package/dist/error-report-source-maps/manifest.d.ts.map +1 -1
- package/dist/error-report-source-maps/package.d.ts.map +1 -1
- package/dist/error-report-source-maps/sourceMapArtifactConstants.d.ts +11 -0
- package/dist/error-report-source-maps/sourceMapArtifactConstants.d.ts.map +1 -0
- package/dist/error-report-source-maps/symbolicate.d.ts.map +1 -1
- package/dist/error-report-source-maps/symbolicationResultConstants.d.ts +6 -0
- package/dist/error-report-source-maps/symbolicationResultConstants.d.ts.map +1 -0
- package/dist/error-report-source-maps/types.d.ts +4 -2
- package/dist/error-report-source-maps/types.d.ts.map +1 -1
- package/dist/excel/excel.d.ts.map +1 -1
- package/dist/excel/excelWorkbookConstants.d.ts +6 -0
- package/dist/excel/excelWorkbookConstants.d.ts.map +1 -0
- package/dist/excel/index.js +117 -116
- package/dist/excel/index.js.map +1 -1
- package/dist/excel/matrixWorkbook.d.ts +6 -1
- package/dist/excel/matrixWorkbook.d.ts.map +1 -1
- package/dist/excel/tableExport.d.ts.map +1 -1
- package/dist/file/checkFileSignature.d.ts.map +1 -1
- package/dist/file/contentDisposition.d.ts.map +1 -1
- package/dist/file/fileSignatureConstants.d.ts +14 -18
- package/dist/file/fileSignatureConstants.d.ts.map +1 -1
- package/dist/file/fileSignatureTypes.d.ts +3 -3
- package/dist/file/fileSignatureTypes.d.ts.map +1 -1
- package/dist/file/image/imageReadConstants.d.ts +3 -0
- package/dist/file/image/imageReadConstants.d.ts.map +1 -0
- package/dist/file/image/readImageFile.d.ts +3 -2
- package/dist/file/image/readImageFile.d.ts.map +1 -1
- package/dist/file/image/types.d.ts +5 -3
- package/dist/file/image/types.d.ts.map +1 -1
- package/dist/file/index.js +139 -165
- package/dist/file/index.js.map +1 -1
- package/dist/file/mimeType.d.ts.map +1 -1
- package/dist/file/mimeTypeConstants.d.ts +18 -0
- package/dist/file/mimeTypeConstants.d.ts.map +1 -0
- package/dist/file/read-file/assert.d.ts.map +1 -1
- package/dist/file/read-file/readFile.d.ts +3 -11
- package/dist/file/read-file/readFile.d.ts.map +1 -1
- package/dist/file/read-file/readFileConstants.d.ts +13 -0
- package/dist/file/read-file/readFileConstants.d.ts.map +1 -0
- package/dist/file/read-file/types.d.ts +7 -6
- package/dist/file/read-file/types.d.ts.map +1 -1
- package/dist/file/signature/checkArchiveSignature.d.ts.map +1 -1
- package/dist/file-system/fileSystemConstants.d.ts +5 -0
- package/dist/file-system/fileSystemConstants.d.ts.map +1 -0
- package/dist/file-system/fileSystemTypes.d.ts +2 -1
- package/dist/file-system/fileSystemTypes.d.ts.map +1 -1
- package/dist/file-system/index.js +11 -10
- package/dist/file-system/index.js.map +1 -1
- package/dist/file-system/resolvePathInsideRoot.d.ts.map +1 -1
- package/dist/formatters/boolean/parseAbapBoolean.d.ts.map +1 -1
- package/dist/formatters/boolean/toAbapBoolean.d.ts.map +1 -1
- package/dist/formatters/date/calendarDate.d.ts.map +1 -1
- package/dist/formatters/date/calendarDateConstants.d.ts +13 -0
- package/dist/formatters/date/calendarDateConstants.d.ts.map +1 -0
- package/dist/formatters/date/calendarPeriod.d.ts +11 -2
- package/dist/formatters/date/calendarPeriod.d.ts.map +1 -1
- package/dist/formatters/date/dateFormatConstants.d.ts +17 -0
- package/dist/formatters/date/dateFormatConstants.d.ts.map +1 -0
- package/dist/formatters/date/datePatternConstants.d.ts +16 -0
- package/dist/formatters/date/datePatternConstants.d.ts.map +1 -0
- package/dist/formatters/date/datePresetNameConstants.d.ts +27 -0
- package/dist/formatters/date/datePresetNameConstants.d.ts.map +1 -0
- package/dist/formatters/date/dateRange.d.ts +3 -1
- package/dist/formatters/date/dateRange.d.ts.map +1 -1
- package/dist/formatters/date/dateValueConstants.d.ts +15 -0
- package/dist/formatters/date/dateValueConstants.d.ts.map +1 -0
- package/dist/formatters/date/educationDate.d.ts.map +1 -1
- package/dist/formatters/date/formatDate.d.ts.map +1 -1
- package/dist/formatters/date/formatInstantDateTime.d.ts.map +1 -1
- package/dist/formatters/date/parseDate.d.ts.map +1 -1
- package/dist/formatters/date/pattern.d.ts.map +1 -1
- package/dist/formatters/date/presets.d.ts.map +1 -1
- package/dist/formatters/date/types.d.ts +8 -6
- package/dist/formatters/date/types.d.ts.map +1 -1
- package/dist/formatters/formatDurationMinutes.d.ts.map +1 -1
- package/dist/formatters/formatFileSize.d.ts.map +1 -1
- package/dist/formatters/formatPhone.d.ts.map +1 -1
- package/dist/formatters/index.js +6 -6
- package/dist/formatters/normalizeLeadingZeros.d.ts.map +1 -1
- package/dist/formatters/number/compact.d.ts.map +1 -1
- package/dist/formatters/number/formatCompactNumber.d.ts.map +1 -1
- package/dist/formatters/number/formatNumber.d.ts.map +1 -1
- package/dist/formatters/number/numberFormatConstants.d.ts +11 -0
- package/dist/formatters/number/numberFormatConstants.d.ts.map +1 -0
- package/dist/formatters/number/numberPresetNameConstants.d.ts +16 -0
- package/dist/formatters/number/numberPresetNameConstants.d.ts.map +1 -0
- package/dist/formatters/number/parseNumber.d.ts.map +1 -1
- package/dist/formatters/number/presets.d.ts.map +1 -1
- package/dist/formatters/number/types.d.ts +2 -1
- package/dist/formatters/number/types.d.ts.map +1 -1
- package/dist/formatters/pipeline/clone.d.ts.map +1 -1
- package/dist/formatters/pipeline/definitions.d.ts.map +1 -1
- package/dist/formatters/pipeline/dependencies.d.ts.map +1 -1
- package/dist/formatters/pipeline/execute.d.ts +4 -1
- package/dist/formatters/pipeline/execute.d.ts.map +1 -1
- package/dist/formatters/pipeline/formattersPipelineConstants.d.ts +19 -0
- package/dist/formatters/pipeline/formattersPipelineConstants.d.ts.map +1 -0
- package/dist/formatters/pipeline/normalize.d.ts.map +1 -1
- package/dist/formatters/pipeline/pipelineValidationConstants.d.ts +40 -0
- package/dist/formatters/pipeline/pipelineValidationConstants.d.ts.map +1 -0
- package/dist/formatters/pipeline/registry.d.ts +1 -1
- package/dist/formatters/pipeline/registry.d.ts.map +1 -1
- package/dist/formatters/pipeline/rekey.d.ts.map +1 -1
- package/dist/formatters/pipeline/runtime.d.ts.map +1 -1
- package/dist/formatters/pipeline/types.d.ts +24 -21
- package/dist/formatters/pipeline/types.d.ts.map +1 -1
- package/dist/formatters/pipeline/validate.d.ts +2 -1
- package/dist/formatters/pipeline/validate.d.ts.map +1 -1
- package/dist/formatters/strings/spaceCharacterConstants.d.ts +5 -0
- package/dist/formatters/strings/spaceCharacterConstants.d.ts.map +1 -0
- package/dist/formatters/strings/stripInnerSpaces.d.ts.map +1 -1
- package/dist/formatters/strings/stripLeadingZeros.d.ts.map +1 -1
- package/dist/formatters/valueState/fixedValueStateResolver.d.ts.map +1 -1
- package/dist/formatters/valueState/presentation.d.ts.map +1 -1
- package/dist/formatters/valueState/resolveValueStateClassName.d.ts.map +1 -1
- package/dist/formatters/valueState/thresholdValueStateResolver.d.ts.map +1 -1
- package/dist/formatters/valueState/types.d.ts +2 -1
- package/dist/formatters/valueState/types.d.ts.map +1 -1
- package/dist/formatters/valueState/valueStateRegistry.d.ts.map +1 -1
- package/dist/formatters/valueState/valueStateResolverConstants.d.ts +6 -0
- package/dist/formatters/valueState/valueStateResolverConstants.d.ts.map +1 -0
- package/dist/formulas/execute.d.ts +3 -2
- package/dist/formulas/execute.d.ts.map +1 -1
- package/dist/formulas/index.js +1 -1
- package/dist/formulas/isTableFormulaDependency.d.ts.map +1 -1
- package/dist/formulas/tableFormulaConstants.d.ts +12 -0
- package/dist/formulas/tableFormulaConstants.d.ts.map +1 -0
- package/dist/formulas/types.d.ts +2 -1
- package/dist/formulas/types.d.ts.map +1 -1
- package/dist/formulas/validate.d.ts +2 -1
- package/dist/formulas/validate.d.ts.map +1 -1
- package/dist/hooks/index.js +110 -107
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/useBlockBrowserZoom.d.ts.map +1 -1
- package/dist/hooks/useDndSortableSensors.d.ts.map +1 -1
- package/dist/hooks/useFloatingListbox.d.ts +15 -33
- package/dist/hooks/useFloatingListbox.d.ts.map +1 -1
- package/dist/http/index.js +8 -7
- package/dist/http/index.js.map +1 -1
- package/dist/http/textResponse.d.ts.map +1 -1
- package/dist/indexed-records/createIndexedRecordsSchema.d.ts.map +1 -1
- package/dist/indexed-records/schema.js +24 -23
- package/dist/indexed-records/schema.js.map +1 -1
- package/dist/media/breakpointConstants.d.ts +5 -0
- package/dist/media/breakpointConstants.d.ts.map +1 -0
- package/dist/media/breakpoints.d.ts +2 -1
- package/dist/media/breakpoints.d.ts.map +1 -1
- package/dist/media/createNotificationTonePlayer.d.ts.map +1 -1
- package/dist/media/getCurrentFontSize.d.ts.map +1 -1
- package/dist/media/index.js +1 -1
- package/dist/media/mediaQueryConstants.d.ts +3 -0
- package/dist/media/mediaQueryConstants.d.ts.map +1 -0
- package/dist/media/responsive.d.ts +1 -1
- package/dist/media/responsive.d.ts.map +1 -1
- package/dist/media/useMatchMedia.d.ts.map +1 -1
- package/dist/media/useMediaQuery.d.ts.map +1 -1
- package/dist/metadata/baseMetaTypes.d.ts.map +1 -1
- package/dist/metadata/metadataTypes.d.ts +8 -7
- package/dist/metadata/metadataTypes.d.ts.map +1 -1
- package/dist/metadata/scalarTypeClassification.d.ts.map +1 -1
- package/dist/metadata/scalarTypeConstants.d.ts +21 -0
- package/dist/metadata/scalarTypeConstants.d.ts.map +1 -0
- package/dist/notifications/index.js +62 -62
- package/dist/notifications/index.js.map +1 -1
- package/dist/notifications/notificationTypeConstants.d.ts +6 -0
- package/dist/notifications/notificationTypeConstants.d.ts.map +1 -0
- package/dist/notifications/notify.d.ts.map +1 -1
- package/dist/notifications/store.d.ts.map +1 -1
- package/dist/notifications/types.d.ts +2 -1
- package/dist/notifications/types.d.ts.map +1 -1
- package/dist/number-scale/index.js +47 -46
- package/dist/number-scale/index.js.map +1 -1
- package/dist/number-scale/marksPositionConstants.d.ts +4 -0
- package/dist/number-scale/marksPositionConstants.d.ts.map +1 -0
- package/dist/number-scale/numberScale.d.ts +1 -1
- package/dist/number-scale/numberScale.d.ts.map +1 -1
- package/dist/number-scale/types.d.ts +2 -1
- package/dist/number-scale/types.d.ts.map +1 -1
- package/dist/odata-service/builder.d.ts.map +1 -1
- package/dist/odata-service/columns.d.ts.map +1 -1
- package/dist/odata-service/entityOperationConstants.d.ts +4 -0
- package/dist/odata-service/entityOperationConstants.d.ts.map +1 -0
- package/dist/odata-service/filterDefinitionConstants.d.ts +24 -0
- package/dist/odata-service/filterDefinitionConstants.d.ts.map +1 -0
- package/dist/odata-service/filterDefinitions.d.ts +19 -17
- package/dist/odata-service/filterDefinitions.d.ts.map +1 -1
- package/dist/odata-service/filterOperationConstants.d.ts +14 -0
- package/dist/odata-service/filterOperationConstants.d.ts.map +1 -0
- package/dist/odata-service/filters.d.ts.map +1 -1
- package/dist/odata-service/formatters.d.ts.map +1 -1
- package/dist/odata-service/index.js +439 -433
- package/dist/odata-service/index.js.map +1 -1
- package/dist/odata-service/odataMetadataConstants.d.ts +8 -0
- package/dist/odata-service/odataMetadataConstants.d.ts.map +1 -0
- package/dist/odata-service/parser.d.ts +1 -3
- package/dist/odata-service/parser.d.ts.map +1 -1
- package/dist/odata-service/schema.d.ts.map +1 -1
- package/dist/odata-service/sorts.d.ts.map +1 -1
- package/dist/odata-service/sqlFilters.d.ts +10 -5
- package/dist/odata-service/sqlFilters.d.ts.map +1 -1
- package/dist/odata-service/types.d.ts +5 -3
- package/dist/odata-service/types.d.ts.map +1 -1
- package/dist/pwa/index.js +72 -71
- package/dist/pwa/index.js.map +1 -1
- package/dist/pwa/sw-cache-policy.js +47 -47
- package/dist/pwa/sw-cache-policy.js.map +1 -1
- package/dist/pwa/swCachePolicy.d.ts +5 -1
- package/dist/pwa/swCachePolicy.d.ts.map +1 -1
- package/dist/pwa/useBrowserOnlineStatus.d.ts.map +1 -1
- package/dist/query-client/broadcast.d.ts +4 -3
- package/dist/query-client/broadcast.d.ts.map +1 -1
- package/dist/query-client/createQueryRestoreSchedulerGuard.d.ts.map +1 -1
- package/dist/query-client/createQueryRestoreStorage.d.ts.map +1 -1
- package/dist/query-client/index.js +1 -1
- package/dist/query-client/invalidationBroadcast.d.ts +2 -1
- package/dist/query-client/invalidationBroadcast.d.ts.map +1 -1
- package/dist/query-client/persistence.d.ts +9 -6
- package/dist/query-client/persistence.d.ts.map +1 -1
- package/dist/query-client/queryCacheEventConstants.d.ts +11 -0
- package/dist/query-client/queryCacheEventConstants.d.ts.map +1 -0
- package/dist/query-client/queryClient.d.ts +2 -1
- package/dist/query-client/queryClient.d.ts.map +1 -1
- package/dist/query-client/queryMeta.d.ts.map +1 -1
- package/dist/query-client/sessionPersistenceConstants.d.ts +5 -0
- package/dist/query-client/sessionPersistenceConstants.d.ts.map +1 -0
- package/dist/query-client/sessionScoped.d.ts.map +1 -1
- package/dist/query-client/sessionScopedResetConstants.d.ts +4 -0
- package/dist/query-client/sessionScopedResetConstants.d.ts.map +1 -0
- package/dist/query-client/sessionScopedResetLifecycleTypes.d.ts +2 -1
- package/dist/query-client/sessionScopedResetLifecycleTypes.d.ts.map +1 -1
- package/dist/seo/index.js +0 -1
- package/dist/seo/index.js.map +1 -1
- package/dist/seo/seo.d.ts +3 -2
- package/dist/seo/seo.d.ts.map +1 -1
- package/dist/seo/seoContentTypeConstants.d.ts +6 -0
- package/dist/seo/seoContentTypeConstants.d.ts.map +1 -0
- package/dist/seo/types.d.ts +2 -1
- package/dist/seo/types.d.ts.map +1 -1
- package/dist/session-storage/index.js +1 -1
- package/dist/table/cellSelection.d.ts.map +1 -1
- package/dist/table/index.js +83 -79
- package/dist/table/index.js.map +1 -1
- package/dist/table/odataAdapter.d.ts +3 -3
- package/dist/table/odataAdapter.d.ts.map +1 -1
- package/dist/table/selection.d.ts +2 -2
- package/dist/table/selection.d.ts.map +1 -1
- package/dist/table/tableColumnConstants.d.ts +5 -0
- package/dist/table/tableColumnConstants.d.ts.map +1 -0
- package/dist/table/tableSelectionConstants.d.ts +8 -0
- package/dist/table/tableSelectionConstants.d.ts.map +1 -0
- package/dist/table/tanStackFeatures.d.ts +8 -8
- package/dist/table/types.d.ts +5 -3
- package/dist/table/types.d.ts.map +1 -1
- package/dist/table/useTableRowSelection.d.ts +2 -2
- package/dist/table/useTableRowSelection.d.ts.map +1 -1
- package/dist/table-document/index.js +88 -87
- package/dist/table-document/index.js.map +1 -1
- package/dist/table-document/insertTableDocumentAxis.d.ts +2 -1
- package/dist/table-document/insertTableDocumentAxis.d.ts.map +1 -1
- package/dist/table-document/tableDocument.d.ts +2 -1
- package/dist/table-document/tableDocument.d.ts.map +1 -1
- package/dist/table-document/tableDocumentAxisGroups.d.ts +4 -3
- package/dist/table-document/tableDocumentAxisGroups.d.ts.map +1 -1
- package/dist/table-document/tableDocumentConstants.d.ts +8 -0
- package/dist/table-document/tableDocumentConstants.d.ts.map +1 -0
- package/dist/table-document/tableDocumentGeometry.d.ts.map +1 -1
- package/dist/three-scene/index.js +32 -32
- package/dist/three-scene/index.js.map +1 -1
- package/dist/three-scene/threeSceneAvailability.d.ts +4 -3
- package/dist/three-scene/threeSceneAvailability.d.ts.map +1 -1
- package/dist/three-scene/threeSceneConstants.d.ts +14 -0
- package/dist/three-scene/threeSceneConstants.d.ts.map +1 -0
- package/dist/three-scene/useThreeSceneAvailability.d.ts.map +1 -1
- package/dist/tree-table/index.js +1 -1
- package/dist/types/abapBooleanConstants.d.ts +4 -0
- package/dist/types/abapBooleanConstants.d.ts.map +1 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/types.d.ts +4 -2
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/valueStateConstants.d.ts +8 -0
- package/dist/types/valueStateConstants.d.ts.map +1 -0
- package/dist/utils/cloneFunctionStrategyConstants.d.ts +4 -0
- package/dist/utils/cloneFunctionStrategyConstants.d.ts.map +1 -0
- package/dist/utils/createLazyComponent.d.ts.map +1 -1
- package/dist/utils/deepCloneWithoutFunctions.d.ts +2 -1
- package/dist/utils/deepCloneWithoutFunctions.d.ts.map +1 -1
- package/dist/utils/deepCopyWithoutFunctions.d.ts +2 -1
- package/dist/utils/deepCopyWithoutFunctions.d.ts.map +1 -1
- package/dist/utils/index.js +2 -209
- package/dist/utils/keyboard.d.ts +2 -1
- package/dist/utils/keyboard.d.ts.map +1 -1
- package/dist/utils/keyboardConstants.d.ts +16 -0
- package/dist/utils/keyboardConstants.d.ts.map +1 -0
- package/dist/validators/index.js +3 -3
- package/dist/validators/index.js.map +1 -1
- package/dist/validators/validateUrl.d.ts.map +1 -1
- package/dist/value-transformers/execute.d.ts.map +1 -1
- package/dist/value-transformers/index.js +9 -6
- package/dist/value-transformers/index.js.map +1 -1
- package/dist/value-transformers/types.d.ts +3 -2
- package/dist/value-transformers/types.d.ts.map +1 -1
- package/dist/value-transformers/valueTransformerConstants.d.ts +4 -0
- package/dist/value-transformers/valueTransformerConstants.d.ts.map +1 -0
- package/package.json +6 -5
- package/src/binary/README.mdx +1 -1
- package/src/dom/README.mdx +1 -1
- package/src/query-client/README.mdx +4 -4
- package/dist/chunks/dom-BK22UmgF.js.map +0 -1
- package/dist/chunks/formatDate-BUvpRI7H.js +0 -133
- package/dist/chunks/formatDate-BUvpRI7H.js.map +0 -1
- package/dist/chunks/formatters-rxriDRPk.js.map +0 -1
- package/dist/chunks/formulas-BXT_XBWI.js.map +0 -1
- package/dist/chunks/media-WK38KtMl.js +0 -191
- package/dist/chunks/media-WK38KtMl.js.map +0 -1
- package/dist/chunks/query-client-CVRfrYZM.js.map +0 -1
- package/dist/chunks/scalarTypeClassification-BZcFmIyR.js +0 -764
- package/dist/chunks/scalarTypeClassification-BZcFmIyR.js.map +0 -1
- package/dist/chunks/uuid-CUJPAbRY.js.map +0 -1
- package/dist/chunks/validate-DsUR-bFF.js +0 -608
- package/dist/chunks/validate-DsUR-bFF.js.map +0 -1
- package/dist/utils/index.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/notifications/notify.ts","../../src/notifications/store.ts"],"sourcesContent":["import { type NotificationPushInput, type NotificationsStoreApi, type NotificationUpdatePatch } from \"./store\";\nimport { type NotificationId } from \"./types\";\n\nlet boundStore: NotificationsStoreApi | null = null;\n\nexport const bindNotifications = (store: NotificationsStoreApi) => {\n\tboundStore = store;\n\n\treturn () => {\n\t\tif (boundStore === store) {\n\t\t\tboundStore = null;\n\t\t}\n\t};\n};\n\nconst requireStore = (): NotificationsStoreApi => {\n\tif (!boundStore) throw new Error(\"Notifications store is not bound. Wrap app with NotificationsProvider.\");\n\treturn boundStore;\n};\n\nexport const notify = Object.freeze({\n\tpush: (input: NotificationPushInput) => requireStore().getState().actions.push(input),\n\tupsert: (input: NotificationPushInput & { id: NotificationId }) => requireStore().getState().actions.upsert(input),\n\tupdate: (id: NotificationId, patch: NotificationUpdatePatch) => requireStore().getState().actions.update(id, patch),\n\n\tdismiss: (id: NotificationId) => requireStore().getState().actions.dismiss(id),\n\tclear: () => requireStore().getState().actions.clear(),\n\tclearHistory: () => requireStore().getState().actions.clearHistory(),\n\n\tsuccess: (message: string, opts?: Omit<NotificationPushInput, \"type\" | \"message\">) =>\n\t\trequireStore()\n\t\t\t.getState()\n\t\t\t.actions.push({ type: \"success\", message, ...opts }),\n\tinfo: (message: string, opts?: Omit<NotificationPushInput, \"type\" | \"message\">) =>\n\t\trequireStore()\n\t\t\t.getState()\n\t\t\t.actions.push({ type: \"info\", message, ...opts }),\n\twarning: (message: string, opts?: Omit<NotificationPushInput, \"type\" | \"message\">) =>\n\t\trequireStore()\n\t\t\t.getState()\n\t\t\t.actions.push({ type: \"warning\", message, ...opts }),\n\terror: (message: string, opts?: Omit<NotificationPushInput, \"type\" | \"message\">) =>\n\t\trequireStore()\n\t\t\t.getState()\n\t\t\t.actions.push({ type: \"error\", message, ...opts }),\n\n\t/**\n\t * Удобный паттерн \"долгой операции\":\n\t * const op = notify.progress(\"Сохраняю...\");\n\t * ... op.success(\"Готово\") или op.error(\"Ошибка\")\n\t */\n\tprogress: (message: string, opts?: { id?: NotificationId; title?: string }) => {\n\t\tconst store = requireStore();\n\t\tconst id = opts?.id;\n\n\t\tif (id) {\n\t\t\tstore.getState().actions.upsert({\n\t\t\t\tid,\n\t\t\t\ttype: \"info\",\n\t\t\t\ttitle: opts?.title,\n\t\t\t\tmessage,\n\t\t\t\tdismissible: false\n\t\t\t});\n\t\t}\n\n\t\tconst notificationId =\n\t\t\tid ??\n\t\t\tstore.getState().actions.push({\n\t\t\t\ttype: \"info\",\n\t\t\t\ttitle: opts?.title,\n\t\t\t\tmessage,\n\t\t\t\tdismissible: false\n\t\t\t});\n\n\t\treturn {\n\t\t\tid: notificationId,\n\t\t\tupdate: (nextMessage: string) => notify.update(notificationId, { message: nextMessage }),\n\t\t\tsuccess: (nextMessage: string, ttlMs = 2500) =>\n\t\t\t\tnotify.update(notificationId, { type: \"success\", message: nextMessage, dismissible: true, ttlMs }),\n\t\t\terror: (nextMessage: string, ttlMs = 5000) =>\n\t\t\t\tnotify.update(notificationId, { type: \"error\", message: nextMessage, dismissible: true, ttlMs }),\n\t\t\tdismiss: () => notify.dismiss(notificationId)\n\t\t};\n\t}\n});\n","import { createStore, type StoreApi } from \"zustand\";\n\nimport { type Notification, type NotificationAction, type NotificationId, type NotificationType } from \"./types\";\n\nexport type NotificationPushInput = {\n\tid?: NotificationId;\n\ttype: NotificationType;\n\ttitle?: string;\n\tmessage: string;\n\tttlMs?: number;\n\tdismissible?: boolean;\n\tactions?: NotificationAction[];\n\t/** false исключает текст из истории, не меняя отображение и срок жизни активного toast. */\n\tretainInHistory?: boolean;\n};\n\nexport type NotificationUpdatePatch = Partial<Omit<Notification, \"id\" | \"createdAt\">> & {\n\t// ttlMs можно менять; createdAt — нет\n};\n\nexport type NotificationsState = {\n\t/** Активные toast-уведомления, которые должен отображать краткоживущий host. */\n\titems: Notification[];\n\t/** История сохраняемых уведомлений; TTL, dismiss и переполнение toast-стека её не сокращают. */\n\thistory: Notification[];\n};\n\nexport type NotificationsActions = {\n\tpush: (input: NotificationPushInput) => NotificationId;\n\tupdate: (id: NotificationId, patch: NotificationUpdatePatch) => boolean;\n\tupsert: (input: NotificationPushInput & { id: NotificationId }) => NotificationId;\n\tdismiss: (id: NotificationId) => void;\n\tclear: () => void;\n\tclearHistory: () => void;\n};\n\nexport type NotificationsStore = NotificationsState & {\n\tactions: NotificationsActions;\n};\n\nconst genId = (): NotificationId => `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 9)}`;\n\nconst MAX_VISIBLE_ITEMS = 6;\n\nexport function createNotificationsStore() {\n\tconst timers = new Map<NotificationId, number>();\n\n\tconst clearTimer = (id: NotificationId) => {\n\t\tconst t = timers.get(id);\n\t\tif (t) {\n\t\t\twindow.clearTimeout(t);\n\t\t\ttimers.delete(id);\n\t\t}\n\t};\n\n\tconst armTimer = (store: StoreApi<NotificationsStore>, id: NotificationId, ttlMs: number = 10_000) => {\n\t\tclearTimer(id);\n\t\tif (ttlMs <= 0) return;\n\n\t\tconst t = window.setTimeout(() => {\n\t\t\tstore.getState().actions.dismiss(id);\n\t\t}, ttlMs);\n\n\t\ttimers.set(id, t);\n\t};\n\n\tconst store = createStore<NotificationsStore>()((set, get) => ({\n\t\titems: [],\n\t\thistory: [],\n\n\t\tactions: {\n\t\t\tpush: (input) => {\n\t\t\t\tconst id = input.id ?? genId();\n\t\t\t\tconst now = Date.now();\n\n\t\t\t\tconst notif: Notification = {\n\t\t\t\t\tid,\n\t\t\t\t\ttype: input.type,\n\t\t\t\t\ttitle: input.title,\n\t\t\t\t\tmessage: input.message,\n\t\t\t\t\tcreatedAt: now,\n\t\t\t\t\tttlMs: input.ttlMs,\n\t\t\t\t\tdismissible: input.dismissible ?? true,\n\t\t\t\t\tactions: input.actions,\n\t\t\t\t\t// Не добавляем поле старым consumers, если они не задали новую политику.\n\t\t\t\t\t...(input.retainInHistory !== undefined ? { retainInHistory: input.retainInHistory } : {})\n\t\t\t\t};\n\n\t\t\t\tconst currentItems = get().items;\n\t\t\t\tconst nextItems = [notif, ...currentItems.filter((notification) => notification.id !== id)].slice(0, MAX_VISIBLE_ITEMS);\n\t\t\t\tconst visibleIds = new Set(nextItems.map((notification) => notification.id));\n\n\t\t\t\t// Для вытесненного toast таймер больше не нужен; сохранение истории определяется его политикой.\n\t\t\t\tcurrentItems.forEach((notification) => {\n\t\t\t\t\tif (!visibleIds.has(notification.id)) clearTimer(notification.id);\n\t\t\t\t});\n\n\t\t\t\tset((state) => {\n\t\t\t\t\tlet history = state.history;\n\n\t\t\t\t\tif (notif.retainInHistory !== false) {\n\t\t\t\t\t\thistory = [notif, ...state.history.filter((notification) => notification.id !== id)];\n\t\t\t\t\t} else if (state.history.some((notification) => notification.id === id)) {\n\t\t\t\t\t\thistory = state.history.filter((notification) => notification.id !== id);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn { items: nextItems, history };\n\t\t\t\t});\n\n\t\t\t\tarmTimer(store, id, notif.ttlMs);\n\t\t\t\treturn id;\n\t\t\t},\n\n\t\t\tupdate: (id, patch) => {\n\t\t\t\tconst previous = get().items.find((notification) => notification.id === id);\n\t\t\t\tif (!previous) return false;\n\n\t\t\t\tconst { retainInHistory, ...contentPatch } = patch;\n\t\t\t\tconst next: Notification = {\n\t\t\t\t\t...previous,\n\t\t\t\t\t...contentPatch,\n\t\t\t\t\t// undefined, в том числе переданный явно, не отменяет прежний отказ от истории.\n\t\t\t\t\t...(retainInHistory !== undefined ? { retainInHistory } : {}),\n\t\t\t\t\tid: previous.id,\n\t\t\t\t\tcreatedAt: previous.createdAt\n\t\t\t\t};\n\n\t\t\t\tset((state) => {\n\t\t\t\t\tconst existsInHistory = state.history.some((notification) => notification.id === id);\n\t\t\t\t\tlet history = state.history;\n\n\t\t\t\t\tif (next.retainInHistory === false) {\n\t\t\t\t\t\tif (existsInHistory) history = state.history.filter((notification) => notification.id !== id);\n\t\t\t\t\t} else if (existsInHistory) {\n\t\t\t\t\t\thistory = state.history.map((notification) => (notification.id === id ? next : notification));\n\t\t\t\t\t} else if (retainInHistory === true) {\n\t\t\t\t\t\t// После clearHistory вернуть активный toast можно только явным решением consumer.\n\t\t\t\t\t\thistory = [next, ...state.history];\n\t\t\t\t\t}\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\titems: state.items.map((notification) => (notification.id === id ? next : notification)),\n\t\t\t\t\t\thistory\n\t\t\t\t\t};\n\t\t\t\t});\n\n\t\t\t\t// если ttlMs изменили — пере-армим таймер\n\t\t\t\tif (\"ttlMs\" in patch) {\n\t\t\t\t\tarmTimer(store, id, next.ttlMs);\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t},\n\n\t\t\tupsert: (input) => {\n\t\t\t\tconst ok = get().actions.update(input.id, {\n\t\t\t\t\ttype: input.type,\n\t\t\t\t\ttitle: input.title,\n\t\t\t\t\tmessage: input.message,\n\t\t\t\t\tttlMs: input.ttlMs,\n\t\t\t\t\tdismissible: input.dismissible,\n\t\t\t\t\t...(input.retainInHistory !== undefined ? { retainInHistory: input.retainInHistory } : {})\n\t\t\t\t});\n\n\t\t\t\tif (ok) return input.id;\n\t\t\t\treturn get().actions.push(input);\n\t\t\t},\n\n\t\t\tdismiss: (id) => {\n\t\t\t\tclearTimer(id);\n\t\t\t\tset((s) => ({ items: s.items.filter((n) => n.id !== id) }));\n\t\t\t},\n\n\t\t\tclear: () => {\n\t\t\t\ttimers.forEach((t) => window.clearTimeout(t));\n\t\t\t\ttimers.clear();\n\t\t\t\tset({ items: [] });\n\t\t\t},\n\n\t\t\tclearHistory: () => {\n\t\t\t\tset({ history: [] });\n\t\t\t}\n\t\t}\n\t}));\n\n\treturn store;\n}\n\nexport type NotificationsStoreApi = StoreApi<NotificationsStore>;\n"],"mappings":";;AAGA,IAAI,IAA2C,MAElC,KAAqB,OACjC,IAAa,SAEA;CACZ,AAAI,MAAe,MAClB,IAAa;AAEf,IAGK,UAA4C;CACjD,IAAI,CAAC,GAAY,MAAU,MAAM,wEAAwE;CACzG,OAAO;AACR,GAEa,IAAS,OAAO,OAAO;CACnC,OAAO,MAAiC,EAAa,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,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B,IAAU,CAAC,GAAM,GAAG,EAAM,OAAO,IAG3B;MACN,OAAO,EAAM,MAAM,KAAK,MAAkB,EAAa,OAAO,IAAK,IAAO,CAAa;MACvF;KACD;IACD,CAAC,GAGG,WAAW,KACd,EAAS,GAAO,GAAI,EAAK,KAAK,GAGxB;GACR;GAEA,SAAS,MACG,EAAI,CAAC,CAAC,QAAQ,OAAO,EAAM,IAAI;IACzC,MAAM,EAAM;IACZ,OAAO,EAAM;IACb,SAAS,EAAM;IACf,OAAO,EAAM;IACb,aAAa,EAAM;IACnB,GAAI,EAAM,oBAAoB,KAAA,IAAyD,CAAC,IAA9C,EAAE,iBAAiB,EAAM,gBAAgB;GACpF,CAEI,IAAW,EAAM,KACd,EAAI,CAAC,CAAC,QAAQ,KAAK,CAAK;GAGhC,UAAU,MAAO;IAEhB,AADA,EAAW,CAAE,GACb,GAAK,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,MAAM,EAAE,OAAO,CAAE,EAAE,EAAE;GAC3D;GAEA,aAAa;IAGZ,AAFA,EAAO,SAAS,MAAM,OAAO,aAAa,CAAC,CAAC,GAC5C,EAAO,MAAM,GACb,EAAI,EAAE,OAAO,CAAC,EAAE,CAAC;GAClB;GAEA,oBAAoB;IACnB,EAAI,EAAE,SAAS,CAAC,EAAE,CAAC;GACpB;EACD;CACD,EAAE;CAEF,OAAO;AACR"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/notifications/notificationTypeConstants.ts","../../src/notifications/notify.ts","../../src/notifications/store.ts"],"sourcesContent":["/** Общие значения типов уведомлений для runtime и публичного строкового контракта. */\nexport const NOTIFICATION_TYPE_ERROR = \"error\";\nexport const NOTIFICATION_TYPE_WARNING = \"warning\";\nexport const NOTIFICATION_TYPE_INFO = \"info\";\nexport const NOTIFICATION_TYPE_SUCCESS = \"success\";\n","import {\n\tNOTIFICATION_TYPE_ERROR,\n\tNOTIFICATION_TYPE_INFO,\n\tNOTIFICATION_TYPE_SUCCESS,\n\tNOTIFICATION_TYPE_WARNING\n} from \"./notificationTypeConstants\";\nimport { type NotificationPushInput, type NotificationsStoreApi, type NotificationUpdatePatch } from \"./store\";\nimport { type NotificationId } from \"./types\";\n\nlet boundStore: NotificationsStoreApi | null = null;\n\nconst PROGRESS_SUCCESS_TTL_MS = 2_500;\nconst PROGRESS_ERROR_TTL_MS = 5_000;\n\nexport const bindNotifications = (store: NotificationsStoreApi) => {\n\tboundStore = store;\n\n\treturn () => {\n\t\tif (boundStore === store) {\n\t\t\tboundStore = null;\n\t\t}\n\t};\n};\n\nconst requireStore = (): NotificationsStoreApi => {\n\tif (!boundStore) throw new Error(\"Notifications store is not bound. Wrap app with NotificationsProvider.\");\n\treturn boundStore;\n};\n\nexport const notify = Object.freeze({\n\tpush: (input: NotificationPushInput) => requireStore().getState().actions.push(input),\n\tupsert: (input: NotificationPushInput & { id: NotificationId }) => requireStore().getState().actions.upsert(input),\n\tupdate: (id: NotificationId, patch: NotificationUpdatePatch) => requireStore().getState().actions.update(id, patch),\n\n\tdismiss: (id: NotificationId) => requireStore().getState().actions.dismiss(id),\n\tclear: () => requireStore().getState().actions.clear(),\n\tclearHistory: () => requireStore().getState().actions.clearHistory(),\n\n\tsuccess: (message: string, opts?: Omit<NotificationPushInput, \"type\" | \"message\">) =>\n\t\trequireStore()\n\t\t\t.getState()\n\t\t\t.actions.push({ type: NOTIFICATION_TYPE_SUCCESS, message, ...opts }),\n\tinfo: (message: string, opts?: Omit<NotificationPushInput, \"type\" | \"message\">) =>\n\t\trequireStore()\n\t\t\t.getState()\n\t\t\t.actions.push({ type: NOTIFICATION_TYPE_INFO, message, ...opts }),\n\twarning: (message: string, opts?: Omit<NotificationPushInput, \"type\" | \"message\">) =>\n\t\trequireStore()\n\t\t\t.getState()\n\t\t\t.actions.push({ type: NOTIFICATION_TYPE_WARNING, message, ...opts }),\n\terror: (message: string, opts?: Omit<NotificationPushInput, \"type\" | \"message\">) =>\n\t\trequireStore()\n\t\t\t.getState()\n\t\t\t.actions.push({ type: NOTIFICATION_TYPE_ERROR, message, ...opts }),\n\n\t/**\n\t * Удобный паттерн \"долгой операции\":\n\t * const op = notify.progress(\"Сохраняю...\");\n\t * ... op.success(\"Готово\") или op.error(\"Ошибка\")\n\t */\n\tprogress: (message: string, opts?: { id?: NotificationId; title?: string }) => {\n\t\tconst store = requireStore();\n\t\tconst id = opts?.id;\n\n\t\tif (id) {\n\t\t\tstore.getState().actions.upsert({\n\t\t\t\tid,\n\t\t\t\ttype: NOTIFICATION_TYPE_INFO,\n\t\t\t\ttitle: opts?.title,\n\t\t\t\tmessage,\n\t\t\t\tdismissible: false\n\t\t\t});\n\t\t}\n\n\t\tconst notificationId =\n\t\t\tid ??\n\t\t\tstore.getState().actions.push({\n\t\t\t\ttype: NOTIFICATION_TYPE_INFO,\n\t\t\t\ttitle: opts?.title,\n\t\t\t\tmessage,\n\t\t\t\tdismissible: false\n\t\t\t});\n\n\t\treturn {\n\t\t\tid: notificationId,\n\t\t\tupdate: (nextMessage: string) => notify.update(notificationId, { message: nextMessage }),\n\t\t\tsuccess: (nextMessage: string, ttlMs = PROGRESS_SUCCESS_TTL_MS) =>\n\t\t\t\tnotify.update(notificationId, { type: NOTIFICATION_TYPE_SUCCESS, message: nextMessage, dismissible: true, ttlMs }),\n\t\t\terror: (nextMessage: string, ttlMs = PROGRESS_ERROR_TTL_MS) =>\n\t\t\t\tnotify.update(notificationId, { type: NOTIFICATION_TYPE_ERROR, message: nextMessage, dismissible: true, ttlMs }),\n\t\t\tdismiss: () => notify.dismiss(notificationId)\n\t\t};\n\t}\n});\n","import { createStore, type StoreApi } from \"zustand\";\n\nimport { type Notification, type NotificationAction, type NotificationId, type NotificationType } from \"./types\";\n\nexport type NotificationPushInput = {\n\tid?: NotificationId;\n\ttype: NotificationType;\n\ttitle?: string;\n\tmessage: string;\n\tttlMs?: number;\n\tdismissible?: boolean;\n\tactions?: NotificationAction[];\n\t/** false исключает текст из истории, не меняя отображение и срок жизни активного toast. */\n\tretainInHistory?: boolean;\n};\n\nexport type NotificationUpdatePatch = Partial<Omit<Notification, \"id\" | \"createdAt\">> & {\n\t// ttlMs можно менять; createdAt — нет\n};\n\nexport type NotificationsState = {\n\t/** Активные toast-уведомления, которые должен отображать краткоживущий host. */\n\titems: Notification[];\n\t/** История сохраняемых уведомлений; TTL, dismiss и переполнение toast-стека её не сокращают. */\n\thistory: Notification[];\n};\n\nexport type NotificationsActions = {\n\tpush: (input: NotificationPushInput) => NotificationId;\n\tupdate: (id: NotificationId, patch: NotificationUpdatePatch) => boolean;\n\tupsert: (input: NotificationPushInput & { id: NotificationId }) => NotificationId;\n\tdismiss: (id: NotificationId) => void;\n\tclear: () => void;\n\tclearHistory: () => void;\n};\n\nexport type NotificationsStore = NotificationsState & {\n\tactions: NotificationsActions;\n};\n\nconst ID_ENCODING_RADIX = 36;\nconst genId = (): NotificationId => `${Date.now().toString(ID_ENCODING_RADIX)}-${Math.random().toString(ID_ENCODING_RADIX).slice(2, 9)}`;\n\nconst MAX_VISIBLE_ITEMS = 6;\nconst DEFAULT_NOTIFICATION_TTL_MS = 10_000;\n\nexport function createNotificationsStore() {\n\tconst timers = new Map<NotificationId, number>();\n\n\tconst clearTimer = (id: NotificationId) => {\n\t\tconst t = timers.get(id);\n\t\tif (t) {\n\t\t\twindow.clearTimeout(t);\n\t\t\ttimers.delete(id);\n\t\t}\n\t};\n\n\tconst armTimer = (store: StoreApi<NotificationsStore>, id: NotificationId, ttlMs: number = DEFAULT_NOTIFICATION_TTL_MS) => {\n\t\tclearTimer(id);\n\t\tif (ttlMs <= 0) return;\n\n\t\tconst t = window.setTimeout(() => {\n\t\t\tstore.getState().actions.dismiss(id);\n\t\t}, ttlMs);\n\n\t\ttimers.set(id, t);\n\t};\n\n\tconst store = createStore<NotificationsStore>()((set, get) => ({\n\t\titems: [],\n\t\thistory: [],\n\n\t\tactions: {\n\t\t\tpush: (input) => {\n\t\t\t\tconst id = input.id ?? genId();\n\t\t\t\tconst now = Date.now();\n\n\t\t\t\tconst notif: Notification = {\n\t\t\t\t\tid,\n\t\t\t\t\ttype: input.type,\n\t\t\t\t\ttitle: input.title,\n\t\t\t\t\tmessage: input.message,\n\t\t\t\t\tcreatedAt: now,\n\t\t\t\t\tttlMs: input.ttlMs,\n\t\t\t\t\tdismissible: input.dismissible ?? true,\n\t\t\t\t\tactions: input.actions,\n\t\t\t\t\t// Не добавляем поле старым consumers, если они не задали новую политику.\n\t\t\t\t\t...(input.retainInHistory !== undefined ? { retainInHistory: input.retainInHistory } : {})\n\t\t\t\t};\n\n\t\t\t\tconst currentItems = get().items;\n\t\t\t\tconst nextItems = [notif, ...currentItems.filter((notification) => notification.id !== id)].slice(0, MAX_VISIBLE_ITEMS);\n\t\t\t\tconst visibleIds = new Set(nextItems.map((notification) => notification.id));\n\n\t\t\t\t// Для вытесненного toast таймер больше не нужен; сохранение истории определяется его политикой.\n\t\t\t\tcurrentItems.forEach((notification) => {\n\t\t\t\t\tif (!visibleIds.has(notification.id)) clearTimer(notification.id);\n\t\t\t\t});\n\n\t\t\t\tset((state) => {\n\t\t\t\t\tlet history = state.history;\n\n\t\t\t\t\tif (notif.retainInHistory !== false) {\n\t\t\t\t\t\thistory = [notif, ...state.history.filter((notification) => notification.id !== id)];\n\t\t\t\t\t} else if (state.history.some((notification) => notification.id === id)) {\n\t\t\t\t\t\thistory = state.history.filter((notification) => notification.id !== id);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn { items: nextItems, history };\n\t\t\t\t});\n\n\t\t\t\tarmTimer(store, id, notif.ttlMs);\n\t\t\t\treturn id;\n\t\t\t},\n\n\t\t\tupdate: (id, patch) => {\n\t\t\t\tconst previous = get().items.find((notification) => notification.id === id);\n\t\t\t\tif (!previous) return false;\n\n\t\t\t\tconst { retainInHistory, ...contentPatch } = patch;\n\t\t\t\tconst next: Notification = {\n\t\t\t\t\t...previous,\n\t\t\t\t\t...contentPatch,\n\t\t\t\t\t// undefined, в том числе переданный явно, не отменяет прежний отказ от истории.\n\t\t\t\t\t...(retainInHistory !== undefined ? { retainInHistory } : {}),\n\t\t\t\t\tid: previous.id,\n\t\t\t\t\tcreatedAt: previous.createdAt\n\t\t\t\t};\n\n\t\t\t\tset((state) => {\n\t\t\t\t\tconst existsInHistory = state.history.some((notification) => notification.id === id);\n\t\t\t\t\tlet history = state.history;\n\n\t\t\t\t\tif (next.retainInHistory === false) {\n\t\t\t\t\t\tif (existsInHistory) history = state.history.filter((notification) => notification.id !== id);\n\t\t\t\t\t} else if (existsInHistory) {\n\t\t\t\t\t\thistory = state.history.map((notification) => (notification.id === id ? next : notification));\n\t\t\t\t\t} else if (retainInHistory === true) {\n\t\t\t\t\t\t// После clearHistory вернуть активный toast можно только явным решением consumer.\n\t\t\t\t\t\thistory = [next, ...state.history];\n\t\t\t\t\t}\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\titems: state.items.map((notification) => (notification.id === id ? next : notification)),\n\t\t\t\t\t\thistory\n\t\t\t\t\t};\n\t\t\t\t});\n\n\t\t\t\t// если ttlMs изменили — пере-армим таймер\n\t\t\t\tif (\"ttlMs\" in patch) {\n\t\t\t\t\tarmTimer(store, id, next.ttlMs);\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t},\n\n\t\t\tupsert: (input) => {\n\t\t\t\tconst ok = get().actions.update(input.id, {\n\t\t\t\t\ttype: input.type,\n\t\t\t\t\ttitle: input.title,\n\t\t\t\t\tmessage: input.message,\n\t\t\t\t\tttlMs: input.ttlMs,\n\t\t\t\t\tdismissible: input.dismissible,\n\t\t\t\t\t...(input.retainInHistory !== undefined ? { retainInHistory: input.retainInHistory } : {})\n\t\t\t\t});\n\n\t\t\t\tif (ok) return input.id;\n\t\t\t\treturn get().actions.push(input);\n\t\t\t},\n\n\t\t\tdismiss: (id) => {\n\t\t\t\tclearTimer(id);\n\t\t\t\tset((s) => ({ items: s.items.filter((n) => n.id !== id) }));\n\t\t\t},\n\n\t\t\tclear: () => {\n\t\t\t\ttimers.forEach((t) => window.clearTimeout(t));\n\t\t\t\ttimers.clear();\n\t\t\t\tset({ items: [] });\n\t\t\t},\n\n\t\t\tclearHistory: () => {\n\t\t\t\tset({ history: [] });\n\t\t\t}\n\t\t}\n\t}));\n\n\treturn store;\n}\n\nexport type NotificationsStoreApi = StoreApi<NotificationsStore>;\n"],"mappings":";;AACA,IAAa,IAA0B,SAC1B,IAA4B,WAC5B,IAAyB,QACzB,IAA4B,WCKrC,IAA2C,MAEzC,IAA0B,MAC1B,IAAwB,KAEjB,KAAqB,OACjC,IAAa,SAEA;CACZ,AAAI,MAAe,MAClB,IAAa;AAEf,IAGK,UAA4C;CACjD,IAAI,CAAC,GAAY,MAAU,MAAM,wEAAwE;CACzG,OAAO;AACR,GAEa,IAAS,OAAO,OAAO;CACnC,OAAO,MAAiC,EAAa,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,KAAK,CAAK;CACpF,SAAS,MAA0D,EAAa,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,OAAO,CAAK;CACjH,SAAS,GAAoB,MAAmC,EAAa,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,OAAO,GAAI,CAAK;CAElH,UAAU,MAAuB,EAAa,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,QAAQ,CAAE;CAC7E,aAAa,EAAa,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,MAAM;CACrD,oBAAoB,EAAa,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,aAAa;CAEnE,UAAU,GAAiB,MAC1B,EAAa,CAAC,CACZ,SAAS,CAAC,CACV,QAAQ,KAAK;EAAE,MAAM;EAA2B;EAAS,GAAG;CAAK,CAAC;CACrE,OAAO,GAAiB,MACvB,EAAa,CAAC,CACZ,SAAS,CAAC,CACV,QAAQ,KAAK;EAAE,MAAM;EAAwB;EAAS,GAAG;CAAK,CAAC;CAClE,UAAU,GAAiB,MAC1B,EAAa,CAAC,CACZ,SAAS,CAAC,CACV,QAAQ,KAAK;EAAE,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AS,MAAM,OAAO,aAAa,CAAC,CAAC,GAC5C,EAAO,MAAM,GACb,EAAI,EAAE,OAAO,CAAC,EAAE,CAAC;GAClB;GAEA,oBAAoB;IACnB,EAAI,EAAE,SAAS,CAAC,EAAE,CAAC;GACpB;EACD;CACD,EAAE;CAEF,OAAO;AACR"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Общие значения типов уведомлений для runtime и публичного строкового контракта. */
|
|
2
|
+
export declare const NOTIFICATION_TYPE_ERROR = "error";
|
|
3
|
+
export declare const NOTIFICATION_TYPE_WARNING = "warning";
|
|
4
|
+
export declare const NOTIFICATION_TYPE_INFO = "info";
|
|
5
|
+
export declare const NOTIFICATION_TYPE_SUCCESS = "success";
|
|
6
|
+
//# sourceMappingURL=notificationTypeConstants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notificationTypeConstants.d.ts","sourceRoot":"","sources":["../../src/notifications/notificationTypeConstants.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,eAAO,MAAM,uBAAuB,UAAU,CAAC;AAC/C,eAAO,MAAM,yBAAyB,YAAY,CAAC;AACnD,eAAO,MAAM,sBAAsB,SAAS,CAAC;AAC7C,eAAO,MAAM,yBAAyB,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notify.d.ts","sourceRoot":"","sources":["../../src/notifications/notify.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"notify.d.ts","sourceRoot":"","sources":["../../src/notifications/notify.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,qBAAqB,EAAE,KAAK,qBAAqB,EAAE,KAAK,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAC/G,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC;AAO9C,eAAO,MAAM,iBAAiB,GAAI,OAAO,qBAAqB,eAQ7D,CAAC;AAOF,eAAO,MAAM,MAAM;kBACJ,qBAAqB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AC,EAAE,kBAAkB,EAAE,CAAC;IAC/B,2FAA2F;IAC3F,eAAe,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,GAAG,WAAW,CAAC,CAAC,GAAG,EAEvF,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAChC,gFAAgF;IAChF,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,gGAAgG;IAChG,OAAO,EAAE,YAAY,EAAE,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IAClC,IAAI,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,cAAc,CAAC;IACvD,MAAM,EAAE,CAAC,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,uBAAuB,KAAK,OAAO,CAAC;IACxE,MAAM,EAAE,CAAC,KAAK,EAAE,qBAAqB,GAAG;QAAE,EAAE,EAAE,cAAc,CAAA;KAAE,KAAK,cAAc,CAAC;IAClF,OAAO,EAAE,CAAC,EAAE,EAAE,cAAc,KAAK,IAAI,CAAC;IACtC,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,YAAY,EAAE,MAAM,IAAI,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,kBAAkB,GAAG;IACrD,OAAO,EAAE,oBAAoB,CAAC;CAC9B,CAAC;AAQF,wBAAgB,wBAAwB,iCA8IvC;AAED,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAAC,kBAAkB,CAAC,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { type NOTIFICATION_TYPE_ERROR, type NOTIFICATION_TYPE_INFO, type NOTIFICATION_TYPE_SUCCESS, type NOTIFICATION_TYPE_WARNING } from "./notificationTypeConstants";
|
|
2
|
+
export type NotificationType = typeof NOTIFICATION_TYPE_ERROR | typeof NOTIFICATION_TYPE_WARNING | typeof NOTIFICATION_TYPE_INFO | typeof NOTIFICATION_TYPE_SUCCESS;
|
|
2
3
|
export type NotificationTone = "neutral" | NotificationType;
|
|
3
4
|
export type NotificationId = string;
|
|
4
5
|
export type NotificationAction = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/notifications/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/notifications/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,MAAM,6BAA6B,CAAC;AAErC,MAAM,MAAM,gBAAgB,GAC3B,OAAO,uBAAuB,GAAG,OAAO,yBAAyB,GAAG,OAAO,sBAAsB,GAAG,OAAO,yBAAyB,CAAC;AAEtI,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,gBAAgB,CAAC;AAE5D,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC;AAEpC,MAAM,MAAM,kBAAkB,GAAG;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC,IAAI,CAAC,EAAE,gBAAgB,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IAC1B,EAAE,EAAE,cAAc,CAAC;IACnB,IAAI,EAAE,gBAAgB,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC/B,4GAA4G;IAC5G,eAAe,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC"}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
//#region src/number-scale/
|
|
2
|
-
|
|
1
|
+
//#region src/number-scale/marksPositionConstants.ts
|
|
2
|
+
var e = "value";
|
|
3
|
+
function t(e) {
|
|
3
4
|
if (!Number.isFinite(e)) return 0;
|
|
4
5
|
let t = e.toString().toLowerCase(), n = t.indexOf("e-");
|
|
5
6
|
if (n >= 0) return Number(t.slice(n + 2));
|
|
6
7
|
let r = t.indexOf(".");
|
|
7
8
|
return r >= 0 ? t.length - r - 1 : 0;
|
|
8
9
|
}
|
|
9
|
-
function
|
|
10
|
+
function n(e, t) {
|
|
10
11
|
if (t <= 0) return Math.round(e);
|
|
11
12
|
let n = 10 ** t;
|
|
12
13
|
return Math.round(e * n) / n;
|
|
13
14
|
}
|
|
14
|
-
function
|
|
15
|
+
function r(e, t) {
|
|
15
16
|
return !Number.isFinite(e) || !Number.isFinite(t) ? {
|
|
16
17
|
min: 0,
|
|
17
18
|
max: 100
|
|
@@ -23,22 +24,22 @@ function n(e, t) {
|
|
|
23
24
|
max: e
|
|
24
25
|
};
|
|
25
26
|
}
|
|
26
|
-
function
|
|
27
|
+
function i(e, t, n) {
|
|
27
28
|
return Number.isFinite(e) ? Math.min(n, Math.max(t, e)) : t;
|
|
28
29
|
}
|
|
29
|
-
function
|
|
30
|
+
function a(e) {
|
|
30
31
|
return !Number.isFinite(e) || e === void 0 || e <= 0 ? 1 : e;
|
|
31
32
|
}
|
|
32
|
-
function
|
|
33
|
+
function o(e, t, n) {
|
|
33
34
|
if (!e?.length) return [];
|
|
34
35
|
let r = /* @__PURE__ */ new Set();
|
|
35
36
|
return e.filter((e) => Number.isFinite(e.value) && e.value >= t && e.value <= n).slice().sort((e, t) => e.value - t.value).filter((e) => !r.has(e.value) && (r.add(e.value), !0));
|
|
36
37
|
}
|
|
37
|
-
function
|
|
38
|
-
let c =
|
|
39
|
-
return
|
|
38
|
+
function s(e, r, o, s) {
|
|
39
|
+
let c = a(s), l = i(e, r, o), u = Math.max(t(c), t(r), t(o));
|
|
40
|
+
return i(n(r + Math.round((l - r) / c) * c, u), r, o);
|
|
40
41
|
}
|
|
41
|
-
function
|
|
42
|
+
function c(e, t) {
|
|
42
43
|
if (!t.length) return;
|
|
43
44
|
let n = t[0], r = Math.abs(e - n.value);
|
|
44
45
|
for (let i = 1; i < t.length; i += 1) {
|
|
@@ -47,53 +48,53 @@ function s(e, t) {
|
|
|
47
48
|
}
|
|
48
49
|
return n;
|
|
49
50
|
}
|
|
50
|
-
function
|
|
51
|
-
if (!t.length) return
|
|
52
|
-
let a =
|
|
53
|
-
return
|
|
51
|
+
function l(e, t, n, r) {
|
|
52
|
+
if (!t.length) return i(e, n, r);
|
|
53
|
+
let a = i(e, n, r);
|
|
54
|
+
return c(a, t)?.value ?? a;
|
|
54
55
|
}
|
|
55
|
-
function
|
|
56
|
-
let { min:
|
|
57
|
-
return
|
|
58
|
-
}
|
|
59
|
-
function u(e, t, n) {
|
|
60
|
-
return n <= t ? 0 : (r(e, t, n) - t) / (n - t) * 100;
|
|
56
|
+
function u(e, t) {
|
|
57
|
+
let { min: n, max: i } = r(t.min, t.max), a = o(t.marks, n, i);
|
|
58
|
+
return a.length > 0 ? l(e, a, n, i) : s(e, n, i, t.step);
|
|
61
59
|
}
|
|
62
60
|
function d(e, t, n) {
|
|
63
|
-
|
|
64
|
-
let i = r(e, 0, 100);
|
|
65
|
-
return t + (n - t) * i / 100;
|
|
61
|
+
return n <= t ? 0 : (i(e, t, n) - t) / (n - t) * 100;
|
|
66
62
|
}
|
|
67
|
-
function f(e, t, n
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
63
|
+
function f(e, t, n) {
|
|
64
|
+
if (n <= t) return t;
|
|
65
|
+
let r = i(e, 0, 100);
|
|
66
|
+
return t + (n - t) * r / 100;
|
|
67
|
+
}
|
|
68
|
+
function p(t, n, r, i, a = e) {
|
|
69
|
+
return a === "index" && n.length > 1 ? t / (n.length - 1) * 100 : a === "index" ? 0 : d(n[t]?.value ?? r, r, i);
|
|
70
|
+
}
|
|
71
|
+
function m(t, n, r, a, o = e) {
|
|
72
|
+
if (!n.length) return;
|
|
73
|
+
let s = i(t, 0, 100), c = n[0], l = Math.abs(s - p(0, n, r, a, o));
|
|
74
|
+
for (let e = 1; e < n.length; e += 1) {
|
|
75
|
+
let t = Math.abs(s - p(e, n, r, a, o));
|
|
76
|
+
t < l && (c = n[e], l = t);
|
|
76
77
|
}
|
|
77
|
-
return
|
|
78
|
+
return c;
|
|
78
79
|
}
|
|
79
|
-
function
|
|
80
|
-
let { min:
|
|
81
|
-
return
|
|
80
|
+
function h(e, t) {
|
|
81
|
+
let { min: n, max: i } = r(t.min, t.max), a = o(t.marks, n, i);
|
|
82
|
+
return a.length > 0 ? m(e, a, n, i, t.marksPosition)?.value ?? n : s(f(e, n, i), n, i, t.step);
|
|
82
83
|
}
|
|
83
|
-
function
|
|
84
|
-
let { min: u, max: d } =
|
|
84
|
+
function g(e, t, n, c = n.min, l = n.max) {
|
|
85
|
+
let { min: u, max: d } = r(c, l), f = o(n.marks, u, d);
|
|
85
86
|
if (f.length > 0) {
|
|
86
|
-
let n = f.map((e) => e.value),
|
|
87
|
+
let n = f.map((e) => e.value), r = 0, a = Math.abs(e - n[0]);
|
|
87
88
|
for (let t = 1; t < n.length; t += 1) {
|
|
88
|
-
let
|
|
89
|
-
|
|
89
|
+
let i = Math.abs(e - n[t]);
|
|
90
|
+
i < a && (a = i, r = t);
|
|
90
91
|
}
|
|
91
|
-
return n[r
|
|
92
|
+
return n[i(r + t, 0, n.length - 1)];
|
|
92
93
|
}
|
|
93
|
-
let p =
|
|
94
|
-
return
|
|
94
|
+
let p = a(n.step);
|
|
95
|
+
return s(e + t * p, u, d, p);
|
|
95
96
|
}
|
|
96
97
|
//#endregion
|
|
97
|
-
export {
|
|
98
|
+
export { i as clampNumberScaleValue, c as findClosestNumberScaleMark, m as findClosestNumberScaleMarkByPercent, p as getNumberScaleMarkPercent, a as normalizeNumberScaleStep, g as offsetNumberScaleValue, f as percentToNumberScaleValue, h as percentToSnappedNumberScaleValue, o as prepareNumberScaleMarks, r as resolveNumberScaleBounds, u as snapNumberScaleValue, l as snapNumberScaleValueToMarks, s as snapNumberScaleValueToStep, d as valueToNumberScalePercent };
|
|
98
99
|
|
|
99
100
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/number-scale/numberScale.ts"],"sourcesContent":["import { NumberScaleBounds, NumberScaleMark, NumberScaleMarksPosition, NumberScaleOptions } from \"./types\";\n\nfunction countFractionDigits(value: number) {\n\tif (!Number.isFinite(value)) {\n\t\treturn 0;\n\t}\n\n\tconst normalized = value.toString().toLowerCase();\n\tconst exponentIndex = normalized.indexOf(\"e-\");\n\tif (exponentIndex >= 0) {\n\t\treturn Number(normalized.slice(exponentIndex + 2));\n\t}\n\n\tconst dotIndex = normalized.indexOf(\".\");\n\treturn dotIndex >= 0 ? normalized.length - dotIndex - 1 : 0;\n}\n\nfunction roundWithPrecision(value: number, precision: number) {\n\tif (precision <= 0) {\n\t\treturn Math.round(value);\n\t}\n\n\tconst factor = 10 ** precision;\n\treturn Math.round(value * factor) / factor;\n}\n\n/**\n * Возвращает безопасные границы числовой шкалы и меняет их местами, если min больше max.\n */\nexport function resolveNumberScaleBounds(min: number, max: number): NumberScaleBounds {\n\tif (!Number.isFinite(min) || !Number.isFinite(max)) {\n\t\treturn { min: 0, max: 100 };\n\t}\n\n\treturn min <= max ? { min, max } : { min: max, max: min };\n}\n\n/**\n * Ограничивает значение конечными границами шкалы.\n */\nexport function clampNumberScaleValue(value: number, min: number, max: number) {\n\tif (!Number.isFinite(value)) {\n\t\treturn min;\n\t}\n\n\treturn Math.min(max, Math.max(min, value));\n}\n\n/**\n * Нормализует шаг шкалы: некорректные, нулевые и отрицательные значения заменяет на 1.\n */\nexport function normalizeNumberScaleStep(step?: number) {\n\tif (!Number.isFinite(step) || step === undefined || step <= 0) {\n\t\treturn 1;\n\t}\n\n\treturn step;\n}\n\n/**\n * Фильтрует, сортирует и дедуплицирует marks по finite value внутри границ шкалы.\n */\nexport function prepareNumberScaleMarks<TMark extends NumberScaleMark>(\n\tmarks: readonly TMark[] | undefined,\n\tmin: number,\n\tmax: number\n): TMark[] {\n\tif (!marks?.length) {\n\t\treturn [];\n\t}\n\n\tconst seen = new Set<number>();\n\n\treturn marks\n\t\t.filter((mark) => Number.isFinite(mark.value) && mark.value >= min && mark.value <= max)\n\t\t.slice()\n\t\t.sort((left, right) => left.value - right.value)\n\t\t.filter((mark) => {\n\t\t\tif (seen.has(mark.value)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tseen.add(mark.value);\n\t\t\treturn true;\n\t\t});\n}\n\n/**\n * Привязывает значение к ближайшему шагу с учётом десятичной точности min/max/step.\n */\nexport function snapNumberScaleValueToStep(value: number, min: number, max: number, step?: number) {\n\tconst normalizedStep = normalizeNumberScaleStep(step);\n\tconst clamped = clampNumberScaleValue(value, min, max);\n\tconst precision = Math.max(countFractionDigits(normalizedStep), countFractionDigits(min), countFractionDigits(max));\n\tconst snapped = min + Math.round((clamped - min) / normalizedStep) * normalizedStep;\n\n\treturn clampNumberScaleValue(roundWithPrecision(snapped, precision), min, max);\n}\n\n/**\n * Возвращает ближайший mark по числовому value.\n */\nexport function findClosestNumberScaleMark<TMark extends NumberScaleMark>(value: number, marks: readonly TMark[]) {\n\tif (!marks.length) {\n\t\treturn undefined;\n\t}\n\n\tlet nearest = marks[0];\n\tlet distance = Math.abs(value - nearest.value);\n\n\tfor (let index = 1; index < marks.length; index += 1) {\n\t\tconst mark = marks[index];\n\t\tconst nextDistance = Math.abs(value - mark.value);\n\n\t\tif (nextDistance < distance) {\n\t\t\tnearest = mark;\n\t\t\tdistance = nextDistance;\n\t\t}\n\t}\n\n\treturn nearest;\n}\n\n/**\n * Привязывает значение к value ближайшего mark.\n */\nexport function snapNumberScaleValueToMarks<TMark extends NumberScaleMark>(\n\tvalue: number,\n\tmarks: readonly TMark[],\n\tmin: number,\n\tmax: number\n) {\n\tif (!marks.length) {\n\t\treturn clampNumberScaleValue(value, min, max);\n\t}\n\n\tconst clamped = clampNumberScaleValue(value, min, max);\n\treturn findClosestNumberScaleMark(clamped, marks)?.value ?? clamped;\n}\n\n/**\n * Привязывает значение к marks, если они есть, иначе к step.\n */\nexport function snapNumberScaleValue<TMark extends NumberScaleMark>(value: number, options: NumberScaleOptions<TMark>) {\n\tconst { min, max } = resolveNumberScaleBounds(options.min, options.max);\n\tconst preparedMarks = prepareNumberScaleMarks(options.marks, min, max);\n\n\tif (preparedMarks.length > 0) {\n\t\treturn snapNumberScaleValueToMarks(value, preparedMarks, min, max);\n\t}\n\n\treturn snapNumberScaleValueToStep(value, min, max, options.step);\n}\n\nexport function valueToNumberScalePercent(value: number, min: number, max: number) {\n\tif (max <= min) {\n\t\treturn 0;\n\t}\n\n\treturn ((clampNumberScaleValue(value, min, max) - min) / (max - min)) * 100;\n}\n\nexport function percentToNumberScaleValue(percent: number, min: number, max: number) {\n\tif (max <= min) {\n\t\treturn min;\n\t}\n\n\tconst safePercent = clampNumberScaleValue(percent, 0, 100);\n\treturn min + ((max - min) * safePercent) / 100;\n}\n\n/**\n * Возвращает позицию mark в процентах: по числовому value или равномерно по индексу.\n */\nexport function getNumberScaleMarkPercent(\n\tmarkIndex: number,\n\tmarks: readonly NumberScaleMark[],\n\tmin: number,\n\tmax: number,\n\tmarksPosition: NumberScaleMarksPosition = \"value\"\n) {\n\tif (marksPosition === \"index\" && marks.length > 1) {\n\t\treturn (markIndex / (marks.length - 1)) * 100;\n\t}\n\n\tif (marksPosition === \"index\") {\n\t\treturn 0;\n\t}\n\n\treturn valueToNumberScalePercent(marks[markIndex]?.value ?? min, min, max);\n}\n\n/**\n * Находит ближайший mark по визуальной позиции процента.\n */\nexport function findClosestNumberScaleMarkByPercent<TMark extends NumberScaleMark>(\n\tpercent: number,\n\tmarks: readonly TMark[],\n\tmin: number,\n\tmax: number,\n\tmarksPosition: NumberScaleMarksPosition = \"value\"\n) {\n\tif (!marks.length) {\n\t\treturn undefined;\n\t}\n\n\tconst safePercent = clampNumberScaleValue(percent, 0, 100);\n\tlet nearest = marks[0];\n\tlet distance = Math.abs(safePercent - getNumberScaleMarkPercent(0, marks, min, max, marksPosition));\n\n\tfor (let index = 1; index < marks.length; index += 1) {\n\t\tconst nextDistance = Math.abs(safePercent - getNumberScaleMarkPercent(index, marks, min, max, marksPosition));\n\n\t\tif (nextDistance < distance) {\n\t\t\tnearest = marks[index];\n\t\t\tdistance = nextDistance;\n\t\t}\n\t}\n\n\treturn nearest;\n}\n\n/**\n * Преобразует pointer percent в значение шкалы с учётом равномерного позиционирования marks.\n */\nexport function percentToSnappedNumberScaleValue<TMark extends NumberScaleMark>(percent: number, options: NumberScaleOptions<TMark>) {\n\tconst { min, max } = resolveNumberScaleBounds(options.min, options.max);\n\tconst preparedMarks = prepareNumberScaleMarks(options.marks, min, max);\n\n\tif (preparedMarks.length > 0) {\n\t\tconst closestMark = findClosestNumberScaleMarkByPercent(percent, preparedMarks, min, max, options.marksPosition);\n\t\treturn closestMark?.value ?? min;\n\t}\n\n\treturn snapNumberScaleValueToStep(percentToNumberScaleValue(percent, min, max), min, max, options.step);\n}\n\n/**\n * Смещает значение на offset шагов или на offset marks.\n */\nexport function offsetNumberScaleValue<TMark extends NumberScaleMark>(\n\tcurrentValue: number,\n\toffset: number,\n\toptions: NumberScaleOptions<TMark>,\n\tlowerBound = options.min,\n\tupperBound = options.max\n) {\n\tconst { min, max } = resolveNumberScaleBounds(lowerBound, upperBound);\n\tconst preparedMarks = prepareNumberScaleMarks(options.marks, min, max);\n\n\tif (preparedMarks.length > 0) {\n\t\tconst values = preparedMarks.map((mark) => mark.value);\n\t\tlet nearestIndex = 0;\n\t\tlet nearestDistance = Math.abs(currentValue - values[0]);\n\n\t\tfor (let index = 1; index < values.length; index += 1) {\n\t\t\tconst nextDistance = Math.abs(currentValue - values[index]);\n\t\t\tif (nextDistance < nearestDistance) {\n\t\t\t\tnearestDistance = nextDistance;\n\t\t\t\tnearestIndex = index;\n\t\t\t}\n\t\t}\n\n\t\tconst nextIndex = clampNumberScaleValue(nearestIndex + offset, 0, values.length - 1);\n\t\treturn values[nextIndex];\n\t}\n\n\tconst normalizedStep = normalizeNumberScaleStep(options.step);\n\treturn snapNumberScaleValueToStep(currentValue + offset * normalizedStep, min, max, normalizedStep);\n}\n"],"mappings":";AAEA,SAAS,EAAoB,GAAe;CAC3C,IAAI,CAAC,OAAO,SAAS,CAAK,GACzB,OAAO;CAGR,IAAM,IAAa,EAAM,SAAS,CAAC,CAAC,YAAY,GAC1C,IAAgB,EAAW,QAAQ,IAAI;CAC7C,IAAI,KAAiB,GACpB,OAAO,OAAO,EAAW,MAAM,IAAgB,CAAC,CAAC;CAGlD,IAAM,IAAW,EAAW,QAAQ,GAAG;CACvC,OAAO,KAAY,IAAI,EAAW,SAAS,IAAW,IAAI;AAC3D;AAEA,SAAS,EAAmB,GAAe,GAAmB;CAC7D,IAAI,KAAa,GAChB,OAAO,KAAK,MAAM,CAAK;CAGxB,IAAM,IAAS,MAAM;CACrB,OAAO,KAAK,MAAM,IAAQ,CAAM,IAAI;AACrC;AAKA,SAAgB,EAAyB,GAAa,GAAgC;CAKrF,OAJI,CAAC,OAAO,SAAS,CAAG,KAAK,CAAC,OAAO,SAAS,CAAG,IACzC;EAAE,KAAK;EAAG,KAAK;CAAI,IAGpB,KAAO,IAAM;EAAE;EAAK;CAAI,IAAI;EAAE,KAAK;EAAK,KAAK;CAAI;AACzD;AAKA,SAAgB,EAAsB,GAAe,GAAa,GAAa;CAK9E,OAJK,OAAO,SAAS,CAAK,IAInB,KAAK,IAAI,GAAK,KAAK,IAAI,GAAK,CAAK,CAAC,IAHjC;AAIT;AAKA,SAAgB,EAAyB,GAAe;CAKvD,OAJI,CAAC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iB,GAAoC;CACpI,IAAM,EAAE,QAAK,WAAQ,EAAyB,EAAQ,KAAK,EAAQ,GAAG,GAChE,IAAgB,EAAwB,EAAQ,OAAO,GAAK,CAAG;CAOrE,OALI,EAAc,SAAS,IACN,EAAoC,GAAS,GAAe,GAAK,GAAK,EAAQ,aAC3F,CAAA,EAAa,SAAS,IAGvB,EAA2B,EAA0B,GAAS,GAAK,CAAG,GAAG,GAAK,GAAK,EAAQ,IAAI;AACvG;AAKA,SAAgB,EACf,GACA,GACA,GACA,IAAa,EAAQ,KACrB,IAAa,EAAQ,KACpB;CACD,IAAM,EAAE,QAAK,WAAQ,EAAyB,GAAY,CAAU,GAC9D,IAAgB,EAAwB,EAAQ,OAAO,GAAK,CAAG;CAErE,IAAI,EAAc,SAAS,GAAG;EAC7B,IAAM,IAAS,EAAc,KAAK,MAAS,EAAK,KAAK,GACjD,IAAe,GACf,IAAkB,KAAK,IAAI,IAAe,EAAO,EAAE;EAEvD,KAAK,IAAI,IAAQ,GAAG,IAAQ,EAAO,QAAQ,KAAS,GAAG;GACtD,IAAM,IAAe,KAAK,IAAI,IAAe,EAAO,EAAM;GAC1D,AAAI,IAAe,MAClB,IAAkB,GAClB,IAAe;EAEjB;EAGA,OAAO,EADW,EAAsB,IAAe,GAAQ,GAAG,EAAO,SAAS,CACpE;CACf;CAEA,IAAM,IAAiB,EAAyB,EAAQ,IAAI;CAC5D,OAAO,EAA2B,IAAe,IAAS,GAAgB,GAAK,GAAK,CAAc;AACnG"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/number-scale/marksPositionConstants.ts","../../src/number-scale/numberScale.ts"],"sourcesContent":["/** Режимы размещения marks сохраняют единые значения для расчётов и публичного union-типа. */\nexport const NUMBER_SCALE_MARKS_POSITION_VALUE = \"value\";\nexport const NUMBER_SCALE_MARKS_POSITION_INDEX = \"index\";\n","import { NUMBER_SCALE_MARKS_POSITION_VALUE, NUMBER_SCALE_MARKS_POSITION_INDEX } from \"./marksPositionConstants\";\nimport { type NumberScaleBounds, type NumberScaleMark, type NumberScaleMarksPosition, type NumberScaleOptions } from \"./types\";\n\nconst NUMBER_SCALE_PERCENT_MAX = 100;\nconst NUMBER_SCALE_DEFAULT_MAX = 100;\n\nfunction countFractionDigits(value: number) {\n\tif (!Number.isFinite(value)) {\n\t\treturn 0;\n\t}\n\n\tconst normalized = value.toString().toLowerCase();\n\tconst exponentIndex = normalized.indexOf(\"e-\");\n\tif (exponentIndex >= 0) {\n\t\treturn Number(normalized.slice(exponentIndex + 2));\n\t}\n\n\tconst dotIndex = normalized.indexOf(\".\");\n\treturn dotIndex >= 0 ? normalized.length - dotIndex - 1 : 0;\n}\n\nfunction roundWithPrecision(value: number, precision: number) {\n\tif (precision <= 0) {\n\t\treturn Math.round(value);\n\t}\n\n\tconst factor = 10 ** precision;\n\treturn Math.round(value * factor) / factor;\n}\n\n/**\n * Возвращает безопасные границы числовой шкалы и меняет их местами, если min больше max.\n */\nexport function resolveNumberScaleBounds(min: number, max: number): NumberScaleBounds {\n\tif (!Number.isFinite(min) || !Number.isFinite(max)) {\n\t\treturn { min: 0, max: NUMBER_SCALE_DEFAULT_MAX };\n\t}\n\n\treturn min <= max ? { min, max } : { min: max, max: min };\n}\n\n/**\n * Ограничивает значение конечными границами шкалы.\n */\nexport function clampNumberScaleValue(value: number, min: number, max: number) {\n\tif (!Number.isFinite(value)) {\n\t\treturn min;\n\t}\n\n\treturn Math.min(max, Math.max(min, value));\n}\n\n/**\n * Нормализует шаг шкалы: некорректные, нулевые и отрицательные значения заменяет на 1.\n */\nexport function normalizeNumberScaleStep(step?: number) {\n\tif (!Number.isFinite(step) || step === undefined || step <= 0) {\n\t\treturn 1;\n\t}\n\n\treturn step;\n}\n\n/**\n * Фильтрует, сортирует и дедуплицирует marks по finite value внутри границ шкалы.\n */\nexport function prepareNumberScaleMarks<TMark extends NumberScaleMark>(\n\tmarks: readonly TMark[] | undefined,\n\tmin: number,\n\tmax: number\n): TMark[] {\n\tif (!marks?.length) {\n\t\treturn [];\n\t}\n\n\tconst seen = new Set<number>();\n\n\treturn marks\n\t\t.filter((mark) => Number.isFinite(mark.value) && mark.value >= min && mark.value <= max)\n\t\t.slice()\n\t\t.sort((left, right) => left.value - right.value)\n\t\t.filter((mark) => {\n\t\t\tif (seen.has(mark.value)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tseen.add(mark.value);\n\t\t\treturn true;\n\t\t});\n}\n\n/**\n * Привязывает значение к ближайшему шагу с учётом десятичной точности min/max/step.\n */\nexport function snapNumberScaleValueToStep(value: number, min: number, max: number, step?: number) {\n\tconst normalizedStep = normalizeNumberScaleStep(step);\n\tconst clamped = clampNumberScaleValue(value, min, max);\n\tconst precision = Math.max(countFractionDigits(normalizedStep), countFractionDigits(min), countFractionDigits(max));\n\tconst snapped = min + Math.round((clamped - min) / normalizedStep) * normalizedStep;\n\n\treturn clampNumberScaleValue(roundWithPrecision(snapped, precision), min, max);\n}\n\n/**\n * Возвращает ближайший mark по числовому value.\n */\nexport function findClosestNumberScaleMark<TMark extends NumberScaleMark>(value: number, marks: readonly TMark[]) {\n\tif (!marks.length) {\n\t\treturn undefined;\n\t}\n\n\tlet nearest = marks[0];\n\tlet distance = Math.abs(value - nearest.value);\n\n\tfor (let index = 1; index < marks.length; index += 1) {\n\t\tconst mark = marks[index];\n\t\tconst nextDistance = Math.abs(value - mark.value);\n\n\t\tif (nextDistance < distance) {\n\t\t\tnearest = mark;\n\t\t\tdistance = nextDistance;\n\t\t}\n\t}\n\n\treturn nearest;\n}\n\n/**\n * Привязывает значение к value ближайшего mark.\n */\nexport function snapNumberScaleValueToMarks<TMark extends NumberScaleMark>(\n\tvalue: number,\n\tmarks: readonly TMark[],\n\tmin: number,\n\tmax: number\n) {\n\tif (!marks.length) {\n\t\treturn clampNumberScaleValue(value, min, max);\n\t}\n\n\tconst clamped = clampNumberScaleValue(value, min, max);\n\treturn findClosestNumberScaleMark(clamped, marks)?.value ?? clamped;\n}\n\n/**\n * Привязывает значение к marks, если они есть, иначе к step.\n */\nexport function snapNumberScaleValue<TMark extends NumberScaleMark>(value: number, options: NumberScaleOptions<TMark>) {\n\tconst { min, max } = resolveNumberScaleBounds(options.min, options.max);\n\tconst preparedMarks = prepareNumberScaleMarks(options.marks, min, max);\n\n\tif (preparedMarks.length > 0) {\n\t\treturn snapNumberScaleValueToMarks(value, preparedMarks, min, max);\n\t}\n\n\treturn snapNumberScaleValueToStep(value, min, max, options.step);\n}\n\nexport function valueToNumberScalePercent(value: number, min: number, max: number) {\n\tif (max <= min) {\n\t\treturn 0;\n\t}\n\n\treturn ((clampNumberScaleValue(value, min, max) - min) / (max - min)) * NUMBER_SCALE_PERCENT_MAX;\n}\n\nexport function percentToNumberScaleValue(percent: number, min: number, max: number) {\n\tif (max <= min) {\n\t\treturn min;\n\t}\n\n\tconst safePercent = clampNumberScaleValue(percent, 0, NUMBER_SCALE_PERCENT_MAX);\n\treturn min + ((max - min) * safePercent) / NUMBER_SCALE_PERCENT_MAX;\n}\n\n/**\n * Возвращает позицию mark в процентах: по числовому value или равномерно по индексу.\n */\nexport function getNumberScaleMarkPercent(\n\tmarkIndex: number,\n\tmarks: readonly NumberScaleMark[],\n\tmin: number,\n\tmax: number,\n\tmarksPosition: NumberScaleMarksPosition = NUMBER_SCALE_MARKS_POSITION_VALUE\n) {\n\tif (marksPosition === NUMBER_SCALE_MARKS_POSITION_INDEX && marks.length > 1) {\n\t\treturn (markIndex / (marks.length - 1)) * NUMBER_SCALE_PERCENT_MAX;\n\t}\n\n\tif (marksPosition === NUMBER_SCALE_MARKS_POSITION_INDEX) {\n\t\treturn 0;\n\t}\n\n\treturn valueToNumberScalePercent(marks[markIndex]?.value ?? min, min, max);\n}\n\n/**\n * Находит ближайший mark по визуальной позиции процента.\n */\nexport function findClosestNumberScaleMarkByPercent<TMark extends NumberScaleMark>(\n\tpercent: number,\n\tmarks: readonly TMark[],\n\tmin: number,\n\tmax: number,\n\tmarksPosition: NumberScaleMarksPosition = NUMBER_SCALE_MARKS_POSITION_VALUE\n) {\n\tif (!marks.length) {\n\t\treturn undefined;\n\t}\n\n\tconst safePercent = clampNumberScaleValue(percent, 0, NUMBER_SCALE_PERCENT_MAX);\n\tlet nearest = marks[0];\n\tlet distance = Math.abs(safePercent - getNumberScaleMarkPercent(0, marks, min, max, marksPosition));\n\n\tfor (let index = 1; index < marks.length; index += 1) {\n\t\tconst nextDistance = Math.abs(safePercent - getNumberScaleMarkPercent(index, marks, min, max, marksPosition));\n\n\t\tif (nextDistance < distance) {\n\t\t\tnearest = marks[index];\n\t\t\tdistance = nextDistance;\n\t\t}\n\t}\n\n\treturn nearest;\n}\n\n/**\n * Преобразует pointer percent в значение шкалы с учётом равномерного позиционирования marks.\n */\nexport function percentToSnappedNumberScaleValue<TMark extends NumberScaleMark>(percent: number, options: NumberScaleOptions<TMark>) {\n\tconst { min, max } = resolveNumberScaleBounds(options.min, options.max);\n\tconst preparedMarks = prepareNumberScaleMarks(options.marks, min, max);\n\n\tif (preparedMarks.length > 0) {\n\t\tconst closestMark = findClosestNumberScaleMarkByPercent(percent, preparedMarks, min, max, options.marksPosition);\n\t\treturn closestMark?.value ?? min;\n\t}\n\n\treturn snapNumberScaleValueToStep(percentToNumberScaleValue(percent, min, max), min, max, options.step);\n}\n\n/**\n * Смещает значение на offset шагов или на offset marks.\n */\nexport function offsetNumberScaleValue<TMark extends NumberScaleMark>(\n\tcurrentValue: number,\n\toffset: number,\n\toptions: NumberScaleOptions<TMark>,\n\tlowerBound = options.min,\n\tupperBound = options.max\n) {\n\tconst { min, max } = resolveNumberScaleBounds(lowerBound, upperBound);\n\tconst preparedMarks = prepareNumberScaleMarks(options.marks, min, max);\n\n\tif (preparedMarks.length > 0) {\n\t\tconst values = preparedMarks.map((mark) => mark.value);\n\t\tlet nearestIndex = 0;\n\t\tlet nearestDistance = Math.abs(currentValue - values[0]);\n\n\t\tfor (let index = 1; index < values.length; index += 1) {\n\t\t\tconst nextDistance = Math.abs(currentValue - values[index]);\n\t\t\tif (nextDistance < nearestDistance) {\n\t\t\t\tnearestDistance = nextDistance;\n\t\t\t\tnearestIndex = index;\n\t\t\t}\n\t\t}\n\n\t\tconst nextIndex = clampNumberScaleValue(nearestIndex + offset, 0, values.length - 1);\n\t\treturn values[nextIndex];\n\t}\n\n\tconst normalizedStep = normalizeNumberScaleStep(options.step);\n\treturn snapNumberScaleValueToStep(currentValue + offset * normalizedStep, min, max, normalizedStep);\n}\n"],"mappings":";AACA,IAAa,IAAoC;ACKjD,SAAS,EAAoB,GAAe;CAC3C,IAAI,CAAC,OAAO,SAAS,CAAK,GACzB,OAAO;CAGR,IAAM,IAAa,EAAM,SAAS,CAAC,CAAC,YAAY,GAC1C,IAAgB,EAAW,QAAQ,IAAI;CAC7C,IAAI,KAAiB,GACpB,OAAO,OAAO,EAAW,MAAM,IAAgB,CAAC,CAAC;CAGlD,IAAM,IAAW,EAAW,QAAQ,GAAG;CACvC,OAAO,KAAY,IAAI,EAAW,SAAS,IAAW,IAAI;AAC3D;AAEA,SAAS,EAAmB,GAAe,GAAmB;CAC7D,IAAI,KAAa,GAChB,OAAO,KAAK,MAAM,CAAK;CAGxB,IAAM,IAAS,MAAM;CACrB,OAAO,KAAK,MAAM,IAAQ,CAAM,IAAI;AACrC;AAKA,SAAgB,EAAyB,GAAa,GAAgC;CAKrF,OAJI,CAAC,OAAO,SAAS,CAAG,KAAK,CAAC,OAAO,SAAS,CAAG,IACzC;EAAE,KAAK;EAAG,KAAK;CAAyB,IAGzC,KAAO,IAAM;EAAE;EAAK;CAAI,IAAI;EAAE,KAAK;EAAK,KAAK;CAAI;AACzD;AAKA,SAAgB,EAAsB,GAAe,GAAa,GAAa;CAK9E,OAJK,OAAO,SAAS,CAAK,IAInB,KAAK,IAAI,GAAK,KAAK,IAAI,GAAK,CAAK,CAAC,IAHjC;AAIT;AAKA,SAAgB,EAAyB,GAAe;CAKvD,OAJI,CAAC,OAAO,SAAS,CAAI,KAAK,MAAS,KAAA,KA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AAQ,EAAyB,EAAQ,KAAK,EAAQ,GAAG,GAChE,IAAgB,EAAwB,EAAQ,OAAO,GAAK,CAAG;CAOrE,OALI,EAAc,SAAS,IACN,EAAoC,GAAS,GAAe,GAAK,GAAK,EAAQ,aAC3F,CAAA,EAAa,SAAS,IAGvB,EAA2B,EAA0B,GAAS,GAAK,CAAG,GAAG,GAAK,GAAK,EAAQ,IAAI;AACvG;AAKA,SAAgB,EACf,GACA,GACA,GACA,IAAa,EAAQ,KACrB,IAAa,EAAQ,KACpB;CACD,IAAM,EAAE,QAAK,WAAQ,EAAyB,GAAY,CAAU,GAC9D,IAAgB,EAAwB,EAAQ,OAAO,GAAK,CAAG;CAErE,IAAI,EAAc,SAAS,GAAG;EAC7B,IAAM,IAAS,EAAc,KAAK,MAAS,EAAK,KAAK,GACjD,IAAe,GACf,IAAkB,KAAK,IAAI,IAAe,EAAO,EAAE;EAEvD,KAAK,IAAI,IAAQ,GAAG,IAAQ,EAAO,QAAQ,KAAS,GAAG;GACtD,IAAM,IAAe,KAAK,IAAI,IAAe,EAAO,EAAM;GAC1D,AAAI,IAAe,MAClB,IAAkB,GAClB,IAAe;EAEjB;EAGA,OAAO,EADW,EAAsB,IAAe,GAAQ,GAAG,EAAO,SAAS,CACpE;CACf;CAEA,IAAM,IAAiB,EAAyB,EAAQ,IAAI;CAC5D,OAAO,EAA2B,IAAe,IAAS,GAAgB,GAAK,GAAK,CAAc;AACnG"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Режимы размещения marks сохраняют единые значения для расчётов и публичного union-типа. */
|
|
2
|
+
export declare const NUMBER_SCALE_MARKS_POSITION_VALUE = "value";
|
|
3
|
+
export declare const NUMBER_SCALE_MARKS_POSITION_INDEX = "index";
|
|
4
|
+
//# sourceMappingURL=marksPositionConstants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marksPositionConstants.d.ts","sourceRoot":"","sources":["../../src/number-scale/marksPositionConstants.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,eAAO,MAAM,iCAAiC,UAAU,CAAC;AACzD,eAAO,MAAM,iCAAiC,UAAU,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NumberScaleBounds, NumberScaleMark, NumberScaleMarksPosition, NumberScaleOptions } from "./types";
|
|
1
|
+
import { type NumberScaleBounds, type NumberScaleMark, type NumberScaleMarksPosition, type NumberScaleOptions } from "./types";
|
|
2
2
|
/**
|
|
3
3
|
* Возвращает безопасные границы числовой шкалы и меняет их местами, если min больше max.
|
|
4
4
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"numberScale.d.ts","sourceRoot":"","sources":["../../src/number-scale/numberScale.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"numberScale.d.ts","sourceRoot":"","sources":["../../src/number-scale/numberScale.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,iBAAiB,EAAE,KAAK,eAAe,EAAE,KAAK,wBAAwB,EAAE,KAAK,kBAAkB,EAAE,MAAM,SAAS,CAAC;AA6B/H;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,iBAAiB,CAMpF;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,UAM5E;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,CAAC,EAAE,MAAM,UAMrD;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,SAAS,eAAe,EACpE,KAAK,EAAE,SAAS,KAAK,EAAE,GAAG,SAAS,EACnC,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,GACT,KAAK,EAAE,CAmBT;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAA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C,KAAK,SAAS,eAAe,EACnE,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,kBAAkB,CAAC,KAAK,CAAC,EAClC,UAAU,SAAc,EACxB,UAAU,SAAc,UAwBxB"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { type NUMBER_SCALE_MARKS_POSITION_VALUE, type NUMBER_SCALE_MARKS_POSITION_INDEX } from "./marksPositionConstants";
|
|
1
2
|
/**
|
|
2
3
|
* Режим расчёта визуальных позиций marks.
|
|
3
4
|
* `value` использует числовую пропорцию, `index` расставляет marks равномерно.
|
|
4
5
|
*/
|
|
5
|
-
export type NumberScaleMarksPosition =
|
|
6
|
+
export type NumberScaleMarksPosition = typeof NUMBER_SCALE_MARKS_POSITION_VALUE | typeof NUMBER_SCALE_MARKS_POSITION_INDEX;
|
|
6
7
|
export interface NumberScaleMark {
|
|
7
8
|
/**
|
|
8
9
|
* Координата mark на внутренней числовой шкале.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/number-scale/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG,OAAO,GAAG,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/number-scale/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iCAAiC,EAAE,KAAK,iCAAiC,EAAE,MAAM,0BAA0B,CAAC;AAE1H;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG,OAAO,iCAAiC,GAAG,OAAO,iCAAiC,CAAC;AAE3H,MAAM,WAAW,eAAe;IAC/B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,kBAAkB,CAAC,KAAK,SAAS,eAAe,GAAG,eAAe;IAClF;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,KAAK,EAAE,CAAC;IACzB;;OAEG;IACH,aAAa,CAAC,EAAE,wBAAwB,CAAC;CACzC;AAED,MAAM,WAAW,iBAAiB;IACjC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;CACZ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../src/odata-service/builder.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../src/odata-service/builder.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EACN,KAAK,cAAc,EACnB,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EAEzB,KAAK,kBAAkB,EAEvB,KAAK,sBAAsB,EAC3B,MAAM,SAAS,CAAC;AAEjB,KAAK,qBAAqB,GAAG;IAC5B,UAAU,CAAC,EAAE,uBAAuB,EAAE,CAAC;CACvC,CAAC;AAwBF;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,qBAAqB,EAAE,MAAM,EAAE,sBAAsB,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAiC9H;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,sBAAsB,GAAG,MAAM,CAGtG;AAED;;GAEG;AACH,wBAAgB,6BAA6B,CAAC,QAAQ,EAAE,sBAAsB,EAAE,MAAM,EAAE,sBAAsB,GAAG,eAAe,CAQ/H;AAED,wBAAgB,wBAAwB,CACvC,QAAQ,EAAE,cAAc,EACxB,MAAM,EAAE,kBAAkB,EAC1B,MAAM,EAAE,sBAAsB,EAC9B,MAAM,EAAE,OAAO,CAAC,oBAAoB,EAAE,IAAI,CAAC,GACzC,MAAM,CAyBR;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACtC,QAAQ,EAAE,sBAAsB,EAChC,MAAM,EAAE,kBAAkB,EAC1B,MAAM,EAAE,sBAAsB,GAC5B,MAAM,CAMR;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,EAAE,sBAAsB,GAAG,MAAM,CAK5H"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"columns.d.ts","sourceRoot":"","sources":["../../src/odata-service/columns.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"columns.d.ts","sourceRoot":"","sources":["../../src/odata-service/columns.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAE/C;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,SAAS,QAAQ,CAAC,oBAAoB,CAAC,EAAE,GAAG,QAAQ,CAAC,oBAAoB,CAAC,EAAE,CAE7H;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,SAAS,QAAQ,CAAC,oBAAoB,CAAC,EAAE,GAAG,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAErH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entityOperationConstants.d.ts","sourceRoot":"","sources":["../../src/odata-service/entityOperationConstants.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,eAAO,MAAM,sBAAsB,WAAW,CAAC;AAC/C,eAAO,MAAM,qBAAqB,UAAU,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** Внутренние дискриминанты связывают типы фильтров, нормализацию и компиляцию. */
|
|
2
|
+
export declare const FILTER_KIND_SEGMENT = "segment";
|
|
3
|
+
export declare const FILTER_KIND_TREE = "tree";
|
|
4
|
+
export declare const FILTER_KIND_ADVANCED = "advanced";
|
|
5
|
+
export declare const FILTER_KIND_LOCAL = "local";
|
|
6
|
+
export declare const FILTER_KIND_REGISTERED = "registered";
|
|
7
|
+
export declare const FILTER_KIND_COLUMN = "column";
|
|
8
|
+
export declare const FILTER_BINDING_LIST = "list";
|
|
9
|
+
export declare const FILTER_BINDING_BOOLEAN = "boolean";
|
|
10
|
+
export declare const FILTER_BINDING_VALUE = "value";
|
|
11
|
+
export declare const FILTER_VALUE_SOURCE_STATIC = "static";
|
|
12
|
+
export declare const FILTER_VALUE_SOURCE_INPUT = "input";
|
|
13
|
+
export declare const FILTER_VALUE_MODE_SINGLE = "single";
|
|
14
|
+
export declare const FILTER_VALUE_MODE_MULTIPLE = "multiple";
|
|
15
|
+
/** Только встроенные component id; зарегистрированные consumer id остаются непрозрачными. */
|
|
16
|
+
export declare const FILTER_COMPONENT_SELECT = "select";
|
|
17
|
+
export declare const FILTER_COMPONENT_MULTI_SELECT = "multi-select";
|
|
18
|
+
export declare const FILTER_COMPONENT_TREE_SELECT = "tree-select";
|
|
19
|
+
export declare const FILTER_COMPONENT_TREE_MULTI_SELECT = "tree-multi-select";
|
|
20
|
+
export declare const FILTER_COMPONENT_CHECKBOX = "checkbox";
|
|
21
|
+
export declare const FILTER_COMPONENT_TEXT_INPUT = "text-input";
|
|
22
|
+
export declare const FILTER_COMPONENT_NUMBER_INPUT = "number-input";
|
|
23
|
+
export declare const FILTER_COMPONENT_ADVANCED_SEARCH_SELECT = "advanced-search-select";
|
|
24
|
+
//# sourceMappingURL=filterDefinitionConstants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filterDefinitionConstants.d.ts","sourceRoot":"","sources":["../../src/odata-service/filterDefinitionConstants.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,eAAO,MAAM,mBAAmB,YAAY,CAAC;AAC7C,eAAO,MAAM,gBAAgB,SAAS,CAAC;AACvC,eAAO,MAAM,oBAAoB,aAAa,CAAC;AAC/C,eAAO,MAAM,iBAAiB,UAAU,CAAC;AACzC,eAAO,MAAM,sBAAsB,eAAe,CAAC;AACnD,eAAO,MAAM,kBAAkB,WAAW,CAAC;AAE3C,eAAO,MAAM,mBAAmB,SAAS,CAAC;AAC1C,eAAO,MAAM,sBAAsB,YAAY,CAAC;AAChD,eAAO,MAAM,oBAAoB,UAAU,CAAC;AAC5C,eAAO,MAAM,0BAA0B,WAAW,CAAC;AACnD,eAAO,MAAM,yBAAyB,UAAU,CAAC;AACjD,eAAO,MAAM,wBAAwB,WAAW,CAAC;AACjD,eAAO,MAAM,0BAA0B,aAAa,CAAC;AAErD,6FAA6F;AAC7F,eAAO,MAAM,uBAAuB,WAAW,CAAC;AAChD,eAAO,MAAM,6BAA6B,iBAAiB,CAAC;AAC5D,eAAO,MAAM,4BAA4B,gBAAgB,CAAC;AAC1D,eAAO,MAAM,kCAAkC,sBAAsB,CAAC;AACtE,eAAO,MAAM,yBAAyB,aAAa,CAAC;AACpD,eAAO,MAAM,2BAA2B,eAAe,CAAC;AACxD,eAAO,MAAM,6BAA6B,iBAAiB,CAAC;AAC5D,eAAO,MAAM,uCAAuC,2BAA2B,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { BaseType, InputType } from "../types";
|
|
2
|
+
import { FILTER_BINDING_BOOLEAN, FILTER_BINDING_LIST, FILTER_BINDING_VALUE, type FILTER_COMPONENT_ADVANCED_SEARCH_SELECT, FILTER_COMPONENT_CHECKBOX, FILTER_COMPONENT_MULTI_SELECT, FILTER_COMPONENT_NUMBER_INPUT, FILTER_COMPONENT_SELECT, FILTER_COMPONENT_TEXT_INPUT, FILTER_COMPONENT_TREE_MULTI_SELECT, FILTER_COMPONENT_TREE_SELECT, FILTER_KIND_ADVANCED, FILTER_KIND_COLUMN, FILTER_KIND_LOCAL, FILTER_KIND_REGISTERED, FILTER_KIND_SEGMENT, FILTER_KIND_TREE, FILTER_VALUE_MODE_MULTIPLE, FILTER_VALUE_MODE_SINGLE, FILTER_VALUE_SOURCE_INPUT, FILTER_VALUE_SOURCE_STATIC } from "./filterDefinitionConstants";
|
|
3
|
+
import { type FILTER_LOGICAL_AND, FILTER_LOGICAL_OR } from "./filterOperationConstants";
|
|
2
4
|
import { type FilterExpression, type FilterOperation } from "./filters";
|
|
3
5
|
import type { BaseMetaType, ODataChainsMap } from "./types";
|
|
4
6
|
type RowRecord = Record<string, unknown>;
|
|
@@ -19,7 +21,7 @@ export type ODataFilterCondition = {
|
|
|
19
21
|
*/
|
|
20
22
|
columnId?: string;
|
|
21
23
|
operation: FilterOperation;
|
|
22
|
-
valueSource:
|
|
24
|
+
valueSource: typeof FILTER_VALUE_SOURCE_STATIC | typeof FILTER_VALUE_SOURCE_INPUT;
|
|
23
25
|
value?: BaseType;
|
|
24
26
|
};
|
|
25
27
|
export type ODataFilterConditionGroup = {
|
|
@@ -32,30 +34,30 @@ export type ODataFilterOption = {
|
|
|
32
34
|
filter?: ODataFilterConditionGroup;
|
|
33
35
|
};
|
|
34
36
|
export type ODataFilterBinding = {
|
|
35
|
-
kind:
|
|
37
|
+
kind: typeof FILTER_BINDING_LIST;
|
|
36
38
|
/** Связка выражений нескольких выбранных опций: `false`/отсутствие означает OR. */
|
|
37
39
|
and?: boolean;
|
|
38
40
|
options: ODataFilterOption[];
|
|
39
41
|
} | {
|
|
40
|
-
kind:
|
|
42
|
+
kind: typeof FILTER_BINDING_BOOLEAN;
|
|
41
43
|
trueFilter?: ODataFilterConditionGroup;
|
|
42
44
|
} | {
|
|
43
|
-
kind:
|
|
45
|
+
kind: typeof FILTER_BINDING_VALUE;
|
|
44
46
|
valueFilter?: ODataFilterConditionGroup;
|
|
45
47
|
};
|
|
46
|
-
export type FilterDefinitionKind =
|
|
48
|
+
export type FilterDefinitionKind = typeof FILTER_KIND_SEGMENT | typeof FILTER_KIND_TREE | typeof FILTER_KIND_ADVANCED | typeof FILTER_KIND_LOCAL | typeof FILTER_KIND_REGISTERED | typeof FILTER_KIND_COLUMN;
|
|
47
49
|
/** Форма controlled-значения зарегистрированного фильтра. */
|
|
48
|
-
export type FilterRegisteredValueMode =
|
|
49
|
-
export type FilterSegmentComponentId =
|
|
50
|
-
export type FilterTreeComponentId =
|
|
51
|
-
export type FilterLocalComponentId =
|
|
52
|
-
export type FilterAdvancedComponentId =
|
|
50
|
+
export type FilterRegisteredValueMode = typeof FILTER_VALUE_MODE_SINGLE | typeof FILTER_VALUE_MODE_MULTIPLE;
|
|
51
|
+
export type FilterSegmentComponentId = typeof FILTER_COMPONENT_MULTI_SELECT | typeof FILTER_COMPONENT_SELECT;
|
|
52
|
+
export type FilterTreeComponentId = typeof FILTER_COMPONENT_TREE_SELECT | typeof FILTER_COMPONENT_TREE_MULTI_SELECT;
|
|
53
|
+
export type FilterLocalComponentId = typeof FILTER_COMPONENT_SELECT | typeof FILTER_COMPONENT_MULTI_SELECT | typeof FILTER_COMPONENT_CHECKBOX | typeof FILTER_COMPONENT_TEXT_INPUT | typeof FILTER_COMPONENT_NUMBER_INPUT;
|
|
54
|
+
export type FilterAdvancedComponentId = typeof FILTER_COMPONENT_ADVANCED_SEARCH_SELECT;
|
|
53
55
|
export type FilterComponentId = FilterSegmentComponentId | FilterTreeComponentId | FilterLocalComponentId | FilterAdvancedComponentId;
|
|
54
56
|
export type ODataCompiledFilterDefinition = {
|
|
55
57
|
id: string;
|
|
56
58
|
ownerColumnId: string;
|
|
57
59
|
columnIds: string[];
|
|
58
|
-
kind: Extract<FilterDefinitionKind,
|
|
60
|
+
kind: Extract<FilterDefinitionKind, typeof FILTER_KIND_SEGMENT>;
|
|
59
61
|
componentId: FilterSegmentComponentId;
|
|
60
62
|
controlType: BaseMetaType;
|
|
61
63
|
dictionaryCodeKey?: string;
|
|
@@ -63,22 +65,22 @@ export type ODataCompiledFilterDefinition = {
|
|
|
63
65
|
id: string;
|
|
64
66
|
ownerColumnId: string;
|
|
65
67
|
columnIds: string[];
|
|
66
|
-
kind: Extract<FilterDefinitionKind,
|
|
68
|
+
kind: Extract<FilterDefinitionKind, typeof FILTER_KIND_TREE>;
|
|
67
69
|
componentId: FilterTreeComponentId;
|
|
68
70
|
controlType: BaseMetaType;
|
|
69
71
|
/** Оператор между выбранными значениями разных уровней дерева. */
|
|
70
|
-
levelOperator?:
|
|
72
|
+
levelOperator?: typeof FILTER_LOGICAL_AND | typeof FILTER_LOGICAL_OR;
|
|
71
73
|
} | {
|
|
72
74
|
id: string;
|
|
73
75
|
ownerColumnId: string;
|
|
74
76
|
columnIds: string[];
|
|
75
|
-
kind: Extract<FilterDefinitionKind,
|
|
77
|
+
kind: Extract<FilterDefinitionKind, typeof FILTER_KIND_LOCAL>;
|
|
76
78
|
componentId: FilterLocalComponentId;
|
|
77
79
|
controlType: BaseMetaType;
|
|
78
80
|
binding: ODataFilterBinding;
|
|
79
81
|
} | {
|
|
80
82
|
id: string;
|
|
81
|
-
kind: Extract<FilterDefinitionKind,
|
|
83
|
+
kind: Extract<FilterDefinitionKind, typeof FILTER_KIND_REGISTERED>;
|
|
82
84
|
/** Id непрозрачного runtime-компонента из внешнего registry. */
|
|
83
85
|
componentId: string;
|
|
84
86
|
controlType: BaseMetaType;
|
|
@@ -90,13 +92,13 @@ export type ODataCompiledFilterDefinition = {
|
|
|
90
92
|
} | {
|
|
91
93
|
id: string;
|
|
92
94
|
ownerColumnId: string;
|
|
93
|
-
kind: Extract<FilterDefinitionKind,
|
|
95
|
+
kind: Extract<FilterDefinitionKind, typeof FILTER_KIND_ADVANCED>;
|
|
94
96
|
componentId: FilterAdvancedComponentId;
|
|
95
97
|
configId: string;
|
|
96
98
|
} | {
|
|
97
99
|
id: string;
|
|
98
100
|
ownerColumnId: string;
|
|
99
|
-
kind: Extract<FilterDefinitionKind,
|
|
101
|
+
kind: Extract<FilterDefinitionKind, typeof FILTER_KIND_COLUMN>;
|
|
100
102
|
};
|
|
101
103
|
export declare function isFilterLocalComponentId(value: unknown): value is FilterLocalComponentId;
|
|
102
104
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filterDefinitions.d.ts","sourceRoot":"","sources":["../../src/odata-service/filterDefinitions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE/C,OAAO,EAA2C,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,WAAW,CAAC;AAEjH,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE5D,KAAK,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACzC,KAAK,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;AAEhD,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,eAAe,CAAC;AAC3D,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;AAEjE;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG;IAClC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,eAAe,CAAC;IAC3B,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"filterDefinitions.d.ts","sourceRoot":"","sources":["../../src/odata-service/filterDefinitions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE/C,OAAO,EACN,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,KAAK,uCAAuC,EAC5C,yBAAyB,EACzB,6BAA6B,EAC7B,6BAA6B,EAC7B,uBAAuB,EACvB,2BAA2B,EAC3B,kCAAkC,EAClC,4BAA4B,EAC5B,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,EACnB,gBAAgB,EAChB,0BAA0B,EAC1B,wBAAwB,EACxB,yBAAyB,EAC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,wBAAgB,sCAAsC,CACrD,WAAW,CAAC,EAAE,SAAS,6BAA6B,EAAE,EACtD,MAAM,CAAC,EAAE,iBAAiB,GACxB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAiC1B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Значения операторов общие для OData-условий и их компиляции; public map сохраняется. */
|
|
2
|
+
export declare const FILTER_OPERATION_EQ = "eq";
|
|
3
|
+
export declare const FILTER_OPERATION_NE = "ne";
|
|
4
|
+
export declare const FILTER_OPERATION_GT = "gt";
|
|
5
|
+
export declare const FILTER_OPERATION_GE = "ge";
|
|
6
|
+
export declare const FILTER_OPERATION_LT = "lt";
|
|
7
|
+
export declare const FILTER_OPERATION_LE = "le";
|
|
8
|
+
export declare const FILTER_OPERATION_STARTSWITH = "startswith";
|
|
9
|
+
export declare const FILTER_OPERATION_ENDSWITH = "endswith";
|
|
10
|
+
export declare const FILTER_OPERATION_CONTAINS = "contains";
|
|
11
|
+
/** Логическая связка относится к выражению, а не к конкретному UI фильтра. */
|
|
12
|
+
export declare const FILTER_LOGICAL_AND = "and";
|
|
13
|
+
export declare const FILTER_LOGICAL_OR = "or";
|
|
14
|
+
//# sourceMappingURL=filterOperationConstants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filterOperationConstants.d.ts","sourceRoot":"","sources":["../../src/odata-service/filterOperationConstants.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,eAAO,MAAM,mBAAmB,OAAO,CAAC;AACxC,eAAO,MAAM,mBAAmB,OAAO,CAAC;AACxC,eAAO,MAAM,mBAAmB,OAAO,CAAC;AACxC,eAAO,MAAM,mBAAmB,OAAO,CAAC;AACxC,eAAO,MAAM,mBAAmB,OAAO,CAAC;AACxC,eAAO,MAAM,mBAAmB,OAAO,CAAC;AACxC,eAAO,MAAM,2BAA2B,eAAe,CAAC;AACxD,eAAO,MAAM,yBAAyB,aAAa,CAAC;AACpD,eAAO,MAAM,yBAAyB,aAAa,CAAC;AAEpD,8EAA8E;AAC9E,eAAO,MAAM,kBAAkB,QAAQ,CAAC;AACxC,eAAO,MAAM,iBAAiB,OAAO,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filters.d.ts","sourceRoot":"","sources":["../../src/odata-service/filters.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"filters.d.ts","sourceRoot":"","sources":["../../src/odata-service/filters.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,eAAO,MAAM,eAAe;;;;;;;;;;EAUjB,CAAC;AAEZ,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC;AAErF,eAAO,MAAM,iBAAiB,EAAoD,SAAS,eAAe,EAAE,CAAC;AAgB7G,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,eAAe,CAE1E;AAED,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,eAAe,GAAG,MAAM,CAExE;AAED,MAAM,WAAW,eAAe,CAAC,CAAC;IACjC,GAAG,EAAE,MAAM,CAAC,CAAC;IACb,KAAK,EAAE,QAAQ,CAAC;IAChB,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,IAAI,CAAC,EAAE,aAAa,CAAC;CACrB;AAGD,MAAM,WAAW,oBAAoB;IACpC;;OAEG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;CACd;AAGD,MAAM,WAAW,yBAAyB,CAAC,CAAC,CAAE,SAAQ,oBAAoB;IACzE,UAAU,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC;IACjC,OAAO,CAAC,EAAE,KAAK,CAAC;CAChB;AAGD,MAAM,WAAW,sBAAsB,CAAC,C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