@ovok/native 1.10.3 → 1.10.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/modules/auth/default-translation.js +21 -0
- package/lib/commonjs/modules/auth/default-translation.js.map +1 -1
- package/lib/commonjs/modules/auth/hooks/use-delete-account.js +1 -1
- package/lib/commonjs/modules/auth/hooks/use-delete-account.js.map +1 -1
- package/lib/commonjs/modules/auth/hooks/use-session.js +5 -0
- package/lib/commonjs/modules/auth/hooks/use-session.js.map +1 -1
- package/lib/commonjs/modules/auth/register/components/form/register-form-provider.js +1 -0
- package/lib/commonjs/modules/auth/register/components/form/register-form-provider.js.map +1 -1
- package/lib/commonjs/modules/auth/reset-password/components/form/reset-password-form-provider.js +1 -0
- package/lib/commonjs/modules/auth/reset-password/components/form/reset-password-form-provider.js.map +1 -1
- package/lib/commonjs/modules/auth/session/logout-session.js +6 -1
- package/lib/commonjs/modules/auth/session/logout-session.js.map +1 -1
- package/lib/commonjs/modules/auth/session/session-store-refresh.js +130 -0
- package/lib/commonjs/modules/auth/session/session-store-refresh.js.map +1 -0
- package/lib/commonjs/modules/auth/session/session-store-request-state.js +73 -0
- package/lib/commonjs/modules/auth/session/session-store-request-state.js.map +1 -0
- package/lib/commonjs/modules/auth/session/session-store-types.js.map +1 -1
- package/lib/commonjs/modules/auth/session/session-store.js +69 -120
- package/lib/commonjs/modules/auth/session/session-store.js.map +1 -1
- package/lib/commonjs/modules/auth/utils/sign-in-error.js +4 -2
- package/lib/commonjs/modules/auth/utils/sign-in-error.js.map +1 -1
- package/lib/commonjs/modules/data-sync/components/apple/apple-health-authorization-provider.js.map +1 -1
- package/lib/commonjs/modules/data-sync/hooks/use-listen-changes.js.map +1 -1
- package/lib/commonjs/modules/data-sync/services/apple-health-sync-service.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/convert-generic-health-data.js +47 -21
- package/lib/commonjs/modules/data-sync/utils/convert-generic-health-data.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/convert-records-to-observation.js +19 -16
- package/lib/commonjs/modules/data-sync/utils/convert-records-to-observation.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/convert-samples-to-observation.js +17 -4
- package/lib/commonjs/modules/data-sync/utils/convert-samples-to-observation.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/get-samples-from-health.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/get-total-samples-count.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/health-data-catalog.js +168 -5
- package/lib/commonjs/modules/data-sync/utils/health-data-catalog.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/health-record-timing.js +52 -0
- package/lib/commonjs/modules/data-sync/utils/health-record-timing.js.map +1 -0
- package/lib/commonjs/modules/data-sync/utils/healthkit-data-types.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/normalize-core-health-observation.js +74 -0
- package/lib/commonjs/modules/data-sync/utils/normalize-core-health-observation.js.map +1 -0
- package/lib/commonjs/modules/helpers/form-items/form-field.js +12 -3
- package/lib/commonjs/modules/helpers/form-items/form-field.js.map +1 -1
- 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 +82 -23
- 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 +52 -13
- 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 +77 -2
- package/lib/commonjs/modules/questionnaire-response-form/utils/questionnaire-submit-utils.js.map +1 -1
- package/lib/commonjs/modules/questionnaire-response-form/utils/translate-fhir-text.js +36 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/translate-fhir-text.js.map +1 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/validate-questionnaire-item-value.js +49 -0
- package/lib/commonjs/modules/questionnaire-response-form/utils/validate-questionnaire-item-value.js.map +1 -0
- package/lib/commonjs/modules/ui/components/prerequisite-gate.js +73 -0
- package/lib/commonjs/modules/ui/components/prerequisite-gate.js.map +1 -0
- package/lib/commonjs/modules/ui/index.js +11 -0
- package/lib/commonjs/modules/ui/index.js.map +1 -1
- package/lib/commonjs/polyfills/index.js +9 -7
- package/lib/commonjs/polyfills/index.js.map +1 -1
- package/lib/module/modules/auth/default-translation.js +21 -0
- package/lib/module/modules/auth/default-translation.js.map +1 -1
- package/lib/module/modules/auth/hooks/use-delete-account.js +1 -1
- package/lib/module/modules/auth/hooks/use-delete-account.js.map +1 -1
- package/lib/module/modules/auth/hooks/use-session.js +5 -0
- package/lib/module/modules/auth/hooks/use-session.js.map +1 -1
- package/lib/module/modules/auth/register/components/form/register-form-provider.js +1 -0
- package/lib/module/modules/auth/register/components/form/register-form-provider.js.map +1 -1
- package/lib/module/modules/auth/reset-password/components/form/reset-password-form-provider.js +1 -0
- package/lib/module/modules/auth/reset-password/components/form/reset-password-form-provider.js.map +1 -1
- package/lib/module/modules/auth/session/logout-session.js +6 -1
- package/lib/module/modules/auth/session/logout-session.js.map +1 -1
- package/lib/module/modules/auth/session/session-store-refresh.js +126 -0
- package/lib/module/modules/auth/session/session-store-refresh.js.map +1 -0
- package/lib/module/modules/auth/session/session-store-request-state.js +69 -0
- package/lib/module/modules/auth/session/session-store-request-state.js.map +1 -0
- package/lib/module/modules/auth/session/session-store-types.js.map +1 -1
- package/lib/module/modules/auth/session/session-store.js +70 -121
- package/lib/module/modules/auth/session/session-store.js.map +1 -1
- package/lib/module/modules/auth/utils/sign-in-error.js +4 -2
- package/lib/module/modules/auth/utils/sign-in-error.js.map +1 -1
- package/lib/module/modules/data-sync/components/apple/apple-health-authorization-provider.js.map +1 -1
- package/lib/module/modules/data-sync/hooks/use-listen-changes.js.map +1 -1
- package/lib/module/modules/data-sync/services/apple-health-sync-service.js.map +1 -1
- package/lib/module/modules/data-sync/utils/convert-generic-health-data.js +47 -21
- package/lib/module/modules/data-sync/utils/convert-generic-health-data.js.map +1 -1
- package/lib/module/modules/data-sync/utils/convert-records-to-observation.js +19 -16
- package/lib/module/modules/data-sync/utils/convert-records-to-observation.js.map +1 -1
- package/lib/module/modules/data-sync/utils/convert-samples-to-observation.js +17 -4
- package/lib/module/modules/data-sync/utils/convert-samples-to-observation.js.map +1 -1
- package/lib/module/modules/data-sync/utils/get-samples-from-health.js.map +1 -1
- package/lib/module/modules/data-sync/utils/get-total-samples-count.js.map +1 -1
- package/lib/module/modules/data-sync/utils/health-data-catalog.js +168 -5
- package/lib/module/modules/data-sync/utils/health-data-catalog.js.map +1 -1
- package/lib/module/modules/data-sync/utils/health-record-timing.js +47 -0
- package/lib/module/modules/data-sync/utils/health-record-timing.js.map +1 -0
- package/lib/module/modules/data-sync/utils/healthkit-data-types.js.map +1 -1
- package/lib/module/modules/data-sync/utils/normalize-core-health-observation.js +69 -0
- package/lib/module/modules/data-sync/utils/normalize-core-health-observation.js.map +1 -0
- package/lib/module/modules/helpers/form-items/form-field.js +12 -3
- package/lib/module/modules/helpers/form-items/form-field.js.map +1 -1
- 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 +82 -23
- 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 +52 -13
- 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 +77 -2
- package/lib/module/modules/questionnaire-response-form/utils/questionnaire-submit-utils.js.map +1 -1
- package/lib/module/modules/questionnaire-response-form/utils/translate-fhir-text.js +31 -0
- package/lib/module/modules/questionnaire-response-form/utils/translate-fhir-text.js.map +1 -0
- package/lib/module/modules/questionnaire-response-form/utils/validate-questionnaire-item-value.js +44 -0
- package/lib/module/modules/questionnaire-response-form/utils/validate-questionnaire-item-value.js.map +1 -0
- package/lib/module/modules/ui/components/prerequisite-gate.js +67 -0
- package/lib/module/modules/ui/components/prerequisite-gate.js.map +1 -0
- package/lib/module/modules/ui/index.js +1 -0
- package/lib/module/modules/ui/index.js.map +1 -1
- package/lib/module/polyfills/index.js +11 -1
- package/lib/module/polyfills/index.js.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/default-translation.d.ts +21 -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 +6 -1
- package/lib/typescript/commonjs/src/modules/auth/hooks/use-session.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/register/components/form/register-form-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/reset-password/components/form/reset-password-form-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/session/logout-session.d.ts +4 -2
- 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 +10 -2
- package/lib/typescript/commonjs/src/modules/auth/session/session-store-types.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/session/session-store.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/auth/session/session-store.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/utils/sign-in-error.d.ts +2 -1
- package/lib/typescript/commonjs/src/modules/auth/utils/sign-in-error.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/components/apple/apple-health-authorization-provider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/hooks/use-listen-changes.d.ts +2 -3
- package/lib/typescript/commonjs/src/modules/data-sync/hooks/use-listen-changes.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/services/apple-health-sync-service.d.ts +4 -5
- package/lib/typescript/commonjs/src/modules/data-sync/services/apple-health-sync-service.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/types/apple-health-authorization-provider-props.d.ts +4 -2
- package/lib/typescript/commonjs/src/modules/data-sync/types/apple-health-authorization-provider-props.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/types/apple-health-sync-props.d.ts +7 -1
- package/lib/typescript/commonjs/src/modules/data-sync/types/apple-health-sync-props.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/types/health-authorization-status.d.ts +2 -1
- package/lib/typescript/commonjs/src/modules/data-sync/types/health-authorization-status.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/convert-generic-health-data.d.ts +3 -2
- package/lib/typescript/commonjs/src/modules/data-sync/utils/convert-generic-health-data.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/convert-records-to-observation.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/convert-samples-to-observation.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/get-samples-from-health.d.ts +5 -4
- package/lib/typescript/commonjs/src/modules/data-sync/utils/get-samples-from-health.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/get-total-samples-count.d.ts +2 -2
- package/lib/typescript/commonjs/src/modules/data-sync/utils/get-total-samples-count.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/health-data-catalog.d.ts +3 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/health-data-catalog.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/health-record-timing.d.ts +10 -0
- package/lib/typescript/commonjs/src/modules/data-sync/utils/health-record-timing.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-data-types.d.ts +6 -5
- package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-data-types.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/normalize-core-health-observation.d.ts +13 -0
- package/lib/typescript/commonjs/src/modules/data-sync/utils/normalize-core-health-observation.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/helpers/form-items/form-field.d.ts.map +1 -1
- 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 +6 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/questionnaire-submit-utils.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/translate-fhir-text.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/translate-fhir-text.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/validate-questionnaire-item-value.d.ts +6 -0
- package/lib/typescript/commonjs/src/modules/questionnaire-response-form/utils/validate-questionnaire-item-value.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/ui/components/prerequisite-gate.d.ts +19 -0
- package/lib/typescript/commonjs/src/modules/ui/components/prerequisite-gate.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/ui/index.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/ui/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/polyfills/index.d.ts +7 -1
- package/lib/typescript/commonjs/src/polyfills/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/default-translation.d.ts +21 -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 +6 -1
- package/lib/typescript/module/src/modules/auth/hooks/use-session.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/register/components/form/register-form-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/reset-password/components/form/reset-password-form-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/session/logout-session.d.ts +4 -2
- 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 +10 -2
- package/lib/typescript/module/src/modules/auth/session/session-store-types.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/session/session-store.d.ts +1 -1
- package/lib/typescript/module/src/modules/auth/session/session-store.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/utils/sign-in-error.d.ts +2 -1
- package/lib/typescript/module/src/modules/auth/utils/sign-in-error.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/components/apple/apple-health-authorization-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/hooks/use-listen-changes.d.ts +2 -3
- package/lib/typescript/module/src/modules/data-sync/hooks/use-listen-changes.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/services/apple-health-sync-service.d.ts +4 -5
- package/lib/typescript/module/src/modules/data-sync/services/apple-health-sync-service.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/types/apple-health-authorization-provider-props.d.ts +4 -2
- package/lib/typescript/module/src/modules/data-sync/types/apple-health-authorization-provider-props.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/types/apple-health-sync-props.d.ts +7 -1
- package/lib/typescript/module/src/modules/data-sync/types/apple-health-sync-props.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/types/health-authorization-status.d.ts +2 -1
- package/lib/typescript/module/src/modules/data-sync/types/health-authorization-status.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/convert-generic-health-data.d.ts +3 -2
- package/lib/typescript/module/src/modules/data-sync/utils/convert-generic-health-data.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/convert-records-to-observation.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/convert-samples-to-observation.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/get-samples-from-health.d.ts +5 -4
- package/lib/typescript/module/src/modules/data-sync/utils/get-samples-from-health.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/get-total-samples-count.d.ts +2 -2
- package/lib/typescript/module/src/modules/data-sync/utils/get-total-samples-count.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/health-data-catalog.d.ts +3 -1
- package/lib/typescript/module/src/modules/data-sync/utils/health-data-catalog.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/health-record-timing.d.ts +10 -0
- package/lib/typescript/module/src/modules/data-sync/utils/health-record-timing.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/data-sync/utils/healthkit-data-types.d.ts +6 -5
- package/lib/typescript/module/src/modules/data-sync/utils/healthkit-data-types.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/normalize-core-health-observation.d.ts +13 -0
- package/lib/typescript/module/src/modules/data-sync/utils/normalize-core-health-observation.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/helpers/form-items/form-field.d.ts.map +1 -1
- 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 +6 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/questionnaire-submit-utils.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/translate-fhir-text.d.ts +4 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/translate-fhir-text.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/validate-questionnaire-item-value.d.ts +6 -0
- package/lib/typescript/module/src/modules/questionnaire-response-form/utils/validate-questionnaire-item-value.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/ui/components/prerequisite-gate.d.ts +19 -0
- package/lib/typescript/module/src/modules/ui/components/prerequisite-gate.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/ui/index.d.ts +1 -0
- package/lib/typescript/module/src/modules/ui/index.d.ts.map +1 -1
- package/lib/typescript/module/src/polyfills/index.d.ts +7 -1
- package/lib/typescript/module/src/polyfills/index.d.ts.map +1 -1
- package/package.json +18 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_index","require","isConditionSatisfied","condition","responses","questionId","question","response","undefined","answerBoolean","checkBooleanCondition","answerString","checkStringCondition","answerDecimal","checkDecimalCondition","answerDate","answerDateTime","checkDateCondition","isItemEnabled","item","enableWhen","length","enableBehavior","every","some","getEnabledItemsForPage","page","
|
|
1
|
+
{"version":3,"names":["_index","require","_fhirCondition","isConditionSatisfied","condition","responses","questionId","question","response","operator","answerExists","undefined","answerBoolean","comparableResponse","getComparableResponse","checkBooleanCondition","answerString","checkStringCondition","answerDecimal","answerInteger","checkDecimalCondition","answerDate","answerDateTime","checkDateCondition","answerTime","checkTimeCondition","answerCoding","checkCodingCondition","answerQuantity","checkQuantityCondition","answerReference","checkReferenceCondition","isItemEnabled","item","enableWhen","length","enableBehavior","every","some","getEnabledItemsForPage","page","_isSyntheticPage","getEnabledDescendants","items","flatMap","descendants","type","ConditionUtils","exports"],"sourceRoot":"../../../../../src","sources":["modules/questionnaire-response-form/utils/condition-utils.ts"],"mappings":";;;;;;AAQA,IAAAA,MAAA,GAAAC,OAAA;AAMA,IAAAC,cAAA,GAAAD,OAAA;AAQA,MAAME,oBAAoB,GAAGA,CAC3BC,SAAsC,EACtCC,SAAyB,KACb;EACZ,MAAMC,UAAU,GAAGF,SAAS,CAACG,QAAQ;EACrC,MAAMC,QAAQ,GAAGH,SAAS,CAACC,UAAU,CAAC;EAEtC,IAAIF,SAAS,CAACK,QAAQ,KAAK,QAAQ,EAAE;IACnC,MAAMC,YAAY,GAChBF,QAAQ,KAAKG,SAAS,IAAIH,QAAQ,KAAK,IAAI,IAAIA,QAAQ,KAAK,EAAE;IAEhE,OAAOE,YAAY,KAAKN,SAAS,CAACQ,aAAa;EACjD;EAEA,IAAIJ,QAAQ,KAAKG,SAAS,IAAIH,QAAQ,KAAK,IAAI,EAAE;IAC/C,OAAO,KAAK;EACd;EAEA,MAAMK,kBAAkB,GAAG,I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AAC,OAAA,CAAAD,cAAA,GAAG;EAC5B5C,oBAAoB;EACpB6B,aAAa;EACbO;AACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getComparableResponse = exports.checkTimeCondition = exports.checkReferenceCondition = exports.checkQuantityCondition = exports.checkCodingCondition = void 0;
|
|
7
|
+
const getComparableResponse = value => {
|
|
8
|
+
if (!value || typeof value !== "object") {
|
|
9
|
+
return value;
|
|
10
|
+
}
|
|
11
|
+
if ("valueBoolean" in value) {
|
|
12
|
+
return value.valueBoolean;
|
|
13
|
+
}
|
|
14
|
+
if ("valueString" in value) {
|
|
15
|
+
return value.valueString;
|
|
16
|
+
}
|
|
17
|
+
if ("valueDecimal" in value) {
|
|
18
|
+
return value.valueDecimal;
|
|
19
|
+
}
|
|
20
|
+
if ("valueInteger" in value) {
|
|
21
|
+
return value.valueInteger;
|
|
22
|
+
}
|
|
23
|
+
if ("valueDate" in value) {
|
|
24
|
+
return value.valueDate;
|
|
25
|
+
}
|
|
26
|
+
if ("valueDateTime" in value) {
|
|
27
|
+
return value.valueDateTime;
|
|
28
|
+
}
|
|
29
|
+
if ("valueTime" in value) {
|
|
30
|
+
return value.valueTime;
|
|
31
|
+
}
|
|
32
|
+
if ("valueUri" in value) {
|
|
33
|
+
return value.valueUri;
|
|
34
|
+
}
|
|
35
|
+
if ("valueQuantity" in value) {
|
|
36
|
+
return value.valueQuantity;
|
|
37
|
+
}
|
|
38
|
+
if ("valueReference" in value) {
|
|
39
|
+
return value.valueReference;
|
|
40
|
+
}
|
|
41
|
+
return value;
|
|
42
|
+
};
|
|
43
|
+
exports.getComparableResponse = getComparableResponse;
|
|
44
|
+
const checkTimeCondition = (condition, response) => {
|
|
45
|
+
const actualSeconds = parseTime(response);
|
|
46
|
+
const expectedSeconds = parseTime(condition.answerTime);
|
|
47
|
+
if (actualSeconds === undefined || expectedSeconds === undefined) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
switch (condition.operator) {
|
|
51
|
+
case "=":
|
|
52
|
+
return actualSeconds === expectedSeconds;
|
|
53
|
+
case "!=":
|
|
54
|
+
return actualSeconds !== expectedSeconds;
|
|
55
|
+
case "<":
|
|
56
|
+
return actualSeconds < expectedSeconds;
|
|
57
|
+
case "<=":
|
|
58
|
+
return actualSeconds <= expectedSeconds;
|
|
59
|
+
case ">":
|
|
60
|
+
return actualSeconds > expectedSeconds;
|
|
61
|
+
case ">=":
|
|
62
|
+
return actualSeconds >= expectedSeconds;
|
|
63
|
+
default:
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
exports.checkTimeCondition = checkTimeCondition;
|
|
68
|
+
const parseTime = value => {
|
|
69
|
+
if (typeof value !== "string") {
|
|
70
|
+
return undefined;
|
|
71
|
+
}
|
|
72
|
+
const match = /^(\d{2}):(\d{2})(?::(\d{2})(\.\d+)?)?$/.exec(value);
|
|
73
|
+
if (!match) {
|
|
74
|
+
return undefined;
|
|
75
|
+
}
|
|
76
|
+
const [, hours, minutes, seconds = "0", fraction = ""] = match;
|
|
77
|
+
const parsedHours = Number(hours);
|
|
78
|
+
const parsedMinutes = Number(minutes);
|
|
79
|
+
const parsedSeconds = Number(seconds);
|
|
80
|
+
if (parsedHours > 23 || parsedMinutes > 59 || parsedSeconds > 59) {
|
|
81
|
+
return undefined;
|
|
82
|
+
}
|
|
83
|
+
return parsedHours * 3600 + parsedMinutes * 60 + parsedSeconds + (fraction ? Number(fraction) : 0);
|
|
84
|
+
};
|
|
85
|
+
const checkCodingCondition = (condition, response) => {
|
|
86
|
+
const actual = getCoding(response);
|
|
87
|
+
const expected = condition.answerCoding;
|
|
88
|
+
const matches = actual !== undefined && expected !== undefined && actual.code === expected.code && (actual.system === undefined || expected.system === undefined || actual.system === expected.system);
|
|
89
|
+
return condition.operator === "!=" ? !matches : matches;
|
|
90
|
+
};
|
|
91
|
+
exports.checkCodingCondition = checkCodingCondition;
|
|
92
|
+
const getCoding = value => {
|
|
93
|
+
if (!value || typeof value !== "object") {
|
|
94
|
+
return typeof value === "string" ? {
|
|
95
|
+
code: value
|
|
96
|
+
} : undefined;
|
|
97
|
+
}
|
|
98
|
+
if ("valueCoding" in value) {
|
|
99
|
+
return value.valueCoding;
|
|
100
|
+
}
|
|
101
|
+
if ("code" in value) {
|
|
102
|
+
return value;
|
|
103
|
+
}
|
|
104
|
+
return undefined;
|
|
105
|
+
};
|
|
106
|
+
const checkQuantityCondition = (condition, response) => {
|
|
107
|
+
const actual = getQuantity(response);
|
|
108
|
+
const expected = condition.answerQuantity;
|
|
109
|
+
if (!actual || !expected || actual.value === undefined || expected.value === undefined || actual.code !== expected.code || actual.system !== expected.system || actual.unit !== expected.unit) {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
switch (condition.operator) {
|
|
113
|
+
case "=":
|
|
114
|
+
return actual.value === expected.value;
|
|
115
|
+
case "!=":
|
|
116
|
+
return actual.value !== expected.value;
|
|
117
|
+
case "<":
|
|
118
|
+
return actual.value < expected.value;
|
|
119
|
+
case "<=":
|
|
120
|
+
return actual.value <= expected.value;
|
|
121
|
+
case ">":
|
|
122
|
+
return actual.value > expected.value;
|
|
123
|
+
case ">=":
|
|
124
|
+
return actual.value >= expected.value;
|
|
125
|
+
default:
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
exports.checkQuantityCondition = checkQuantityCondition;
|
|
130
|
+
const getQuantity = value => {
|
|
131
|
+
if (!value || typeof value !== "object" || !("value" in value)) {
|
|
132
|
+
return undefined;
|
|
133
|
+
}
|
|
134
|
+
return value;
|
|
135
|
+
};
|
|
136
|
+
const checkReferenceCondition = (condition, response) => {
|
|
137
|
+
const actual = getReference(response);
|
|
138
|
+
const matches = actual !== undefined && actual === condition.answerReference?.reference;
|
|
139
|
+
return condition.operator === "!=" ? !matches : matches;
|
|
140
|
+
};
|
|
141
|
+
exports.checkReferenceCondition = checkReferenceCondition;
|
|
142
|
+
const getReference = value => {
|
|
143
|
+
if (!value || typeof value !== "object" || !("reference" in value)) {
|
|
144
|
+
return undefined;
|
|
145
|
+
}
|
|
146
|
+
return typeof value.reference === "string" ? value.reference : undefined;
|
|
147
|
+
};
|
|
148
|
+
//# sourceMappingURL=fhir-condition.js.map
|
package/lib/commonjs/modules/questionnaire-response-form/utils/conditions/fhir-condition.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getComparableResponse","value","valueBoolean","valueString","valueDecimal","valueInteger","valueDate","valueDateTime","valueTime","valueUri","valueQuantity","valueReference","exports","checkTimeCondition","condition","response","actualSeconds","parseTime","expectedSeconds","answerTime","undefined","operator","match","exec","hours","minutes","seconds","fraction","parsedHours","Number","parsedMinutes","parsedSeconds","checkCodingCondition","actual","getCoding","expected","answerCoding","matches","code","system","valueCoding","checkQuantityCondition","getQuantity","answerQuantity","unit","checkReferenceCondition","getReference","answerReference","reference"],"sourceRoot":"../../../../../../src","sources":["modules/questionnaire-response-form/utils/conditions/fhir-condition.ts"],"mappings":";;;;;;AAIA,MAAMA,qBAAqB,GAAIC,KAA6B,IAAc;EACxE,IAAI,CAACA,KAAK,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IACvC,OAAOA,KAAK;EACd;EAEA,IAAI,cAAc,IAAIA,KAAK,EAAE;IAC3B,OAAOA,KAAK,CAACC,YAAY;EAC3B;EACA,IAAI,aAAa,IAAID,KAAK,EAAE;IAC1B,OAAOA,KAAK,CAACE,WAAW;EAC1B;EACA,IAAI,cAAc,IAAIF,KAAK,EAAE;IAC3B,OAAOA,KAAK,CAACG,YAAY;EAC3B;EACA,IAAI,cAAc,IAAIH,KAAK,EAAE;IAC3B,OAAOA,KAAK,CAACI,YAAY;EAC3B;EACA,IAAI,WAAW,IAAIJ,KAAK,EAAE;IACxB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estionnaireItemAnswered = exports.createAnswerFromValue = void 0;
|
|
7
|
+
var _isValidQuestionnaireAnswer = require("./is-valid-questionnaire-answer.js");
|
|
8
|
+
const createNumericAnswer = (value, type) => {
|
|
9
|
+
if (typeof value !== "string" && typeof value !== "number") {
|
|
10
|
+
return undefined;
|
|
11
|
+
}
|
|
12
|
+
const number = typeof value === "number" ? value : Number(value.trim());
|
|
13
|
+
if (!Number.isFinite(number) || type === "integer" && !Number.isInteger(number)) {
|
|
14
|
+
return undefined;
|
|
15
|
+
}
|
|
16
|
+
return number;
|
|
17
|
+
};
|
|
18
|
+
const createChoiceAnswer = (value, item) => {
|
|
19
|
+
if (typeof value === "object" && value !== null) {
|
|
20
|
+
if ("code" in value && item.type === "choice") {
|
|
21
|
+
return {
|
|
22
|
+
valueCoding: value
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
if ("reference" in value && item.type === "choice") {
|
|
26
|
+
return {
|
|
27
|
+
valueReference: value
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
if (typeof value !== "string" && typeof value !== "number") {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
const option = item.answerOption?.find(candidate => candidate.valueCoding?.code === value || candidate.valueReference?.reference === value || candidate.valueInteger === value || candidate.valueDate === value || candidate.valueTime === value || candidate.valueString === value);
|
|
36
|
+
if (option?.valueCoding) {
|
|
37
|
+
return {
|
|
38
|
+
valueCoding: option.valueCoding
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
if (option?.valueReference) {
|
|
42
|
+
return {
|
|
43
|
+
valueReference: option.valueReference
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
if (option?.valueInteger !== undefined) {
|
|
47
|
+
return {
|
|
48
|
+
valueInteger: option.valueInteger
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
if (option?.valueDate !== undefined) {
|
|
52
|
+
return {
|
|
53
|
+
valueDate: option.valueDate
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
if (option?.valueTime !== undefined) {
|
|
57
|
+
return {
|
|
58
|
+
valueTime: option.valueTime
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
if (option?.valueString !== undefined) {
|
|
62
|
+
return {
|
|
63
|
+
valueString: option.valueString
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
if (item.type === "open-choice" && typeof value === "string") {
|
|
67
|
+
return {
|
|
68
|
+
valueString: value
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
return typeof value === "string" ? {
|
|
72
|
+
valueCoding: {
|
|
73
|
+
code: value
|
|
74
|
+
}
|
|
75
|
+
} : undefined;
|
|
76
|
+
};
|
|
77
|
+
const createAnswerFromValue = (value, item) => {
|
|
78
|
+
if (value === undefined || value === null || value === "") {
|
|
79
|
+
return undefined;
|
|
80
|
+
}
|
|
81
|
+
if (typeof value === "object") {
|
|
82
|
+
const key = (0, _isValidQuestionnaireAnswer.getAnswerValueKey)(value);
|
|
83
|
+
if (key) {
|
|
84
|
+
return (0, _isValidQuestionnaireAnswer.validateAnswerForItem)(value, item.type);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
switch (item.type) {
|
|
88
|
+
case "boolean":
|
|
89
|
+
return (0, _isValidQuestionnaireAnswer.createTypedAnswer)(item.type, "valueBoolean", value);
|
|
90
|
+
case "date":
|
|
91
|
+
return (0, _isValidQuestionnaireAnswer.createTypedAnswer)(item.type, "valueDate", value);
|
|
92
|
+
case "dateTime":
|
|
93
|
+
return (0, _isValidQuestionnaireAnswer.createTypedAnswer)(item.type, "valueDateTime", value);
|
|
94
|
+
case "time":
|
|
95
|
+
return (0, _isValidQuestionnaireAnswer.createTypedAnswer)(item.type, "valueTime", value);
|
|
96
|
+
case "choice":
|
|
97
|
+
case "open-choice":
|
|
98
|
+
return (0, _isValidQuestionnaireAnswer.validateAnswerForItem)(createChoiceAnswer(value, item), item.type);
|
|
99
|
+
case "decimal":
|
|
100
|
+
{
|
|
101
|
+
const number = createNumericAnswer(value, "decimal");
|
|
102
|
+
return number === undefined ? undefined : (0, _isValidQuestionnaireAnswer.createTypedAnswer)(item.type, "valueDecimal", number);
|
|
103
|
+
}
|
|
104
|
+
case "integer":
|
|
105
|
+
{
|
|
106
|
+
const number = createNumericAnswer(value, "integer");
|
|
107
|
+
return number === undefined ? undefined : (0, _isValidQuestionnaireAnswer.createTypedAnswer)(item.type, "valueInteger", number);
|
|
108
|
+
}
|
|
109
|
+
case "string":
|
|
110
|
+
case "text":
|
|
111
|
+
return (0, _isValidQuestionnaireAnswer.createTypedAnswer)(item.type, "valueString", value);
|
|
112
|
+
case "url":
|
|
113
|
+
return (0, _isValidQuestionnaireAnswer.createTypedAnswer)(item.type, "valueUri", value);
|
|
114
|
+
case "attachment":
|
|
115
|
+
return (0, _isValidQuestionnaireAnswer.createTypedAnswer)(item.type, "valueAttachment", value);
|
|
116
|
+
case "reference":
|
|
117
|
+
return (0, _isValidQuestionnaireAnswer.createTypedAnswer)(item.type, "valueReference", value);
|
|
118
|
+
case "quantity":
|
|
119
|
+
return (0, _isValidQuestionnaireAnswer.createTypedAnswer)(item.type, "valueQuantity", value);
|
|
120
|
+
default:
|
|
121
|
+
return undefined;
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
exports.createAnswerFromValue = createAnswerFromValue;
|
|
125
|
+
const isQuestionnaireItemAnswered = (value, item) => createAnswerFromValue(value, item) !== undefined;
|
|
126
|
+
exports.isQuestionnaireItemAnswered = isQuestionnaireItemAnswered;
|
|
127
|
+
//# sourceMappingURL=create-answer-from-value.js.map
|
package/lib/commonjs/modules/questionnaire-response-form/utils/create-answer-from-value.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_isValidQuestionnaireAnswer","require","createNumericAnswer","value","type","undefined","number","Number","trim","isFinite","isInteger","createChoiceAnswer","item","valueCoding","valueReference","option","answerOption","find","candidate","code","reference","valueInteger","valueDate","valueTime","valueString","createAnswerFromValue","key","getAnswerValueKey","validateAnswerForItem","createTypedAnswer","exports","isQuestionnaireItemAnswered"],"sourceRoot":"../../../../../src","sources":["modules/questionnaire-response-form/utils/create-answer-from-value.ts"],"mappings":";;;;;;AAKA,IAAAA,2BAAA,GAAAC,OAAA;AAMA,MAAMC,mBAAmB,GAAGA,CAC1BC,KAA6B,EAC7BC,IAA2B,KACJ;EACvB,IAAI,OAAOD,KAAK,KAAK,QAAQ,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC1D,OAAOE,SAAS;EAClB;EAEA,MAAMC,MAAM,GAAG,OAAOH,KAAK,KAAK,QAAQ,GAAGA,KAAK,GAAGI,MAAM,CAACJ,KAAK,CAACK,IAAI,CAAC,CAAC,CAAC;EAEvE,IACE,CAACD,MAAM,CAACE,QAAQ,CAACH,MAAM,CAAC,IACvBF,IAAI,KAAK,SAAS,IAAI,CAACG,MAAM,CAACG,SAAS,CAACJ,MAAM,CAAE,EACjD;IACA,OAAOD,SAAS;EAClB;EAEA,OAAOC,MAAM;AACf,CAAC;AAED,MAAMK,kBAAkB,GAAGA,CACzBR,KAA6B,EAC7BS,IAA+B,KACiB;EAChD,IAAI,OAAOT,KAAK,KAAK,QAAQ,IAAIA,KAAK,KAAK,IAAI,EAAE;IAC/C,IAAI,MAAM,IAAIA,KAAK,IAAIS,IAAI,CAACR,IAAI,KAAK,QAAQ,EAAE;MAC7C,OAAO;QAAES,WAAW,EAAEV;MAAM,CAAC;IAC/B;IACA,IAAI,WAAW,IAAIA,KAAK,IAAIS,IAAI,CAACR,IAAI,KAAK,QAAQ,EAAE;MAClD,OAAO;QAAEU,cAAc,EAAEX;MAAM,CAAC;IAClC;IAEA,OAAOE,SAAS;EAClB;EAEA,IAAI,OAAOF,KAAK,KAAK,QAAQ,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC1D,OAAOE,SAAS;EAClB;EAEA,MAAMU,MAAM,GAAGH,IAAI,CAAC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QACd,MAAMA,MAAM,GAAGJ,mBAAmB,CAACC,KAAK,EAAE,SAAS,CAAC;QAEpD,OAAOG,MAAM,KAAKD,SAAS,GACvBA,SAAS,GACT,IAAAwB,6CAAiB,EAACjB,IAAI,CAACR,IAAI,EAAE,cAAc,EAAEE,MAAM,CAAC;MAC1D;IACA,KAAK,QAAQ;IACb,KAAK,MAAM;MACT,OAAO,IAAAuB,6CAAiB,EAACjB,IAAI,CAACR,IAAI,EAAE,aAAa,EAAED,KAAK,CAAC;IAC3D,KAAK,KAAK;MACR,OAAO,IAAA0B,6CAAiB,EAACjB,IAAI,CAACR,IAAI,EAAE,UAAU,EAAED,KAAK,CAAC;IACxD,KAAK,YAAY;MACf,OAAO,IAAA0B,6CAAiB,EAACjB,IAAI,CAACR,IAAI,EAAE,iBAAiB,EAAED,KAAK,CAAC;IAC/D,KAAK,WAAW;MACd,OAAO,IAAA0B,6CAAiB,EAACjB,IAAI,CAACR,IAAI,EAAE,gBAAgB,EAAED,KAAK,CAAC;IAC9D,KAAK,UAAU;MACb,OAAO,IAAA0B,6CAAiB,EAACjB,IAAI,CAACR,IAAI,EAAE,eAAe,EAAED,KAAK,CAAC;IAC7D;MACE,OAAOE,SAAS;EACpB;AACF,CAAC;AAACyB,OAAA,CAAAL,qBAAA,GAAAA,qBAAA;AAEF,MAAMM,2BAA2B,GAAGA,CAClC5B,KAA6B,EAC7BS,IAA+B,KACnBa,qBAAqB,CAACtB,KAAK,EAAES,IAAI,CAAC,KAAKP,SAAS;AAACyB,OAAA,CAAAC,2BAAA,GAAAA,2BAAA","ignoreList":[]}
|
|
@@ -4,15 +4,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getOptionText = void 0;
|
|
7
|
-
|
|
7
|
+
var _translateFhirText = require("../translate-fhir-text.js");
|
|
8
|
+
const getOptionText = (option, locale) => {
|
|
8
9
|
if (option.valueCoding?.display) {
|
|
9
|
-
return option.valueCoding.display;
|
|
10
|
+
return (0, _translateFhirText.translateFhirText)(option.valueCoding.display, option.valueCoding._display, locale);
|
|
10
11
|
}
|
|
11
12
|
if (option.valueCoding?.code) {
|
|
12
13
|
return option.valueCoding.code;
|
|
13
14
|
}
|
|
14
15
|
if (option.valueString) {
|
|
15
|
-
return option.valueString;
|
|
16
|
+
return (0, _translateFhirText.translateFhirText)(option.valueString, option._valueString, locale);
|
|
16
17
|
}
|
|
17
18
|
return "";
|
|
18
19
|
};
|
package/lib/commonjs/modules/questionnaire-response-form/utils/fields/get-option-text.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getOptionText","option","valueCoding","display","code","valueString","exports"],"sourceRoot":"../../../../../../src","sources":["modules/questionnaire-response-form/utils/fields/get-option-text.ts"],"mappings":";;;;;;AAEO,
|
|
1
|
+
{"version":3,"names":["_translateFhirText","require","getOptionText","option","locale","valueCoding","display","translateFhirText","_display","code","valueString","_valueString","exports"],"sourceRoot":"../../../../../../src","sources":["modules/questionnaire-response-form/utils/fields/get-option-text.ts"],"mappings":";;;;;;AAGA,IAAAA,kBAAA,GAAAC,OAAA;AAEO,MAAMC,aAAa,GAAGA,CAC3BC,MAA6C,EAC7CC,MAAe,KACJ;EACX,IAAID,MAAM,CAACE,WAAW,EAAEC,OAAO,EAAE;IAC/B,OAAO,IAAAC,oCAAiB,EACtBJ,MAAM,CAACE,WAAW,CAACC,OAAO,EACzBH,MAAM,CAACE,WAAW,CAAqCG,QAAQ,EAChEJ,MACF,CAAC;EACH;EACA,IAAID,MAAM,CAACE,WAAW,EAAEI,IAAI,EAAE;IAC5B,OAAON,MAAM,CAACE,WAAW,CAACI,IAAI;EAChC;EACA,IAAIN,MAAM,CAACO,WAAW,EAAE;IACtB,OAAO,IAAAH,oCAAiB,EAACJ,MAAM,CAACO,WAAW,EAAEP,MAAM,CAACQ,YAAY,EAAEP,MAAM,CAAC;EAC3E;EAEA,OAAO,EAAE;AACX,CAAC;AAACQ,OAAA,CAAAV,aAAA,GAAAA,aAAA","ignoreList":[]}
|
|
@@ -4,84 +4,87 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.FormUtils = void 0;
|
|
7
|
+
var _conditionUtils = require("./condition-utils.js");
|
|
8
|
+
var _createAnswerFromValue = require("./create-answer-from-value.js");
|
|
9
|
+
var _formValidation = require("./form-validation.js");
|
|
10
|
+
var _isAnswerableQuestionnaireItem = require("./is-answerable-questionnaire-item.js");
|
|
7
11
|
const extractPagesFromQuestionnaire = questionnaire => {
|
|
8
12
|
if (!questionnaire.item || !questionnaire.item.length) {
|
|
9
13
|
return [];
|
|
10
14
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
text: questionnaire.title || "Questionnaire",
|
|
17
|
-
type: "group",
|
|
18
|
-
item: questionnaire.item
|
|
19
|
-
}];
|
|
20
|
-
};
|
|
21
|
-
const getItemType = (linkId, pages) => {
|
|
22
|
-
for (const page of pages) {
|
|
23
|
-
if (!page.item) {
|
|
24
|
-
continue;
|
|
15
|
+
const pages = [];
|
|
16
|
+
let ungroupedItems = [];
|
|
17
|
+
const flushUngroupedItems = () => {
|
|
18
|
+
if (!ungroupedItems.length) {
|
|
19
|
+
return;
|
|
25
20
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
21
|
+
pages.push({
|
|
22
|
+
linkId: `page-${pages.length + 1}`,
|
|
23
|
+
text: questionnaire.title || "Questionnaire",
|
|
24
|
+
type: "group",
|
|
25
|
+
item: ungroupedItems,
|
|
26
|
+
_isSyntheticPage: true
|
|
27
|
+
});
|
|
28
|
+
ungroupedItems = [];
|
|
29
|
+
};
|
|
30
|
+
questionnaire.item.forEach(item => {
|
|
31
|
+
if (item.type === "group") {
|
|
32
|
+
flushUngroupedItems();
|
|
33
|
+
pages.push(item);
|
|
34
|
+
} else {
|
|
35
|
+
ungroupedItems.push(item);
|
|
29
36
|
}
|
|
30
|
-
}
|
|
31
|
-
|
|
37
|
+
});
|
|
38
|
+
flushUngroupedItems();
|
|
39
|
+
return pages;
|
|
32
40
|
};
|
|
33
|
-
const
|
|
34
|
-
if (
|
|
41
|
+
const createResponseItem = (item, responses) => {
|
|
42
|
+
if (!_conditionUtils.ConditionUtils.isItemEnabled(item, responses)) {
|
|
35
43
|
return undefined;
|
|
36
44
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
return {
|
|
52
|
-
valueCoding: {
|
|
53
|
-
code: value
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
case "decimal":
|
|
57
|
-
return {
|
|
58
|
-
valueDecimal: parseFloat(value)
|
|
59
|
-
};
|
|
60
|
-
case "integer":
|
|
61
|
-
return {
|
|
62
|
-
valueInteger: parseInt(value, 10)
|
|
63
|
-
};
|
|
64
|
-
case "string":
|
|
65
|
-
case "text":
|
|
66
|
-
default:
|
|
67
|
-
return {
|
|
68
|
-
valueString: value
|
|
69
|
-
};
|
|
45
|
+
const nestedItems = (item.item ?? []).flatMap(nestedItem => {
|
|
46
|
+
const responseItem = createResponseItem(nestedItem, responses);
|
|
47
|
+
return responseItem ? [responseItem] : [];
|
|
48
|
+
});
|
|
49
|
+
if (item.type === "group") {
|
|
50
|
+
return {
|
|
51
|
+
linkId: item.linkId || "",
|
|
52
|
+
text: item.text,
|
|
53
|
+
item: nestedItems.length ? nestedItems : undefined
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
const answer = (0, _createAnswerFromValue.createAnswerFromValue)(responses[item.linkId || ""], item);
|
|
57
|
+
if (!answer && !nestedItems.length) {
|
|
58
|
+
return undefined;
|
|
70
59
|
}
|
|
60
|
+
return {
|
|
61
|
+
linkId: item.linkId || "",
|
|
62
|
+
answer: answer ? [{
|
|
63
|
+
...answer,
|
|
64
|
+
...(nestedItems.length ? {
|
|
65
|
+
item: nestedItems
|
|
66
|
+
} : {})
|
|
67
|
+
}] : undefined
|
|
68
|
+
};
|
|
71
69
|
};
|
|
72
70
|
const createQuestionnaireResponseItems = (responses, pages) => {
|
|
73
|
-
return
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
71
|
+
return pages.flatMap(page => {
|
|
72
|
+
if (!page._isSyntheticPage && !_conditionUtils.ConditionUtils.isItemEnabled(page, responses)) {
|
|
73
|
+
return [];
|
|
74
|
+
}
|
|
75
|
+
if (page._isSyntheticPage) {
|
|
76
|
+
return (page.item ?? []).flatMap(item => {
|
|
77
|
+
const responseItem = createResponseItem(item, responses);
|
|
78
|
+
return responseItem ? [responseItem] : [];
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
const responseItem = createResponseItem(page, responses);
|
|
82
|
+
return responseItem ? [responseItem] : [];
|
|
80
83
|
});
|
|
81
84
|
};
|
|
82
85
|
const initializeDefaultValues = pages => {
|
|
83
86
|
const defaults = {};
|
|
84
|
-
const allItems = pages.flatMap(page => page.
|
|
87
|
+
const allItems = getItems(pages.flatMap(page => page._isSyntheticPage ? page.item ?? [] : [page]));
|
|
85
88
|
allItems.forEach(item => {
|
|
86
89
|
const hasEnableWhenConditions = item.enableWhen && item.enableWhen.length > 0;
|
|
87
90
|
if (!hasEnableWhenConditions) {
|
|
@@ -101,10 +104,14 @@ const initializeDefaultValues = pages => {
|
|
|
101
104
|
});
|
|
102
105
|
return defaults;
|
|
103
106
|
};
|
|
107
|
+
const getItems = items => items.flatMap(item => [item, ...getItems(item.item ?? [])]);
|
|
108
|
+
const getAllQuestionnaireItems = pages => pages.flatMap(page => getItems(page.item ?? []));
|
|
109
|
+
const hasUnansweredRequiredItems = (pages, responses, renderItem, resolver, unitOptionsResolver) => pages.some(page => _conditionUtils.ConditionUtils.getEnabledItemsForPage(page, responses).some(item => item.type !== "display" && item.required && !(0, _isAnswerableQuestionnaireItem.isAnswerableQuestionnaireItem)(item) && !renderItem)) || !_formValidation.FormValidation.validateRequiredFields(pages, responses, renderItem, resolver, unitOptionsResolver).isValid;
|
|
104
110
|
const FormUtils = exports.FormUtils = {
|
|
105
111
|
extractPagesFromQuestionnaire,
|
|
106
|
-
getItemType,
|
|
107
112
|
createQuestionnaireResponseItems,
|
|
108
|
-
initializeDefaultValues
|
|
113
|
+
initializeDefaultValues,
|
|
114
|
+
getAllQuestionnaireItems,
|
|
115
|
+
hasUnansweredRequiredItems
|
|
109
116
|
};
|
|
110
117
|
//# sourceMappingURL=form-utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["extractPagesFromQuestionnaire","questionnaire","item","length","
|
|
1
|
+
{"version":3,"names":["_conditionUtils","require","_createAnswerFromValue","_formValidation","_isAnswerableQuestionnaireItem","extractPagesFromQuestionnaire","questionnaire","item","length","pages","ungroupedItems","flushUngroupedItems","push","linkId","text","title","type","_isSyntheticPage","forEach","createResponseItem","responses","ConditionUtils","isItemEnabled","undefined","nestedItems","flatMap","nestedItem","responseItem","answer","createAnswerFromValue","createQuestionnaireResponseItems","page","initializeDefaultValues","defaults","allItems","getItems","hasEnableWhenConditions","enableWhen","answerOption","initialSelectedOption","find","option","initialSelected","valueCoding","code","valueString","items","getAllQuestionnaireItems","hasUnansweredRequiredItems","renderItem","resolver","unitOptionsResolver","some","getEnabledItemsForPage","required","isAnswerableQuestionnaireItem","FormValidation","validateRequiredFields","isValid","FormUtils","exports"],"sourceRoot":"../../../../../src","sources":["modules/questionnaire-response-form/utils/form-utils.ts"],"mappings":";;;;;;AAMA,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,sBAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,8BAAA,GAAAH,OAAA;AAMA,MAAMI,6BA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AACM,MAAM,IAAI,EAAE,CAAC,GAAG0B,qBAAqB,CAACM,WAAW;UACjE;QACF;MACF;IACF;EACF,CAAC,CAAC;EAEF,OAAOZ,QAAQ;AACjB,CAAC;AAED,MAAME,QAAQ,GACZW,KAAkC,IAElCA,KAAK,CAACrB,OAAO,CAAElB,IAAI,IAAK,CAACA,IAAI,EAAE,GAAG4B,QAAQ,CAAC5B,IAAI,CAACA,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC;AAE/D,MAAMwC,wBAAwB,GAC5BtC,KAAkC,IAElCA,KAAK,CAACgB,OAAO,CAAEM,IAAI,IAAKI,QAAQ,CAACJ,IAAI,CAACxB,IAAI,IAAI,EAAE,CAAC,CAAC;AAEpD,MAAMyC,0BAA0B,GAAGA,CACjCvC,KAAkC,EAClCW,SAAyB,EACzB6B,UAAsC,EACtCC,QAA0C,EAC1CC,mBAAsD,KAEtD1C,KAAK,CAAC2C,IAAI,CAAErB,IAAI,IACdV,8BAAc,CAACgC,sBAAsB,CAACtB,IAAI,EAAEX,SAAS,CAAC,CAACgC,IAAI,CACxD7C,IAAI,IACHA,IAAI,CAACS,IAAI,KAAK,SAAS,IACvBT,IAAI,CAAC+C,QAAQ,IACb,CAAC,IAAAC,4DAA6B,EAAChD,IAAI,CAAC,IACpC,CAAC0C,UACL,CACF,CAAC,IACD,CAACO,8BAAc,CAACC,sBAAsB,CACpChD,KAAK,EACLW,SAAS,EACT6B,UAAU,EACVC,QAAQ,EACRC,mBACF,CAAC,CAACO,OAAO;AAEJ,MAAMC,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG;EACvBtD,6BAA6B;EAC7ByB,gCAAgC;EAChCE,uBAAuB;EACvBe,wBAAwB;EACxBC;AACF,CAAC","ignoreList":[]}
|
|
@@ -5,27 +5,45 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.FormValidation = void 0;
|
|
7
7
|
var _conditionUtils = require("./condition-utils.js");
|
|
8
|
+
var _createAnswerFromValue = require("./create-answer-from-value.js");
|
|
9
|
+
var _isAnswerableQuestionnaireItem = require("./is-answerable-questionnaire-item.js");
|
|
10
|
+
var _validateQuestionnaireItemValue = require("./validate-questionnaire-item-value.js");
|
|
8
11
|
/**
|
|
9
12
|
* Validates all required and enabled items have answers
|
|
10
13
|
* @param pages All questionnaire pages
|
|
11
14
|
* @param responses Current responses
|
|
12
15
|
* @returns Object containing validation result and first unanswered item location if any
|
|
13
16
|
*/
|
|
14
|
-
const validateRequiredFields = (pages, responses) => {
|
|
17
|
+
const validateRequiredFields = (pages, responses, renderItem, resolver, unitOptionsResolver) => {
|
|
15
18
|
for (let pageIndex = 0; pageIndex < pages.length; pageIndex++) {
|
|
16
19
|
const page = pages[pageIndex];
|
|
17
20
|
if (!page || !page.item) {
|
|
18
21
|
continue;
|
|
19
22
|
}
|
|
20
23
|
const enabledItems = _conditionUtils.ConditionUtils.getEnabledItemsForPage(page, responses);
|
|
21
|
-
const
|
|
22
|
-
|
|
24
|
+
const failureIndex = enabledItems.findIndex(item => {
|
|
25
|
+
if (item.type === "group" || item.type === "display") {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
const value = responses[item.linkId || ""];
|
|
29
|
+
const answered = (0, _createAnswerFromValue.isQuestionnaireItemAnswered)(value, item);
|
|
30
|
+
const isRequired = item.required === true;
|
|
31
|
+
if (isRequired && ((0, _isAnswerableQuestionnaireItem.isAnswerableQuestionnaireItem)(item) || renderItem) && !answered) {
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
return (0, _validateQuestionnaireItemValue.validateQuestionnaireItemValue)(value, item, responses, resolver, unitOptionsResolver) !== undefined;
|
|
35
|
+
});
|
|
36
|
+
if (failureIndex !== -1) {
|
|
37
|
+
const item = enabledItems[failureIndex];
|
|
38
|
+
const value = item ? responses[item.linkId || ""] : undefined;
|
|
39
|
+
const answered = item ? (0, _createAnswerFromValue.isQuestionnaireItemAnswered)(value, item) : false;
|
|
23
40
|
return {
|
|
24
41
|
isValid: false,
|
|
25
42
|
firstUnansweredLocation: {
|
|
26
43
|
pageIndex,
|
|
27
|
-
itemIndex:
|
|
28
|
-
}
|
|
44
|
+
itemIndex: failureIndex
|
|
45
|
+
},
|
|
46
|
+
failureReason: item?.required && !answered ? "required" : "invalid-answer"
|
|
29
47
|
};
|
|
30
48
|
}
|
|
31
49
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_conditionUtils","require","validateRequiredFields","pages","responses","pageIndex","length","page","item","enabledItems","ConditionUtils","getEnabledItemsForPage","
|
|
1
|
+
{"version":3,"names":["_conditionUtils","require","_createAnswerFromValue","_isAnswerableQuestionnaireItem","_validateQuestionnaireItemValue","validateRequiredFields","pages","responses","renderItem","resolver","unitOptionsResolver","pageIndex","length","page","item","enabledItems","ConditionUtils","getEnabledItemsForPage","failureIndex","findIndex","type","value","linkId","answered","isQuestionnaireItemAnswered","isRequired","required","isAnswerableQuestionnaireItem","validateQuestionnaireItemValue","undefined","isValid","firstUnansweredLocation","itemIndex","failureReason","FormValidation","exports"],"sourceRoot":"../../../../../src","sources":["modules/questionnaire-response-form/utils/form-validation.ts"],"mappings":";;;;;;AAIA,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,sBAAA,GAAAD,OAAA;AACA,IAAAE,8BAAA,GAAAF,OAAA;AAKA,IAAAG,+BAAA,GAAAH,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMI,sBAAsB,GAAGA,CAC7BC,KAAkC,EAClCC,SAAyB,EACzBC,UAAsC,EACtCC,QAA0C,EAC1CC,mBAAsD,KAKnD;EACH,KAAK,IAAIC,SAAS,GAAG,CAAC,EAAEA,SAAS,GAAGL,KAAK,CAACM,MAAM,EAAED,SAAS,EAAE,EAAE;IAC7D,MAAME,IAAI,GAAGP,KAAK,CAACK,SAAS,CAAC;IAE7B,IAAI,CAACE,IAAI,IAAI,CAACA,IAAI,CAACC,IAAI,EAAE;MACvB;IACF;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,OAAO,EAAE,IAAI;IACbC,uBAAuB,EAAE;EAC3B,CAAC;AACH,CAAC;AAEM,MAAMG,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG;EAC5B7B;AACF,CAAC","ignoreList":[]}
|
package/lib/commonjs/modules/questionnaire-response-form/utils/is-answerable-questionnaire-item.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isAnswerableQuestionnaireItem = void 0;
|
|
7
|
+
const ANSWERABLE_ITEM_TYPES = new Set(["boolean", "choice", "date", "dateTime", "decimal", "integer", "string", "text", "time"]);
|
|
8
|
+
const isAnswerableQuestionnaireItem = item => ANSWERABLE_ITEM_TYPES.has(item.type);
|
|
9
|
+
exports.isAnswerableQuestionnaireItem = isAnswerableQuestionnaireItem;
|
|
10
|
+
//# sourceMappingURL=is-answerable-questionnaire-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ANSWERABLE_ITEM_TYPES","Set","isAnswerableQuestionnaireItem","item","has","type","exports"],"sourceRoot":"../../../../../src","sources":["modules/questionnaire-response-form/utils/is-answerable-questionnaire-item.ts"],"mappings":";;;;;;AAEA,MAAMA,qBAAqB,GAAG,IAAIC,GAAG,CAA4B,CAC/D,SAAS,EACT,QAAQ,EACR,MAAM,EACN,UAAU,EACV,SAAS,EACT,SAAS,EACT,QAAQ,EACR,MAAM,EACN,MAAM,CACP,CAAC;AAEK,MAAMC,6BAA6B,GACxCC,IAAuB,IACXH,qBAAqB,CAACI,GAAG,CAACD,IAAI,CAACE,IAAI,CAAC;AAACC,OAAA,CAAAJ,6BAAA,GAAAA,6BAAA","ignoreList":[]}
|