@ovok/native 1.10.3 → 1.10.4
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/lib/commonjs/modules/auth/default-translation.js +17 -0
- package/lib/commonjs/modules/auth/default-translation.js.map +1 -1
- package/lib/commonjs/modules/auth/hooks/use-session.js +3 -0
- package/lib/commonjs/modules/auth/hooks/use-session.js.map +1 -1
- package/lib/commonjs/modules/auth/register/components/form/register-form-provider.js +1 -0
- package/lib/commonjs/modules/auth/register/components/form/register-form-provider.js.map +1 -1
- package/lib/commonjs/modules/auth/reset-password/components/form/reset-password-form-provider.js +1 -0
- package/lib/commonjs/modules/auth/reset-password/components/form/reset-password-form-provider.js.map +1 -1
- package/lib/commonjs/modules/auth/session/session-store-refresh.js +125 -0
- package/lib/commonjs/modules/auth/session/session-store-refresh.js.map +1 -0
- package/lib/commonjs/modules/auth/session/session-store-request-state.js +73 -0
- package/lib/commonjs/modules/auth/session/session-store-request-state.js.map +1 -0
- package/lib/commonjs/modules/auth/session/session-store-types.js.map +1 -1
- package/lib/commonjs/modules/auth/session/session-store.js +36 -115
- package/lib/commonjs/modules/auth/session/session-store.js.map +1 -1
- package/lib/commonjs/modules/auth/utils/sign-in-error.js +4 -2
- package/lib/commonjs/modules/auth/utils/sign-in-error.js.map +1 -1
- package/lib/commonjs/modules/data-sync/components/apple/apple-health-authorization-provider.js.map +1 -1
- package/lib/commonjs/modules/data-sync/hooks/use-listen-changes.js.map +1 -1
- package/lib/commonjs/modules/data-sync/services/apple-health-sync-service.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/convert-generic-health-data.js +47 -21
- package/lib/commonjs/modules/data-sync/utils/convert-generic-health-data.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/convert-records-to-observation.js +19 -16
- package/lib/commonjs/modules/data-sync/utils/convert-records-to-observation.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/convert-samples-to-observation.js +17 -4
- package/lib/commonjs/modules/data-sync/utils/convert-samples-to-observation.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/get-samples-from-health.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/get-total-samples-count.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/health-data-catalog.js +168 -5
- package/lib/commonjs/modules/data-sync/utils/health-data-catalog.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/health-record-timing.js +52 -0
- package/lib/commonjs/modules/data-sync/utils/health-record-timing.js.map +1 -0
- package/lib/commonjs/modules/data-sync/utils/healthkit-data-types.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/normalize-core-health-observation.js +74 -0
- package/lib/commonjs/modules/data-sync/utils/normalize-core-health-observation.js.map +1 -0
- package/lib/commonjs/modules/picker-sheet/components/value-wheel-picker.js +41 -0
- package/lib/commonjs/modules/picker-sheet/components/value-wheel-picker.js.map +1 -0
- package/lib/commonjs/modules/picker-sheet/components/wheel-picker.js +56 -15
- package/lib/commonjs/modules/picker-sheet/components/wheel-picker.js.map +1 -1
- package/lib/commonjs/modules/picker-sheet/index.js +11 -0
- package/lib/commonjs/modules/picker-sheet/index.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/README.md +59 -20
- package/lib/commonjs/modules/questionnaire-response-form/components/content/questionnaire-content-item.js +8 -0
- package/lib/commonjs/modules/questionnaire-response-form/components/content/questionnaire-content-item.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/components/content/questionnaire-content-specific-item.js +8 -0
- package/lib/commonjs/modules/questionnaire-response-form/components/content/questionnaire-content-specific-item.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/components/fields/common/questionnaire-field-wrapper.js +8 -3
- package/lib/commonjs/modules/questionnaire-response-form/components/fields/common/questionnaire-field-wrapper.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/components/fields/questionnaire-choice-field.js +9 -3
- package/lib/commonjs/modules/questionnaire-response-form/components/fields/questionnaire-choice-field.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/components/fields/questionnaire-date-field.js +18 -8
- package/lib/commonjs/modules/questionnaire-response-form/components/fields/questionnaire-date-field.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/components/fields/questionnaire-item-renderer.js +41 -2
- package/lib/commonjs/modules/questionnaire-response-form/components/fields/questionnaire-item-renderer.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/components/fields/questionnaire-text-field.js +43 -5
- package/lib/commonjs/modules/questionnaire-response-form/components/fields/questionnaire-text-field.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/components/header/questionnaire-header-title.js +3 -1
- package/lib/commonjs/modules/questionnaire-response-form/components/header/questionnaire-header-title.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/components/questionnaire-form-provider.js +37 -11
- package/lib/commonjs/modules/questionnaire-response-form/components/questionnaire-form-provider.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/components/questionnaire-form.js +1 -0
- package/lib/commonjs/modules/questionnaire-response-form/components/questionnaire-form.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/components/questionnaire-navigation-provider.js +9 -3
- package/lib/commonjs/modules/questionnaire-response-form/components/questionnaire-navigation-provider.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/hooks/use-initial-selected-values.js +5 -3
- package/lib/commonjs/modules/questionnaire-response-form/hooks/use-initial-selected-values.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/hooks/use-navigation-handlers.js +15 -4
- package/lib/commonjs/modules/questionnaire-response-form/hooks/use-navigation-handlers.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/hooks/use-questionnaire-navigation-state.js +14 -7
- package/lib/commonjs/modules/questionnaire-response-form/hooks/use-questionnaire-navigation-state.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/index.js +20 -0
- package/lib/commonjs/modules/questionnaire-response-form/index.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/types/questionnaire-form-values.js +4 -0
- package/lib/commonjs/modules/questionnaire-response-form/types/questionnaire-item-render-props.js +6 -0
- package/lib/commonjs/modules/questionnaire-response-form/types/questionnaire-item-render-props.js.map +1 -0
- package/lib/commonjs/modules/questionnaire-response-form/types/response-values.js +4 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/condition-utils.js +37 -6
- package/lib/commonjs/modules/questionnaire-response-form/utils/condition-utils.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/utils/conditions/fhir-condition.js +148 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/conditions/fhir-condition.js.map +1 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/create-answer-from-value.js +127 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/create-answer-from-value.js.map +1 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/fields/get-option-text.js +4 -3
- package/lib/commonjs/modules/questionnaire-response-form/utils/fields/get-option-text.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/utils/form-utils.js +71 -64
- package/lib/commonjs/modules/questionnaire-response-form/utils/form-utils.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/utils/form-validation.js +23 -5
- package/lib/commonjs/modules/questionnaire-response-form/utils/form-validation.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/utils/is-answerable-questionnaire-item.js +10 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/is-answerable-questionnaire-item.js.map +1 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/is-valid-questionnaire-answer.js +83 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/is-valid-questionnaire-answer.js.map +1 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/questionnaire-date-utils.js +54 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/questionnaire-date-utils.js.map +1 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/questionnaire-item-constraints.js +75 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/questionnaire-item-constraints.js.map +1 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/questionnaire-item-value-constraint-validators.js +63 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/questionnaire-item-value-constraint-validators.js.map +1 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/questionnaire-navigation-utils.js +49 -18
- package/lib/commonjs/modules/questionnaire-response-form/utils/questionnaire-navigation-utils.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/utils/questionnaire-picker-options.js +117 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/questionnaire-picker-options.js.map +1 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/questionnaire-string-constraint-validator.js +109 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/questionnaire-string-constraint-validator.js.map +1 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/questionnaire-submit-utils.js +2 -2
- package/lib/commonjs/modules/questionnaire-response-form/utils/questionnaire-submit-utils.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/utils/translate-fhir-text.js +36 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/translate-fhir-text.js.map +1 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/validate-questionnaire-item-value.js +49 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/validate-questionnaire-item-value.js.map +1 -0
- package/lib/commonjs/modules/ui/components/prerequisite-gate.js +73 -0
- package/lib/commonjs/modules/ui/components/prerequisite-gate.js.map +1 -0
- package/lib/commonjs/modules/ui/index.js +11 -0
- package/lib/commonjs/modules/ui/index.js.map +1 -1
- package/lib/commonjs/polyfills/index.js +9 -7
- package/lib/commonjs/polyfills/index.js.map +1 -1
- package/lib/module/modules/auth/default-translation.js +17 -0
- package/lib/module/modules/auth/default-translation.js.map +1 -1
- package/lib/module/modules/auth/hooks/use-session.js +3 -0
- package/lib/module/modules/auth/hooks/use-session.js.map +1 -1
- package/lib/module/modules/auth/register/components/form/register-form-provider.js +1 -0
- package/lib/module/modules/auth/register/components/form/register-form-provider.js.map +1 -1
- package/lib/module/modules/auth/reset-password/components/form/reset-password-form-provider.js +1 -0
- package/lib/module/modules/auth/reset-password/components/form/reset-password-form-provider.js.map +1 -1
- package/lib/module/modules/auth/session/session-store-refresh.js +121 -0
- package/lib/module/modules/auth/session/session-store-refresh.js.map +1 -0
- package/lib/module/modules/auth/session/session-store-request-state.js +69 -0
- package/lib/module/modules/auth/session/session-store-request-state.js.map +1 -0
- package/lib/module/modules/auth/session/session-store-types.js.map +1 -1
- package/lib/module/modules/auth/session/session-store.js +36 -115
- package/lib/module/modules/auth/session/session-store.js.map +1 -1
- package/lib/module/modules/auth/utils/sign-in-error.js +4 -2
- package/lib/module/modules/auth/utils/sign-in-error.js.map +1 -1
- package/lib/module/modules/data-sync/components/apple/apple-health-authorization-provider.js.map +1 -1
- package/lib/module/modules/data-sync/hooks/use-listen-changes.js.map +1 -1
- package/lib/module/modules/data-sync/services/apple-health-sync-service.js.map +1 -1
- package/lib/module/modules/data-sync/utils/convert-generic-health-data.js +47 -21
- package/lib/module/modules/data-sync/utils/convert-generic-health-data.js.map +1 -1
- package/lib/module/modules/data-sync/utils/convert-records-to-observation.js +19 -16
- package/lib/module/modules/data-sync/utils/convert-records-to-observation.js.map +1 -1
- package/lib/module/modules/data-sync/utils/convert-samples-to-observation.js +17 -4
- package/lib/module/modules/data-sync/utils/convert-samples-to-observation.js.map +1 -1
- package/lib/module/modules/data-sync/utils/get-samples-from-health.js.map +1 -1
- package/lib/module/modules/data-sync/utils/get-total-samples-count.js.map +1 -1
- package/lib/module/modules/data-sync/utils/health-data-catalog.js +168 -5
- package/lib/module/modules/data-sync/utils/health-data-catalog.js.map +1 -1
- package/lib/module/modules/data-sync/utils/health-record-timing.js +47 -0
- package/lib/module/modules/data-sync/utils/health-record-timing.js.map +1 -0
- package/lib/module/modules/data-sync/utils/healthkit-data-types.js.map +1 -1
- package/lib/module/modules/data-sync/utils/normalize-core-health-observation.js +69 -0
- package/lib/module/modules/data-sync/utils/normalize-core-health-observation.js.map +1 -0
- package/lib/module/modules/picker-sheet/components/value-wheel-picker.js +36 -0
- package/lib/module/modules/picker-sheet/components/value-wheel-picker.js.map +1 -0
- package/lib/module/modules/picker-sheet/components/wheel-picker.js +56 -15
- package/lib/module/modules/picker-sheet/components/wheel-picker.js.map +1 -1
- package/lib/module/modules/picker-sheet/index.js +1 -0
- package/lib/module/modules/picker-sheet/index.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/README.md +59 -20
- package/lib/module/modules/questionnaire-response-form/components/content/questionnaire-content-item.js +8 -0
- package/lib/module/modules/questionnaire-response-form/components/content/questionnaire-content-item.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/components/content/questionnaire-content-specific-item.js +8 -0
- package/lib/module/modules/questionnaire-response-form/components/content/questionnaire-content-specific-item.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/components/fields/common/questionnaire-field-wrapper.js +8 -3
- package/lib/module/modules/questionnaire-response-form/components/fields/common/questionnaire-field-wrapper.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/components/fields/questionnaire-choice-field.js +9 -3
- package/lib/module/modules/questionnaire-response-form/components/fields/questionnaire-choice-field.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/components/fields/questionnaire-date-field.js +18 -8
- package/lib/module/modules/questionnaire-response-form/components/fields/questionnaire-date-field.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/components/fields/questionnaire-item-renderer.js +42 -3
- package/lib/module/modules/questionnaire-response-form/components/fields/questionnaire-item-renderer.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/components/fields/questionnaire-text-field.js +41 -3
- package/lib/module/modules/questionnaire-response-form/components/fields/questionnaire-text-field.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/components/header/questionnaire-header-title.js +3 -1
- package/lib/module/modules/questionnaire-response-form/components/header/questionnaire-header-title.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/components/questionnaire-form-provider.js +37 -11
- package/lib/module/modules/questionnaire-response-form/components/questionnaire-form-provider.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/components/questionnaire-form.js +1 -0
- package/lib/module/modules/questionnaire-response-form/components/questionnaire-form.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/components/questionnaire-navigation-provider.js +9 -3
- package/lib/module/modules/questionnaire-response-form/components/questionnaire-navigation-provider.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/hooks/use-initial-selected-values.js +5 -3
- package/lib/module/modules/questionnaire-response-form/hooks/use-initial-selected-values.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/hooks/use-navigation-handlers.js +15 -4
- package/lib/module/modules/questionnaire-response-form/hooks/use-navigation-handlers.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/hooks/use-questionnaire-navigation-state.js +14 -7
- package/lib/module/modules/questionnaire-response-form/hooks/use-questionnaire-navigation-state.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/index.js +2 -0
- package/lib/module/modules/questionnaire-response-form/index.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/types/questionnaire-form-values.js +2 -0
- package/lib/module/modules/questionnaire-response-form/types/questionnaire-item-render-props.js +4 -0
- package/lib/module/modules/questionnaire-response-form/types/questionnaire-item-render-props.js.map +1 -0
- package/lib/module/modules/questionnaire-response-form/types/response-values.js +2 -0
- package/lib/module/modules/questionnaire-response-form/utils/condition-utils.js +37 -6
- package/lib/module/modules/questionnaire-response-form/utils/condition-utils.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/utils/conditions/fhir-condition.js +140 -0
- package/lib/module/modules/questionnaire-response-form/utils/conditions/fhir-condition.js.map +1 -0
- package/lib/module/modules/questionnaire-response-form/utils/create-answer-from-value.js +122 -0
- package/lib/module/modules/questionnaire-response-form/utils/create-answer-from-value.js.map +1 -0
- package/lib/module/modules/questionnaire-response-form/utils/fields/get-option-text.js +4 -3
- package/lib/module/modules/questionnaire-response-form/utils/fields/get-option-text.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/utils/form-utils.js +71 -64
- package/lib/module/modules/questionnaire-response-form/utils/form-utils.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/utils/form-validation.js +23 -5
- package/lib/module/modules/questionnaire-response-form/utils/form-validation.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/utils/is-answerable-questionnaire-item.js +5 -0
- package/lib/module/modules/questionnaire-response-form/utils/is-answerable-questionnaire-item.js.map +1 -0
- package/lib/module/modules/questionnaire-response-form/utils/is-valid-questionnaire-answer.js +77 -0
- package/lib/module/modules/questionnaire-response-form/utils/is-valid-questionnaire-answer.js.map +1 -0
- package/lib/module/modules/questionnaire-response-form/utils/questionnaire-date-utils.js +49 -0
- package/lib/module/modules/questionnaire-response-form/utils/questionnaire-date-utils.js.map +1 -0
- package/lib/module/modules/questionnaire-response-form/utils/questionnaire-item-constraints.js +71 -0
- package/lib/module/modules/questionnaire-response-form/utils/questionnaire-item-constraints.js.map +1 -0
- package/lib/module/modules/questionnaire-response-form/utils/questionnaire-item-value-constraint-validators.js +57 -0
- package/lib/module/modules/questionnaire-response-form/utils/questionnaire-item-value-constraint-validators.js.map +1 -0
- package/lib/module/modules/questionnaire-response-form/utils/questionnaire-navigation-utils.js +49 -18
- package/lib/module/modules/questionnaire-response-form/utils/questionnaire-navigation-utils.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/utils/questionnaire-picker-options.js +112 -0
- package/lib/module/modules/questionnaire-response-form/utils/questionnaire-picker-options.js.map +1 -0
- package/lib/module/modules/questionnaire-response-form/utils/questionnaire-string-constraint-validator.js +105 -0
- package/lib/module/modules/questionnaire-response-form/utils/questionnaire-string-constraint-validator.js.map +1 -0
- package/lib/module/modules/questionnaire-response-form/utils/questionnaire-submit-utils.js +2 -2
- package/lib/module/modules/questionnaire-response-form/utils/questionnaire-submit-utils.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/utils/translate-fhir-text.js +31 -0
- package/lib/module/modules/questionnaire-response-form/utils/translate-fhir-text.js.map +1 -0
- package/lib/module/modules/questionnaire-response-form/utils/validate-questionnaire-item-value.js +44 -0
- package/lib/module/modules/questionnaire-response-form/utils/validate-questionnaire-item-value.js.map +1 -0
- package/lib/module/modules/ui/components/prerequisite-gate.js +67 -0
- package/lib/module/modules/ui/components/prerequisite-gate.js.map +1 -0
- package/lib/module/modules/ui/index.js +1 -0
- package/lib/module/modules/ui/index.js.map +1 -1
- package/lib/module/polyfills/index.js +11 -1
- package/lib/module/polyfills/index.js.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/default-translation.d.ts +17 -0
- package/lib/typescript/commonjs/src/modules/auth/default-translation.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/hooks/use-session.d.ts +4 -1
- package/lib/typescript/commonjs/src/modules/auth/hooks/use-session.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/register/components/form/register-form-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/reset-password/components/form/reset-password-form-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/session/session-store-refresh.d.ts +8 -0
- package/lib/typescript/commonjs/src/modules/auth/session/session-store-refresh.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/auth/session/session-store-request-state.d.ts +23 -0
- package/lib/typescript/commonjs/src/modules/auth/session/session-store-request-state.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/auth/session/session-store-types.d.ts +8 -2
- package/lib/typescript/commonjs/src/modules/auth/session/session-store-types.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/session/session-store.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/auth/session/session-store.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/utils/sign-in-error.d.ts +2 -1
- package/lib/typescript/commonjs/src/modules/auth/utils/sign-in-error.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/components/apple/apple-health-authorization-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/hooks/use-listen-changes.d.ts +2 -3
- package/lib/typescript/commonjs/src/modules/data-sync/hooks/use-listen-changes.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/services/apple-health-sync-service.d.ts +4 -5
- package/lib/typescript/commonjs/src/modules/data-sync/services/apple-health-sync-service.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/types/apple-health-authorization-provider-props.d.ts +4 -2
- package/lib/typescript/commonjs/src/modules/data-sync/types/apple-health-authorization-provider-props.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/types/apple-health-sync-props.d.ts +7 -1
- package/lib/typescript/commonjs/src/modules/data-sync/types/apple-health-sync-props.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/types/health-authorization-status.d.ts +2 -1
- package/lib/typescript/commonjs/src/modules/data-sync/types/health-authorization-status.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/convert-generic-health-data.d.ts +3 -2
- package/lib/typescript/commonjs/src/modules/data-sync/utils/convert-generic-health-data.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/convert-records-to-observation.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/convert-samples-to-observation.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/get-samples-from-health.d.ts +5 -4
- package/lib/typescript/commonjs/src/modules/data-sync/utils/get-samples-from-health.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/get-total-samples-count.d.ts +2 -2
- package/lib/typescript/commonjs/src/modules/data-sync/utils/get-total-samples-count.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/health-data-catalog.d.ts +3 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/health-data-catalog.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/health-record-timing.d.ts +10 -0
- package/lib/typescript/commonjs/src/modules/data-sync/utils/health-record-timing.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-data-types.d.ts +6 -5
- package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-data-types.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/normalize-core-health-observation.d.ts +13 -0
- package/lib/typescript/commonjs/src/modules/data-sync/utils/normalize-core-health-observation.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/picker-sheet/components/value-wheel-picker.d.ts +21 -0
- package/lib/typescript/commonjs/src/modules/picker-sheet/components/value-wheel-picker.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/picker-sheet/components/wheel-picker.d.ts +7 -3
- package/lib/typescript/commonjs/src/modules/picker-sheet/components/wheel-picker.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/picker-sheet/index.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/picker-sheet/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/content/questionnaire-content-item.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/content/questionnaire-content-specific-item.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/fields/common/questionnaire-field-wrapper.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/fields/questionnaire-choice-field.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/fields/questionnaire-date-field.d.ts +3 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/fields/questionnaire-date-field.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/fields/questionnaire-item-renderer.d.ts +9 -3
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/fields/questionnaire-item-renderer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/fields/questionnaire-text-field.d.ts +5 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/fields/questionnaire-text-field.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/header/questionnaire-header-title.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/questionnaire-form-provider.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/questionnaire-form-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/questionnaire-form.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/questionnaire-navigation-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/hooks/use-initial-selected-values.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/hooks/use-navigation-handlers.d.ts +6 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/hooks/use-navigation-handlers.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/hooks/use-questionnaire-navigation-state.d.ts +2 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/hooks/use-questionnaire-navigation-state.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/index.d.ts +4 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/extended-questionnaire-item.d.ts +7 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/extended-questionnaire-item.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-form-context-type.d.ts +6 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-form-context-type.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-form-props.d.ts +3 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-form-props.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-form-provider-props.d.ts +11 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-form-provider-props.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-form-values.d.ts +5 -2
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-form-values.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-item-render-props.d.ts +15 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-item-render-props.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-navigation-provider-props.d.ts +5 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-navigation-provider-props.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/response-values.d.ts +2 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/response-values.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/condition-utils.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/conditions/fhir-condition.d.ts +9 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/conditions/fhir-condition.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/create-answer-from-value.d.ts +7 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/create-answer-from-value.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/fields/get-option-text.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/fields/get-option-text.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/form-utils.d.ts +4 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/form-utils.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/form-validation.d.ts +4 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/form-validation.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/is-answerable-questionnaire-item.d.ts +3 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/is-answerable-questionnaire-item.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/is-valid-questionnaire-answer.d.ts +8 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/is-valid-questionnaire-answer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/questionnaire-date-utils.d.ts +5 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/questionnaire-date-utils.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/questionnaire-item-constraints.d.ts +22 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/questionnaire-item-constraints.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/questionnaire-item-value-constraint-validators.d.ts +10 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/questionnaire-item-value-constraint-validators.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/questionnaire-navigation-utils.d.ts +2 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/questionnaire-navigation-utils.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/questionnaire-picker-options.d.ts +15 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/questionnaire-picker-options.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/questionnaire-string-constraint-validator.d.ts +5 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/questionnaire-string-constraint-validator.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/questionnaire-submit-utils.d.ts +3 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/questionnaire-submit-utils.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/translate-fhir-text.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/translate-fhir-text.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/validate-questionnaire-item-value.d.ts +6 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/validate-questionnaire-item-value.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/ui/components/prerequisite-gate.d.ts +19 -0
- package/lib/typescript/commonjs/src/modules/ui/components/prerequisite-gate.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/ui/index.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/ui/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/polyfills/index.d.ts +7 -1
- package/lib/typescript/commonjs/src/polyfills/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/default-translation.d.ts +17 -0
- package/lib/typescript/module/src/modules/auth/default-translation.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/hooks/use-session.d.ts +4 -1
- package/lib/typescript/module/src/modules/auth/hooks/use-session.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/register/components/form/register-form-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/reset-password/components/form/reset-password-form-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/session/session-store-refresh.d.ts +8 -0
- package/lib/typescript/module/src/modules/auth/session/session-store-refresh.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/auth/session/session-store-request-state.d.ts +23 -0
- package/lib/typescript/module/src/modules/auth/session/session-store-request-state.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/auth/session/session-store-types.d.ts +8 -2
- package/lib/typescript/module/src/modules/auth/session/session-store-types.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/session/session-store.d.ts +1 -1
- package/lib/typescript/module/src/modules/auth/session/session-store.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/utils/sign-in-error.d.ts +2 -1
- package/lib/typescript/module/src/modules/auth/utils/sign-in-error.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/components/apple/apple-health-authorization-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/hooks/use-listen-changes.d.ts +2 -3
- package/lib/typescript/module/src/modules/data-sync/hooks/use-listen-changes.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/services/apple-health-sync-service.d.ts +4 -5
- package/lib/typescript/module/src/modules/data-sync/services/apple-health-sync-service.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/types/apple-health-authorization-provider-props.d.ts +4 -2
- package/lib/typescript/module/src/modules/data-sync/types/apple-health-authorization-provider-props.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/types/apple-health-sync-props.d.ts +7 -1
- package/lib/typescript/module/src/modules/data-sync/types/apple-health-sync-props.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/types/health-authorization-status.d.ts +2 -1
- package/lib/typescript/module/src/modules/data-sync/types/health-authorization-status.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/convert-generic-health-data.d.ts +3 -2
- package/lib/typescript/module/src/modules/data-sync/utils/convert-generic-health-data.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/convert-records-to-observation.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/convert-samples-to-observation.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/get-samples-from-health.d.ts +5 -4
- package/lib/typescript/module/src/modules/data-sync/utils/get-samples-from-health.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/get-total-samples-count.d.ts +2 -2
- package/lib/typescript/module/src/modules/data-sync/utils/get-total-samples-count.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/health-data-catalog.d.ts +3 -1
- package/lib/typescript/module/src/modules/data-sync/utils/health-data-catalog.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/health-record-timing.d.ts +10 -0
- package/lib/typescript/module/src/modules/data-sync/utils/health-record-timing.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/data-sync/utils/healthkit-data-types.d.ts +6 -5
- package/lib/typescript/module/src/modules/data-sync/utils/healthkit-data-types.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/normalize-core-health-observation.d.ts +13 -0
- package/lib/typescript/module/src/modules/data-sync/utils/normalize-core-health-observation.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/picker-sheet/components/value-wheel-picker.d.ts +21 -0
- package/lib/typescript/module/src/modules/picker-sheet/components/value-wheel-picker.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/picker-sheet/components/wheel-picker.d.ts +7 -3
- package/lib/typescript/module/src/modules/picker-sheet/components/wheel-picker.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/picker-sheet/index.d.ts +1 -0
- package/lib/typescript/module/src/modules/picker-sheet/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/components/content/questionnaire-content-item.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/components/content/questionnaire-content-specific-item.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/components/fields/common/questionnaire-field-wrapper.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/components/fields/questionnaire-choice-field.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/components/fields/questionnaire-date-field.d.ts +3 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/components/fields/questionnaire-date-field.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/components/fields/questionnaire-item-renderer.d.ts +9 -3
- package/lib/typescript/module/src/modules/questionnaire-response-form/components/fields/questionnaire-item-renderer.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/components/fields/questionnaire-text-field.d.ts +5 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/components/fields/questionnaire-text-field.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/components/header/questionnaire-header-title.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/components/questionnaire-form-provider.d.ts +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/components/questionnaire-form-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/components/questionnaire-form.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/components/questionnaire-navigation-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/hooks/use-initial-selected-values.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/hooks/use-navigation-handlers.d.ts +6 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/hooks/use-navigation-handlers.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/hooks/use-questionnaire-navigation-state.d.ts +2 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/hooks/use-questionnaire-navigation-state.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/index.d.ts +4 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/types/extended-questionnaire-item.d.ts +7 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/types/extended-questionnaire-item.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-form-context-type.d.ts +6 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-form-context-type.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-form-props.d.ts +3 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-form-props.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-form-provider-props.d.ts +11 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-form-provider-props.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-form-values.d.ts +5 -2
- package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-form-values.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-item-render-props.d.ts +15 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-item-render-props.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-navigation-provider-props.d.ts +5 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-navigation-provider-props.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/types/response-values.d.ts +2 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/types/response-values.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/condition-utils.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/conditions/fhir-condition.d.ts +9 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/conditions/fhir-condition.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/create-answer-from-value.d.ts +7 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/create-answer-from-value.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/fields/get-option-text.d.ts +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/fields/get-option-text.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/form-utils.d.ts +4 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/form-utils.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/form-validation.d.ts +4 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/form-validation.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/is-answerable-questionnaire-item.d.ts +3 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/is-answerable-questionnaire-item.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/is-valid-questionnaire-answer.d.ts +8 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/is-valid-questionnaire-answer.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/questionnaire-date-utils.d.ts +5 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/questionnaire-date-utils.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/questionnaire-item-constraints.d.ts +22 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/questionnaire-item-constraints.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/questionnaire-item-value-constraint-validators.d.ts +10 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/questionnaire-item-value-constraint-validators.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/questionnaire-navigation-utils.d.ts +2 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/questionnaire-navigation-utils.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/questionnaire-picker-options.d.ts +15 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/questionnaire-picker-options.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/questionnaire-string-constraint-validator.d.ts +5 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/questionnaire-string-constraint-validator.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/questionnaire-submit-utils.d.ts +3 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/questionnaire-submit-utils.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/translate-fhir-text.d.ts +4 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/translate-fhir-text.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/validate-questionnaire-item-value.d.ts +6 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/validate-questionnaire-item-value.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/ui/components/prerequisite-gate.d.ts +19 -0
- package/lib/typescript/module/src/modules/ui/components/prerequisite-gate.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/ui/index.d.ts +1 -0
- package/lib/typescript/module/src/modules/ui/index.d.ts.map +1 -1
- package/lib/typescript/module/src/polyfills/index.d.ts +7 -1
- package/lib/typescript/module/src/polyfills/index.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["LENGTH_TYPES","Set","hasSameUcumUnit","value","bound","system","code","validateAnswerLength","answer","item","constraints","minLength","undefined","maxLength","has","type","textValue","String","length","validateNumberConstraints","min","minValue","max","maxValue","step","baseline","steps","Math","abs","round","validateQuantityConstraints","unresolvedUnitValueSet","minQuantity","maxQuantity","unitOpen","unitValueSet","unitOptions","some"],"sourceRoot":"../../../../../src","sources":["modules/questionnaire-response-form/utils/questionnaire-item-value-constraint-validators.ts"],"mappings":";;AAcA,MAAMA,YAAY,GAAG,IAAIC,GAAG,CAAC,CAC3B,MAAM,EACN,UAAU,EACV,SAAS,EACT,SAAS,EACT,QAAQ,EACR,MAAM,EACN,MAAM,EACN,KAAK,CACN,CAAC;AAEF,MAAMC,eAAe,GAAGA,CAACC,KAAe,EAAEC,KAAe,KACvDD,KAAK,CAACE,MAAM,KAAK,2BAA2B,IAC5CD,KAAK,CAACC,MAAM,KAAK,2BAA2B,IAC5CF,KAAK,CAACG,IAAI,KAAKF,KAAK,CAACE,IAAI;AAE3B,MAAMC,oBAAoB,GAAGA,CAC3BJ,KAA6B,EAC7BK,MAAe,EACfC,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AAC,EACpC;IACA,OAAO,cAAc;EACvB;EAEA,IACER,WAAW,CAACwB,QAAQ,KAAK,aAAa,IACtCxB,WAAW,CAAC0B,WAAW,CAAClB,MAAM,GAAG,CAAC,IAClC,CAACR,WAAW,CAAC0B,WAAW,CAACC,IAAI,CAC3B,CAAC;IAAEhC,MAAM;IAAEC;EAAK,CAAC,KAAKD,MAAM,KAAKG,MAAM,CAACH,MAAM,IAAIC,IAAI,KAAKE,MAAM,CAACF,IACpE,CAAC,EACD;IACA,OAAO,cAAc;EACvB;EAEA,OAAOM,SAAS;AAClB,CAAC;AAED,SACEL,oBAAoB,EACpBY,yBAAyB,EACzBW,2BAA2B","ignoreList":[]}
|
package/lib/module/modules/questionnaire-response-form/utils/questionnaire-navigation-utils.js
CHANGED
|
@@ -1,14 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { ConditionUtils } from "./condition-utils.js";
|
|
4
|
+
import { isQuestionnaireItemAnswered } from "./create-answer-from-value.js";
|
|
5
|
+
import { isAnswerableQuestionnaireItem } from "./is-answerable-questionnaire-item.js";
|
|
6
|
+
const findNextEnabledPageIndex = (pages, startIndex, responses) => {
|
|
7
|
+
for (let pageIndex = startIndex; pageIndex < pages.length; pageIndex++) {
|
|
8
|
+
const page = pages[pageIndex];
|
|
9
|
+
if (page && ConditionUtils.getEnabledItemsForPage(page, responses).length) {
|
|
10
|
+
return pageIndex;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return undefined;
|
|
14
|
+
};
|
|
4
15
|
export class QuestionnaireNavigationUtils {
|
|
5
|
-
static handleNext(currentPage, enabledItems, currentItem, currentItemIndex, currentPageIndex, pages, responses) {
|
|
6
|
-
if (!currentPage || !
|
|
16
|
+
static handleNext(currentPage, enabledItems, currentItem, currentItemIndex, currentPageIndex, pages, responses, renderItem) {
|
|
17
|
+
if (!currentPage || !pages[currentPageIndex]) {
|
|
7
18
|
return {
|
|
8
19
|
hasError: true
|
|
9
20
|
};
|
|
10
21
|
}
|
|
11
|
-
if (currentItem
|
|
22
|
+
if (!currentItem) {
|
|
23
|
+
if (enabledItems.length) {
|
|
24
|
+
return {
|
|
25
|
+
hasError: true,
|
|
26
|
+
errorMessage: "This question is required"
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
const nextPageIndex = findNextEnabledPageIndex(pages, currentPageIndex + 1, responses);
|
|
30
|
+
return nextPageIndex === undefined ? {} : {
|
|
31
|
+
newPageIndex: nextPageIndex
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
if (currentItem.required && (isAnswerableQuestionnaireItem(currentItem) || !!renderItem && currentItem.type !== "group" && currentItem.type !== "display") && !isQuestionnaireItemAnswered(responses[currentItem.linkId || ""], currentItem)) {
|
|
12
35
|
return {
|
|
13
36
|
hasError: true,
|
|
14
37
|
errorMessage: "This question is required"
|
|
@@ -18,28 +41,36 @@ export class QuestionnaireNavigationUtils {
|
|
|
18
41
|
return {
|
|
19
42
|
newItemIndex: currentItemIndex + 1
|
|
20
43
|
};
|
|
21
|
-
} else
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
44
|
+
} else {
|
|
45
|
+
const nextPageIndex = findNextEnabledPageIndex(pages, currentPageIndex + 1, responses);
|
|
46
|
+
if (nextPageIndex !== undefined) {
|
|
47
|
+
return {
|
|
48
|
+
newPageIndex: nextPageIndex
|
|
49
|
+
};
|
|
50
|
+
}
|
|
25
51
|
}
|
|
26
52
|
return {};
|
|
27
53
|
}
|
|
28
54
|
static handlePrevious(currentItemIndex, currentPageIndex, pages, responses) {
|
|
29
|
-
|
|
55
|
+
const currentPage = pages[currentPageIndex];
|
|
56
|
+
const currentPageItems = currentPage ? ConditionUtils.getEnabledItemsForPage(currentPage, responses) : [];
|
|
57
|
+
if (currentItemIndex > 0 && currentPageItems.length) {
|
|
30
58
|
return {
|
|
31
|
-
newItemIndex: currentItemIndex - 1
|
|
59
|
+
newItemIndex: Math.min(currentItemIndex - 1, currentPageItems.length - 1)
|
|
32
60
|
};
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
61
|
+
}
|
|
62
|
+
for (let pageIndex = currentPageIndex - 1; pageIndex >= 0; pageIndex--) {
|
|
63
|
+
const page = pages[pageIndex];
|
|
64
|
+
if (!page) {
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
const previousItems = ConditionUtils.getEnabledItemsForPage(page, responses);
|
|
68
|
+
if (previousItems.length) {
|
|
69
|
+
return {
|
|
70
|
+
newPageIndex: pageIndex,
|
|
71
|
+
lastItemIndex: previousItems.length - 1
|
|
72
|
+
};
|
|
37
73
|
}
|
|
38
|
-
const prevPageEnabledItems = ConditionUtils.getEnabledItemsForPage(prevPage, responses);
|
|
39
|
-
return {
|
|
40
|
-
newPageIndex: currentPageIndex - 1,
|
|
41
|
-
lastItemIndex: prevPageEnabledItems.length ? prevPageEnabledItems.length - 1 : 0
|
|
42
|
-
};
|
|
43
74
|
}
|
|
44
75
|
return {};
|
|
45
76
|
}
|
package/lib/module/modules/questionnaire-response-form/utils/questionnaire-navigation-utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ConditionUtils","QuestionnaireNavigationUtils","handleNext","currentPage","enabledItems","currentItem","currentItemIndex","currentPageIndex","
|
|
1
|
+
{"version":3,"names":["ConditionUtils","isQuestionnaireItemAnswered","isAnswerableQuestionnaireItem","findNextEnabledPageIndex","pages","startIndex","responses","pageIndex","length","page","getEnabledItemsForPage","undefined","QuestionnaireNavigationUtils","handleNext","currentPage","enabledItems","currentItem","currentItemIndex","currentPageIndex","renderItem","hasError","errorMessage","nextPageIndex","newPageIndex","required","type","linkId","newItemIndex","handlePrevious","currentPageItems","Math","min","previousItems","lastItemIndex"],"sourceRoot":"../../../../../src","sources":["modules/questionnaire-response-form/utils/questionnaire-navigation-utils.ts"],"mappings":";;AAIA,SAASA,cAAc,QAAQ,sBAAmB;AAClD,SAASC,2BAA2B,QA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sBAAsB,CACzDD,IAAI,EACJH,SACF,CAAC;MAED,IAAI0B,aAAa,CAACxB,MAAM,EAAE;QACxB,OAAO;UACLe,YAAY,EAAEhB,SAAS;UACvB0B,aAAa,EAAED,aAAa,CAACxB,MAAM,GAAG;QACxC,CAAC;MACH;IACF;IAEA,OAAO,CAAC,CAAC;EACX;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { getOptionText } from "./fields/get-option-text.js";
|
|
4
|
+
const getQuestionnaireNumericPickerOptions = (item, constraints, locale, maximumOptions = 1000) => {
|
|
5
|
+
const {
|
|
6
|
+
minValue,
|
|
7
|
+
maxValue
|
|
8
|
+
} = constraints;
|
|
9
|
+
if (item.type !== "integer" && item.type !== "decimal" || typeof minValue !== "number" || typeof maxValue !== "number" || !Number.isFinite(minValue) || !Number.isFinite(maxValue) || maxValue < minValue || !Number.isInteger(maximumOptions) || maximumOptions < 1 || maximumOptions > 5000) {
|
|
10
|
+
return [];
|
|
11
|
+
}
|
|
12
|
+
const step = constraints.step ?? (item.type === "integer" ? 1 : undefined);
|
|
13
|
+
if (step === undefined || !Number.isFinite(step) || step <= 0) {
|
|
14
|
+
return [];
|
|
15
|
+
}
|
|
16
|
+
if (item.type === "integer" && ![minValue, maxValue, step].every(Number.isInteger)) {
|
|
17
|
+
return [];
|
|
18
|
+
}
|
|
19
|
+
const precision = Math.min(12, Math.max(...[minValue, maxValue, step].map(number => {
|
|
20
|
+
const decimalPart = String(number).split(".")[1];
|
|
21
|
+
return decimalPart?.length ?? 0;
|
|
22
|
+
})));
|
|
23
|
+
const scale = 10 ** precision;
|
|
24
|
+
const start = Math.round(minValue * scale);
|
|
25
|
+
const end = Math.round(maxValue * scale);
|
|
26
|
+
const increment = Math.round(step * scale);
|
|
27
|
+
if (increment <= 0) {
|
|
28
|
+
return [];
|
|
29
|
+
}
|
|
30
|
+
const count = Math.floor((end - start) / increment + 1e-9) + 1;
|
|
31
|
+
if (count > maximumOptions) {
|
|
32
|
+
return [];
|
|
33
|
+
}
|
|
34
|
+
const formatter = new Intl.NumberFormat(locale, {
|
|
35
|
+
maximumFractionDigits: precision
|
|
36
|
+
});
|
|
37
|
+
return Array.from({
|
|
38
|
+
length: count
|
|
39
|
+
}, (_, index) => {
|
|
40
|
+
const value = (start + index * increment) / scale;
|
|
41
|
+
return {
|
|
42
|
+
label: formatter.format(value),
|
|
43
|
+
value
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
const getOptionAnswer = option => {
|
|
48
|
+
if (option.valueCoding !== undefined) {
|
|
49
|
+
return {
|
|
50
|
+
valueCoding: option.valueCoding
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
if (option.valueReference !== undefined) {
|
|
54
|
+
return {
|
|
55
|
+
valueReference: option.valueReference
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
if (option.valueInteger !== undefined) {
|
|
59
|
+
return {
|
|
60
|
+
valueInteger: option.valueInteger
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
if (option.valueDate !== undefined) {
|
|
64
|
+
return {
|
|
65
|
+
valueDate: option.valueDate
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
if (option.valueTime !== undefined) {
|
|
69
|
+
return {
|
|
70
|
+
valueTime: option.valueTime
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
if (option.valueString !== undefined) {
|
|
74
|
+
return {
|
|
75
|
+
valueString: option.valueString
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
return undefined;
|
|
79
|
+
};
|
|
80
|
+
const getOptionLabel = (option, locale) => {
|
|
81
|
+
const localizedLabel = getOptionText(option, locale);
|
|
82
|
+
if (localizedLabel) {
|
|
83
|
+
return localizedLabel;
|
|
84
|
+
}
|
|
85
|
+
if (option.valueInteger !== undefined) {
|
|
86
|
+
return String(option.valueInteger);
|
|
87
|
+
}
|
|
88
|
+
if (option.valueDate !== undefined) {
|
|
89
|
+
return option.valueDate;
|
|
90
|
+
}
|
|
91
|
+
if (option.valueTime !== undefined) {
|
|
92
|
+
return option.valueTime;
|
|
93
|
+
}
|
|
94
|
+
if (option.valueReference?.display) {
|
|
95
|
+
return option.valueReference.display;
|
|
96
|
+
}
|
|
97
|
+
return option.valueReference?.reference ?? "";
|
|
98
|
+
};
|
|
99
|
+
const getQuestionnaireAnswerPickerOptions = (item, locale) => {
|
|
100
|
+
if (item.type !== "choice" && item.type !== "open-choice") {
|
|
101
|
+
return [];
|
|
102
|
+
}
|
|
103
|
+
return (item.answerOption ?? []).flatMap(option => {
|
|
104
|
+
const value = getOptionAnswer(option);
|
|
105
|
+
return value ? [{
|
|
106
|
+
label: getOptionLabel(option, locale),
|
|
107
|
+
value
|
|
108
|
+
}] : [];
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
export { getQuestionnaireAnswerPickerOptions, getQuestionnaireNumericPickerOptions };
|
|
112
|
+
//# sourceMappingURL=questionnaire-picker-options.js.map
|
package/lib/module/modules/questionnaire-response-form/utils/questionnaire-picker-options.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getOptionText","getQuestionnaireNumericPickerOptions","item","constraints","locale","maximumOptions","minValue","maxValue","type","Number","isFinite","isInteger","step","undefined","every","precision","Math","min","max","map","number","decimalPart","String","split","length","scale","start","round","end","increment","count","floor","formatter","Intl","NumberFormat","maximumFractionDigits","Array","from","_","index","value","label","format","getOptionAnswer","option","valueCoding","valueReference","valueInteger","valueDate","valueTime","valueString","getOptionLabel","localizedLabel","display","reference","getQuestionnaireAnswerPickerOptions","answerOption","flatMap"],"sourceRoot":"../../../../../src","sources":["modules/questionnaire-response-form/utils/questionnaire-picker-options.ts"],"mappings":";;AAOA,SAASA,aAAa,QAAQ,6BAA0B;AAaxD,MAAMC,oCAAoC,GAAGA,CAC3CC,IAA+B,EAC/BC,WAAyC,EACzCC,MAAe,EACfC,cAAc,G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,KAAK,QAAQ,IAAIN,IAAI,CAACM,IAAI,KAAK,aAAa,EAAE;IACzD,OAAO,EAAE;EACX;EAEA,OAAO,CAACN,IAAI,CAACsD,YAAY,IAAI,EAAE,EAAEC,OAAO,CAAEb,MAAM,IAAK;IACnD,MAAMJ,KAAK,GAAGG,eAAe,CAACC,MAAM,CAAC;IAErC,OAAOJ,KAAK,GAAG,CAAC;MAAEC,KAAK,EAAEU,cAAc,CAACP,MAAM,EAAExC,MAAM,CAAC;MAAEoC;IAAM,CAAC,CAAC,GAAG,EAAE;EACxE,CAAC,CAAC;AACJ,CAAC;AAED,SACEe,mCAAmC,EACnCtD,oCAAoC","ignoreList":[]}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const compare = (value, bound) => {
|
|
4
|
+
if (typeof value === "number" && typeof bound === "number") {
|
|
5
|
+
return value - bound;
|
|
6
|
+
}
|
|
7
|
+
if (typeof value === "string" && typeof bound === "string") {
|
|
8
|
+
if (/^\d{4}(?:-\d{2}){0,2}$/.test(value) && /^\d{4}(?:-\d{2}){0,2}$/.test(bound)) {
|
|
9
|
+
return value.localeCompare(bound);
|
|
10
|
+
}
|
|
11
|
+
if (value.includes("T") && bound.includes("T")) {
|
|
12
|
+
const valueTime = Date.parse(value);
|
|
13
|
+
const boundTime = Date.parse(bound);
|
|
14
|
+
if (Number.isFinite(valueTime) && Number.isFinite(boundTime)) {
|
|
15
|
+
return valueTime - boundTime;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return value.localeCompare(bound);
|
|
19
|
+
}
|
|
20
|
+
return Number.NaN;
|
|
21
|
+
};
|
|
22
|
+
const getDateInterval = value => {
|
|
23
|
+
if (value.includes("T")) {
|
|
24
|
+
const timestamp = Date.parse(value);
|
|
25
|
+
return Number.isFinite(timestamp) ? {
|
|
26
|
+
start: timestamp,
|
|
27
|
+
end: timestamp
|
|
28
|
+
} : undefined;
|
|
29
|
+
}
|
|
30
|
+
const match = /^(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?$/.exec(value);
|
|
31
|
+
if (!match) {
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
const year = Number(match[1]);
|
|
35
|
+
const month = Number(match[2] ?? 1);
|
|
36
|
+
const startDay = Number(match[3] ?? 1);
|
|
37
|
+
const endDay = match[3] ? startDay : match[2] ? new Date(year, month, 0).getDate() : 31;
|
|
38
|
+
const start = new Date(year, month - 1, startDay).getTime();
|
|
39
|
+
const end = new Date(year, match[2] ? month - 1 : 11, endDay, 23, 59, 59, 999).getTime();
|
|
40
|
+
return {
|
|
41
|
+
start,
|
|
42
|
+
end
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
const getTimeValue = value => {
|
|
46
|
+
const match = /^(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d+))?)?$/.exec(value);
|
|
47
|
+
if (!match) {
|
|
48
|
+
return undefined;
|
|
49
|
+
}
|
|
50
|
+
const hours = Number(match[1]);
|
|
51
|
+
const minutes = Number(match[2]);
|
|
52
|
+
const seconds = Number(match[3] ?? 0);
|
|
53
|
+
if (hours > 23 || minutes > 59 || seconds > 59) {
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
const fractionalSeconds = match[4] ? Number(`0.${match[4]}`) : 0;
|
|
57
|
+
return hours * 3600 + minutes * 60 + seconds + fractionalSeconds;
|
|
58
|
+
};
|
|
59
|
+
const validateDateConstraints = (answer, constraints) => {
|
|
60
|
+
const {
|
|
61
|
+
minValue: min,
|
|
62
|
+
maxValue: max
|
|
63
|
+
} = constraints;
|
|
64
|
+
const answerInterval = getDateInterval(answer);
|
|
65
|
+
const minInterval = typeof min === "string" ? getDateInterval(min) : undefined;
|
|
66
|
+
const maxInterval = typeof max === "string" ? getDateInterval(max) : undefined;
|
|
67
|
+
if (!answerInterval || min !== undefined && !minInterval || max !== undefined && !maxInterval) {
|
|
68
|
+
return "invalid-answer";
|
|
69
|
+
}
|
|
70
|
+
return minInterval && answerInterval.start < minInterval.start || maxInterval && answerInterval.end > maxInterval.end ? "out-of-range" : undefined;
|
|
71
|
+
};
|
|
72
|
+
const validateTimeConstraints = (answer, constraints) => {
|
|
73
|
+
const {
|
|
74
|
+
minValue: min,
|
|
75
|
+
maxValue: max
|
|
76
|
+
} = constraints;
|
|
77
|
+
const answerTime = getTimeValue(answer);
|
|
78
|
+
const minTime = typeof min === "string" ? getTimeValue(min) : undefined;
|
|
79
|
+
const maxTime = typeof max === "string" ? getTimeValue(max) : undefined;
|
|
80
|
+
if (answerTime === undefined || min !== undefined && minTime === undefined || max !== undefined && maxTime === undefined) {
|
|
81
|
+
return "invalid-answer";
|
|
82
|
+
}
|
|
83
|
+
return minTime !== undefined && answerTime < minTime || maxTime !== undefined && answerTime > maxTime ? "out-of-range" : undefined;
|
|
84
|
+
};
|
|
85
|
+
const validateOtherStringConstraints = (answer, constraints) => {
|
|
86
|
+
const {
|
|
87
|
+
minValue: min,
|
|
88
|
+
maxValue: max
|
|
89
|
+
} = constraints;
|
|
90
|
+
if (min !== undefined && max !== undefined && compare(min, max) > 0) {
|
|
91
|
+
return "out-of-range";
|
|
92
|
+
}
|
|
93
|
+
return min !== undefined && compare(answer, min) < 0 || max !== undefined && compare(answer, max) > 0 ? "out-of-range" : undefined;
|
|
94
|
+
};
|
|
95
|
+
const validateStringConstraints = (answer, item, constraints) => {
|
|
96
|
+
if (item.type === "date" || item.type === "dateTime") {
|
|
97
|
+
return validateDateConstraints(answer, constraints);
|
|
98
|
+
}
|
|
99
|
+
if (item.type === "time") {
|
|
100
|
+
return validateTimeConstraints(answer, constraints);
|
|
101
|
+
}
|
|
102
|
+
return validateOtherStringConstraints(answer, constraints);
|
|
103
|
+
};
|
|
104
|
+
export { validateStringConstraints };
|
|
105
|
+
//# sourceMappingURL=questionnaire-string-constraint-validator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["compare","value","bound","test","localeCompare","includes","valueTime","Date","parse","boundTime","Number","isFinite","NaN","getDateInterval","timestamp","start","end","undefined","match","exec","year","month","startDay","endDay","getDate","getTime","getTimeValue","hours","minutes","seconds","fractionalSeconds","validateDateConstraints","answer","constraints","minValue","min","maxValue","max","answerInterval","minInterval","maxInterval","validateTimeConstraints","answerTime","minTime","maxTime","validateOtherStringConstraints","validateStringConstraints","item","type"],"sourceRoot":"../../../../../src","sources":["modules/questionnaire-response-form/utils/questionnaire-string-constraint-validator.ts"],"mappings":";;AAIA,MAAMA,OAAO,GAAGA,CAACC,KAAsB,EAAEC,KAAsB,KAAa;EAC1E,IAAI,OAAOD,KAAK,KAAK,QAAQ,IAAI,OAAOC,KAAK,KAAK,QAAQ,EAAE;IAC1D,OAAOD,KAAK,GAAGC,KAAK;EACtB;EAEA,IAAI,OAAOD,KAAK,KAAK,QAAQ,IAAI,OAAOC,KAAK,KAAK,QAAQ,EAAE;IAC1D,IACE,wBAAwB,CAACC,IAAI,CAACF,KAAK,CAAC,IACpC,wBAAwB,CAACE,IAAI,CAACD,KAAK,CAAC,EACpC;MACA,OAAOD,KAAK,CAACG,aAAa,CAACF,KAAK,CAAC;IACnC;IAEA,IAAID,KAAK,CAACI,QAAQ,CAAC,GAAG,CAAC,IAAIH,KAAK,CAACG,QAAQ,CAAC,GAAG,CAAC,EAAE;MAC9C,MAAMC,SAAS,GAAGC,IAAI,CAACC,KAAK,CAACP,KAAK,CAAC;MACnC,MAAMQ,SAAS,GAAGF,IAAI,CAACC,KAAK,CAACN,KAAK,CAAC;MAEnC,IAAIQ,MAAM,CAACC,QAAQ,CAACL,SAAS,CAAC,IAAII,MAAM,CAACC,QAAQ,CAACF,SAAS,CAAC,EAAE;QAC5D,OAAOH,SAAS,GAAGG,SAAS;MAC9B;IACF;IAEA,OAAOR,KAAK,CAACG,aAAa,CAACF,KAAK,CAAC;EACnC;EAEA,OAAOQ,MAAM,CAACE,GAAG;AACnB,CAAC;AAED,MAAMC,eAAe,GACnBZ,KAAa,IACkC;EAC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OAAQF,GAAG,KAAKlB,SAAS,IAAIjB,OAAO,CAACgC,MAAM,EAAEG,GAAG,CAAC,GAAG,CAAC,IAClDE,GAAG,KAAKpB,SAAS,IAAIjB,OAAO,CAACgC,MAAM,EAAEK,GAAG,CAAC,GAAG,CAAE,GAC7C,cAAc,GACdpB,SAAS;AACf,CAAC;AAED,MAAM6B,yBAAyB,GAAGA,CAChCd,MAAc,EACde,IAA+B,EAC/Bd,WAAyC,KACS;EAClD,IAAIc,IAAI,CAACC,IAAI,KAAK,MAAM,IAAID,IAAI,CAACC,IAAI,KAAK,UAAU,EAAE;IACpD,OAAOjB,uBAAuB,CAACC,MAAM,EAAEC,WAAW,CAAC;EACrD;EAEA,IAAIc,IAAI,CAACC,IAAI,KAAK,MAAM,EAAE;IACxB,OAAOP,uBAAuB,CAACT,MAAM,EAAEC,WAAW,CAAC;EACrD;EAEA,OAAOY,8BAA8B,CAACb,MAAM,EAAEC,WAAW,CAAC;AAC5D,CAAC;AAED,SAASa,yBAAyB","ignoreList":[]}
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
import { FormUtils } from "./form-utils.js";
|
|
4
4
|
export class QuestionnaireSubmitUtils {
|
|
5
|
-
static createQuestionnaireResponse(responses, pages, questionnaire) {
|
|
5
|
+
static createQuestionnaireResponse(responses, pages, questionnaire, renderItem, resolver, unitOptionsResolver) {
|
|
6
6
|
const responseItems = FormUtils.createQuestionnaireResponseItems(responses, pages);
|
|
7
7
|
const response = {
|
|
8
8
|
resourceType: "QuestionnaireResponse",
|
|
9
9
|
questionnaire: `Questionnaire/${questionnaire.id}`,
|
|
10
|
-
status: "completed",
|
|
10
|
+
status: FormUtils.hasUnansweredRequiredItems(pages, responses, renderItem, resolver, unitOptionsResolver) ? "in-progress" : "completed",
|
|
11
11
|
item: responseItems,
|
|
12
12
|
authored: new Date().toISOString()
|
|
13
13
|
};
|
package/lib/module/modules/questionnaire-response-form/utils/questionnaire-submit-utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["FormUtils","QuestionnaireSubmitUtils","createQuestionnaireResponse","responses","pages","questionnaire","responseItems","createQuestionnaireResponseItems","response","resourceType","id","status","item","authored","Date","toISOString"],"sourceRoot":"../../../../../src","sources":["modules/questionnaire-response-form/utils/questionnaire-submit-utils.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"names":["FormUtils","QuestionnaireSubmitUtils","createQuestionnaireResponse","responses","pages","questionnaire","renderItem","resolver","unitOptionsResolver","responseItems","createQuestionnaireResponseItems","response","resourceType","id","status","hasUnansweredRequiredItems","item","authored","Date","toISOString"],"sourceRoot":"../../../../../src","sources":["modules/questionnaire-response-form/utils/questionnaire-submit-utils.ts"],"mappings":";;AAMA,SAASA,SAAS,QAAQ,iBAAc;AAMxC,OAAO,MAAMC,wBAAwB,CAAC;EACpC,OAAOC,2BAA2BA,CAChCC,SAAyB,EACzBC,KAAkC,EAClCC,aAA4B,EAC5BC,UAAsC,EACtCC,QAA0C,EAC1CC,mBAAsD,EAC/B;IACvB,MAAMC,aAAa,GAAGT,SAAS,CAACU,gCAAgC,CAC9DP,SAAS,EACTC,KACF,CAAC;IAED,MAAMO,QAA+B,GAAG;MACtCC,YAAY,EAAE,uBAAuB;MACrCP,aAAa,EAAE,iBAAiBA,aAAa,CAACQ,EAAE,EAAE;MAClDC,MAAM,EAAEd,SAAS,CAACe,0BAA0B,CAC1CX,KAAK,EACLD,SAAS,EACTG,UAAU,EACVC,QAAQ,EACRC,mBACF,CAAC,GACG,aAAa,GACb,WAAW;MACfQ,IAAI,EAAEP,aAAa;MACnBQ,QAAQ,EAAE,IAAIC,IAAI,CAAC,CAAC,CAACC,WAAW,CAAC;IACnC,CAAC;IAED,OAAOR,QAAQ;EACjB;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const TRANSLATION_EXTENSION = "http://hl7.org/fhir/StructureDefinition/translation";
|
|
4
|
+
const normalizeLanguage = language => language.trim().replace(/_/g, "-").toLowerCase();
|
|
5
|
+
|
|
6
|
+
/** Resolves the standard FHIR translation extension for a primitive string. */
|
|
7
|
+
export const translateFhirText = (value, element, language) => {
|
|
8
|
+
const requestedLanguage = normalizeLanguage(language ?? "");
|
|
9
|
+
const requestedBaseLanguage = requestedLanguage.split("-")[0];
|
|
10
|
+
const translations = (element?.extension ?? []).filter(({
|
|
11
|
+
url
|
|
12
|
+
}) => url === TRANSLATION_EXTENSION).map(({
|
|
13
|
+
extension = []
|
|
14
|
+
}) => {
|
|
15
|
+
const translationLanguage = extension.find(({
|
|
16
|
+
url
|
|
17
|
+
}) => url === "lang")?.valueCode;
|
|
18
|
+
const content = extension.find(({
|
|
19
|
+
url
|
|
20
|
+
}) => url === "content");
|
|
21
|
+
const translatedValue = content?.valueString ?? content?.valueMarkdown;
|
|
22
|
+
return typeof translationLanguage === "string" && typeof translatedValue === "string" ? {
|
|
23
|
+
language: normalizeLanguage(translationLanguage),
|
|
24
|
+
value: translatedValue
|
|
25
|
+
} : undefined;
|
|
26
|
+
}).filter(translation => translation !== undefined);
|
|
27
|
+
const exactTranslation = translations.find(translation => translation.language === requestedLanguage);
|
|
28
|
+
const baseTranslation = translations.find(translation => translation.language.split("-")[0] === requestedBaseLanguage);
|
|
29
|
+
return exactTranslation?.value ?? baseTranslation?.value ?? value ?? "";
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=translate-fhir-text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["TRANSLATION_EXTENSION","normalizeLanguage","language","trim","replace","toLowerCase","translateFhirText","value","element","requestedLanguage","requestedBaseLanguage","split","translations","extension","filter","url","map","translationLanguage","find","valueCode","content","translatedValue","valueString","valueMarkdown","undefined","translation","exactTranslation","baseTranslation"],"sourceRoot":"../../../../../src","sources":["modules/questionnaire-response-form/utils/translate-fhir-text.ts"],"mappings":";;AAEA,MAAMA,qBAAqB,GACzB,q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A,WAAW,CAACvB,QAAQ,KAAKO,iBAC5C,CAAC;EAED,MAAMkB,eAAe,GAAGf,YAAY,CAACM,IAAI,CACtCO,WAAW,IAAKA,WAAW,CAACvB,QAAQ,CAACS,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAKD,qBAC1D,CAAC;EAED,OAAOgB,gBAAgB,EAAEnB,KAAK,IAAIoB,eAAe,EAAEpB,KAAK,IAAIA,KAAK,IAAI,EAAE;AACzE,CAAC","ignoreList":[]}
|
package/lib/module/modules/questionnaire-response-form/utils/validate-questionnaire-item-value.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { createAnswerFromValue } from "./create-answer-from-value.js";
|
|
4
|
+
import { getAnswerValueKey } from "./is-valid-questionnaire-answer.js";
|
|
5
|
+
import { getQuestionnaireItemConstraints } from "./questionnaire-item-constraints.js";
|
|
6
|
+
import { validateAnswerLength, validateNumberConstraints, validateQuantityConstraints } from "./questionnaire-item-value-constraint-validators.js";
|
|
7
|
+
import { validateStringConstraints } from "./questionnaire-string-constraint-validator.js";
|
|
8
|
+
const hasValue = value => value !== undefined && value !== null && value !== "";
|
|
9
|
+
const getAnswerValue = (value, item) => {
|
|
10
|
+
const answer = createAnswerFromValue(value, item);
|
|
11
|
+
if (!answer) {
|
|
12
|
+
return undefined;
|
|
13
|
+
}
|
|
14
|
+
const key = getAnswerValueKey(answer);
|
|
15
|
+
return key ? answer[key] : undefined;
|
|
16
|
+
};
|
|
17
|
+
export const validateQuestionnaireItemValue = (value, item, answers = {}, resolver, unitOptionsResolver) => {
|
|
18
|
+
if (!hasValue(value)) {
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
const answer = getAnswerValue(value, item);
|
|
22
|
+
if (answer === undefined) {
|
|
23
|
+
return "invalid-answer";
|
|
24
|
+
}
|
|
25
|
+
const constraints = getQuestionnaireItemConstraints(item, answers, resolver, unitOptionsResolver);
|
|
26
|
+
if (constraints.unresolvedDynamicBounds.length > 0) {
|
|
27
|
+
return "unresolved-constraint";
|
|
28
|
+
}
|
|
29
|
+
const lengthViolation = validateAnswerLength(value, answer, item, constraints);
|
|
30
|
+
if (lengthViolation) {
|
|
31
|
+
return lengthViolation;
|
|
32
|
+
}
|
|
33
|
+
if (typeof answer === "number") {
|
|
34
|
+
return validateNumberConstraints(answer, constraints);
|
|
35
|
+
}
|
|
36
|
+
if (typeof answer === "string") {
|
|
37
|
+
return validateStringConstraints(answer, item, constraints);
|
|
38
|
+
}
|
|
39
|
+
if (typeof answer === "object" && answer !== null && "value" in answer) {
|
|
40
|
+
return validateQuantityConstraints(answer, constraints);
|
|
41
|
+
}
|
|
42
|
+
return undefined;
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=validate-questionnaire-item-value.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createAnswerFromValue","getAnswerValueKey","getQuestionnaireItemConstraints","validateAnswerLength","validateNumberConstraints","validateQuantityConstraints","validateStringConstraints","hasValue","value","undefined","getAnswerValue","item","answer","key","validateQuestionnaireItemValue","answers","resolver","unitOptionsResolver","constraints","unresolvedDynamicBounds","length","lengthViolation"],"sourceRoot":"../../../../../src","sources":["modules/questionnaire-response-form/utils/validate-questionnaire-item-value.ts"],"mappings":";;AAKA,SAASA,qBAAqB,QAAQ,+BAA4B;AAClE,SAASC,iBAAiB,QAAQ,oCAAiC;AACnE,SACEC,+BAA+B,QAG1B,qCAAkC;AACzC,SACEC,oBAAoB,EACpBC,yBAAyB,EACzBC,2BAA2B,QACtB,qDAAkD;AACzD,SAASC,yBAAyB,QAAQ,gDAA6C;AAUvF,MAAMC,QAAQ,GAAIC,KAAc,IAC9BA,KAAK,KAAKC,SAAS,IAAID,KAAK,KAAK,IAAI,IAAIA,KAAK,KAAK,EAAE;AAEvD,MAAME,cAAc,GAAGA,CACrBF,KAA6B,EAC7BG,IAA+B,KACnB;EACZ,MAAMC,MAAM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A2B,CAACO,MAAM,EAAcM,WAAW,CAAC;EACrE;EAEA,OAAOT,SAAS;AAClB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
/**
|
|
6
|
+
* Loads host-defined, account-scoped prerequisites before rendering children.
|
|
7
|
+
* This is a UI gate only; backend authorization remains authoritative.
|
|
8
|
+
*/
|
|
9
|
+
export const PrerequisiteGate = ({
|
|
10
|
+
scopeKey,
|
|
11
|
+
check,
|
|
12
|
+
pending = null,
|
|
13
|
+
renderRequired,
|
|
14
|
+
onError,
|
|
15
|
+
children
|
|
16
|
+
}) => {
|
|
17
|
+
const checkRef = React.useRef(check);
|
|
18
|
+
const onErrorRef = React.useRef(onError);
|
|
19
|
+
const [attempt, setAttempt] = React.useState(0);
|
|
20
|
+
const [result, setResult] = React.useState();
|
|
21
|
+
React.useEffect(() => {
|
|
22
|
+
checkRef.current = check;
|
|
23
|
+
onErrorRef.current = onError;
|
|
24
|
+
}, [check, onError]);
|
|
25
|
+
React.useEffect(() => {
|
|
26
|
+
let active = true;
|
|
27
|
+
void Promise.resolve().then(() => checkRef.current()).then(requirement => {
|
|
28
|
+
if (active) {
|
|
29
|
+
setResult({
|
|
30
|
+
scopeKey,
|
|
31
|
+
attempt,
|
|
32
|
+
requirement: requirement ?? null
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}).catch(error => {
|
|
36
|
+
if (active) {
|
|
37
|
+
setResult({
|
|
38
|
+
scopeKey,
|
|
39
|
+
attempt,
|
|
40
|
+
requirement: null
|
|
41
|
+
});
|
|
42
|
+
onErrorRef.current?.(error);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
return () => {
|
|
46
|
+
active = false;
|
|
47
|
+
};
|
|
48
|
+
}, [scopeKey, attempt]);
|
|
49
|
+
const refresh = React.useCallback(() => {
|
|
50
|
+
setAttempt(current => current + 1);
|
|
51
|
+
}, []);
|
|
52
|
+
const currentResult = result?.scopeKey === scopeKey && result.attempt === attempt ? result : undefined;
|
|
53
|
+
if (!currentResult) {
|
|
54
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
55
|
+
children: pending
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
if (currentResult.requirement === null) {
|
|
59
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
60
|
+
children: children
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
64
|
+
children: renderRequired(currentResult.requirement, refresh)
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=prerequisite-gate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Fragment","_Fragment","jsx","_jsx","PrerequisiteGate","scopeKey","check","pending","renderRequired","onError","children","checkRef","useRef","onErrorRef","attempt","setAttempt","useState","result","setResult","useEffect","current","active","Promise","resolve","then","requirement","catch","error","refresh","useCallback","currentResult","undefined"],"sourceRoot":"../../../../../src","sources":["modules/ui/components/prerequisite-gate.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAAC,SAAAC,QAAA,IAAAC,SAAA,EAAAC,GAAA,IAAAC,IAAA;AA0B/B;AACA;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,GAAGA,CAAK;EACnCC,QAAQ;EACRC,KAAK;EACLC,OAAO,GAAG,IAAI;EACdC,cAAc;EACdC,OAAO;EACPC;AACwB,CAAC,KAAK;EAC9B,MAAMC,QAAQ,GAAGZ,KAAK,CAACa,MAAM,CAACN,KAAK,CAAC;EACpC,MAAMO,UAAU,GAAGd,KAAK,CAACa,MAAM,CAACH,OAAO,CAAC;EACxC,MAAM,CAACK,OAAO,EAAEC,UAAU,CAAC,GAAGhB,KAAK,CAACiB,QAAQ,CAAC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,IAAI,CAACD,aAAa,EAAE;IAClB,oBAAO3B,IAAA,CAAAF,SAAA;MAAAS,QAAA,EAAGH;IAAO,CAAG,CAAC;EACvB;EAEA,IAAIuB,aAAa,CAACL,WAAW,KAAK,IAAI,EAAE;IACtC,oBAAOtB,IAAA,CAAAF,SAAA;MAAAS,QAAA,EAAGA;IAAQ,CAAG,CAAC;EACxB;EAEA,oBAAOP,IAAA,CAAAF,SAAA;IAAAS,QAAA,EAAGF,cAAc,CAACsB,aAAa,CAACL,WAAW,EAAEG,OAAO;EAAC,CAAG,CAAC;AAClE,CAAC","ignoreList":[]}
|
|
@@ -4,6 +4,7 @@ export * from "./types.js";
|
|
|
4
4
|
export * from "./use-ovok-ui.js";
|
|
5
5
|
export * from "./components/ecg-strip-viewer.js";
|
|
6
6
|
export * from "./components/flow-frame.js";
|
|
7
|
+
export * from "./components/prerequisite-gate.js";
|
|
7
8
|
export * from "./components/manual-entry-form.js";
|
|
8
9
|
export * from "./components/supported-devices-catalog-list.js";
|
|
9
10
|
export * from "./components/bluetooth-state-notice.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["modules/ui/index.ts"],"mappings":";;AAAA,cAAc,YAAS;AACvB,cAAc,kBAAe;AAC7B,cAAc,kCAA+B;AAC7C,cAAc,4BAAyB;AACvC,cAAc,mCAAgC;AAC9C,cAAc,gDAA6C;AAC3D,cAAc,wCAAqC;AACnD,cAAc,8BAA2B;AACzC,cAAc,sCAAmC;AACjD,cAAc,mCAAgC;AAC9C,cAAc,oCAAiC;AAC/C,cAAc,yCAAsC;AACpD,cAAc,yCAAsC;AACpD,cAAc,0BAAuB;AACrC,cAAc,iCAA8B","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["modules/ui/index.ts"],"mappings":";;AAAA,cAAc,YAAS;AACvB,cAAc,kBAAe;AAC7B,cAAc,kCAA+B;AAC7C,cAAc,4BAAyB;AACvC,cAAc,mCAAgC;AAC9C,cAAc,mCAAgC;AAC9C,cAAc,gDAA6C;AAC3D,cAAc,wCAAqC;AACnD,cAAc,8BAA2B;AACzC,cAAc,sCAAmC;AACjD,cAAc,mCAAgC;AAC9C,cAAc,oCAAiC;AAC/C,cAAc,yCAAsC;AACpD,cAAc,yCAAsC;AACpD,cAAc,0BAAuB;AACrC,cAAc,iCAA8B","ignoreList":[]}
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
/* eslint-disable import/group-exports */
|
|
4
|
+
|
|
5
|
+
import { polyfillMedplumWebAPIs as polyfillOvokWebAPIs } from "@medplum/expo-polyfills";
|
|
6
|
+
export { ExpoClientStorage, ExtendedExpoCrypto, IExpoClientStorage, PolyfillEnabledConfig, cleanupMedplumWebAPIs, cleanupMedplumWebAPIs as cleanupOvokNativeRuntime, initWebSocketManager } from "@medplum/expo-polyfills";
|
|
7
|
+
export { polyfillOvokWebAPIs };
|
|
8
|
+
|
|
9
|
+
/** @deprecated Use polyfillOvokWebAPIs instead. */
|
|
10
|
+
export const polyfillMedplumWebAPIs = polyfillOvokWebAPIs;
|
|
11
|
+
|
|
12
|
+
/** @deprecated Use polyfillOvokWebAPIs instead. */
|
|
13
|
+
export const initializeOvokNativeRuntime = polyfillOvokWebAPIs;
|
|
4
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["polyfillMedplumWebAPIs","
|
|
1
|
+
{"version":3,"names":["polyfillMedplumWebAPIs","polyfillOvokWebAPIs","ExpoClientStorage","ExtendedExpoCrypto","IExpoClientStorage","PolyfillEnabledConfig","cleanupMedplumWebAPIs","cleanupOvokNativeRuntime","initWebSocketManager","initializeOvokNativeRuntime"],"sourceRoot":"../../../src","sources":["polyfills/index.ts"],"mappings":";;AAAA;;AAEA,SAASA,sBAAsB,IAAIC,mBAAmB,QAAQ,yBAAyB;AAEvF,SACEC,iBAAiB,EACjBC,kBAAkB,EAClBC,kBAAkB,EAClBC,qBAAqB,EACrBC,qBAAqB,EACrBA,qBAAqB,IAAIC,wBAAwB,EACjDC,oBAAoB,QACf,yBAAyB;AAEhC,SAASP,mBAAmB;;AAE5B;AACA,OAAO,MAAMD,sBAAsB,GAAGC,mBAAmB;;AAEzD;AACA,OAAO,MAAMQ,2BAA2B,GAAGR,mBAAmB","ignoreList":[]}
|
|
@@ -7,6 +7,15 @@ export declare const defaultTranslation: {
|
|
|
7
7
|
cancel: string;
|
|
8
8
|
delete: string;
|
|
9
9
|
};
|
|
10
|
+
"questionnaire-form": {
|
|
11
|
+
item: {
|
|
12
|
+
unsupported: string;
|
|
13
|
+
};
|
|
14
|
+
picker: {
|
|
15
|
+
increase: string;
|
|
16
|
+
decrease: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
10
19
|
profile: {
|
|
11
20
|
form: {
|
|
12
21
|
error: {
|
|
@@ -24,6 +33,10 @@ export declare const defaultTranslation: {
|
|
|
24
33
|
register: {
|
|
25
34
|
"already-have-account": string;
|
|
26
35
|
button: string;
|
|
36
|
+
errors: {
|
|
37
|
+
network: string;
|
|
38
|
+
generic: string;
|
|
39
|
+
};
|
|
27
40
|
name: string;
|
|
28
41
|
"full-name": string;
|
|
29
42
|
"or-register-with": string;
|
|
@@ -35,6 +48,10 @@ export declare const defaultTranslation: {
|
|
|
35
48
|
"reset-password": {
|
|
36
49
|
accountType: string;
|
|
37
50
|
email: string;
|
|
51
|
+
errors: {
|
|
52
|
+
network: string;
|
|
53
|
+
generic: string;
|
|
54
|
+
};
|
|
38
55
|
patient: string;
|
|
39
56
|
practitioner: string;
|
|
40
57
|
"reset-password": string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-translation.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/auth/default-translation.ts"],"names":[],"mappings":"AAEA,8FAA8F;AAC9F,eAAO,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"default-translation.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/auth/default-translation.ts"],"names":[],"mappings":"AAEA,8FAA8F;AAC9F,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoF9B,CAAC"}
|