@ovok/native 1.10.2 → 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/README.md +5 -5
- package/lib/commonjs/modules/auth/default-translation.js +22 -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/profile/components/profile-form-provider.js +3 -6
- package/lib/commonjs/modules/auth/profile/components/profile-form-provider.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 +4 -3
- package/lib/commonjs/modules/auth/reset-password/components/form/reset-password-form-provider.js.map +1 -1
- package/lib/commonjs/modules/auth/session/logout-session.js +5 -2
- package/lib/commonjs/modules/auth/session/logout-session.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 +17 -0
- package/lib/commonjs/modules/auth/session/session-store-types.js.map +1 -0
- package/lib/commonjs/modules/auth/session/session-store.js +56 -123
- package/lib/commonjs/modules/auth/session/session-store.js.map +1 -1
- package/lib/commonjs/modules/auth/utils/sign-in-error.js +10 -4
- package/lib/commonjs/modules/auth/utils/sign-in-error.js.map +1 -1
- package/lib/commonjs/modules/bt-management/components/bt-provider-child-wrapper.js +5 -0
- package/lib/commonjs/modules/bt-management/components/bt-provider-child-wrapper.js.map +1 -1
- package/lib/commonjs/modules/bt-management/hooks/declined-device-storage.js +36 -1
- package/lib/commonjs/modules/bt-management/hooks/declined-device-storage.js.map +1 -1
- package/lib/commonjs/modules/bt-management/hooks/nearby-device-offer-state.js +25 -0
- package/lib/commonjs/modules/bt-management/hooks/nearby-device-offer-state.js.map +1 -0
- package/lib/commonjs/modules/bt-management/hooks/nearby-device-offer-types.js +6 -0
- package/lib/commonjs/modules/bt-management/hooks/nearby-device-offer-types.js.map +1 -0
- package/lib/commonjs/modules/bt-management/hooks/use-nearby-device-offer.js +22 -36
- package/lib/commonjs/modules/bt-management/hooks/use-nearby-device-offer.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/background-sync/background-sync-coordinator.js +11 -0
- package/lib/commonjs/modules/bt-management/services/background-sync/background-sync-coordinator.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 +74 -34
- 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 +219 -16
- 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/health-units.js +1 -0
- package/lib/commonjs/modules/data-sync/utils/health-units.js.map +1 -1
- 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/bluetooth-state-notice.js +31 -15
- package/lib/commonjs/modules/ui/components/bluetooth-state-notice.js.map +1 -1
- 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/default-translation.js +50 -0
- package/lib/commonjs/modules/ui/default-translation.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 +22 -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/profile/components/profile-form-provider.js +3 -6
- package/lib/module/modules/auth/profile/components/profile-form-provider.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 +3 -3
- package/lib/module/modules/auth/reset-password/components/form/reset-password-form-provider.js.map +1 -1
- package/lib/module/modules/auth/session/logout-session.js +5 -2
- package/lib/module/modules/auth/session/logout-session.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 +13 -0
- package/lib/module/modules/auth/session/session-store-types.js.map +1 -0
- package/lib/module/modules/auth/session/session-store.js +56 -123
- package/lib/module/modules/auth/session/session-store.js.map +1 -1
- package/lib/module/modules/auth/utils/sign-in-error.js +9 -4
- package/lib/module/modules/auth/utils/sign-in-error.js.map +1 -1
- package/lib/module/modules/bt-management/components/bt-provider-child-wrapper.js +5 -0
- package/lib/module/modules/bt-management/components/bt-provider-child-wrapper.js.map +1 -1
- package/lib/module/modules/bt-management/hooks/declined-device-storage.js +33 -1
- package/lib/module/modules/bt-management/hooks/declined-device-storage.js.map +1 -1
- package/lib/module/modules/bt-management/hooks/nearby-device-offer-state.js +20 -0
- package/lib/module/modules/bt-management/hooks/nearby-device-offer-state.js.map +1 -0
- package/lib/module/modules/bt-management/hooks/nearby-device-offer-types.js +4 -0
- package/lib/module/modules/bt-management/hooks/nearby-device-offer-types.js.map +1 -0
- package/lib/module/modules/bt-management/hooks/use-nearby-device-offer.js +21 -35
- package/lib/module/modules/bt-management/hooks/use-nearby-device-offer.js.map +1 -1
- package/lib/module/modules/bt-management/services/background-sync/background-sync-coordinator.js +11 -0
- package/lib/module/modules/bt-management/services/background-sync/background-sync-coordinator.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 +74 -34
- 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 +219 -16
- 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/health-units.js +1 -0
- package/lib/module/modules/data-sync/utils/health-units.js.map +1 -1
- 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/bluetooth-state-notice.js +31 -15
- package/lib/module/modules/ui/components/bluetooth-state-notice.js.map +1 -1
- 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/default-translation.js +45 -0
- package/lib/module/modules/ui/default-translation.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 +22 -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/profile/components/profile-form-provider.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/logout-session.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 +33 -0
- package/lib/typescript/commonjs/src/modules/auth/session/session-store-types.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/auth/session/session-store.d.ts +1 -18
- 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 +4 -2
- package/lib/typescript/commonjs/src/modules/auth/utils/sign-in-error.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/components/bt-provider-child-wrapper.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/declined-device-storage.d.ts +10 -1
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/declined-device-storage.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/nearby-device-offer-state.d.ts +6 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/nearby-device-offer-state.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/nearby-device-offer-types.d.ts +15 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/nearby-device-offer-types.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-nearby-device-offer.d.ts +6 -14
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-nearby-device-offer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/background-sync/background-sync-coordinator.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/background-sync.d.ts +7 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/background-sync.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 +5 -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/health-units.d.ts.map +1 -1
- 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/bluetooth-state-notice.d.ts +8 -5
- package/lib/typescript/commonjs/src/modules/ui/components/bluetooth-state-notice.d.ts.map +1 -1
- 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/default-translation.d.ts +30 -0
- package/lib/typescript/commonjs/src/modules/ui/default-translation.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 +22 -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/profile/components/profile-form-provider.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/logout-session.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 +33 -0
- package/lib/typescript/module/src/modules/auth/session/session-store-types.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/auth/session/session-store.d.ts +1 -18
- 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 +4 -2
- package/lib/typescript/module/src/modules/auth/utils/sign-in-error.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/components/bt-provider-child-wrapper.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/hooks/declined-device-storage.d.ts +10 -1
- package/lib/typescript/module/src/modules/bt-management/hooks/declined-device-storage.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/hooks/nearby-device-offer-state.d.ts +6 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/nearby-device-offer-state.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/nearby-device-offer-types.d.ts +15 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/nearby-device-offer-types.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/use-nearby-device-offer.d.ts +6 -14
- package/lib/typescript/module/src/modules/bt-management/hooks/use-nearby-device-offer.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/background-sync/background-sync-coordinator.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/background-sync.d.ts +7 -0
- package/lib/typescript/module/src/modules/bt-management/types/background-sync.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 +5 -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/health-units.d.ts.map +1 -1
- 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/bluetooth-state-notice.d.ts +8 -5
- package/lib/typescript/module/src/modules/ui/components/bluetooth-state-notice.d.ts.map +1 -1
- 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/default-translation.d.ts +30 -0
- package/lib/typescript/module/src/modules/ui/default-translation.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 +5 -8
|
@@ -64,16 +64,19 @@ const MyComponent = () => {
|
|
|
64
64
|
|
|
65
65
|
## Props
|
|
66
66
|
|
|
67
|
-
| Prop
|
|
68
|
-
|
|
|
69
|
-
| questionnaire
|
|
70
|
-
| onSubmit
|
|
71
|
-
| onSuccess
|
|
72
|
-
| onError
|
|
73
|
-
| initialValues
|
|
74
|
-
|
|
|
75
|
-
|
|
|
76
|
-
|
|
|
67
|
+
| Prop | Type | Description |
|
|
68
|
+
| ------------------------------- | ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
|
|
69
|
+
| questionnaire | Questionnaire | The FHIR Questionnaire resource to render |
|
|
70
|
+
| onSubmit | (values: QuestionnaireFormValues, formikHelpers?: FormikHelpers<QuestionnaireFormValues>) => Promise<void> | Optional callback for form submission |
|
|
71
|
+
| onSuccess | (response: QuestionnaireResponse) => void | Optional callback when form is submitted successfully |
|
|
72
|
+
| onError | (error: Error) => void | Optional callback when form submission fails |
|
|
73
|
+
| initialValues | Partial<QuestionnaireFormValues> | Optional initial values for the form |
|
|
74
|
+
| renderItem | QuestionnaireItemRenderer | Optional host control for any non-group FHIR item |
|
|
75
|
+
| resolveQuestionnaireConstraint | QuestionnaireConstraintResolver | Resolves SDC calculated min/max values with the host's expression context |
|
|
76
|
+
| resolveQuestionnaireUnitOptions | QuestionnaireUnitOptionsResolver | Supplies a cached expansion for an SDC `unitValueSet` canonical |
|
|
77
|
+
| children | ReactNode | Child components for custom layout |
|
|
78
|
+
| style | ViewStyle | Optional styles for the container |
|
|
79
|
+
| testID | string | Test ID for testing |
|
|
77
80
|
|
|
78
81
|
Choose either the host-owned `onSubmit(values, formikHelpers?)` mode or the SDK-managed
|
|
79
82
|
`onSuccess(response)` mode. `onError(error)` is optional in the SDK-managed mode. The
|
|
@@ -81,6 +84,33 @@ SDK-managed path requires the active `@ovok/core` client/profile context, create
|
|
|
81
84
|
completed `QuestionnaireResponse`, adds the patient subject and a stable identifier,
|
|
82
85
|
and persists it with `createResourceIfNoneExist`.
|
|
83
86
|
|
|
87
|
+
Custom `renderItem` controls receive a `constraints` object with `minValue`,
|
|
88
|
+
`maxValue`, `minQuantity`, `maxQuantity`, `step`, `minLength`, `maxLength`,
|
|
89
|
+
`unitOptions`, `unitValueSet`, and `unitOpen`. This lets an app use its own
|
|
90
|
+
controls and terminology cache without coupling the SDK to an expression or
|
|
91
|
+
terminology service. Implement `resolveQuestionnaireConstraint` for calculated
|
|
92
|
+
SDC bounds and `resolveQuestionnaireUnitOptions` for cached ValueSet expansions;
|
|
93
|
+
both callbacks are synchronous. If a calculated bound or unit ValueSet is not
|
|
94
|
+
resolved, a non-empty answer using it is not accepted as valid. Quantity bounds
|
|
95
|
+
are compared only when the answer and bound use the same UCUM code; convert
|
|
96
|
+
units in the host control before returning the answer when conversions are
|
|
97
|
+
needed.
|
|
98
|
+
|
|
99
|
+
Static date/dateTime bounds are passed to the date picker, numeric bounds and
|
|
100
|
+
steps are checked on navigation and submission, and simple-type length limits
|
|
101
|
+
are checked before submission. Bounded integer items and decimal items with an
|
|
102
|
+
explicit step use a touch wheel when the generated range contains at most 1,000
|
|
103
|
+
values; unconstrained, invalid, or larger ranges retain text entry. A displayed
|
|
104
|
+
wheel default is not saved until the person changes the selection. The typed
|
|
105
|
+
`ValueWheelPicker<T>` in `@ovok/native/picker-sheet` can render `unitOptions`;
|
|
106
|
+
use its `value` prop for the committed selection and `defaultIndex` only for a
|
|
107
|
+
display-only initial position.
|
|
108
|
+
|
|
109
|
+
Host-rendered quantity and duration controls can combine `minQuantity`,
|
|
110
|
+
`maxQuantity`, `unitOptions`, and the host-resolved `unitValueSet` in one or
|
|
111
|
+
more typed wheels. This keeps UCUM conversion and terminology lookup in the
|
|
112
|
+
host app while reusing the same generic picker in different forms and styles.
|
|
113
|
+
|
|
84
114
|
## Extended Properties
|
|
85
115
|
|
|
86
116
|
In addition to standard FHIR QuestionnaireItem properties, the component supports these additional UI properties:
|
|
@@ -168,6 +198,15 @@ The form supports various field types through specialized components:
|
|
|
168
198
|
- **QuestionnaireDateField**: Date picker
|
|
169
199
|
- **QuestionnaireItemRenderer**: Dynamic field type renderer
|
|
170
200
|
|
|
201
|
+
The optional `renderItem` callback can provide host-designed controls for item
|
|
202
|
+
types without a built-in control, including `url`, `open-choice`, `quantity`,
|
|
203
|
+
`attachment`, and `reference`. Its `onChange` accepts either a primitive value
|
|
204
|
+
for built-in types or a typed FHIR answer value such as
|
|
205
|
+
`{ valueQuantity: { value: 2, unit: "mg" } }`. This preserves the corresponding
|
|
206
|
+
FHIR `value[x]` field in SDK-created responses and makes required custom items
|
|
207
|
+
participate in validation. Without a custom renderer, unsupported items show a
|
|
208
|
+
fallback and do not prevent continuing through the form.
|
|
209
|
+
|
|
171
210
|
## Context and Hooks
|
|
172
211
|
|
|
173
212
|
The form provides a context and hooks for advanced customization:
|
|
@@ -253,16 +292,16 @@ const MyComponent = () => {
|
|
|
253
292
|
|
|
254
293
|
#### QuestionnaireForm Props
|
|
255
294
|
|
|
256
|
-
| Prop | Type
|
|
257
|
-
| ------------- |
|
|
258
|
-
| questionnaire | Questionnaire
|
|
259
|
-
| onSubmit | (values: QuestionnaireFormValues, formikHelpers?) => Promise<void> | Host-owned submit callback
|
|
260
|
-
| onSuccess | (response: QuestionnaireResponse) => void
|
|
261
|
-
| onError | (error: Error) => void
|
|
262
|
-
| initialValues | Partial<QuestionnaireFormValues>
|
|
263
|
-
| paged | boolean
|
|
264
|
-
| style | StyleProp<ViewStyle>
|
|
265
|
-
| testID | string
|
|
295
|
+
| Prop | Type | Description |
|
|
296
|
+
| ------------- | ------------------------------------------------------------------ | ---------------------------------------------------- |
|
|
297
|
+
| questionnaire | Questionnaire | The questionnaire object to render |
|
|
298
|
+
| onSubmit | (values: QuestionnaireFormValues, formikHelpers?) => Promise<void> | Host-owned submit callback |
|
|
299
|
+
| onSuccess | (response: QuestionnaireResponse) => void | Called after SDK-managed persistence |
|
|
300
|
+
| onError | (error: Error) => void | Called when SDK-managed persistence fails |
|
|
301
|
+
| initialValues | Partial<QuestionnaireFormValues> | Initial values for the form |
|
|
302
|
+
| paged | boolean | Whether to show one item at a time; defaults to true |
|
|
303
|
+
| style | StyleProp<ViewStyle> | Style for the container |
|
|
304
|
+
| testID | string | Test ID for the component |
|
|
266
305
|
|
|
267
306
|
#### QuestionnaireForm.Header Props
|
|
268
307
|
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { View } from "react-native";
|
|
5
5
|
import { useQuestionnaireForm } from "../../hooks/use-questionnaire-form.js";
|
|
6
|
+
import { getQuestionnaireItemConstraints } from "../../utils/questionnaire-item-constraints.js";
|
|
6
7
|
import { QuestionnaireItemRenderer } from "../fields/questionnaire-item-renderer.js";
|
|
7
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
9
|
export const QuestionnaireContentItem = /*#__PURE__*/React.memo(({
|
|
@@ -12,6 +13,10 @@ export const QuestionnaireContentItem = /*#__PURE__*/React.memo(({
|
|
|
12
13
|
}) => {
|
|
13
14
|
const {
|
|
14
15
|
currentItem,
|
|
16
|
+
locale,
|
|
17
|
+
renderItem,
|
|
18
|
+
resolveQuestionnaireConstraint,
|
|
19
|
+
resolveQuestionnaireUnitOptions,
|
|
15
20
|
values,
|
|
16
21
|
setFieldValue
|
|
17
22
|
} = useQuestionnaireForm();
|
|
@@ -34,6 +39,9 @@ export const QuestionnaireContentItem = /*#__PURE__*/React.memo(({
|
|
|
34
39
|
item: currentItem,
|
|
35
40
|
value: value,
|
|
36
41
|
onChange: onChange,
|
|
42
|
+
locale: locale,
|
|
43
|
+
renderItem: renderItem,
|
|
44
|
+
constraints: getQuestionnaireItemConstraints(currentItem, values, resolveQuestionnaireConstraint, resolveQuestionnaireUnitOptions),
|
|
37
45
|
testID: testID ? `${testID}-${itemId}` : `item-${itemId}`
|
|
38
46
|
})
|
|
39
47
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","useQuestionnaireForm","QuestionnaireItemRenderer","jsx","_jsx","QuestionnaireContentItem","memo","style","testID","props","currentItem","values","setFieldValue","onChange","useCallback","val","linkId","itemId","value","children","item"],"sourceRoot":"../../../../../../src","sources":["modules/questionnaire-response-form/components/content/questionnaire-content-item.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,IAAI,QAAmB,cAAc;AAE9C,SAASC,oBAAoB,QAAQ,uCAAoC;
|
|
1
|
+
{"version":3,"names":["React","View","useQuestionnaireForm","getQuestionnaireItemConstraints","QuestionnaireItemRenderer","jsx","_jsx","QuestionnaireContentItem","memo","style","testID","props","currentItem","locale","renderItem","resolveQuestionnaireConstraint","resolveQuestionnaireUnitOptions","values","setFieldValue","onChange","useCallback","val","linkId","itemId","value","children","item","constraints"],"sourceRoot":"../../../../../../src","sources":["modules/questionnaire-response-form/components/content/questionnaire-content-item.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,IAAI,QAAmB,cAAc;AAE9C,SAASC,oBAAoB,QAAQ,uCAAoC;AAEzE,SAASC,+BAA+B,QAAQ,+CAA4C;AAC5F,SAASC,yBAAyB,QAAQ,0CAAuC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAElF,OAAO,MAAMC,wBAAwB,gBAAGP,KAAK,CAACQ,IAAI,CAChD,CAAC;EAAEC,KAAK;EAAEC,MAAM;EAAE,GAAGC;AAAiB,CAAC,KAAK;EAC1C,MAAM;IACJC,WAAW;IACXC,MAAM;IACNC,UAAU;IACVC,8BAA8B;IAC9BC,+BAA+B;IAC/BC,MAAM;IACNC;EACF,CAAC,GAAGhB,oBAAoB,CAAC,CAAC;EAE1B,MAAMiB,QAAQ,GAAGnB,KAAK,CAACoB,WAAW,CAC/BC,GAA2B,IAAK;IAC/B,IAAI,CAACT,WAAW,EAAEU,MAAM,EAAE;MACxB;IACF;IAEAJ,aAAa,CAACN,WAAW,CAACU,MAAM,EAAED,GAAG,CAAC;EACxC,CAAC,EACD,CAACT,WAAW,EAAEU,MAAM,EAAEJ,aAAa,CACrC,CAAC;EAED,IAAI,CAACN,WAAW,EAAE;IAChB,OAAO,IAAI;EACb;EAEA,MAAMW,MAAM,GAAGX,WAAW,CAACU,MAAM,IAAI,EAAE;EACvC,MAAME,KAAK,GAAGP,MAAM,CAACM,MAAM,CAAC;EAE5B,oBACEjB,IAAA,CAACL,IAAI;IAAA,GAAKU,KAAK;IAAEF,KAAK,EAAEA,KAAM;IAACC,MAAM,EAAEA,MAAO;IAAAe,QAAA,eAC5CnB,IAAA,CAACF,yBAAyB;MACxBsB,IAAI,EAAEd,WAAY;MAClBY,KAAK,EAAEA,KAAM;MACbL,QAAQ,EAAEA,QAAS;MACnBN,MAAM,EAAEA,MAAO;MACfC,UAAU,EAAEA,UAAW;MACvBa,WAAW,EAAExB,+BAA+B,CAC1CS,WAAW,EACXK,MAAM,EACNF,8BAA8B,EAC9BC,+BACF,CAAE;MACFN,MAAM,EAAEA,MAAM,GAAG,GAAGA,MAAM,IAAIa,MAAM,EAAE,GAAG,QAAQA,MAAM;IAAG,CAC3D;EAAC,CACE,CAAC;AAEX,CACF,CAAC","ignoreList":[]}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { View } from "react-native";
|
|
5
5
|
import { useQuestionnaireForm } from "../../hooks/use-questionnaire-form.js";
|
|
6
|
+
import { getQuestionnaireItemConstraints } from "../../utils/questionnaire-item-constraints.js";
|
|
6
7
|
import { QuestionnaireItemRenderer } from "../fields/questionnaire-item-renderer.js";
|
|
7
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
9
|
const QuestionnaireContentSpecificItemComponent = /*#__PURE__*/React.memo(({
|
|
@@ -12,6 +13,10 @@ const QuestionnaireContentSpecificItemComponent = /*#__PURE__*/React.memo(({
|
|
|
12
13
|
...props
|
|
13
14
|
}) => {
|
|
14
15
|
const {
|
|
16
|
+
locale,
|
|
17
|
+
renderItem,
|
|
18
|
+
resolveQuestionnaireConstraint,
|
|
19
|
+
resolveQuestionnaireUnitOptions,
|
|
15
20
|
values,
|
|
16
21
|
setFieldValue
|
|
17
22
|
} = useQuestionnaireForm();
|
|
@@ -34,6 +39,9 @@ const QuestionnaireContentSpecificItemComponent = /*#__PURE__*/React.memo(({
|
|
|
34
39
|
item: item,
|
|
35
40
|
value: value,
|
|
36
41
|
onChange: onChange,
|
|
42
|
+
locale: locale,
|
|
43
|
+
renderItem: renderItem,
|
|
44
|
+
constraints: getQuestionnaireItemConstraints(item, values, resolveQuestionnaireConstraint, resolveQuestionnaireUnitOptions),
|
|
37
45
|
testID: testID ? `${testID}-${itemId}` : `item-${itemId}`
|
|
38
46
|
})
|
|
39
47
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","useQuestionnaireForm","QuestionnaireItemRenderer","jsx","_jsx","QuestionnaireContentSpecificItemComponent","memo","style","testID","item","props","values","setFieldValue","onChange","useCallback","val","linkId","itemId","value","children","QuestionnaireContentSpecificItem"],"sourceRoot":"../../../../../../src","sources":["modules/questionnaire-response-form/components/content/questionnaire-content-specific-item.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,IAAI,QAAmB,cAAc;AAE9C,SAASC,oBAAoB,QAAQ,uCAAoC;
|
|
1
|
+
{"version":3,"names":["React","View","useQuestionnaireForm","getQuestionnaireItemConstraints","QuestionnaireItemRenderer","jsx","_jsx","QuestionnaireContentSpecificItemComponent","memo","style","testID","item","props","locale","renderItem","resolveQuestionnaireConstraint","resolveQuestionnaireUnitOptions","values","setFieldValue","onChange","useCallback","val","linkId","itemId","value","children","constraints","QuestionnaireContentSpecificItem"],"sourceRoot":"../../../../../../src","sources":["modules/questionnaire-response-form/components/content/questionnaire-content-specific-item.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,IAAI,QAAmB,cAAc;AAE9C,SAASC,oBAAoB,QAAQ,uCAAoC;AAGzE,SAASC,+BAA+B,QAAQ,+CAA4C;AAC5F,SAASC,yBAAyB,QAAQ,0CAAuC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAElF,MAAMC,yCAAyC,gBAAGP,KAAK,CAACQ,IAAI,CAC1D,CAAC;EACCC,KAAK;EACLC,MAAM;EACNC,IAAI;EACJ,GAAGC;AAC4C,CAAC,KAAK;EACrD,MAAM;IACJC,MAAM;IACNC,UAAU;IACVC,8BAA8B;IAC9BC,+BAA+B;IAC/BC,MAAM;IACNC;EACF,CAAC,GAAGhB,oBAAoB,CAAC,CAAC;EAE1B,MAAMiB,QAAQ,GAAGnB,KAAK,CAACoB,WAAW,CAC/BC,GAA2B,IAAK;IAC/B,IAAI,CAACV,IAAI,EAAEW,MAAM,EAAE;MACjB;IACF;IAEAJ,aAAa,CAACP,IAAI,CAACW,MAAM,EAAED,GAAG,CAAC;EACjC,CAAC,EACD,CAACV,IAAI,EAAEW,MAAM,EAAEJ,aAAa,CAC9B,CAAC;EAED,IAAI,CAACP,IAAI,EAAE;IACT,OAAO,IAAI;EACb;EAEA,MAAMY,MAAM,GAAGZ,IAAI,CAACW,MAAM,IAAI,EAAE;EAChC,MAAME,KAAK,GAAGP,MAAM,CAACM,MAAM,CAAC;EAE5B,oBACEjB,IAAA,CAACL,IAAI;IAAA,GAAKW,KAAK;IAAEH,KAAK,EAAEA,KAAM;IAACC,MAAM,EAAEA,MAAO;IAAAe,QAAA,eAC5CnB,IAAA,CAACF,yBAAyB;MACxBO,IAAI,EAAEA,IAAK;MACXa,KAAK,EAAEA,KAAM;MACbL,QAAQ,EAAEA,QAAS;MACnBN,MAAM,EAAEA,MAAO;MACfC,UAAU,EAAEA,UAAW;MACvBY,WAAW,EAAEvB,+BAA+B,CAC1CQ,IAAI,EACJM,MAAM,EACNF,8BAA8B,EAC9BC,+BACF,CAAE;MACFN,MAAM,EAAEA,MAAM,GAAG,GAAGA,MAAM,IAAIa,MAAM,EAAE,GAAG,QAAQA,MAAM;IAAG,CAC3D;EAAC,CACE,CAAC;AAEX,CACF,CAAC;AAED,OAAO,MAAMI,gCAAgC,GAC3CpB,yCAAyC","ignoreList":[]}
|
|
@@ -5,6 +5,7 @@ import { StyleSheet, View } from "react-native";
|
|
|
5
5
|
import { Text } from "react-native-paper";
|
|
6
6
|
import { useAppTheme } from "../../../../theme/index.js";
|
|
7
7
|
import { useQuestionnaireForm } from "../../../hooks/index.js";
|
|
8
|
+
import { translateFhirText } from "../../../utils/translate-fhir-text.js";
|
|
8
9
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
10
|
export const QuestionnaireFieldWrapper = /*#__PURE__*/React.memo(({
|
|
10
11
|
item,
|
|
@@ -14,8 +15,12 @@ export const QuestionnaireFieldWrapper = /*#__PURE__*/React.memo(({
|
|
|
14
15
|
}) => {
|
|
15
16
|
const theme = useAppTheme();
|
|
16
17
|
const {
|
|
18
|
+
locale,
|
|
17
19
|
paged
|
|
18
20
|
} = useQuestionnaireForm();
|
|
21
|
+
const prefix = translateFhirText(item.prefix, item._prefix, locale);
|
|
22
|
+
const questionText = translateFhirText(item.text, item._text, locale);
|
|
23
|
+
const helperText = translateFhirText(item.helperText, item._helperText, locale);
|
|
19
24
|
return /*#__PURE__*/_jsxs(View, {
|
|
20
25
|
testID: testID,
|
|
21
26
|
style: [styles.container, {
|
|
@@ -26,18 +31,18 @@ export const QuestionnaireFieldWrapper = /*#__PURE__*/React.memo(({
|
|
|
26
31
|
style: [styles.title, {
|
|
27
32
|
color: theme.colors.onSurface
|
|
28
33
|
}],
|
|
29
|
-
children: [
|
|
34
|
+
children: [prefix ? `${prefix} ` : "", questionText, item.required && /*#__PURE__*/_jsx(Text, {
|
|
30
35
|
style: {
|
|
31
36
|
color: theme.colors.error
|
|
32
37
|
},
|
|
33
38
|
children: " *"
|
|
34
39
|
})]
|
|
35
|
-
}), children,
|
|
40
|
+
}), children, helperText && /*#__PURE__*/_jsx(Text, {
|
|
36
41
|
variant: "bodySmall",
|
|
37
42
|
style: [{
|
|
38
43
|
color: theme.colors.onSurfaceVariant
|
|
39
44
|
}],
|
|
40
|
-
children:
|
|
45
|
+
children: helperText
|
|
41
46
|
})]
|
|
42
47
|
});
|
|
43
48
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","StyleSheet","View","Text","useAppTheme","useQuestionnaireForm","jsx","_jsx","jsxs","_jsxs","QuestionnaireFieldWrapper","memo","item","children","testID","style","theme","paged","styles","container","gap","spacing","variant","title","color","colors","onSurface","
|
|
1
|
+
{"version":3,"names":["React","StyleSheet","View","Text","useAppTheme","useQuestionnaireForm","translateFhirText","jsx","_jsx","jsxs","_jsxs","QuestionnaireFieldWrapper","memo","item","children","testID","style","theme","locale","paged","prefix","_prefix","questionText","text","_text","helperText","_helperText","styles","container","gap","spacing","variant","title","color","colors","onSurface","required","error","onSurfaceVariant","create","width","fontWeight"],"sourceRoot":"../../../../../../../src","sources":["modules/questionnaire-response-form/components/fields/common/questionnaire-field-wrapper.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,UAAU,EAAEC,IAAI,QAAmB,cAAc;AAC1D,SAASC,IAAI,QAAQ,oBAAoB;AAEzC,SAASC,WAAW,QAAQ,4BAAmB;AAC/C,SAASC,oBAAoB,QAAQ,yBAAgB;AAErD,SAASC,iBAAiB,QAAQ,uCAAoC;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AASvE,OAAO,MAAMC,yBAAyB,gBAAGX,KAAK,CAACY,IAAI,CACjD,CAAC;EAAEC,IAAI;EAAEC,QAAQ;EAAEC,MAAM;EAAEC;AAAsC,CAAC,KAAK;EACrE,MAAMC,KAAK,GAAGb,WAAW,CAAC,CAAC;EAC3B,MAAM;IAAEc,MAAM;IAAEC;EAAM,CAAC,GAAGd,oBAAoB,CAAC,CAAC;EAChD,MAAMe,MAAM,GAAGd,iBAAiB,CAACO,IAAI,CAACO,MAAM,EAAEP,IAAI,CAACQ,OAAO,EAAEH,MAAM,CAAC;EACnE,MAAMI,YAAY,GAAGhB,iBAAiB,CAACO,IAAI,CAACU,IAAI,EAAEV,IAAI,CAACW,KAAK,EAAEN,MAAM,CAAC;EAErE,MAAMO,UAAU,GAAGnB,iBAAiB,CAClCO,IAAI,CAACY,UAAU,EACfZ,IAAI,CAACa,WAAW,EAChBR,MACF,CA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ireForm } from "../../hooks/use-questionnaire-form.js";
|
|
4
5
|
import { getOptionText } from "../../utils/fields/get-option-text.js";
|
|
5
6
|
import { getOptionValue } from "../../utils/fields/get-option-value.js";
|
|
6
7
|
import { QuestionnaireFieldWrapper, QuestionnaireOptionButton, QuestionnaireOptionsContainer } from "./common/index.js";
|
|
@@ -10,10 +11,11 @@ const MemoizedOptionButton = /*#__PURE__*/React.memo(({
|
|
|
10
11
|
index,
|
|
11
12
|
value,
|
|
12
13
|
onChange,
|
|
14
|
+
locale,
|
|
13
15
|
testID
|
|
14
16
|
}) => {
|
|
15
17
|
const optionValue = React.useMemo(() => getOptionValue(option), [option]);
|
|
16
|
-
const optionText = React.useMemo(() => getOptionText(option), [option]);
|
|
18
|
+
const optionText = React.useMemo(() => getOptionText(option, locale), [option, locale]);
|
|
17
19
|
const isSelected = React.useMemo(() => value === optionValue, [value, optionValue]);
|
|
18
20
|
return /*#__PURE__*/_jsx(QuestionnaireOptionButton, {
|
|
19
21
|
value: optionValue,
|
|
@@ -29,10 +31,13 @@ export const QuestionnaireChoiceField = /*#__PURE__*/React.memo(({
|
|
|
29
31
|
onChange,
|
|
30
32
|
testID
|
|
31
33
|
}) => {
|
|
32
|
-
|
|
34
|
+
const {
|
|
35
|
+
locale
|
|
36
|
+
} = useQuestionnaireForm();
|
|
37
|
+
const options = React.useMemo(() => item.answerOption || [], [item.answerOption]);
|
|
38
|
+
if (options.length === 0) {
|
|
33
39
|
return null;
|
|
34
40
|
}
|
|
35
|
-
const options = React.useMemo(() => item.answerOption || [], [item.answerOption]);
|
|
36
41
|
return /*#__PURE__*/_jsx(QuestionnaireFieldWrapper, {
|
|
37
42
|
testID: testID,
|
|
38
43
|
item: item,
|
|
@@ -44,6 +49,7 @@ export const QuestionnaireChoiceField = /*#__PURE__*/React.memo(({
|
|
|
44
49
|
return /*#__PURE__*/_jsx(MemoizedOptionButton, {
|
|
45
50
|
option: option,
|
|
46
51
|
index: index,
|
|
52
|
+
locale: locale,
|
|
47
53
|
onChange: onChange,
|
|
48
54
|
testID: testID,
|
|
49
55
|
value: value || ""
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","getOptionText","getOptionValue","QuestionnaireFieldWrapper","QuestionnaireOptionButton","QuestionnaireOptionsContainer","jsx","_jsx","MemoizedOptionButton","memo","option","index","value","onChange","testID","optionValue","useMemo","optionText","isSelected","label","onPress","QuestionnaireChoiceField","item","
|
|
1
|
+
{"version":3,"names":["React","useQuestionnaireForm","getOptionText","getOptionValue","QuestionnaireFieldWrapper","QuestionnaireOptionButton","QuestionnaireOptionsContainer","jsx","_jsx","MemoizedOptionButton","memo","option","index","value","onChange","locale","testID","optionValue","useMemo","optionText","isSelected","label","onPress","QuestionnaireChoiceField","item","options","answerOption","length","children","onValueChange","map"],"sourceRoot":"../../../../../../src","sources":["modules/questionnaire-response-form/components/fields/questionnaire-choice-field.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,SAASC,oBAAoB,QAAQ,uCAAoC;AAKzE,SAASC,aAAa,QAAQ,uCAAoC;AAClE,SAASC,cAAc,QAAQ,wCAAqC;AAEpE,SACEC,yBAAyB,EACzBC,yBAAyB,EACzBC,6BAA6B,QACxB,mBAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAkBlB,MAAMC,oBAAoB,gBAAGT,KAAK,CAACU,IAAI,CACrC,CAAC;EACCC,MAAM;EACNC,KAAK;EACLC,KAAK;EACLC,QAAQ;EACRC,MAAM;EACNC;AAC8B,CAAC,KAAK;EACpC,MAAMC,WAAW,GAAGjB,KAAK,CAACkB,OAAO,CAAC,MAAMf,cAAc,CAACQ,MAAM,CAAC,EAAE,CAACA,MAAM,CAAC,CAAC;EAEzE,MAAMQ,UAAU,GAAGnB,KAAK,CAACkB,OAAO,CAC9B,MAAMhB,aAAa,CAACS,MAAM,EAAEI,MAAM,CAAC,EACnC,CAACJ,MAAM,EAAEI,MAAM,CACjB,CAAC;EAED,MAAMK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E,MAAM,EAAEA,MAAO;UACfH,KAAK,EAAEA,KAAK,IAAI;QAAG,GANdD,KAON,CAAC;MAEN,CAAC;IAAC,CAC2B;EAAC,CACP,CAAC;AAEhC,CACF,CAAC","ignoreList":[]}
|
package/lib/module/modules/questionnaire-response-form/components/fields/questionnaire-date-field.js
CHANGED
|
@@ -7,12 +7,14 @@ import DateTimePickerModal from "react-native-modal-datetime-picker";
|
|
|
7
7
|
import { Text } from "react-native-paper";
|
|
8
8
|
import { useAppTheme } from "../../../theme/index.js";
|
|
9
9
|
import { useQuestionnaireForm } from "../../hooks/index.js";
|
|
10
|
+
import { isQuestionnaireDateOutsideBounds, parseQuestionnaireDate } from "../../utils/questionnaire-date-utils.js";
|
|
10
11
|
import { QuestionnaireFieldWrapper } from "./common/index.js";
|
|
11
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
13
|
export const QuestionnaireDateField = /*#__PURE__*/React.memo(({
|
|
13
14
|
item,
|
|
14
15
|
value,
|
|
15
16
|
onChange,
|
|
17
|
+
constraints,
|
|
16
18
|
testID
|
|
17
19
|
}) => {
|
|
18
20
|
const theme = useAppTheme();
|
|
@@ -20,6 +22,9 @@ export const QuestionnaireDateField = /*#__PURE__*/React.memo(({
|
|
|
20
22
|
const {
|
|
21
23
|
paged
|
|
22
24
|
} = useQuestionnaireForm();
|
|
25
|
+
const minimumDate = parseQuestionnaireDate(constraints?.minValue, item.type, "minimum");
|
|
26
|
+
const maximumDate = parseQuestionnaireDate(constraints?.maxValue, item.type, "maximum");
|
|
27
|
+
const initialPickerDate = parseQuestionnaireDate(value, item.type, "minimum");
|
|
23
28
|
const showPicker = React.useCallback(() => setPickerVisible(true), []);
|
|
24
29
|
const hidePicker = React.useCallback(() => setPickerVisible(false), []);
|
|
25
30
|
const handleConfirm = React.useCallback(selectedDate => {
|
|
@@ -38,22 +43,22 @@ export const QuestionnaireDateField = /*#__PURE__*/React.memo(({
|
|
|
38
43
|
}
|
|
39
44
|
},
|
|
40
45
|
time: () => {
|
|
41
|
-
const timeString = selectedDate.
|
|
42
|
-
hour: "2-digit",
|
|
43
|
-
minute: "2-digit"
|
|
44
|
-
});
|
|
46
|
+
const timeString = [selectedDate.getHours(), selectedDate.getMinutes(), selectedDate.getSeconds()].map(part => String(part).padStart(2, "0")).join(":");
|
|
45
47
|
if (timeString) {
|
|
46
48
|
onChange(timeString);
|
|
47
49
|
}
|
|
48
50
|
}
|
|
49
51
|
};
|
|
52
|
+
if (isQuestionnaireDateOutsideBounds(selectedDate, item.type, minimumDate, maximumDate)) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
50
55
|
actionMap[item.type]();
|
|
51
|
-
}, [hidePicker, onChange, item.type]);
|
|
56
|
+
}, [hidePicker, maximumDate, minimumDate, onChange, item.type]);
|
|
52
57
|
const formattedDate = React.useMemo(() => {
|
|
53
58
|
if (!value) {
|
|
54
59
|
return "Select a date";
|
|
55
60
|
}
|
|
56
|
-
const dateObj = new Date(value);
|
|
61
|
+
const dateObj = parseQuestionnaireDate(value, item.type, "minimum") ?? new Date(value);
|
|
57
62
|
const actionMap = {
|
|
58
63
|
dateTime: () => {
|
|
59
64
|
const dateFormatted = dateObj.toLocaleDateString();
|
|
@@ -67,7 +72,10 @@ export const QuestionnaireDateField = /*#__PURE__*/React.memo(({
|
|
|
67
72
|
return dateObj.toLocaleDateString();
|
|
68
73
|
},
|
|
69
74
|
time: () => {
|
|
70
|
-
return
|
|
75
|
+
return dateObj.toLocaleTimeString([], {
|
|
76
|
+
hour: "2-digit",
|
|
77
|
+
minute: "2-digit"
|
|
78
|
+
});
|
|
71
79
|
}
|
|
72
80
|
};
|
|
73
81
|
return actionMap[item.type]();
|
|
@@ -95,7 +103,9 @@ export const QuestionnaireDateField = /*#__PURE__*/React.memo(({
|
|
|
95
103
|
mode: item.type.toLowerCase(),
|
|
96
104
|
onConfirm: handleConfirm,
|
|
97
105
|
onCancel: hidePicker,
|
|
98
|
-
date:
|
|
106
|
+
date: initialPickerDate ?? new Date(),
|
|
107
|
+
minimumDate: minimumDate,
|
|
108
|
+
maximumDate: maximumDate,
|
|
99
109
|
testID: `${testID}-picker`,
|
|
100
110
|
display: "inline"
|
|
101
111
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useState","StyleSheet","TouchableOpacity","DateTimePickerModal","Text","useAppTheme","useQuestionnaireForm","QuestionnaireFieldWrapper","jsx","_jsx","jsxs","_jsxs","QuestionnaireDateField","memo","item","value","onChange","testID","theme","isPickerVisible","setPickerVisible","paged","showPicker","useCallback","hidePicker","handleConfirm","selectedDate","actionMap","dateTime","dateTimeString","toISOString","date","dateString","getFullYear","String","getMonth","padStart","getDate","time","timeString","
|
|
1
|
+
{"version":3,"names":["React","useState","StyleSheet","TouchableOpacity","DateTimePickerModal","Text","useAppTheme","useQuestionnaireForm","isQuestionnaireDateOutsideBounds","parseQuestionnaireDate","QuestionnaireFieldWrapper","jsx","_jsx","jsxs","_jsxs","QuestionnaireDateField","memo","item","value","onChange","constraints","testID","theme","isPickerVisible","setPickerVisible","paged","minimumDate","minValue","type","maximumDate","maxValue","initialPickerDate","showPicker","useCallback","hidePicker","handleConfirm","selectedDate","actionMap","dateTime","dateTimeString","toISOString","date","dateString","getFullYear","String","getMonth","padStart","getDate","time","timeString","getHours","getMinutes","getSeconds","map","part","join","formattedDate","useMemo","dateObj","Date","dateFormatted","toLocaleDateString","timeFormatted","toLocaleTimeString","hour","minute","children","onPress","style","styles","datePickerContainer","borderColor","colors","outline","backgroundColor","surface","borderRadius","padding","spacing","variant","color","onSurface","isVisible","mode","toLowerCase","onConfirm","onCancel","display","create","borderWidth","alignItems"],"sourceRoot":"../../../../../../src","sources":["modules/questionnaire-response-form/components/fields/questionnaire-date-field.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,QAAQ,OAAO;AAChC,SAASC,UAAU,EAAEC,gBAAgB,QAAQ,cAAc;AAC3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kD,MAAM,CAACG,OAAO;QACrCC,YAAY,EAAEtD,KAAK,CAACsD,YAAY,CAAC,CAAC,CAAC;QACnCC,OAAO,EAAEpD,KAAK,GAAGH,KAAK,CAACwD,OAAO,CAAC,CAAC,CAAC,GAAGxD,KAAK,CAACwD,OAAO,CAAC,CAAC;MACrD,CAAC,CACD;MAAAZ,QAAA,eAEFtD,IAAA,CAACP,IAAI;QACH0E,OAAO,EAAEtD,KAAK,GAAG,YAAY,GAAG,WAAY;QAC5C2C,KAAK,EAAE,CAAC;UAAEY,KAAK,EAAE1D,KAAK,CAACkD,MAAM,CAACS;QAAU,CAAC,CAAE;QAAAf,QAAA,EAE1CV;MAAa,CACV;IAAC,CACS,CAAC,eAEnB5C,IAAA,CAACR,mBAAmB;MAClB8E,SAAS,EAAE3D,eAAgB;MAC3B4D,IAAI,EAAElE,IAAI,CAACW,IAAI,CAACwD,WAAW,CAAC,CAAkC;MAC9DC,SAAS,EAAElD,aAAc;MACzBmD,QAAQ,EAAEpD,UAAW;MACrBO,IAAI,EAAEV,iBAAiB,IAAI,IAAI4B,IAAI,CAAC,CAAE;MACtCjC,WAAW,EAAEA,WAAY;MACzBG,WAAW,EAAEA,WAAY;MACzBR,MAAM,EAAE,GAAGA,MAAM,SAAU;MAC3BkE,OAAO,EAAC;IAAQ,CACjB,CAAC;EAAA,CACuB,CAAC;AAEhC,CACF,CAAC;AAED,MAAMlB,MAAM,GAAGnE,UAAU,CAACsF,MAAM,CAAC;EAC/BlB,mBAAmB,EAAE;IACnBmB,WAAW,EAAE,CAAC;IACdC,UAAU,EAAE;EACd;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,23 +1,52 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import * as React from "react";
|
|
4
|
+
import { useTranslation } from "react-i18next";
|
|
5
|
+
import { Text } from "react-native-paper";
|
|
4
6
|
import { getKeyboardType } from "../../utils/fields/get-keyboard-type.js";
|
|
7
|
+
import { getQuestionnaireItemConstraints } from "../../utils/questionnaire-item-constraints.js";
|
|
8
|
+
import { getQuestionnaireNumericPickerOptions } from "../../utils/questionnaire-picker-options.js";
|
|
9
|
+
import { translateFhirText } from "../../utils/translate-fhir-text.js";
|
|
5
10
|
import { QuestionnaireBooleanField } from "./questionnaire-boolean-field.js";
|
|
6
11
|
import { QuestionnaireChoiceField } from "./questionnaire-choice-field.js";
|
|
7
12
|
import { QuestionnaireDateField } from "./questionnaire-date-field.js";
|
|
8
13
|
import { QuestionnaireTextField } from "./questionnaire-text-field.js";
|
|
9
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
15
|
export const QuestionnaireItemRenderer = /*#__PURE__*/React.memo(({
|
|
11
16
|
item,
|
|
12
17
|
value,
|
|
13
18
|
onChange,
|
|
19
|
+
locale,
|
|
20
|
+
renderItem,
|
|
21
|
+
constraints,
|
|
14
22
|
testID
|
|
15
23
|
}) => {
|
|
16
24
|
const extendedItem = item;
|
|
25
|
+
const {
|
|
26
|
+
t
|
|
27
|
+
} = useTranslation();
|
|
28
|
+
const resolvedConstraints = constraints ?? getQuestionnaireItemConstraints(extendedItem);
|
|
17
29
|
const keyboardType = React.useMemo(() => getKeyboardType(item.type), [item.type]);
|
|
18
30
|
const handleChange = React.useCallback(val => {
|
|
19
31
|
onChange(val);
|
|
20
32
|
}, [onChange]);
|
|
33
|
+
if (renderItem && item.type !== "group") {
|
|
34
|
+
return renderItem({
|
|
35
|
+
item: extendedItem,
|
|
36
|
+
value,
|
|
37
|
+
constraints: resolvedConstraints,
|
|
38
|
+
onChange,
|
|
39
|
+
locale,
|
|
40
|
+
testID
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
if (item.type === "display") {
|
|
44
|
+
return /*#__PURE__*/_jsx(Text, {
|
|
45
|
+
accessibilityRole: "text",
|
|
46
|
+
testID: testID,
|
|
47
|
+
children: translateFhirText(item.text, extendedItem._text, locale)
|
|
48
|
+
});
|
|
49
|
+
}
|
|
21
50
|
switch (item.type) {
|
|
22
51
|
case "boolean":
|
|
23
52
|
return /*#__PURE__*/_jsx(QuestionnaireBooleanField, {
|
|
@@ -39,6 +68,7 @@ export const QuestionnaireItemRenderer = /*#__PURE__*/React.memo(({
|
|
|
39
68
|
return /*#__PURE__*/_jsx(QuestionnaireDateField, {
|
|
40
69
|
testID: testID,
|
|
41
70
|
item: extendedItem,
|
|
71
|
+
constraints: resolvedConstraints,
|
|
42
72
|
value: value,
|
|
43
73
|
onChange: handleChange
|
|
44
74
|
});
|
|
@@ -49,12 +79,21 @@ export const QuestionnaireItemRenderer = /*#__PURE__*/React.memo(({
|
|
|
49
79
|
return /*#__PURE__*/_jsx(QuestionnaireTextField, {
|
|
50
80
|
testID: testID,
|
|
51
81
|
item: extendedItem,
|
|
82
|
+
constraints: resolvedConstraints,
|
|
52
83
|
value: value,
|
|
53
84
|
onChange: handleChange,
|
|
54
|
-
keyboardType: keyboardType
|
|
85
|
+
keyboardType: keyboardType,
|
|
86
|
+
numericOptions: getQuestionnaireNumericPickerOptions(extendedItem, resolvedConstraints, locale)
|
|
55
87
|
});
|
|
56
88
|
default:
|
|
57
|
-
return
|
|
89
|
+
return /*#__PURE__*/_jsxs(Text, {
|
|
90
|
+
accessibilityRole: "alert",
|
|
91
|
+
testID: testID,
|
|
92
|
+
children: [translateFhirText(item.text, extendedItem._text, locale), "\n", t("questionnaire-form.item.unsupported", {
|
|
93
|
+
type: item.type,
|
|
94
|
+
defaultValue: `This question type (${item.type}) is not supported. You can continue without answering it.`
|
|
95
|
+
})]
|
|
96
|
+
});
|
|
58
97
|
}
|
|
59
98
|
});
|
|
60
99
|
//# sourceMappingURL=questionnaire-item-renderer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","getKeyboardType","QuestionnaireBooleanField","QuestionnaireChoiceField","QuestionnaireDateField","QuestionnaireTextField","jsx","_jsx","QuestionnaireItemRenderer","memo","item","value","onChange","testID","extendedItem","keyboardType","useMemo","type","handleChange","useCallback","val"],"sourceRoot":"../../../../../../src","sources":["modules/questionnaire-response-form/components/fields/questionnaire-item-renderer.tsx"],"mappings":";;AACA,OAAO,KAAKA,KAAK,MAAM,OAAO;
|
|
1
|
+
{"version":3,"names":["React","useTranslation","Text","getKeyboardType","getQuestionnaireItemConstraints","getQuestionnaireNumericPickerOptions","translateFhirText","QuestionnaireBooleanField","QuestionnaireChoiceField","QuestionnaireDateField","QuestionnaireTextField","jsx","_jsx","jsxs","_jsxs","QuestionnaireItemRenderer","memo","item","value","onChange","locale","renderItem","constraints","testID","extendedItem","t","resolvedConstraints","keyboardType","useMemo","type","handleChange","useCallback","val","accessibilityRole","children","text","_text","numericOptions","defaultValue"],"sourceRoot":"../../../../../../src","sources":["modules/questionnaire-response-form/components/fields/questionnaire-item-renderer.tsx"],"mappings":";;AACA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,cAAc,QAAQ,eAAe;AAC9C,SAASC,IAAI,QAAQ,oBAAoB;AAMzC,SAASC,eAAe,QAAQ,yCAAsC;AACtE,SACEC,+BAA+B,QAE1B,+CAA4C;AACnD,SAASC,oCAAoC,QAAQ,6CAA0C;AAC/F,SAASC,iBAAiB,QAAQ,oCAAiC;AAEnE,SAASC,yBAAyB,QAAQ,kCAA+B;AACzE,SAASC,wBAAwB,QAAQ,iCAA8B;AACvE,SAASC,sBAAsB,QAAQ,+BAA4B;AACnE,SAASC,sBAAsB,QAAQ,+BAA4B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAYpE,OAAO,MAAMC,yBAAyB,gBAAGf,KAAK,CAACgB,IAAI,CACjD,CAAC;EACCC,IAAI;EACJC,KAAK;EACLC,QAAQ;EACRC,MAAM;EACNC,UAAU;EACVC,WAAW;EACXC;AAC8B,CAAC,KAAK;EACpC,MAAMC,YAAY,GAAGP,IAAiC;EACtD,MAAM;IAAEQ;EA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xB,CAAC;IAEN,KAAK,MAAM;IACX,KAAK,MAAM;IACX,KAAK,UAAU;MACb,oBACElB,IAAA,CAACH,sBAAsB;QACrBc,MAAM,EAAEA,MAAO;QACfN,IAAI,EACFO,YACD;QACDF,WAAW,EAAEI,mBAAoB;QACjCR,KAAK,EAAEA,KAAgB;QACvBC,QAAQ,EAAEW;MAAa,CACxB,CAAC;IAEN,KAAK,SAAS;IACd,KAAK,SAAS;IACd,KAAK,QAAQ;IACb,KAAK,MAAM;MACT,oBACElB,IAAA,CAACF,sBAAsB;QACrBa,MAAM,EAAEA,MAAO;QACfN,IAAI,EAAEO,YAAa;QACnBF,WAAW,EAAEI,mBAAoB;QACjCR,KAAK,EAAEA,KAAgB;QACvBC,QAAQ,EAAEW,YAAa;QACvBH,YAAY,EAAEA,YAAa;QAC3BU,cAAc,EAAEhC,oCAAoC,CAClDmB,YAAY,EACZE,mBAAmB,EACnBN,MACF;MAAE,CACH,CAAC;IAEN;MACE,oBACEN,KAAA,CAACZ,IAAI;QAAC+B,iBAAiB,EAAC,OAAO;QAACV,MAAM,EAAEA,MAAO;QAAAW,QAAA,GAC5C5B,iBAAiB,CAACW,IAAI,CAACkB,IAAI,EAAEX,YAAY,CAACY,KAAK,EAAEhB,MAAM,CAAC,EACxD,IAAI,EACJK,CAAC,CAAC,qCAAqC,EAAE;UACxCI,IAAI,EAAEZ,IAAI,CAACY,IAAI;UACfS,YAAY,EAAE,uBAAuBrB,IAAI,CAACY,IAAI;QAChD,CAAC,CAAC;MAAA,CACE,CAAC;EAEb;AACF,CACF,CAAC","ignoreList":[]}
|
package/lib/module/modules/questionnaire-response-form/components/fields/questionnaire-text-field.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import * as React from "react";
|
|
4
|
+
import { useTranslation } from "react-i18next";
|
|
4
5
|
import { StyleSheet, TextInput } from "react-native";
|
|
6
|
+
import { ValueWheelPicker } from "../../../picker-sheet/components/value-wheel-picker.js";
|
|
5
7
|
import { useAppTheme } from "../../../theme/index.js";
|
|
8
|
+
import { useQuestionnaireForm } from "../../hooks/index.js";
|
|
9
|
+
import { translateFhirText } from "../../utils/translate-fhir-text.js";
|
|
6
10
|
import { QuestionnaireFieldWrapper } from "./common/index.js";
|
|
7
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
12
|
export const QuestionnaireTextField = ({
|
|
@@ -10,9 +14,29 @@ export const QuestionnaireTextField = ({
|
|
|
10
14
|
value,
|
|
11
15
|
onChange,
|
|
12
16
|
testID,
|
|
13
|
-
keyboardType = "default"
|
|
17
|
+
keyboardType = "default",
|
|
18
|
+
constraints,
|
|
19
|
+
numericOptions
|
|
14
20
|
}) => {
|
|
15
21
|
const theme = useAppTheme();
|
|
22
|
+
const {
|
|
23
|
+
t
|
|
24
|
+
} = useTranslation();
|
|
25
|
+
const {
|
|
26
|
+
locale
|
|
27
|
+
} = useQuestionnaireForm();
|
|
28
|
+
const accessibilityHint = [constraints?.minValue !== undefined ? t("questionnaire-form.constraints.minimum", {
|
|
29
|
+
value: constraints.minValue,
|
|
30
|
+
defaultValue: `Minimum ${constraints.minValue}`
|
|
31
|
+
}) : undefined, constraints?.maxValue !== undefined ? t("questionnaire-form.constraints.maximum", {
|
|
32
|
+
value: constraints.maxValue,
|
|
33
|
+
defaultValue: `Maximum ${constraints.maxValue}`
|
|
34
|
+
}) : undefined, constraints?.step !== undefined ? t("questionnaire-form.constraints.step", {
|
|
35
|
+
value: constraints.step,
|
|
36
|
+
defaultValue: `Step ${constraints.step}`
|
|
37
|
+
}) : undefined].filter(Boolean).join(". ");
|
|
38
|
+
const placeholder = translateFhirText(item.placeholder, item._placeholder, locale);
|
|
39
|
+
const handleNumericChange = React.useCallback(numericValue => onChange(String(numericValue)), [onChange]);
|
|
16
40
|
const handleChangeText = React.useCallback(text => {
|
|
17
41
|
if (item.type === "decimal") {
|
|
18
42
|
if (text === "" || /^-?\d*\.?\d*$/.test(text)) {
|
|
@@ -29,11 +53,25 @@ export const QuestionnaireTextField = ({
|
|
|
29
53
|
return /*#__PURE__*/_jsx(QuestionnaireFieldWrapper, {
|
|
30
54
|
testID: testID,
|
|
31
55
|
item: item,
|
|
32
|
-
children: /*#__PURE__*/_jsx(
|
|
56
|
+
children: numericOptions && numericOptions.length > 1 ? /*#__PURE__*/_jsx(ValueWheelPicker, {
|
|
57
|
+
options: numericOptions,
|
|
58
|
+
value: value === undefined || value === "" ? undefined : Number(value),
|
|
59
|
+
onChange: handleNumericChange,
|
|
60
|
+
accessibilityLabel: translateFhirText(item.text, item._text, locale),
|
|
61
|
+
accessibilityHint: accessibilityHint || undefined,
|
|
62
|
+
accessibilityIncrementLabel: t("questionnaire-form.picker.increase", {
|
|
63
|
+
defaultValue: "Increase value"
|
|
64
|
+
}),
|
|
65
|
+
accessibilityDecrementLabel: t("questionnaire-form.picker.decrease", {
|
|
66
|
+
defaultValue: "Decrease value"
|
|
67
|
+
})
|
|
68
|
+
}) : /*#__PURE__*/_jsx(TextInput, {
|
|
33
69
|
value: value || "",
|
|
34
70
|
onChangeText: handleChangeText,
|
|
35
|
-
placeholder:
|
|
71
|
+
placeholder: placeholder,
|
|
36
72
|
keyboardType: keyboardType,
|
|
73
|
+
maxLength: constraints?.maxLength,
|
|
74
|
+
accessibilityHint: accessibilityHint || undefined,
|
|
37
75
|
style: [styles.input, {
|
|
38
76
|
borderColor: theme.colors.outline,
|
|
39
77
|
backgroundColor: theme.colors.surface,
|