@icure/form 1.1.10 → 1.1.14
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/components/common/field-with-options.d.ts +9 -0
- package/components/common/field-with-options.js +50 -0
- package/components/common/field-with-options.js.map +1 -0
- package/components/common/field.d.ts +46 -0
- package/components/common/field.js +107 -0
- package/components/common/field.js.map +1 -0
- package/components/common/index.d.ts +1 -0
- package/{lib/components/iqr-form-loader → components/common}/index.js +1 -3
- package/components/common/index.js.map +1 -0
- package/{lib/components/iqr-text-field → components/common}/styles/paths.d.ts +1 -0
- package/{lib/components/iqr-text-field → components/common}/styles/paths.js +25 -8
- package/components/common/styles/paths.js.map +1 -0
- package/components/common/utils.d.ts +8 -0
- package/components/common/utils.js +42 -0
- package/components/common/utils.js.map +1 -0
- package/components/icure-button-group/index.d.ts +12 -0
- package/components/icure-button-group/index.js +1140 -0
- package/components/icure-button-group/index.js.map +1 -0
- package/components/icure-date-picker/index.d.ts +16 -0
- package/components/icure-date-picker/index.js +1140 -0
- package/components/icure-date-picker/index.js.map +1 -0
- package/components/icure-dropdown-field/index.d.ts +16 -0
- package/components/icure-dropdown-field/index.js +1153 -0
- package/components/icure-dropdown-field/index.js.map +1 -0
- package/components/icure-form/fields/button-group/checkbox.d.ts +6 -0
- package/{lib/components/common/optionsField.js → components/icure-form/fields/button-group/checkbox.js} +29 -24
- package/components/icure-form/fields/button-group/checkbox.js.map +1 -0
- package/components/icure-form/fields/button-group/index.d.ts +2 -0
- package/components/icure-form/fields/button-group/index.js +19 -0
- package/components/icure-form/fields/button-group/index.js.map +1 -0
- package/components/icure-form/fields/button-group/radio-button.d.ts +6 -0
- package/components/icure-form/fields/button-group/radio-button.js +61 -0
- package/components/icure-form/fields/button-group/radio-button.js.map +1 -0
- package/components/icure-form/fields/date-picker/date-picker.d.ts +4 -0
- package/components/icure-form/fields/date-picker/date-picker.js +29 -0
- package/components/icure-form/fields/date-picker/date-picker.js.map +1 -0
- package/components/icure-form/fields/date-picker/date-time-picker.d.ts +4 -0
- package/components/icure-form/fields/date-picker/date-time-picker.js +29 -0
- package/components/icure-form/fields/date-picker/date-time-picker.js.map +1 -0
- package/components/icure-form/fields/date-picker/index.d.ts +3 -0
- package/components/icure-form/fields/date-picker/index.js +20 -0
- package/components/icure-form/fields/date-picker/index.js.map +1 -0
- package/components/icure-form/fields/date-picker/time-picker.d.ts +4 -0
- package/components/icure-form/fields/date-picker/time-picker.js +29 -0
- package/components/icure-form/fields/date-picker/time-picker.js.map +1 -0
- package/components/icure-form/fields/dropdown/dropdown-field.d.ts +11 -0
- package/{lib/components/iqr-form/fields/dropdown.js → components/icure-form/fields/dropdown/dropdown-field.js} +27 -26
- package/components/icure-form/fields/dropdown/dropdown-field.js.map +1 -0
- package/components/icure-form/fields/dropdown/index.d.ts +1 -0
- package/components/icure-form/fields/dropdown/index.js +18 -0
- package/components/icure-form/fields/dropdown/index.js.map +1 -0
- package/components/icure-form/fields/index.d.ts +9 -0
- package/components/icure-form/fields/index.js +26 -0
- package/components/icure-form/fields/index.js.map +1 -0
- package/components/icure-form/fields/items-list-field/index.d.ts +1 -0
- package/components/icure-form/fields/items-list-field/index.js +18 -0
- package/components/icure-form/fields/items-list-field/index.js.map +1 -0
- package/components/icure-form/fields/items-list-field/items-list-field.d.ts +6 -0
- package/{lib/components/common/labelizedField.js → components/icure-form/fields/items-list-field/items-list-field.js} +28 -23
- package/components/icure-form/fields/items-list-field/items-list-field.js.map +1 -0
- package/components/icure-form/fields/label/index.d.ts +1 -0
- package/components/icure-form/fields/label/index.js +18 -0
- package/components/icure-form/fields/label/index.js.map +1 -0
- package/components/icure-form/fields/label/label.d.ts +9 -0
- package/{lib/components/common/valuedField.js → components/icure-form/fields/label/label.js} +25 -14
- package/components/icure-form/fields/label/label.js.map +1 -0
- package/components/icure-form/fields/measure-field/index.d.ts +1 -0
- package/components/icure-form/fields/measure-field/index.js +18 -0
- package/components/icure-form/fields/measure-field/index.js.map +1 -0
- package/components/icure-form/fields/measure-field/measure-field.d.ts +4 -0
- package/components/icure-form/fields/measure-field/measure-field.js +31 -0
- package/components/icure-form/fields/measure-field/measure-field.js.map +1 -0
- package/components/icure-form/fields/number-field/index.d.ts +1 -0
- package/components/icure-form/fields/number-field/index.js +18 -0
- package/components/icure-form/fields/number-field/index.js.map +1 -0
- package/components/icure-form/fields/number-field/number-field.d.ts +4 -0
- package/components/icure-form/fields/number-field/number-field.js +29 -0
- package/components/icure-form/fields/number-field/number-field.js.map +1 -0
- package/components/icure-form/fields/text-field/index.d.ts +1 -0
- package/components/icure-form/fields/text-field/index.js +18 -0
- package/components/icure-form/fields/text-field/index.js.map +1 -0
- package/components/icure-form/fields/text-field/text-field.d.ts +28 -0
- package/{lib/components/iqr-form/fields/textfield.js → components/icure-form/fields/text-field/text-field.js} +32 -81
- package/components/icure-form/fields/text-field/text-field.js.map +1 -0
- package/components/icure-form/fields/token-field/index.d.ts +1 -0
- package/components/icure-form/fields/token-field/index.js +18 -0
- package/components/icure-form/fields/token-field/index.js.map +1 -0
- package/components/icure-form/fields/token-field/token-field.d.ts +6 -0
- package/{lib/components/common/translatedField.js → components/icure-form/fields/token-field/token-field.js} +27 -22
- package/components/icure-form/fields/token-field/token-field.js.map +1 -0
- package/components/icure-form/fields/utils/index.d.ts +11 -0
- package/components/icure-form/fields/utils/index.js +48 -0
- package/components/icure-form/fields/utils/index.js.map +1 -0
- package/components/icure-form/index.d.ts +23 -0
- package/{lib/components/common/stylizedField.js → components/icure-form/index.js} +400 -74
- package/components/icure-form/index.js.map +1 -0
- package/components/icure-form/renderer/form/form-selection-button.d.ts +9 -0
- package/components/icure-form/renderer/form/form-selection-button.js +108 -0
- package/components/icure-form/renderer/form/form-selection-button.js.map +1 -0
- package/components/icure-form/renderer/form/form.d.ts +3 -0
- package/components/icure-form/renderer/form/form.js +399 -0
- package/components/icure-form/renderer/form/form.js.map +1 -0
- package/components/icure-form/renderer/index.d.ts +11 -0
- package/components/icure-form/renderer/index.js.map +1 -0
- package/components/icure-label/index.d.ts +8 -0
- package/{lib/components/iqr-radio-button-group → components/icure-label}/index.js +379 -114
- package/components/icure-label/index.js.map +1 -0
- package/components/icure-text-field/index.d.ts +69 -0
- package/components/icure-text-field/index.js +1739 -0
- package/components/icure-text-field/index.js.map +1 -0
- package/components/icure-text-field/plugin/caret-fix-plugin.js.map +1 -0
- package/components/icure-text-field/plugin/has-content-class-plugin.js.map +1 -0
- package/components/icure-text-field/plugin/mask-plugin.js.map +1 -0
- package/components/icure-text-field/plugin/regexp-plugin.js.map +1 -0
- package/components/icure-text-field/prosemirror-commands.js.map +1 -0
- package/components/icure-text-field/prosemirror-utils.js.map +1 -0
- package/components/icure-text-field/schema/common-marks.js.map +1 -0
- package/components/icure-text-field/schema/date-time-schema.js.map +1 -0
- package/components/icure-text-field/schema/decimal-schema.js.map +1 -0
- package/components/icure-text-field/schema/index.d.ts +6 -0
- package/{lib/components/iqr-text-field → components/icure-text-field}/schema/index.js +6 -3
- package/components/icure-text-field/schema/index.js.map +1 -0
- package/components/icure-text-field/schema/items-list-schema.d.ts +3 -0
- package/components/icure-text-field/schema/items-list-schema.js +28 -0
- package/components/icure-text-field/schema/items-list-schema.js.map +1 -0
- package/components/icure-text-field/schema/items-list.d.ts +3 -0
- package/components/icure-text-field/schema/items-list.js +31 -0
- package/components/icure-text-field/schema/items-list.js.map +1 -0
- package/components/icure-text-field/schema/markdown-schema.js.map +1 -0
- package/components/icure-text-field/schema/measure-schema.d.ts +7 -0
- package/components/icure-text-field/schema/measure-schema.js +81 -0
- package/components/icure-text-field/schema/measure-schema.js.map +1 -0
- package/{lib/components/iqr-text-field → components/icure-text-field}/schema/token-schema.js +3 -6
- package/components/icure-text-field/schema/token-schema.js.map +1 -0
- package/components/icure-text-field/schema/utils.js.map +1 -0
- package/components/icure-text-field/selection-companion.js.map +1 -0
- package/{lib/components/iqr-text-field → components/icure-text-field}/suggestion-palette.d.ts +1 -6
- package/components/icure-text-field/suggestion-palette.js.map +1 -0
- package/components/index.d.ts +5 -0
- package/{lib/components → components}/index.js +4 -5
- package/components/index.js.map +1 -0
- package/components/model/index.d.ts +782 -0
- package/components/model/index.js +632 -0
- package/components/model/index.js.map +1 -0
- package/components/themes/default/index.js +28 -0
- package/components/themes/default/index.js.map +1 -0
- package/components/themes/ehr-lite/index.js +321 -0
- package/components/themes/ehr-lite/index.js.map +1 -0
- package/components/themes/kendo/index.js +285 -0
- package/components/themes/kendo/index.js.map +1 -0
- package/conversion/ckmeans-grouping.d.ts +4 -0
- package/conversion/ckmeans-grouping.js +53 -0
- package/conversion/ckmeans-grouping.js.map +1 -0
- package/conversion/ckmeans.d.ts +44 -0
- package/conversion/ckmeans.js +287 -0
- package/conversion/ckmeans.js.map +1 -0
- package/conversion/icure-convert.d.ts +3 -0
- package/conversion/icure-convert.js +165 -0
- package/conversion/icure-convert.js.map +1 -0
- package/generic/index.d.ts +1 -0
- package/generic/index.js +18 -0
- package/generic/index.js.map +1 -0
- package/generic/model.d.ts +39 -0
- package/{lib/components/iqr-form/renderer/index.js → generic/model.js} +1 -1
- package/generic/model.js.map +1 -0
- package/icure/form-values-container.d.ts +83 -0
- package/icure/form-values-container.js +445 -0
- package/icure/form-values-container.js.map +1 -0
- package/icure/index.d.ts +2 -0
- package/icure/index.js +19 -0
- package/icure/index.js.map +1 -0
- package/icure/model.d.ts +10 -0
- package/{lib/components/iqr-form-loader/models.js → icure/model.js} +1 -1
- package/icure/model.js.map +1 -0
- package/package.json +22 -94
- package/utils/code-utils.d.ts +18 -0
- package/utils/code-utils.js +36 -0
- package/utils/code-utils.js.map +1 -0
- package/utils/fields-values-provider.d.ts +18 -0
- package/utils/fields-values-provider.js +50 -0
- package/utils/fields-values-provider.js.map +1 -0
- package/utils/form-value-container.d.ts +3 -0
- package/utils/form-value-container.js +45 -0
- package/utils/form-value-container.js.map +1 -0
- package/utils/icure-utils.d.ts +16 -0
- package/{lib/utils → utils}/icure-utils.js +33 -48
- package/utils/icure-utils.js.map +1 -0
- package/utils/interpreter.d.ts +4 -0
- package/utils/interpreter.js +52 -0
- package/utils/interpreter.js.map +1 -0
- package/utils/languages.d.ts +10 -0
- package/utils/languages.js +15 -0
- package/utils/languages.js.map +1 -0
- package/utils/markdown.d.ts +8 -0
- package/utils/markdown.js +58 -0
- package/utils/markdown.js.map +1 -0
- package/utils/primitive.d.ts +7 -0
- package/utils/primitive.js +123 -0
- package/utils/primitive.js.map +1 -0
- package/.eslintrc +0 -34
- package/.prettierrc +0 -8
- package/.yarn/plugins/@yarnpkg/plugin-version.cjs +0 -550
- package/.yarn/versions/76a58acc.yml +0 -0
- package/.yarn/versions/c3ca09e7.yml +0 -0
- package/lib/components/common/index.d.ts +0 -4
- package/lib/components/common/index.js.map +0 -1
- package/lib/components/common/labelizedField.d.ts +0 -8
- package/lib/components/common/labelizedField.js.map +0 -1
- package/lib/components/common/optionsField.d.ts +0 -10
- package/lib/components/common/optionsField.js.map +0 -1
- package/lib/components/common/stylizedField.d.ts +0 -4
- package/lib/components/common/stylizedField.js.map +0 -1
- package/lib/components/common/translatedField.d.ts +0 -8
- package/lib/components/common/translatedField.js.map +0 -1
- package/lib/components/common/valuedField.d.ts +0 -10
- package/lib/components/common/valuedField.js.map +0 -1
- package/lib/components/index.d.ts +0 -6
- package/lib/components/index.js.map +0 -1
- package/lib/components/iqr-dropdown/index.js +0 -129
- package/lib/components/iqr-dropdown/index.js.map +0 -1
- package/lib/components/iqr-form/fields/checkbox.d.ts +0 -8
- package/lib/components/iqr-form/fields/checkbox.js +0 -50
- package/lib/components/iqr-form/fields/checkbox.js.map +0 -1
- package/lib/components/iqr-form/fields/datePicker.d.ts +0 -24
- package/lib/components/iqr-form/fields/datePicker.js +0 -101
- package/lib/components/iqr-form/fields/datePicker.js.map +0 -1
- package/lib/components/iqr-form/fields/dateTimePicker.d.ts +0 -24
- package/lib/components/iqr-form/fields/dateTimePicker.js +0 -100
- package/lib/components/iqr-form/fields/dateTimePicker.js.map +0 -1
- package/lib/components/iqr-form/fields/dropdown.d.ts +0 -10
- package/lib/components/iqr-form/fields/dropdown.js.map +0 -1
- package/lib/components/iqr-form/fields/label.d.ts +0 -7
- package/lib/components/iqr-form/fields/label.js +0 -23
- package/lib/components/iqr-form/fields/label.js.map +0 -1
- package/lib/components/iqr-form/fields/measureField.d.ts +0 -25
- package/lib/components/iqr-form/fields/measureField.js +0 -107
- package/lib/components/iqr-form/fields/measureField.js.map +0 -1
- package/lib/components/iqr-form/fields/multipleChoice.d.ts +0 -15
- package/lib/components/iqr-form/fields/multipleChoice.js +0 -87
- package/lib/components/iqr-form/fields/multipleChoice.js.map +0 -1
- package/lib/components/iqr-form/fields/numberField.d.ts +0 -24
- package/lib/components/iqr-form/fields/numberField.js +0 -100
- package/lib/components/iqr-form/fields/numberField.js.map +0 -1
- package/lib/components/iqr-form/fields/radioButton.d.ts +0 -8
- package/lib/components/iqr-form/fields/radioButton.js +0 -50
- package/lib/components/iqr-form/fields/radioButton.js.map +0 -1
- package/lib/components/iqr-form/fields/textfield.d.ts +0 -1
- package/lib/components/iqr-form/fields/textfield.js.map +0 -1
- package/lib/components/iqr-form/fields/timePicker.d.ts +0 -15
- package/lib/components/iqr-form/fields/timePicker.js +0 -90
- package/lib/components/iqr-form/fields/timePicker.js.map +0 -1
- package/lib/components/iqr-form/index.d.ts +0 -11
- package/lib/components/iqr-form/index.js +0 -150
- package/lib/components/iqr-form/index.js.map +0 -1
- package/lib/components/iqr-form/legacy/Content.d.ts +0 -28
- package/lib/components/iqr-form/legacy/Content.js +0 -30
- package/lib/components/iqr-form/legacy/Content.js.map +0 -1
- package/lib/components/iqr-form/legacy/Data.d.ts +0 -14
- package/lib/components/iqr-form/legacy/Data.js +0 -21
- package/lib/components/iqr-form/legacy/Data.js.map +0 -1
- package/lib/components/iqr-form/legacy/Editor.d.ts +0 -34
- package/lib/components/iqr-form/legacy/Editor.js +0 -19
- package/lib/components/iqr-form/legacy/Editor.js.map +0 -1
- package/lib/components/iqr-form/legacy/FormColumn.d.ts +0 -18
- package/lib/components/iqr-form/legacy/FormColumn.js +0 -10
- package/lib/components/iqr-form/legacy/FormColumn.js.map +0 -1
- package/lib/components/iqr-form/legacy/FormDataOption.d.ts +0 -16
- package/lib/components/iqr-form/legacy/FormDataOption.js +0 -21
- package/lib/components/iqr-form/legacy/FormDataOption.js.map +0 -1
- package/lib/components/iqr-form/legacy/FormLayout.d.ts +0 -25
- package/lib/components/iqr-form/legacy/FormLayout.js +0 -10
- package/lib/components/iqr-form/legacy/FormLayout.js.map +0 -1
- package/lib/components/iqr-form/legacy/FormLayoutData.d.ts +0 -42
- package/lib/components/iqr-form/legacy/FormLayoutData.js +0 -10
- package/lib/components/iqr-form/legacy/FormLayoutData.js.map +0 -1
- package/lib/components/iqr-form/legacy/FormPlanning.d.ts +0 -22
- package/lib/components/iqr-form/legacy/FormPlanning.js +0 -21
- package/lib/components/iqr-form/legacy/FormPlanning.js.map +0 -1
- package/lib/components/iqr-form/legacy/FormSection.d.ts +0 -19
- package/lib/components/iqr-form/legacy/FormSection.js +0 -10
- package/lib/components/iqr-form/legacy/FormSection.js.map +0 -1
- package/lib/components/iqr-form/legacy/Formula.d.ts +0 -27
- package/lib/components/iqr-form/legacy/Formula.js +0 -32
- package/lib/components/iqr-form/legacy/Formula.js.map +0 -1
- package/lib/components/iqr-form/legacy/GuiCode.d.ts +0 -16
- package/lib/components/iqr-form/legacy/GuiCode.js +0 -21
- package/lib/components/iqr-form/legacy/GuiCode.js.map +0 -1
- package/lib/components/iqr-form/legacy/GuiCodeType.d.ts +0 -15
- package/lib/components/iqr-form/legacy/GuiCodeType.js +0 -21
- package/lib/components/iqr-form/legacy/GuiCodeType.js.map +0 -1
- package/lib/components/iqr-form/legacy/Suggest.d.ts +0 -19
- package/lib/components/iqr-form/legacy/Suggest.js +0 -21
- package/lib/components/iqr-form/legacy/Suggest.js.map +0 -1
- package/lib/components/iqr-form/legacy/Tag.d.ts +0 -16
- package/lib/components/iqr-form/legacy/Tag.js +0 -21
- package/lib/components/iqr-form/legacy/Tag.js.map +0 -1
- package/lib/components/iqr-form/model/index.d.ts +0 -130
- package/lib/components/iqr-form/model/index.js +0 -164
- package/lib/components/iqr-form/model/index.js.map +0 -1
- package/lib/components/iqr-form/renderer/cards.d.ts +0 -2
- package/lib/components/iqr-form/renderer/cards.js +0 -69
- package/lib/components/iqr-form/renderer/cards.js.map +0 -1
- package/lib/components/iqr-form/renderer/form.d.ts +0 -3
- package/lib/components/iqr-form/renderer/form.js +0 -240
- package/lib/components/iqr-form/renderer/form.js.map +0 -1
- package/lib/components/iqr-form/renderer/index.d.ts +0 -7
- package/lib/components/iqr-form/renderer/index.js.map +0 -1
- package/lib/components/iqr-form/utils.d.ts +0 -5
- package/lib/components/iqr-form/utils.js +0 -91
- package/lib/components/iqr-form/utils.js.map +0 -1
- package/lib/components/iqr-form-loader/fieldsMapper.d.ts +0 -3
- package/lib/components/iqr-form-loader/fieldsMapper.js +0 -16
- package/lib/components/iqr-form-loader/fieldsMapper.js.map +0 -1
- package/lib/components/iqr-form-loader/fieldsValuesProviders.d.ts +0 -38
- package/lib/components/iqr-form-loader/fieldsValuesProviders.js +0 -122
- package/lib/components/iqr-form-loader/fieldsValuesProviders.js.map +0 -1
- package/lib/components/iqr-form-loader/formValuesContainer.d.ts +0 -41
- package/lib/components/iqr-form-loader/formValuesContainer.js +0 -160
- package/lib/components/iqr-form-loader/formValuesContainer.js.map +0 -1
- package/lib/components/iqr-form-loader/index.d.ts +0 -3
- package/lib/components/iqr-form-loader/index.js.map +0 -1
- package/lib/components/iqr-form-loader/models.d.ts +0 -14
- package/lib/components/iqr-form-loader/models.js.map +0 -1
- package/lib/components/iqr-label/index.js +0 -16
- package/lib/components/iqr-label/index.js.map +0 -1
- package/lib/components/iqr-label/utils.d.ts +0 -4
- package/lib/components/iqr-label/utils.js +0 -19
- package/lib/components/iqr-label/utils.js.map +0 -1
- package/lib/components/iqr-radio-button-group/index.js.map +0 -1
- package/lib/components/iqr-text-field/index.d.ts +0 -36
- package/lib/components/iqr-text-field/index.js +0 -1346
- package/lib/components/iqr-text-field/index.js.map +0 -1
- package/lib/components/iqr-text-field/plugin/caret-fix-plugin.js.map +0 -1
- package/lib/components/iqr-text-field/plugin/has-content-class-plugin.js.map +0 -1
- package/lib/components/iqr-text-field/plugin/mask-plugin.js.map +0 -1
- package/lib/components/iqr-text-field/plugin/regexp-plugin.js.map +0 -1
- package/lib/components/iqr-text-field/prosemirror-commands.js.map +0 -1
- package/lib/components/iqr-text-field/prosemirror-utils.js.map +0 -1
- package/lib/components/iqr-text-field/schema/common-marks.js.map +0 -1
- package/lib/components/iqr-text-field/schema/date-time-schema.js.map +0 -1
- package/lib/components/iqr-text-field/schema/decimal-schema.js.map +0 -1
- package/lib/components/iqr-text-field/schema/index.d.ts +0 -11
- package/lib/components/iqr-text-field/schema/index.js.map +0 -1
- package/lib/components/iqr-text-field/schema/markdown-schema.js.map +0 -1
- package/lib/components/iqr-text-field/schema/measure-schema.d.ts +0 -3
- package/lib/components/iqr-text-field/schema/measure-schema.js +0 -37
- package/lib/components/iqr-text-field/schema/measure-schema.js.map +0 -1
- package/lib/components/iqr-text-field/schema/token-schema.js.map +0 -1
- package/lib/components/iqr-text-field/schema/utils.js.map +0 -1
- package/lib/components/iqr-text-field/selection-companion.js.map +0 -1
- package/lib/components/iqr-text-field/styles/paths.js.map +0 -1
- package/lib/components/iqr-text-field/suggestion-palette.js.map +0 -1
- package/lib/package.json +0 -32
- package/lib/utils/icure-utils.d.ts +0 -22
- package/lib/utils/icure-utils.js.map +0 -1
- package/lib/utils/languages.d.ts +0 -8
- package/lib/utils/languages.js +0 -15
- package/lib/utils/languages.js.map +0 -1
- package/stats.json +0 -1
- package/tsconfig.tmp.json +0 -39
- /package/{lib/components/common → components/icure-form/renderer}/index.js +0 -0
- /package/{lib/components/iqr-text-field → components/icure-text-field}/plugin/caret-fix-plugin.d.ts +0 -0
- /package/{lib/components/iqr-text-field → components/icure-text-field}/plugin/caret-fix-plugin.js +0 -0
- /package/{lib/components/iqr-text-field → components/icure-text-field}/plugin/has-content-class-plugin.d.ts +0 -0
- /package/{lib/components/iqr-text-field → components/icure-text-field}/plugin/has-content-class-plugin.js +0 -0
- /package/{lib/components/iqr-text-field → components/icure-text-field}/plugin/mask-plugin.d.ts +0 -0
- /package/{lib/components/iqr-text-field → components/icure-text-field}/plugin/mask-plugin.js +0 -0
- /package/{lib/components/iqr-text-field → components/icure-text-field}/plugin/regexp-plugin.d.ts +0 -0
- /package/{lib/components/iqr-text-field → components/icure-text-field}/plugin/regexp-plugin.js +0 -0
- /package/{lib/components/iqr-text-field → components/icure-text-field}/prosemirror-commands.d.ts +0 -0
- /package/{lib/components/iqr-text-field → components/icure-text-field}/prosemirror-commands.js +0 -0
- /package/{lib/components/iqr-text-field → components/icure-text-field}/prosemirror-utils.d.ts +0 -0
- /package/{lib/components/iqr-text-field → components/icure-text-field}/prosemirror-utils.js +0 -0
- /package/{lib/components/iqr-text-field → components/icure-text-field}/schema/common-marks.d.ts +0 -0
- /package/{lib/components/iqr-text-field → components/icure-text-field}/schema/common-marks.js +0 -0
- /package/{lib/components/iqr-text-field → components/icure-text-field}/schema/date-time-schema.d.ts +0 -0
- /package/{lib/components/iqr-text-field → components/icure-text-field}/schema/date-time-schema.js +0 -0
- /package/{lib/components/iqr-text-field → components/icure-text-field}/schema/decimal-schema.d.ts +0 -0
- /package/{lib/components/iqr-text-field → components/icure-text-field}/schema/decimal-schema.js +0 -0
- /package/{lib/components/iqr-text-field → components/icure-text-field}/schema/markdown-schema.d.ts +0 -0
- /package/{lib/components/iqr-text-field → components/icure-text-field}/schema/markdown-schema.js +0 -0
- /package/{lib/components/iqr-text-field → components/icure-text-field}/schema/token-schema.d.ts +0 -0
- /package/{lib/components/iqr-text-field → components/icure-text-field}/schema/utils.d.ts +0 -0
- /package/{lib/components/iqr-text-field → components/icure-text-field}/schema/utils.js +0 -0
- /package/{lib/components/iqr-text-field → components/icure-text-field}/selection-companion.d.ts +0 -0
- /package/{lib/components/iqr-text-field → components/icure-text-field}/selection-companion.js +0 -0
- /package/{lib/components/iqr-text-field → components/icure-text-field}/suggestion-palette.js +0 -0
- /package/{lib/components/iqr-dropdown → components/themes/default}/index.d.ts +0 -0
- /package/{lib/components/iqr-label → components/themes/ehr-lite}/index.d.ts +0 -0
- /package/{lib/components/iqr-radio-button-group → components/themes/kendo}/index.d.ts +0 -0
- /package/{lib/index.d.ts → index.d.ts} +0 -0
- /package/{lib/index.js → index.js} +0 -0
- /package/{lib/index.js.map → index.js.map} +0 -0
- /package/{lib/utils → utils}/no-lodash.d.ts +0 -0
- /package/{lib/utils → utils}/no-lodash.js +0 -0
- /package/{lib/utils → utils}/no-lodash.js.map +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fieldsMapper.js","sourceRoot":"","sources":["../../../tmp/components/iqr-form-loader/fieldsMapper.ts"],"names":[],"mappings":";;;AAGA,SAAgB,YAAY,CAAC,KAAY;;IACxC,OAAO,MAAM,CAAC,IAAI,CAAC,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,mCAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE;;QAC1D,MAAM,IAAI,GAAW,MAAC,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,0CAAG,SAAS,CAAY,mCAAI,EAAE,CAAA;QAClE,OAAO;YACN,EAAE,EAAE,SAAS;YACb,IAAI,EAAE,IAAI;SACV,CAAA;IACF,CAAC,CAAC,CAAA;AACH,CAAC;AARD,oCAQC","sourcesContent":["import { Field } from '../iqr-form/model'\nimport { OptionCode } from '../common'\n\nexport function optionMapper(field: Field): OptionCode[] {\n\treturn Object.keys(field?.options ?? []).map((optionKey) => {\n\t\tconst text: string = (field?.options?.[optionKey] as string) ?? ''\n\t\treturn {\n\t\t\tid: optionKey,\n\t\t\ttext: text,\n\t\t}\n\t})\n}\n"]}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Field } from '../iqr-form/model';
|
|
2
|
-
import { Meta, VersionedMeta, VersionedValue } from '../iqr-text-field';
|
|
3
|
-
import { CodeStub, Content } from '@icure/api';
|
|
4
|
-
import { FormValuesContainer } from './formValuesContainer';
|
|
5
|
-
export declare function numberFieldValuesProvider(formValuesContainer: FormValuesContainer, field: Field): () => VersionedValue[];
|
|
6
|
-
export declare function measureFieldValuesProvider(formValuesContainer: FormValuesContainer, field: Field): () => VersionedValue[];
|
|
7
|
-
export declare function textFieldValuesProvider(formValuesContainer: FormValuesContainer, field: Field): () => VersionedValue[];
|
|
8
|
-
export declare function dateFieldValuesProvider(formValuesContainer: FormValuesContainer, field: Field): () => VersionedValue[];
|
|
9
|
-
export declare function dateTimeFieldValuesProvider(formValuesContainer: FormValuesContainer, field: Field): () => VersionedValue[];
|
|
10
|
-
export declare function timeFieldValuesProvider(formValuesContainer: FormValuesContainer, field: Field): () => VersionedValue[];
|
|
11
|
-
export declare function dropdownFieldValuesProvider(formValuesContainer: FormValuesContainer, field: Field): () => VersionedValue[];
|
|
12
|
-
export declare function radioButtonFieldValuesProvider(formValuesContainer: FormValuesContainer, field: Field): () => VersionedValue[];
|
|
13
|
-
export declare function metaProvider(formValuesContainer: FormValuesContainer, field: Field): () => VersionedMeta[];
|
|
14
|
-
export declare function handleFieldValueChangedProvider(field: Field, formValuesContainer: FormValuesContainer, formValuesContainerChanged: (newValue: FormValuesContainer) => void): (language: string, content: {
|
|
15
|
-
asString: string;
|
|
16
|
-
content?: Content;
|
|
17
|
-
}, serviceId?: string | undefined, codes?: CodeStub[]) => void;
|
|
18
|
-
export declare function handleMeasureFieldValueChangedProvider(field: Field, formValuesContainer: FormValuesContainer, formValuesContainerChanged: (newValue: FormValuesContainer) => void): (serviceId: string | undefined, language: string, content: {
|
|
19
|
-
asString: string;
|
|
20
|
-
value: Content;
|
|
21
|
-
}, codes: CodeStub[]) => void;
|
|
22
|
-
export declare function handleNumberFieldValueChangedProvider(field: Field, formValuesContainer: FormValuesContainer, formValuesContainerChanged: (newValue: FormValuesContainer) => void): (serviceId: string | undefined, language: string, content: {
|
|
23
|
-
asString: string;
|
|
24
|
-
value: Content;
|
|
25
|
-
}, codes: CodeStub[]) => void;
|
|
26
|
-
export declare function handleDateTimeFieldValueChangedProvider(field: Field, formValuesContainer: FormValuesContainer, formValuesContainerChanged: (newValue: FormValuesContainer) => void): (serviceId: string | undefined, language: string, content: {
|
|
27
|
-
asString: string;
|
|
28
|
-
value: Content;
|
|
29
|
-
}, codes: CodeStub[]) => void;
|
|
30
|
-
export declare function handleDateFieldValueChangedProvider(field: Field, formValuesContainer: FormValuesContainer, formValuesContainerChanged: (newValue: FormValuesContainer) => void): (serviceId: string | undefined, language: string, content: {
|
|
31
|
-
asString: string;
|
|
32
|
-
value: Content;
|
|
33
|
-
}, codes: CodeStub[]) => void;
|
|
34
|
-
export declare function handleTimeFieldValueChangedProvider(field: Field, formValuesContainer: FormValuesContainer, formValuesContainerChanged: (newValue: FormValuesContainer) => void): (serviceId: string | undefined, language: string, content: {
|
|
35
|
-
asString: string;
|
|
36
|
-
value: Content;
|
|
37
|
-
}, codes: CodeStub[]) => void;
|
|
38
|
-
export declare function handleMetaChangedProvider(formValuesContainer: FormValuesContainer): (serviceId: string, meta: Meta) => void;
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.handleMetaChangedProvider = exports.handleTimeFieldValueChangedProvider = exports.handleDateFieldValueChangedProvider = exports.handleDateTimeFieldValueChangedProvider = exports.handleNumberFieldValueChangedProvider = exports.handleMeasureFieldValueChangedProvider = exports.handleFieldValueChangedProvider = exports.metaProvider = exports.radioButtonFieldValuesProvider = exports.dropdownFieldValuesProvider = exports.timeFieldValuesProvider = exports.dateTimeFieldValuesProvider = exports.dateFieldValuesProvider = exports.textFieldValuesProvider = exports.measureFieldValuesProvider = exports.numberFieldValuesProvider = void 0;
|
|
4
|
-
const icure_utils_1 = require("../../utils/icure-utils");
|
|
5
|
-
const api_1 = require("@icure/api");
|
|
6
|
-
// @ts-ignore
|
|
7
|
-
const uuid_1 = require("uuid");
|
|
8
|
-
function numberFieldValuesProvider(formValuesContainer, field) {
|
|
9
|
-
return () => (0, icure_utils_1.convertServicesToVersionedValues)((0, icure_utils_1.getVersions)(formValuesContainer, field), (content) => content.numberValue || content.numberValue === 0 ? new Intl.NumberFormat('fr').format(content.numberValue) : '');
|
|
10
|
-
}
|
|
11
|
-
exports.numberFieldValuesProvider = numberFieldValuesProvider;
|
|
12
|
-
function measureFieldValuesProvider(formValuesContainer, field) {
|
|
13
|
-
return () => (0, icure_utils_1.convertServicesToVersionedValues)((0, icure_utils_1.getVersions)(formValuesContainer, field), (content) => { var _a, _b, _c; return ((_a = content.measureValue) === null || _a === void 0 ? void 0 : _a.value) || ((_b = content.measureValue) === null || _b === void 0 ? void 0 : _b.value) === 0 ? `${new Intl.NumberFormat('fr').format(content.measureValue.value)} ${(_c = content.measureValue) === null || _c === void 0 ? void 0 : _c.unit}` : ''; });
|
|
14
|
-
}
|
|
15
|
-
exports.measureFieldValuesProvider = measureFieldValuesProvider;
|
|
16
|
-
function textFieldValuesProvider(formValuesContainer, field) {
|
|
17
|
-
return () => (0, icure_utils_1.convertServicesToVersionedValues)((0, icure_utils_1.getVersions)(formValuesContainer, field), (content) => content.stringValue || '');
|
|
18
|
-
}
|
|
19
|
-
exports.textFieldValuesProvider = textFieldValuesProvider;
|
|
20
|
-
function dateFieldValuesProvider(formValuesContainer, field) {
|
|
21
|
-
return () => (0, icure_utils_1.convertServicesToVersionedValues)((0, icure_utils_1.getVersions)(formValuesContainer, field), (content) => `${content.fuzzyDateValue}`.replace(/(....)(..)(..)/, '$3$2$1') || '');
|
|
22
|
-
}
|
|
23
|
-
exports.dateFieldValuesProvider = dateFieldValuesProvider;
|
|
24
|
-
function dateTimeFieldValuesProvider(formValuesContainer, field) {
|
|
25
|
-
return () => (0, icure_utils_1.convertServicesToVersionedValues)((0, icure_utils_1.getVersions)(formValuesContainer, field), (content) => `${content.fuzzyDateValue}`.replace(/(....)(..)(..)(......)/, '$3$2$1 $4') || '');
|
|
26
|
-
}
|
|
27
|
-
exports.dateTimeFieldValuesProvider = dateTimeFieldValuesProvider;
|
|
28
|
-
function timeFieldValuesProvider(formValuesContainer, field) {
|
|
29
|
-
return () => (0, icure_utils_1.convertServicesToVersionedValues)((0, icure_utils_1.getVersions)(formValuesContainer, field), (content) => `${content.fuzzyDateValue}`);
|
|
30
|
-
}
|
|
31
|
-
exports.timeFieldValuesProvider = timeFieldValuesProvider;
|
|
32
|
-
function dropdownFieldValuesProvider(formValuesContainer, field) {
|
|
33
|
-
return () => (0, icure_utils_1.convertServicesToVersionedValues)((0, icure_utils_1.getVersions)(formValuesContainer, field), (content) => `${content.stringValue}`);
|
|
34
|
-
}
|
|
35
|
-
exports.dropdownFieldValuesProvider = dropdownFieldValuesProvider;
|
|
36
|
-
function radioButtonFieldValuesProvider(formValuesContainer, field) {
|
|
37
|
-
return () => (0, icure_utils_1.convertServicesToVersionedValues)((0, icure_utils_1.getVersions)(formValuesContainer, field), (content) => `${content.stringValue}`);
|
|
38
|
-
}
|
|
39
|
-
exports.radioButtonFieldValuesProvider = radioButtonFieldValuesProvider;
|
|
40
|
-
function metaProvider(formValuesContainer, field) {
|
|
41
|
-
return () => (0, icure_utils_1.convertServicesToVersionedMetas)((0, icure_utils_1.getVersions)(formValuesContainer, field));
|
|
42
|
-
}
|
|
43
|
-
exports.metaProvider = metaProvider;
|
|
44
|
-
function handleFieldValueChangedProvider(field, formValuesContainer, formValuesContainerChanged) {
|
|
45
|
-
return (language, value, serviceId, codes) => {
|
|
46
|
-
var _a, _b, _c;
|
|
47
|
-
const sId = serviceId !== null && serviceId !== void 0 ? serviceId : (0, uuid_1.v4)();
|
|
48
|
-
formValuesContainerChanged(formValuesContainer.setValue((_a = field.shortLabel) !== null && _a !== void 0 ? _a : field.label(), sId, language, (_b = value.content) !== null && _b !== void 0 ? _b : new api_1.Content({ stringValue: value.asString }), codes !== null && codes !== void 0 ? codes : [], ((_c = field.tags) !== null && _c !== void 0 ? _c : []).map((s) => {
|
|
49
|
-
const parts = s.split('|');
|
|
50
|
-
return new api_1.CodeStub({ id: s, type: parts[0], code: parts[1], version: parts[2] });
|
|
51
|
-
})));
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
exports.handleFieldValueChangedProvider = handleFieldValueChangedProvider;
|
|
55
|
-
function handleMeasureFieldValueChangedProvider(field, formValuesContainer, formValuesContainerChanged) {
|
|
56
|
-
return (serviceId, language, content, codes) => {
|
|
57
|
-
var _a, _b, _c, _d;
|
|
58
|
-
const sId = serviceId !== null && serviceId !== void 0 ? serviceId : (0, uuid_1.v4)();
|
|
59
|
-
formValuesContainerChanged(formValuesContainer.setValue((_a = field.shortLabel) !== null && _a !== void 0 ? _a : field.label(), sId, language, (_b = content.value) !== null && _b !== void 0 ? _b : new api_1.Content({ measureValue: { value: content.asString.split(' ')[0] || '', unit: content.asString.split(' ')[1] || '' } }), [
|
|
60
|
-
...(_c = (codes || [])) === null || _c === void 0 ? void 0 : _c.filter((code) => code.type !== 'CD-UNIT'),
|
|
61
|
-
new api_1.CodeStub({ id: 'CD-UNIT|' + content.asString.split(' ')[1] || '' + '|1', type: 'CD-UNIT', code: content.asString.split(' ')[1] || '', version: '1' }),
|
|
62
|
-
], ((_d = field.tags) !== null && _d !== void 0 ? _d : []).map((s) => {
|
|
63
|
-
const parts = s.split('|');
|
|
64
|
-
return new api_1.CodeStub({ id: s, type: parts[0], code: parts[1], version: parts[2] });
|
|
65
|
-
})));
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
exports.handleMeasureFieldValueChangedProvider = handleMeasureFieldValueChangedProvider;
|
|
69
|
-
function handleNumberFieldValueChangedProvider(field, formValuesContainer, formValuesContainerChanged) {
|
|
70
|
-
return (serviceId, language, content, codes) => {
|
|
71
|
-
var _a, _b, _c;
|
|
72
|
-
const sId = serviceId !== null && serviceId !== void 0 ? serviceId : (0, uuid_1.v4)();
|
|
73
|
-
formValuesContainerChanged(formValuesContainer.setValue((_a = field.shortLabel) !== null && _a !== void 0 ? _a : field.label(), sId, language, (_b = content.value) !== null && _b !== void 0 ? _b : new api_1.Content({ numberValue: content.value }), codes, ((_c = field.tags) !== null && _c !== void 0 ? _c : []).map((s) => {
|
|
74
|
-
const parts = s.split('|');
|
|
75
|
-
return new api_1.CodeStub({ id: s, type: parts[0], code: parts[1], version: parts[2] });
|
|
76
|
-
})));
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
exports.handleNumberFieldValueChangedProvider = handleNumberFieldValueChangedProvider;
|
|
80
|
-
function handleDateTimeFieldValueChangedProvider(field, formValuesContainer, formValuesContainerChanged) {
|
|
81
|
-
return (serviceId, language, content, codes) => {
|
|
82
|
-
var _a, _b, _c;
|
|
83
|
-
const sId = serviceId !== null && serviceId !== void 0 ? serviceId : (0, uuid_1.v4)();
|
|
84
|
-
formValuesContainerChanged(formValuesContainer.setValue((_a = field.shortLabel) !== null && _a !== void 0 ? _a : field.label(), sId, language, (_b = content.value) !== null && _b !== void 0 ? _b : new api_1.Content({ fuzzyDateValue: content.asString.replace(/[\/:-]/gm, '').replace(/(..)(..)(....)(......)/, '$3$2$1$4') || '' }), codes, ((_c = field.tags) !== null && _c !== void 0 ? _c : []).map((s) => {
|
|
85
|
-
const parts = s.split('|');
|
|
86
|
-
return new api_1.CodeStub({ id: s, type: parts[0], code: parts[1], version: parts[2] });
|
|
87
|
-
})));
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
exports.handleDateTimeFieldValueChangedProvider = handleDateTimeFieldValueChangedProvider;
|
|
91
|
-
function handleDateFieldValueChangedProvider(field, formValuesContainer, formValuesContainerChanged) {
|
|
92
|
-
return (serviceId, language, content, codes) => {
|
|
93
|
-
var _a, _b, _c;
|
|
94
|
-
const sId = serviceId !== null && serviceId !== void 0 ? serviceId : (0, uuid_1.v4)();
|
|
95
|
-
formValuesContainerChanged(formValuesContainer.setValue((_a = field.shortLabel) !== null && _a !== void 0 ? _a : field.label(), sId, language, (_b = content.value) !== null && _b !== void 0 ? _b : new api_1.Content({ fuzzyDateValue: content.asString.replace(/[\/-]/gm, '').replace(/(..)(..)(....)/, '$3$2$1') || '' }), codes, ((_c = field.tags) !== null && _c !== void 0 ? _c : []).map((s) => {
|
|
96
|
-
const parts = s.split('|');
|
|
97
|
-
return new api_1.CodeStub({ id: s, type: parts[0], code: parts[1], version: parts[2] });
|
|
98
|
-
})));
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
exports.handleDateFieldValueChangedProvider = handleDateFieldValueChangedProvider;
|
|
102
|
-
function handleTimeFieldValueChangedProvider(field, formValuesContainer, formValuesContainerChanged) {
|
|
103
|
-
return (serviceId, language, content, codes) => {
|
|
104
|
-
var _a, _b, _c;
|
|
105
|
-
const sId = serviceId !== null && serviceId !== void 0 ? serviceId : (0, uuid_1.v4)();
|
|
106
|
-
formValuesContainerChanged(formValuesContainer.setValue((_a = field.shortLabel) !== null && _a !== void 0 ? _a : field.label(), sId, language, (_b = content.value) !== null && _b !== void 0 ? _b : new api_1.Content({ fuzzyDateValue: content.asString.replace(/[-:]/gm, '') || '' }), codes, ((_c = field.tags) !== null && _c !== void 0 ? _c : []).map((s) => {
|
|
107
|
-
const parts = s.split('|');
|
|
108
|
-
return new api_1.CodeStub({ id: s, type: parts[0], code: parts[1], version: parts[2] });
|
|
109
|
-
})));
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
exports.handleTimeFieldValueChangedProvider = handleTimeFieldValueChangedProvider;
|
|
113
|
-
function handleMetaChangedProvider(formValuesContainer) {
|
|
114
|
-
return (serviceId, meta) => {
|
|
115
|
-
if (meta.owner !== undefined)
|
|
116
|
-
formValuesContainer.setResponsible(serviceId, meta.owner === null ? null : meta.owner.id);
|
|
117
|
-
if (meta.valueDate !== undefined)
|
|
118
|
-
formValuesContainer.setValueDate(serviceId, meta.valueDate);
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
exports.handleMetaChangedProvider = handleMetaChangedProvider;
|
|
122
|
-
//# sourceMappingURL=fieldsValuesProviders.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fieldsValuesProviders.js","sourceRoot":"","sources":["../../../tmp/components/iqr-form-loader/fieldsValuesProviders.ts"],"names":[],"mappings":";;;AAEA,yDAAwH;AACxH,oCAA8C;AAE9C,aAAa;AACb,+BAAiC;AAEjC,SAAgB,yBAAyB,CAAC,mBAAwC,EAAE,KAAY;IAC/F,OAAO,GAAG,EAAE,CACX,IAAA,8CAAgC,EAAC,IAAA,yBAAW,EAAC,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,OAAgB,EAAE,EAAE,CAC9F,OAAO,CAAC,WAAW,IAAI,OAAO,CAAC,WAAW,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,CAC/G,CAAA;AACH,CAAC;AALD,8DAKC;AAED,SAAgB,0BAA0B,CAAC,mBAAwC,EAAE,KAAY;IAChG,OAAO,GAAG,EAAE,CACX,IAAA,8CAAgC,EAAC,IAAA,yBAAW,EAAC,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,OAAgB,EAAE,EAAE,mBAC9F,OAAA,CAAA,MAAA,OAAO,CAAC,YAAY,0CAAE,KAAK,KAAI,CAAA,MAAA,OAAO,CAAC,YAAY,0CAAE,KAAK,MAAK,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,MAAA,OAAO,CAAC,YAAY,0CAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EA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AC9F,CAAC,CAAA;AACF,CAAC;AALD,8DAKC","sourcesContent":["import { Field } from '../iqr-form/model'\nimport { Meta, VersionedMeta, VersionedValue } from '../iqr-text-field'\nimport { convertServicesToVersionedMetas, convertServicesToVersionedValues, getVersions } from '../../utils/icure-utils'\nimport { CodeStub, Content } from '@icure/api'\nimport { FormValuesContainer } from './formValuesContainer'\n// @ts-ignore\nimport { v4 as uuid } from 'uuid'\n\nexport function numberFieldValuesProvider(formValuesContainer: FormValuesContainer, field: Field): () => VersionedValue[] {\n\treturn () =>\n\t\tconvertServicesToVersionedValues(getVersions(formValuesContainer, field), (content: Content) =>\n\t\t\tcontent.numberValue || content.numberValue === 0 ? new Intl.NumberFormat('fr').format(content.numberValue) : '',\n\t\t)\n}\n\nexport function measureFieldValuesProvider(formValuesContainer: FormValuesContainer, field: Field): () => VersionedValue[] {\n\treturn () =>\n\t\tconvertServicesToVersionedValues(getVersions(formValuesContainer, field), (content: Content) =>\n\t\t\tcontent.measureValue?.value || content.measureValue?.value === 0 ? `${new Intl.NumberFormat('fr').format(content.measureValue.value)} ${content.measureValue?.unit}` : '',\n\t\t)\n}\n\nexport function textFieldValuesProvider(formValuesContainer: FormValuesContainer, field: Field): () => VersionedValue[] {\n\treturn () => convertServicesToVersionedValues(getVersions(formValuesContainer, field), (content: Content) => content.stringValue || '')\n}\n\nexport function dateFieldValuesProvider(formValuesContainer: FormValuesContainer, field: Field): () => VersionedValue[] {\n\treturn () =>\n\t\tconvertServicesToVersionedValues(getVersions(formValuesContainer, field), (content: Content) => `${content.fuzzyDateValue}`.replace(/(....)(..)(..)/, '$3$2$1') || '')\n}\n\nexport function dateTimeFieldValuesProvider(formValuesContainer: FormValuesContainer, field: Field): () => VersionedValue[] {\n\treturn () =>\n\t\tconvertServicesToVersionedValues(\n\t\t\tgetVersions(formValuesContainer, field),\n\t\t\t(content: Content) => `${content.fuzzyDateValue}`.replace(/(....)(..)(..)(......)/, '$3$2$1 $4') || '',\n\t\t)\n}\n\nexport function timeFieldValuesProvider(formValuesContainer: FormValuesContainer, field: Field): () => VersionedValue[] {\n\treturn () => convertServicesToVersionedValues(getVersions(formValuesContainer, field), (content: Content) => `${content.fuzzyDateValue}`)\n}\n\nexport function dropdownFieldValuesProvider(formValuesContainer: FormValuesContainer, field: Field): () => VersionedValue[] {\n\treturn () => convertServicesToVersionedValues(getVersions(formValuesContainer, field), (content: Content) => `${content.stringValue}`)\n}\n\nexport function radioButtonFieldValuesProvider(formValuesContainer: FormValuesContainer, field: Field): () => VersionedValue[] {\n\treturn () => convertServicesToVersionedValues(getVersions(formValuesContainer, field), (content: Content) => `${content.stringValue}`)\n}\n\nexport function metaProvider(formValuesContainer: FormValuesContainer, field: Field): () => VersionedMeta[] {\n\treturn () => convertServicesToVersionedMetas(getVersions(formValuesContainer, field))\n}\n\nexport function handleFieldValueChangedProvider(\n\tfield: Field,\n\tformValuesContainer: FormValuesContainer,\n\tformValuesContainerChanged: (newValue: FormValuesContainer) => void,\n): (language: string, content: { asString: string; content?: Content }, serviceId?: string | undefined, codes?: CodeStub[]) => void {\n\treturn (language: string, value: { asString: string; content?: Content }, serviceId?: string | undefined, codes?: CodeStub[]) => {\n\t\tconst sId = serviceId ?? uuid()\n\t\tformValuesContainerChanged(\n\t\t\tformValuesContainer.setValue(\n\t\t\t\tfield.shortLabel ?? field.label(),\n\t\t\t\tsId,\n\t\t\t\tlanguage,\n\t\t\t\tvalue.content ?? new Content({ stringValue: value.asString }),\n\t\t\t\tcodes ?? [],\n\t\t\t\t(field.tags ?? []).map((s) => {\n\t\t\t\t\tconst parts = s.split('|')\n\t\t\t\t\treturn new CodeStub({ id: s, type: parts[0], code: parts[1], version: parts[2] })\n\t\t\t\t}),\n\t\t\t),\n\t\t)\n\t}\n}\n\nexport function handleMeasureFieldValueChangedProvider(\n\tfield: Field,\n\tformValuesContainer: FormValuesContainer,\n\tformValuesContainerChanged: (newValue: FormValuesContainer) => void,\n): (serviceId: string | undefined, language: string, content: { asString: string; value: Content }, codes: CodeStub[]) => void {\n\treturn (serviceId: string | undefined, language: string, content: { asString: string; value: Content }, codes: CodeStub[]) => {\n\t\tconst sId = serviceId ?? uuid()\n\t\tformValuesContainerChanged(\n\t\t\tformValuesContainer.setValue(\n\t\t\t\tfield.shortLabel ?? field.label(),\n\t\t\t\tsId,\n\t\t\t\tlanguage,\n\t\t\t\tcontent.value ?? new Content({ measureValue: { value: content.asString.split(' ')[0] || '', unit: content.asString.split(' ')[1] || '' } }),\n\t\t\t\t[\n\t\t\t\t\t...(codes || [])?.filter((code) => code.type !== 'CD-UNIT'),\n\t\t\t\t\tnew CodeStub({ id: 'CD-UNIT|' + content.asString.split(' ')[1] || '' + '|1', type: 'CD-UNIT', code: content.asString.split(' ')[1] || '', version: '1' }),\n\t\t\t\t],\n\t\t\t\t(field.tags ?? []).map((s) => {\n\t\t\t\t\tconst parts = s.split('|')\n\t\t\t\t\treturn new CodeStub({ id: s, type: parts[0], code: parts[1], version: parts[2] })\n\t\t\t\t}),\n\t\t\t),\n\t\t)\n\t}\n}\n\nexport function handleNumberFieldValueChangedProvider(\n\tfield: Field,\n\tformValuesContainer: FormValuesContainer,\n\tformValuesContainerChanged: (newValue: FormValuesContainer) => void,\n): (serviceId: string | undefined, language: string, content: { asString: string; value: Content }, codes: CodeStub[]) => void {\n\treturn (serviceId: string | undefined, language: string, content: { asString: string; value: Content }, codes: CodeStub[]) => {\n\t\tconst sId = serviceId ?? uuid()\n\t\tformValuesContainerChanged(\n\t\t\tformValuesContainer.setValue(\n\t\t\t\tfield.shortLabel ?? field.label(),\n\t\t\t\tsId,\n\t\t\t\tlanguage,\n\t\t\t\tcontent.value ?? new Content({ numberValue: content.value }),\n\t\t\t\tcodes,\n\t\t\t\t(field.tags ?? []).map((s) => {\n\t\t\t\t\tconst parts = s.split('|')\n\t\t\t\t\treturn new CodeStub({ id: s, type: parts[0], code: parts[1], version: parts[2] })\n\t\t\t\t}),\n\t\t\t),\n\t\t)\n\t}\n}\n\nexport function handleDateTimeFieldValueChangedProvider(\n\tfield: Field,\n\tformValuesContainer: FormValuesContainer,\n\tformValuesContainerChanged: (newValue: FormValuesContainer) => void,\n): (serviceId: string | undefined, language: string, content: { asString: string; value: Content }, codes: CodeStub[]) => void {\n\treturn (serviceId: string | undefined, language: string, content: { asString: string; value: Content }, codes: CodeStub[]) => {\n\t\tconst sId = serviceId ?? uuid()\n\t\tformValuesContainerChanged(\n\t\t\tformValuesContainer.setValue(\n\t\t\t\tfield.shortLabel ?? field.label(),\n\t\t\t\tsId,\n\t\t\t\tlanguage,\n\t\t\t\tcontent.value ?? new Content({ fuzzyDateValue: content.asString.replace(/[\\/:-]/gm, '').replace(/(..)(..)(....)(......)/, '$3$2$1$4') || '' }),\n\t\t\t\tcodes,\n\t\t\t\t(field.tags ?? []).map((s) => {\n\t\t\t\t\tconst parts = s.split('|')\n\t\t\t\t\treturn new CodeStub({ id: s, type: parts[0], code: parts[1], version: parts[2] })\n\t\t\t\t}),\n\t\t\t),\n\t\t)\n\t}\n}\n\nexport function handleDateFieldValueChangedProvider(\n\tfield: Field,\n\tformValuesContainer: FormValuesContainer,\n\tformValuesContainerChanged: (newValue: FormValuesContainer) => void,\n): (serviceId: string | undefined, language: string, content: { asString: string; value: Content }, codes: CodeStub[]) => void {\n\treturn (serviceId: string | undefined, language: string, content: { asString: string; value: Content }, codes: CodeStub[]) => {\n\t\tconst sId = serviceId ?? uuid()\n\t\tformValuesContainerChanged(\n\t\t\tformValuesContainer.setValue(\n\t\t\t\tfield.shortLabel ?? field.label(),\n\t\t\t\tsId,\n\t\t\t\tlanguage,\n\t\t\t\tcontent.value ?? new Content({ fuzzyDateValue: content.asString.replace(/[\\/-]/gm, '').replace(/(..)(..)(....)/, '$3$2$1') || '' }),\n\t\t\t\tcodes,\n\t\t\t\t(field.tags ?? []).map((s) => {\n\t\t\t\t\tconst parts = s.split('|')\n\t\t\t\t\treturn new CodeStub({ id: s, type: parts[0], code: parts[1], version: parts[2] })\n\t\t\t\t}),\n\t\t\t),\n\t\t)\n\t}\n}\n\nexport function handleTimeFieldValueChangedProvider(\n\tfield: Field,\n\tformValuesContainer: FormValuesContainer,\n\tformValuesContainerChanged: (newValue: FormValuesContainer) => void,\n): (serviceId: string | undefined, language: string, content: { asString: string; value: Content }, codes: CodeStub[]) => void {\n\treturn (serviceId: string | undefined, language: string, content: { asString: string; value: Content }, codes: CodeStub[]) => {\n\t\tconst sId = serviceId ?? uuid()\n\t\tformValuesContainerChanged(\n\t\t\tformValuesContainer.setValue(\n\t\t\t\tfield.shortLabel ?? field.label(),\n\t\t\t\tsId,\n\t\t\t\tlanguage,\n\t\t\t\tcontent.value ?? new Content({ fuzzyDateValue: content.asString.replace(/[-:]/gm, '') || '' }),\n\t\t\t\tcodes,\n\t\t\t\t(field.tags ?? []).map((s) => {\n\t\t\t\t\tconst parts = s.split('|')\n\t\t\t\t\treturn new CodeStub({ id: s, type: parts[0], code: parts[1], version: parts[2] })\n\t\t\t\t}),\n\t\t\t),\n\t\t)\n\t}\n}\n\nexport function handleMetaChangedProvider(formValuesContainer: FormValuesContainer): (serviceId: string, meta: Meta) => void {\n\treturn (serviceId: string, meta: Meta) => {\n\t\tif (meta.owner !== undefined) formValuesContainer.setResponsible(serviceId, meta.owner === null ? null : meta.owner.id)\n\t\tif (meta.valueDate !== undefined) formValuesContainer.setValueDate(serviceId, meta.valueDate)\n\t}\n}\n"]}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { CodeStub, Contact, Content, Service } from '@icure/api';
|
|
2
|
-
import { ServicesHistory } from './models';
|
|
3
|
-
export declare function withLabel(label: string): (svc: Service) => boolean;
|
|
4
|
-
export interface FormValuesContainer {
|
|
5
|
-
copy(currentContact: Contact): FormValuesContainer;
|
|
6
|
-
getVersions(selector: (svc: Service) => boolean): ServicesHistory;
|
|
7
|
-
setValue(label: string, serviceId: string, language: string, content: Content, codes: CodeStub[], tags: CodeStub[]): FormValuesContainer;
|
|
8
|
-
setValueDate(serviceId: string, fuzzyDate: number | null): FormValuesContainer;
|
|
9
|
-
setAuthor(serviceId: string, author: string | null): FormValuesContainer;
|
|
10
|
-
setResponsible(serviceId: string, responsible: string | null): FormValuesContainer;
|
|
11
|
-
delete(serviceId: string): FormValuesContainer;
|
|
12
|
-
compute<T, S extends {
|
|
13
|
-
[key: string | symbol]: unknown;
|
|
14
|
-
}>(formula: string, sandbox?: S): T | undefined;
|
|
15
|
-
}
|
|
16
|
-
export declare class ICureFormValuesContainer implements FormValuesContainer {
|
|
17
|
-
currentContact: Contact;
|
|
18
|
-
contact: Contact;
|
|
19
|
-
contactsHistory: Contact[];
|
|
20
|
-
sandboxProxies: WeakMap<object, any>;
|
|
21
|
-
codeSnippets: Map<string, any>;
|
|
22
|
-
serviceFactory: (label: string, serviceId: string, language: string, content: Content, codes: CodeStub[], tags: CodeStub[]) => Service;
|
|
23
|
-
constructor(currentContact: Contact, contact: Contact, contactsHistory: Contact[], serviceFactory: (label: string, serviceId: string, language: string, content: Content, codes: CodeStub[], tags: CodeStub[]) => Service);
|
|
24
|
-
copy(currentContact: Contact): ICureFormValuesContainer;
|
|
25
|
-
getVersions(selector: (svc: Service) => boolean): ServicesHistory;
|
|
26
|
-
private setServiceProperty;
|
|
27
|
-
setValueDate(serviceId: string, fuzzyDate: number | null): FormValuesContainer;
|
|
28
|
-
setAuthor(serviceId: string, author: string | null): FormValuesContainer;
|
|
29
|
-
setResponsible(serviceId: string, responsible: string | null): FormValuesContainer;
|
|
30
|
-
setValue(label: string, serviceId: string, language: string, content: Content, codes: CodeStub[], tags: CodeStub[]): FormValuesContainer;
|
|
31
|
-
delete(serviceId: string): FormValuesContainer;
|
|
32
|
-
compute<T, S extends {
|
|
33
|
-
[key: string | symbol]: unknown;
|
|
34
|
-
}>(formula: string, sandbox?: S): T | undefined;
|
|
35
|
-
/** returns all services in history that match a selector
|
|
36
|
-
*
|
|
37
|
-
* @param selector a function used to select the services of interest, usually : withLabel("someLabel")
|
|
38
|
-
* @private
|
|
39
|
-
*/
|
|
40
|
-
private getServicesInHistory;
|
|
41
|
-
}
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.ICureFormValuesContainer = exports.withLabel = void 0;
|
|
15
|
-
const api_1 = require("@icure/api");
|
|
16
|
-
const no_lodash_1 = require("../../utils/no-lodash");
|
|
17
|
-
const icure_utils_1 = require("../../utils/icure-utils");
|
|
18
|
-
function withLabel(label) {
|
|
19
|
-
return (svc) => svc.label === label;
|
|
20
|
-
}
|
|
21
|
-
exports.withLabel = withLabel;
|
|
22
|
-
class ICureFormValuesContainer {
|
|
23
|
-
constructor(currentContact, contact, contactsHistory, serviceFactory) {
|
|
24
|
-
this.sandboxProxies = new WeakMap();
|
|
25
|
-
this.codeSnippets = new Map();
|
|
26
|
-
if (!contactsHistory.includes(contact) && contact !== currentContact) {
|
|
27
|
-
throw new Error('Illegal argument, the history must contain the contact');
|
|
28
|
-
}
|
|
29
|
-
if (contactsHistory.includes(currentContact)) {
|
|
30
|
-
throw new Error('Illegal argument, the history must not contain the currentContact');
|
|
31
|
-
}
|
|
32
|
-
this.currentContact = currentContact;
|
|
33
|
-
this.contact = contact;
|
|
34
|
-
this.contactsHistory = (0, no_lodash_1.sortedBy)(contactsHistory, 'created', 'desc');
|
|
35
|
-
this.serviceFactory = serviceFactory;
|
|
36
|
-
}
|
|
37
|
-
copy(currentContact) {
|
|
38
|
-
return new ICureFormValuesContainer(currentContact, this.contact, this.contactsHistory, this.serviceFactory);
|
|
39
|
-
}
|
|
40
|
-
getVersions(selector) {
|
|
41
|
-
return (0, no_lodash_1.groupBy)(this.getServicesInHistory(selector).filter((swc) => +((0, icure_utils_1.fuzzyDate)(swc.contact.created) || 0) <= +((0, icure_utils_1.fuzzyDate)(this.contact.created) || 0)), (swc) => swc.service.id || '');
|
|
42
|
-
}
|
|
43
|
-
setServiceProperty(serviceId, newValue, getter, setter) {
|
|
44
|
-
const swcs = this.getServicesInHistory((s) => s.id === serviceId);
|
|
45
|
-
if (swcs.length) {
|
|
46
|
-
if (newValue !== getter(swcs[0].service)) {
|
|
47
|
-
return this.copy((0, icure_utils_1.setServices)(this.currentContact, [], [setter(swcs[0].service, newValue)]));
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
return this;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
return this;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
setValueDate(serviceId, fuzzyDate) {
|
|
58
|
-
return this.setServiceProperty(serviceId, fuzzyDate, (s) => s.valueDate, (s) => new api_1.Service(Object.assign(Object.assign({}, s), { valueDate: fuzzyDate })));
|
|
59
|
-
}
|
|
60
|
-
setAuthor(serviceId, author) {
|
|
61
|
-
return this.setServiceProperty(serviceId, author, (s) => s.author, (s) => new api_1.Service(Object.assign(Object.assign({}, s), { author })));
|
|
62
|
-
}
|
|
63
|
-
setResponsible(serviceId, responsible) {
|
|
64
|
-
return this.setServiceProperty(serviceId, responsible, (s) => s.author, (s) => new api_1.Service(Object.assign(Object.assign({}, s), { responsible })));
|
|
65
|
-
}
|
|
66
|
-
setValue(label, serviceId, language, content, codes, tags) {
|
|
67
|
-
const swcs = this.getServicesInHistory((s) => s.id === serviceId);
|
|
68
|
-
if (swcs.length) {
|
|
69
|
-
const previousContent = swcs[0].service.content;
|
|
70
|
-
if (!previousContent || !(0, icure_utils_1.isServiceContentEqual)({ [language]: content }, previousContent)) {
|
|
71
|
-
// Omit end of life
|
|
72
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
73
|
-
const _a = Object.assign(Object.assign({}, swcs[0].service), { content: Object.assign(Object.assign({}, previousContent), { [language]: content }), codes: codes, modified: +new Date() }), { endOfLife } = _a, modifiedServiceValues = __rest(_a, ["endOfLife"]);
|
|
74
|
-
return this.copy((0, icure_utils_1.setServices)(Object.assign(Object.assign({}, this.currentContact), { services: this.currentContact.services }), [], [new api_1.Service(modifiedServiceValues)]));
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
return this;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
return this.copy((0, icure_utils_1.setServices)(this.currentContact, [this.serviceFactory(label, serviceId, language, content, codes, tags)], []));
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
delete(serviceId) {
|
|
85
|
-
const swcs = this.getServicesInHistory((s) => s.id === serviceId);
|
|
86
|
-
if (swcs.length) {
|
|
87
|
-
//Omit end of life
|
|
88
|
-
const now = +new Date();
|
|
89
|
-
return this.copy((0, icure_utils_1.setServices)(this.currentContact, [], [
|
|
90
|
-
new api_1.Service(Object.assign(Object.assign({}, swcs[0].service), { content: {}, modified: now, endOfLife: now })),
|
|
91
|
-
]));
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
return this;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
compute(formula, sandbox = new Proxy({}, {
|
|
98
|
-
has: (target, key) => { var _a; return Object.keys((_a = this.getVersions((s) => s.label === key)) !== null && _a !== void 0 ? _a : {}).length > 0; },
|
|
99
|
-
get: (target, key) => Object.values(this.getVersions((s) => s.label === key)),
|
|
100
|
-
})) {
|
|
101
|
-
const sb = this.sandboxProxies;
|
|
102
|
-
const cs = this.codeSnippets;
|
|
103
|
-
function compileCode(src) {
|
|
104
|
-
if (cs.has(src)) {
|
|
105
|
-
return cs.get(src);
|
|
106
|
-
}
|
|
107
|
-
src = 'with (sandbox) {' + src + '}';
|
|
108
|
-
const code = new Function('sandbox', src);
|
|
109
|
-
const result = function (sandbox) {
|
|
110
|
-
if (!sb.has(sandbox)) {
|
|
111
|
-
const sandboxProxy = new Proxy(sandbox, { has, get });
|
|
112
|
-
sb.set(sandbox, sandboxProxy);
|
|
113
|
-
}
|
|
114
|
-
return code(sb.get(sandbox));
|
|
115
|
-
};
|
|
116
|
-
cs.set(src, result);
|
|
117
|
-
return result;
|
|
118
|
-
}
|
|
119
|
-
function has() {
|
|
120
|
-
return true;
|
|
121
|
-
}
|
|
122
|
-
function get(target, key) {
|
|
123
|
-
if (key === Symbol.unscopables)
|
|
124
|
-
return undefined;
|
|
125
|
-
return target[key];
|
|
126
|
-
}
|
|
127
|
-
let compiledCode;
|
|
128
|
-
try {
|
|
129
|
-
compiledCode = compileCode(formula);
|
|
130
|
-
}
|
|
131
|
-
catch (e) {
|
|
132
|
-
console.info('Invalid Formula: ' + formula);
|
|
133
|
-
return undefined;
|
|
134
|
-
}
|
|
135
|
-
try {
|
|
136
|
-
const result = compiledCode(sandbox);
|
|
137
|
-
return result;
|
|
138
|
-
}
|
|
139
|
-
catch (e) {
|
|
140
|
-
console.info('Error while executing formula: ' + formula, e);
|
|
141
|
-
return undefined;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
/** returns all services in history that match a selector
|
|
145
|
-
*
|
|
146
|
-
* @param selector a function used to select the services of interest, usually : withLabel("someLabel")
|
|
147
|
-
* @private
|
|
148
|
-
*/
|
|
149
|
-
getServicesInHistory(selector) {
|
|
150
|
-
return [this.currentContact].concat(this.contactsHistory).flatMap((ctc) => {
|
|
151
|
-
var _a, _b;
|
|
152
|
-
return ((_b = (_a = ctc.services) === null || _a === void 0 ? void 0 : _a.filter(selector)) === null || _b === void 0 ? void 0 : _b.map((s) => ({
|
|
153
|
-
service: s,
|
|
154
|
-
contact: ctc,
|
|
155
|
-
}))) || [];
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
exports.ICureFormValuesContainer = ICureFormValuesContainer;
|
|
160
|
-
//# sourceMappingURL=formValuesContainer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"formValuesContainer.js","sourceRoot":"","sources":["../../../tmp/components/iqr-form-loader/formValuesContainer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,oCAAgE;AAChE,qDAAyD;AACzD,yDAAuF;AAGvF,SAAgB,SAAS,CAAC,KAAa;IACtC,OAAO,CAAC,GAAY,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,KAAK,KAAK,CAAA;AAC7C,CAAC;AAFD,8BAEC;AAaD,MAAa,wBAAwB;IASpC,YACC,cAAuB,EACvB,OAAgB,EAChB,eAA0B,EAC1B,cAAsI;QATvI,mBAAc,GAAG,IAAI,OAAO,EAAE,CAAA;QAC9B,iBAAY,GAAG,IAAI,GAAG,EAAe,CAAA;QAUpC,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,OAAO,KAAK,cAAc,EAAE;YACrE,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAA;SACzE;QACD,IAAI,eAAe,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE;YAC7C,MAAM,IAAI,KAAK,CAAC,mEAAmE,CAAC,CAAA;SACpF;QACD,IAAI,CAAC,cAAc,GAAG,cAAc,CAAA;QACpC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,eAAe,GAAG,IAAA,oBAAQ,EAAC,eAAe,EAAE,SAAS,EAAE,MAAM,CAAC,CAAA;QACnE,IAAI,CAAC,cAAc,GAAG,cAAc,CAAA;IACrC,CAAC;IAED,IAAI,CAAC,cAAuB;QAC3B,OAAO,IAAI,wBAAwB,CAAC,cAAc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AAE,MAAM,CAAC,CAAA;YAEnB,OAAO,MAAM,CAAA;QACd,CAAC;QAED,SAAS,GAAG;YACX,OAAO,IAAI,CAAA;QACZ,CAAC;QAED,SAAS,GAAG,CAAC,MAAS,EAAE,GAAoB;YAC3C,IAAI,GAAG,KAAK,MAAM,CAAC,WAAW;gBAAE,OAAO,SAAS,CAAA;YAChD,OAAO,MAAM,CAAC,GAAG,CAAC,CAAA;QACnB,CAAC;QAED,IAAI,YAAiB,CAAA;QACrB,IAAI;YACH,YAAY,GAAG,WAAW,CAAC,OAAO,CAAC,CAAA;SACnC;QAAC,OAAO,CAAC,EAAE;YACX,OAAO,CAAC,IAAI,CAAC,mBAAmB,GAAG,OAAO,CAAC,CAAA;YAC3C,OAAO,SAAS,CAAA;SAChB;QACD,IAAI;YACH,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,CAAA;YACpC,OAAO,MAAM,CAAA;SACb;QAAC,OAAO,CAAC,EAAE;YACX,OAAO,CAAC,IAAI,CAAC,iCAAiC,GAAG,OAAO,EAAE,CAAC,CAAC,CAAA;YAC5D,OAAO,SAAS,CAAA;SAChB;IACF,CAAC;IAED;;;;OAIG;IACK,oBAAoB,CAAC,QAAmC;QAC/D,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,OAAO,CAChE,CAAC,GAAG,EAAE,EAAE;;YACP,OAAA,CAAA,MAAA,MAAA,GAAG,CAAC,QAAQ,0CAAE,MAAM,CAAC,QAAQ,CAAC,0CAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;gBAC3C,OAAO,EAAE,CAAC;gBACV,OAAO,EAAE,GAAG;aACZ,CAAC,CAAC,KAAI,EAAE,CAAA;SAAA,CACV,CAAA;IACF,CAAC;CACD;AAlMD,4DAkMC","sourcesContent":["import { CodeStub, Contact, Content, Service } from '@icure/api'\nimport { groupBy, sortedBy } from '../../utils/no-lodash'\nimport { fuzzyDate, isServiceContentEqual, setServices } from '../../utils/icure-utils'\nimport { ServicesHistory, ServiceWithContact } from './models'\n\nexport function withLabel(label: string): (svc: Service) => boolean {\n\treturn (svc: Service) => svc.label === label\n}\n\nexport interface FormValuesContainer {\n\tcopy(currentContact: Contact): FormValuesContainer\n\tgetVersions(selector: (svc: Service) => boolean): ServicesHistory\n\tsetValue(label: string, serviceId: string, language: string, content: Content, codes: CodeStub[], tags: CodeStub[]): FormValuesContainer\n\tsetValueDate(serviceId: string, fuzzyDate: number | null): FormValuesContainer\n\tsetAuthor(serviceId: string, author: string | null): FormValuesContainer\n\tsetResponsible(serviceId: string, responsible: string | null): FormValuesContainer\n\tdelete(serviceId: string): FormValuesContainer\n\tcompute<T, S extends { [key: string | symbol]: unknown }>(formula: string, sandbox?: S): T | undefined\n}\n\nexport class ICureFormValuesContainer implements FormValuesContainer {\n\tcurrentContact: Contact //The contact of the day, used to record modifications\n\tcontact: Contact //The displayed contact (may be in the past). === to currentContact if the contact is the contact of the day\n\tcontactsHistory: Contact[] //Must be sorted (most recent first), does not include currentContent but must include contact (except if contact is currentContact)\n\tsandboxProxies = new WeakMap()\n\tcodeSnippets = new Map<string, any>()\n\n\tserviceFactory: (label: string, serviceId: string, language: string, content: Content, codes: CodeStub[], tags: CodeStub[]) => Service\n\n\tconstructor(\n\t\tcurrentContact: Contact,\n\t\tcontact: Contact,\n\t\tcontactsHistory: Contact[],\n\t\tserviceFactory: (label: string, serviceId: string, language: string, content: Content, codes: CodeStub[], tags: CodeStub[]) => Service,\n\t) {\n\t\tif (!contactsHistory.includes(contact) && contact !== currentContact) {\n\t\t\tthrow new Error('Illegal argument, the history must contain the contact')\n\t\t}\n\t\tif (contactsHistory.includes(currentContact)) {\n\t\t\tthrow new Error('Illegal argument, the history must not contain the currentContact')\n\t\t}\n\t\tthis.currentContact = currentContact\n\t\tthis.contact = contact\n\t\tthis.contactsHistory = sortedBy(contactsHistory, 'created', 'desc')\n\t\tthis.serviceFactory = serviceFactory\n\t}\n\n\tcopy(currentContact: Contact): ICureFormValuesContainer {\n\t\treturn new ICureFormValuesContainer(currentContact, this.contact, this.contactsHistory, this.serviceFactory)\n\t}\n\n\tgetVersions(selector: (svc: Service) => boolean): ServicesHistory {\n\t\treturn groupBy(\n\t\t\tthis.getServicesInHistory(selector).filter((swc) => +(fuzzyDate(swc.contact.created) || 0) <= +(fuzzyDate(this.contact.created) || 0)),\n\t\t\t(swc) => swc.service.id || '',\n\t\t)\n\t}\n\n\tprivate setServiceProperty<K>(serviceId: string, newValue: K, getter: (svc: Service) => K, setter: (svc: Service, value: K) => Service): FormValuesContainer {\n\t\tconst swcs = this.getServicesInHistory((s) => s.id === serviceId)\n\t\tif (swcs.length) {\n\t\t\tif (newValue !== getter(swcs[0].service)) {\n\t\t\t\treturn this.copy(setServices(this.currentContact, [], [setter(swcs[0].service, newValue)]))\n\t\t\t} else {\n\t\t\t\treturn this\n\t\t\t}\n\t\t} else {\n\t\t\treturn this\n\t\t}\n\t}\n\n\tsetValueDate(serviceId: string, fuzzyDate: number | null): FormValuesContainer {\n\t\treturn this.setServiceProperty(\n\t\t\tserviceId,\n\t\t\tfuzzyDate,\n\t\t\t(s) => s.valueDate,\n\t\t\t(s) => new Service({ ...s, valueDate: fuzzyDate }),\n\t\t)\n\t}\n\n\tsetAuthor(serviceId: string, author: string | null): FormValuesContainer {\n\t\treturn this.setServiceProperty(\n\t\t\tserviceId,\n\t\t\tauthor,\n\t\t\t(s) => s.author,\n\t\t\t(s) => new Service({ ...s, author }),\n\t\t)\n\t}\n\n\tsetResponsible(serviceId: string, responsible: string | null): FormValuesContainer {\n\t\treturn this.setServiceProperty(\n\t\t\tserviceId,\n\t\t\tresponsible,\n\t\t\t(s) => s.author,\n\t\t\t(s) => new Service({ ...s, responsible }),\n\t\t)\n\t}\n\n\tsetValue(label: string, serviceId: string, language: string, content: Content, codes: CodeStub[], tags: CodeStub[]): FormValuesContainer {\n\t\tconst swcs = this.getServicesInHistory((s) => s.id === serviceId)\n\t\tif (swcs.length) {\n\t\t\tconst previousContent = swcs[0].service.content\n\n\t\t\tif (!previousContent || !isServiceContentEqual({ [language]: content }, previousContent)) {\n\t\t\t\t// Omit end of life\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\t\t\t\tconst { endOfLife, ...modifiedServiceValues } = {\n\t\t\t\t\t...swcs[0].service,\n\t\t\t\t\tcontent: { ...previousContent, [language]: content },\n\t\t\t\t\tcodes: codes,\n\t\t\t\t\tmodified: +new Date(),\n\t\t\t\t}\n\t\t\t\treturn this.copy(setServices({ ...this.currentContact, services: this.currentContact.services }, [], [new Service(modifiedServiceValues)]))\n\t\t\t} else {\n\t\t\t\treturn this\n\t\t\t}\n\t\t} else {\n\t\t\treturn this.copy(setServices(this.currentContact, [this.serviceFactory(label, serviceId, language, content, codes, tags)], []))\n\t\t}\n\t}\n\n\tdelete(serviceId: string): FormValuesContainer {\n\t\tconst swcs = this.getServicesInHistory((s) => s.id === serviceId)\n\t\tif (swcs.length) {\n\t\t\t//Omit end of life\n\t\t\tconst now = +new Date()\n\t\t\treturn this.copy(\n\t\t\t\tsetServices(\n\t\t\t\t\tthis.currentContact,\n\t\t\t\t\t[],\n\t\t\t\t\t[\n\t\t\t\t\t\tnew Service({\n\t\t\t\t\t\t\t...swcs[0].service,\n\t\t\t\t\t\t\tcontent: {},\n\t\t\t\t\t\t\tmodified: now,\n\t\t\t\t\t\t\tendOfLife: now,\n\t\t\t\t\t\t}),\n\t\t\t\t\t],\n\t\t\t\t),\n\t\t\t)\n\t\t} else {\n\t\t\treturn this\n\t\t}\n\t}\n\n\tcompute<T, S extends { [key: string | symbol]: unknown }>(\n\t\tformula: string,\n\t\tsandbox: S = new Proxy({} as S, {\n\t\t\thas: (target: S, key: string | symbol) => Object.keys(this.getVersions((s) => s.label === key) ?? {}).length > 0,\n\t\t\tget: (target: S, key: string | symbol) => Object.values(this.getVersions((s) => s.label === key)),\n\t\t}),\n\t): T | undefined {\n\t\tconst sb = this.sandboxProxies\n\t\tconst cs = this.codeSnippets\n\t\tfunction compileCode(src: string) {\n\t\t\tif (cs.has(src)) {\n\t\t\t\treturn cs.get(src)\n\t\t\t}\n\n\t\t\tsrc = 'with (sandbox) {' + src + '}'\n\t\t\tconst code = new Function('sandbox', src)\n\n\t\t\tconst result = function (sandbox: S) {\n\t\t\t\tif (!sb.has(sandbox)) {\n\t\t\t\t\tconst sandboxProxy = new Proxy<S>(sandbox, { has, get })\n\t\t\t\t\tsb.set(sandbox, sandboxProxy)\n\t\t\t\t}\n\t\t\t\treturn code(sb.get(sandbox))\n\t\t\t}\n\n\t\t\tcs.set(src, result)\n\n\t\t\treturn result\n\t\t}\n\n\t\tfunction has() {\n\t\t\treturn true\n\t\t}\n\n\t\tfunction get(target: S, key: string | symbol) {\n\t\t\tif (key === Symbol.unscopables) return undefined\n\t\t\treturn target[key]\n\t\t}\n\n\t\tlet compiledCode: any\n\t\ttry {\n\t\t\tcompiledCode = compileCode(formula)\n\t\t} catch (e) {\n\t\t\tconsole.info('Invalid Formula: ' + formula)\n\t\t\treturn undefined\n\t\t}\n\t\ttry {\n\t\t\tconst result = compiledCode(sandbox)\n\t\t\treturn result\n\t\t} catch (e) {\n\t\t\tconsole.info('Error while executing formula: ' + formula, e)\n\t\t\treturn undefined\n\t\t}\n\t}\n\n\t/** returns all services in history that match a selector\n\t *\n\t * @param selector a function used to select the services of interest, usually : withLabel(\"someLabel\")\n\t * @private\n\t */\n\tprivate getServicesInHistory(selector: (svc: Service) => boolean): ServiceWithContact[] {\n\t\treturn [this.currentContact].concat(this.contactsHistory).flatMap(\n\t\t\t(ctc) =>\n\t\t\t\tctc.services?.filter(selector)?.map((s) => ({\n\t\t\t\t\tservice: s,\n\t\t\t\t\tcontact: ctc,\n\t\t\t\t})) || [],\n\t\t)\n\t}\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../tmp/components/iqr-form-loader/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAwB;AACxB,wDAAqC;AACrC,0DAAuC","sourcesContent":["export * from './models'\nexport * from './formValuesContainer'\nexport * from './fieldsValuesProviders'\n"]}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Contact, Form, Service } from '@icure/api';
|
|
2
|
-
import { FormValuesContainer } from './formValuesContainer';
|
|
3
|
-
export type ServicesHistory = {
|
|
4
|
-
[id: string]: ServiceWithContact[];
|
|
5
|
-
};
|
|
6
|
-
export interface FormHierarchy {
|
|
7
|
-
form: Form;
|
|
8
|
-
formValuesContainer: FormValuesContainer;
|
|
9
|
-
children: FormHierarchy[];
|
|
10
|
-
}
|
|
11
|
-
export interface ServiceWithContact {
|
|
12
|
-
service: Service;
|
|
13
|
-
contact: Contact;
|
|
14
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../../tmp/components/iqr-form-loader/models.ts"],"names":[],"mappings":"","sourcesContent":["import { Contact, Form, Service } from '@icure/api'\nimport { FormValuesContainer } from './formValuesContainer'\n\nexport type ServicesHistory = {\n\t[id: string]: ServiceWithContact[] //All services in a service history have the same id as id\n}\n\nexport interface FormHierarchy {\n\tform: Form\n\tformValuesContainer: FormValuesContainer\n\tchildren: FormHierarchy[] //All services in a service history have the same id as id\n}\n\nexport interface ServiceWithContact {\n\tservice: Service\n\tcontact: Contact\n}\n"]}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const lit_1 = require("lit");
|
|
4
|
-
const utils_1 = require("./utils");
|
|
5
|
-
const labelizedField_1 = require("../common/labelizedField");
|
|
6
|
-
class IqrLabel extends labelizedField_1.LabelizedField {
|
|
7
|
-
constructor() {
|
|
8
|
-
super();
|
|
9
|
-
}
|
|
10
|
-
render() {
|
|
11
|
-
var _a, _b;
|
|
12
|
-
return (0, lit_1.html) `${(0, utils_1.generateLabel)((_a = this.label) !== null && _a !== void 0 ? _a : '', (_b = this.labelPosition) !== null && _b !== void 0 ? _b : 'float')}`;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
customElements.define('iqr-label', IqrLabel);
|
|
16
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../tmp/components/iqr-label/index.ts"],"names":[],"mappings":";;AAAA,6BAA0B;AAC1B,mCAAuC;AACvC,6DAAyD;AAEzD,MAAM,QAAS,SAAQ,+BAAc;IACpC;QACC,KAAK,EAAE,CAAA;IACR,CAAC;IAED,MAAM;;QACL,OAAO,IAAA,UAAI,EAAA,GAAG,IAAA,qBAAa,EAAC,MAAA,IAAI,CAAC,KAAK,mCAAI,EAAE,EAAE,MAAA,IAAI,CAAC,aAAa,mCAAI,OAAO,CAAC,EAAE,CAAA;IAC/E,CAAC;CACD;AACD,cAAc,CAAC,MAAM,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAA","sourcesContent":["import { html } from 'lit'\nimport { generateLabel } from './utils'\nimport { LabelizedField } from '../common/labelizedField'\n\nclass IqrLabel extends LabelizedField {\n\tconstructor() {\n\t\tsuper()\n\t}\n\n\trender() {\n\t\treturn html`${generateLabel(this.label ?? '', this.labelPosition ?? 'float')}`\n\t}\n}\ncustomElements.define('iqr-label', IqrLabel)\n"]}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { TemplateResult } from 'lit';
|
|
2
|
-
import { Labels } from '../iqr-text-field';
|
|
3
|
-
export declare function generateLabels(labels: Labels, translationProvider?: (text: string) => string): TemplateResult[];
|
|
4
|
-
export declare function generateLabel(label: string, labelPosition: string, translationProvider?: (text: string) => string): TemplateResult;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.generateLabel = exports.generateLabels = void 0;
|
|
4
|
-
const lit_1 = require("lit");
|
|
5
|
-
function generateLabels(labels, translationProvider = (text) => text) {
|
|
6
|
-
return Object.keys(labels).map((position) => generateLabel(labels[position], position, translationProvider));
|
|
7
|
-
}
|
|
8
|
-
exports.generateLabels = generateLabels;
|
|
9
|
-
function generateLabel(label, labelPosition, translationProvider = (text) => text) {
|
|
10
|
-
switch (labelPosition) {
|
|
11
|
-
case 'right':
|
|
12
|
-
case 'left':
|
|
13
|
-
return (0, lit_1.html) ` <label class="iqr-label side above ${labelPosition}"><span>${translationProvider(label)}</span></iqr-label> `;
|
|
14
|
-
default:
|
|
15
|
-
return (0, lit_1.html) ` <label class="iqr-label ${labelPosition}"><span>${translationProvider(label)}</span></iqr-label> `;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
exports.generateLabel = generateLabel;
|
|
19
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../tmp/components/iqr-label/utils.ts"],"names":[],"mappings":";;;AAAA,6BAA0C;AAG1C,SAAgB,cAAc,CAAC,MAAc,EAAE,sBAAgD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI;IAC5G,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,mBAAmB,CAAC,CAAC,CAAA;AAC7G,CAAC;AAFD,wCAEC;AAED,SAAgB,aAAa,CAAC,KAAa,EAAE,aAAqB,EAAE,sBAAgD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI;IACjI,QAAQ,aAAa,EAAE;QACtB,KAAK,OAAO,CAAC;QACb,KAAK,MAAM;YACV,OAAO,IAAA,UAAI,EAAA,uCAAuC,aAAa,WAAW,mBAAmB,CAAC,KAAK,CAAC,sBAAsB,CAAA;QAC3H;YACC,OAAO,IAAA,UAAI,EAAA,4BAA4B,aAAa,WAAW,mBAAmB,CAAC,KAAK,CAAC,sBAAsB,CAAA;KAChH;AACF,CAAC;AARD,sCAQC","sourcesContent":["import { html, TemplateResult } from 'lit'\nimport { Labels } from '../iqr-text-field'\n\nexport function generateLabels(labels: Labels, translationProvider: (text: string) => string = (text) => text): TemplateResult[] {\n\treturn Object.keys(labels).map((position) => generateLabel(labels[position], position, translationProvider))\n}\n\nexport function generateLabel(label: string, labelPosition: string, translationProvider: (text: string) => string = (text) => text): TemplateResult {\n\tswitch (labelPosition) {\n\t\tcase 'right':\n\t\tcase 'left':\n\t\t\treturn html` <label class=\"iqr-label side above ${labelPosition}\"><span>${translationProvider(label)}</span></iqr-label> `\n\t\tdefault:\n\t\t\treturn html` <label class=\"iqr-label ${labelPosition}\"><span>${translationProvider(label)}</span></iqr-label> `\n\t}\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../tmp/components/iqr-radio-button-group/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,6BAA0D;AAC1D,qDAAmD;AACnD,aAAa;AACb,6BAA0B;AAC1B,MAAM,OAAO,GAAG,IAAA,SAAG,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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C,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;IAClF,CAAC;CACD;AA7DA;IAAC,IAAA,wBAAQ,GAAE;;iDAAqC;AAChD;IAAC,IAAA,qBAAK,GAAE;;wDAAqC;AA8D9C,cAAc,CAAC,MAAM,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,CAAA","sourcesContent":["import { CSSResultGroup, html, TemplateResult } from 'lit'\nimport { property, state } from 'lit/decorators.js'\n// @ts-ignore\nimport { css } from 'lit';\nconst baseCss = css`@charset \"UTF-8\";\n:host {\n --bg-color-1: #F44336;\n}\n\n.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: \"liga\" 0; /* the above doesn't seem to work in Edge */\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\n.ProseMirror li {\n position: relative;\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection {\n caret-color: transparent;\n}\n\n.ProseMirror-selectednode {\n outline: 2px solid #8cf;\n}\n\n/* Make sure li selections wrap around markers */\nli.ProseMirror-selectednode {\n outline: none;\n}\n\nli.ProseMirror-selectednode:after {\n content: \"\";\n position: absolute;\n left: -32px;\n right: -2px;\n top: -2px;\n bottom: -2px;\n border: 2px solid #8cf;\n pointer-events: none;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n}\n\n.ProseMirror-gapcursor:after {\n content: \"\";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}\n\n/* Add space around the hr to make clicking it easier */\n.ProseMirror-example-setup-style hr {\n padding: 2px 10px;\n border: none;\n margin: 1em 0;\n}\n\n.ProseMirror-example-setup-style hr:after {\n content: \"\";\n display: block;\n height: 1px;\n background: silver;\n line-height: 2px;\n}\n\n.ProseMirror ul, .ProseMirror ol {\n padding-left: 30px;\n}\n\n.ProseMirror blockquote {\n padding-left: 1em;\n border-left: 3px solid #eee;\n margin-left: 0;\n margin-right: 0;\n}\n\n.ProseMirror-example-setup-style img {\n cursor: default;\n}\n\n.ProseMirror-prompt {\n background: white;\n padding: 5px 10px 5px 15px;\n border: 1px solid silver;\n position: fixed;\n border-radius: 3px;\n z-index: 11;\n box-shadow: -0.5px 2px 5px rgba(0, 0, 0, 0.2);\n}\n\n.ProseMirror-prompt h5 {\n margin: 0;\n font-weight: normal;\n font-size: 100%;\n color: #444;\n}\n\n.ProseMirror-prompt input[type=text],\n.ProseMirror-prompt textarea {\n background: #eee;\n border: none;\n outline: none;\n}\n\n.ProseMirror-prompt input[type=text] {\n padding: 0 4px;\n}\n\n.ProseMirror-prompt-close {\n position: absolute;\n left: 2px;\n top: 1px;\n color: #666;\n border: none;\n background: transparent;\n padding: 0;\n}\n\n.ProseMirror-prompt-close:after {\n content: \"✕\";\n font-size: 12px;\n}\n\n.ProseMirror-invalid {\n background: #ffc;\n border: 1px solid #cc7;\n border-radius: 4px;\n padding: 5px 10px;\n position: absolute;\n min-width: 10em;\n}\n\n.ProseMirror-prompt-buttons {\n margin-top: 5px;\n display: none;\n}\n\n#editor, .editor {\n color: black;\n background-clip: padding-box;\n border-radius: 4px;\n border: 2px solid rgba(0, 0, 0, 0.2);\n padding: 5px 0;\n}\n\n.ProseMirror p:last-child,\n.ProseMirror h1:last-child,\n.ProseMirror h2:last-child,\n.ProseMirror h3:last-child,\n.ProseMirror h4:last-child,\n.ProseMirror h5:last-child,\n.ProseMirror h6:last-child {\n margin-bottom: 2px;\n}\n\n.ProseMirror {\n padding: 6px 8px 2px 8px;\n line-height: 1.2;\n color: #274768;\n font-size: 14px;\n font-weight: 400;\n outline: none;\n}\n\n.ProseMirror p {\n margin-bottom: 1em;\n}\n\n.iqr-input {\n background: #EDF2F7;\n border-radius: 8px;\n border: none;\n min-height: 28px;\n height: auto;\n display: flex;\n flex-flow: row nowrap;\n align-items: flex-start;\n justify-content: space-between;\n}\n\n#editor {\n background: transparent;\n border: none;\n padding: 0;\n flex-grow: 1;\n}\n\n#content {\n position: relative;\n padding: 0;\n}\n\n* {\n font-family: \"Roboto\", Helvetica, sans-serif;\n}\n\np {\n margin-top: 0;\n}\n\nh3 {\n color: #274768;\n margin-top: 0;\n}\n\n.extra {\n flex-shrink: 0;\n height: 28px;\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n padding: 0 8px;\n transition: all 0.24s cubic-bezier(0.42, 0.01, 1, 0.62);\n}\n\n.extra > .info {\n color: #809AB4;\n font-size: 12px;\n width: 100%;\n height: auto;\n overflow: hidden;\n pointer-events: none;\n text-align: right;\n}\n\n.extra > .info > span {\n font-weight: 700;\n}\n\n.extra .buttons-container {\n display: flex;\n height: 100%;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: flex-end;\n width: 0;\n transition: all 0.24s cubic-bezier(0.14, 0.69, 0.87, 0.54);\n}\n\n.extra:hover .buttons-container .menu-container .btn {\n animation: slideIn 0.24s ease-in forwards;\n pointer-events: none;\n}\n\n.extra:hover .buttons-container .menu-container .btn {\n animation-delay: 0.24s;\n}\n\n.extra:hover .buttons-container .menu-container:hover .btn {\n animation-delay: 0.04s;\n}\n\n.extra.forced:hover .buttons-container .menu-container .btn {\n animation: none;\n pointer-events: all;\n}\n\n.extra.forced .buttons-container .btn {\n opacity: 1 !important;\n}\n\n.extra.forced .info {\n opacity: 0 !important;\n}\n\n.extra:hover .info {\n opacity: 0 !important;\n z-index: 0 !important;\n}\n\n.extra .buttons-container .btn {\n border: none;\n background: transparent;\n position: relative;\n top: 0;\n opacity: 0;\n cursor: pointer;\n height: 20px;\n width: 10px;\n margin-left: 4px;\n margin-right: 4px;\n padding: 0;\n}\n\n.extra .buttons-container .menu-container:last-child .btn {\n margin-right: 0;\n}\n\n.extra .buttons-container .btn svg path {\n fill: #809AB4;\n}\n\n.extra .buttons-container .btn:hover svg path {\n fill: #274768;\n}\n\n.extra .buttons-container .menu-container .btn:hover::after {\n content: attr(data-content);\n position: absolute;\n top: -22px;\n height: 16px;\n left: 50%;\n transform: translateX(-50%);\n border-radius: 8px;\n background: #274768;\n color: white;\n display: flex;\n flex-flow: row wrap;\n align-items: center;\n text-transform: capitalize;\n white-space: nowrap;\n padding: 0 12px;\n font-size: 12px;\n line-height: 0;\n}\n\n.extra .buttons-container .btn:focus, .extra .buttons-container .btn:focus-within {\n border: none;\n outline: none;\n}\n\n.extra .buttons-container .menu-container .btn:hover::before {\n content: \"\";\n display: block;\n border-color: #274768 transparent transparent transparent;\n border-style: solid;\n border-width: 4px;\n position: absolute;\n top: -6px;\n}\n\n@keyframes slideIn {\n 0% {\n top: 12px;\n pointer-events: none;\n }\n 100% {\n top: 0;\n opacity: 1;\n pointer-events: all;\n }\n}\n.menu-container {\n position: relative;\n display: flex;\n align-items: center;\n height: 100%;\n}\n\n.menu {\n display: block;\n position: absolute;\n top: 20px;\n right: 0;\n z-index: 2;\n background: #fff;\n box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.25);\n border-radius: 8px;\n padding: 8px;\n width: 220px;\n min-height: 120px;\n max-height: 320px;\n overflow-y: scroll;\n}\n\n.menu .input-container {\n background: #EDF2F7;\n border-radius: 4px;\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: flex-start;\n height: 32px;\n margin-bottom: 4px;\n padding: 0 4px;\n}\n\n.menu .input-container:hover {\n box-shadow: 0 0 0 3px rgba(40, 151, 255, 0.2);\n}\n\n.menu .input-container:focus-within {\n box-shadow: 0 0 0 3px rgba(40, 151, 255, 0.2), 0 0 0 1px rgb(40, 151, 255);\n}\n\n.menu .input-container input {\n background: transparent;\n border: none;\n flex-grow: 1;\n height: 100%;\n}\n\n.menu .input-container input:focus {\n background: transparent;\n border: none;\n outline: none;\n}\n\n.menu-trigger:focus .menu {\n display: block;\n}\n\n.menu-container .item {\n height: 22px;\n width: 100%;\n background: transparent;\n border-radius: 4px;\n font-size: 14px;\n color: #274768;\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-content: flex-start;\n box-shadow: none;\n border: none;\n white-space: nowrap;\n overflow-x: hidden;\n text-overflow: ellipsis;\n}\n\n.menu-container .item:hover {\n background: #F5F9FD;\n font-weight: 500;\n border-radius: 4px;\n}\n\nspan {\n position: relative;\n z-index: 1;\n}\n\nspan.date {\n margin-right: 1px;\n}\n\nspan.time {\n margin-left: 1px;\n}\n\nspan.measure {\n display: inline-block;\n margin-right: 1px;\n}\n\nspan.unit {\n margin-left: 1px;\n display: inline-block;\n}\n\nspan[data-content]:hover::after {\n position: absolute;\n content: attr(data-content);\n background: #274768;\n color: #FFFFFF;\n font-size: 9px;\n line-height: 12px;\n top: -12px;\n left: 0px;\n padding: 0px 2px;\n}\n\nspan[data-content]::before {\n position: absolute;\n content: \"\";\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: -1;\n opacity: 0.3;\n}\n\n.masked {\n display: none;\n}\n\n.companion {\n position: absolute;\n width: 15px;\n background-color: hsl(194, 100%, 50%);\n color: white;\n z-index: 20;\n padding: 0;\n text-align: center;\n font-size: 14px;\n font-weight: 500;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n border-radius: 0 2px 2px 0;\n}\n\n.companion:hover {\n font-weight: 700;\n background: hsl(202, 100%, 50%);\n}\n\n*::selection {\n background-color: hsla(194, 100%, 50%, 0.2);\n}\n\n.suggestion-palette {\n position: absolute;\n z-index: 20;\n max-width: 380px;\n font-size: 11px;\n overflow: hidden;\n text-overflow: ellipsis;\n padding: 4px;\n border: none;\n border-radius: 8px;\n background: white;\n box-shadow: 0 1.1px 1.1px rgba(0, 0, 0, 0.022), 0 2.7px 2.7px rgba(0, 0, 0, 0.032), 0 5px 5px rgba(0, 0, 0, 0.04), 0 8.9px 8.9px rgba(0, 0, 0, 0.048), 0 16.7px 16.7px rgba(0, 0, 0, 0.058), 0 40px 40px rgba(0, 0, 0, 0.08);\n}\n\n.suggestion-palette ul {\n white-space: nowrap;\n list-style-type: none;\n margin: 0;\n padding: 0;\n}\n\n.suggestion-palette ul li {\n padding: 0 8px;\n font-size: 11px;\n height: 20px;\n box-sizing: border-box;\n display: flex;\n align-items: center;\n justify-content: space-between;\n border-radius: 4px;\n color: rgb(39, 71, 104);\n}\n.suggestion-palette ul li svg {\n height: 12px;\n width: 12px;\n border-radius: 4px;\n transform-origin: center center;\n}\n.suggestion-palette ul li svg path {\n fill: rgb(128, 154, 180);\n}\n\n.suggestion-palette ul li:not(:first-child) svg.tab-icn, .suggestion-palette ul li:not(.focused) svg.return-icn, .suggestion-palette ul.focused li:first-child svg.tab-icn {\n height: 0;\n width: 0;\n transform: scale(0);\n opacity: 0;\n}\n\n.suggestion-palette ul li.focused {\n background-color: rgb(237, 242, 247);\n}\n\n.suggestion-palette ul li.focused svg.return-icn {\n animation: growIn 0.24s ease-in forwards;\n}\n\n@keyframes growIn {\n 0% {\n transform: scale(0.5);\n }\n 90% {\n transform: scale(1.1);\n }\n 100% {\n transform: scale(1);\n }\n}\nspan.code-count-1::after, span.code-count-1::before {\n background: var(--bg-code-color-1);\n color: var(--text-code-color-1);\n}\n\nspan.code-count-2::after, span.code-count-2::before {\n background: var(--bg-code-color-1);\n color: var(--text-code-color-1);\n /* STRIPES */\n /*background: repeating-linear-gradient(*/\n /*\t45deg,*/\n /*\tvar(--bg-code-color-1),*/\n /*\tvar(--bg-code-color-1) 10px,*/\n /*\tvar(--bg-code-color-2) 10px,*/\n /*\tvar(--bg-code-color-2) 20px*/\n /*);*/\n /* PAS STRIPES */\n background: linear-gradient(90deg, var(--bg-code-color-1) 0%, var(--bg-code-color-2) 100%);\n}\n\nspan.code-count-3::after, span.code-count-3::before {\n background: var(--bg-code-color-1);\n color: var(--text-code-color-1);\n /* STRIPES */\n background: repeating-linear-gradient(45deg, var(--bg-code-color-1), var(--bg-code-color-1) 10px, var(--bg-code-color-2) 10px, var(--bg-code-color-2) 20px);\n /* PAS STRIPES */\n /* background: linear-gradient(90deg, var(--bg-code-color-1) 0%, var(--bg-code-color-2) 100%);*/\n}\n\n.selected-option {\n padding: 2px;\n margin-right: 5px;\n}` \n// @ts-ignore\nconst kendoCss = css`input[type=radio] {\n margin-top: -1px;\n vertical-align: middle;\n}\n\n.iqr-checkbox:checked {\n accent-color: #06a070;\n}\n\n.iqr-text-field {\n position: relative;\n padding-top: 1.4em;\n display: flex;\n flex-wrap: wrap;\n justify-content: stretch;\n}\n.iqr-text-field > .iqr-label {\n z-index: 1;\n pointer-events: none;\n position: absolute;\n line-height: 1.4em;\n cursor: text;\n font-size: 14px;\n top: calc( 1.4em + 5px );\n left: 9px;\n transition: transform 0.2s ease-out, color 0.2s ease-out;\n color: #656565;\n display: flex;\n align-items: center;\n height: 28px;\n max-width: 55%;\n min-width: 0;\n}\n.iqr-text-field > .iqr-label > span {\n display: block;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n padding-right: 8px;\n}\n.iqr-text-field > div {\n display: flex;\n align-items: center;\n}\n.iqr-text-field > div > .iqr-radio-button-label {\n z-index: 1;\n pointer-events: none;\n line-height: 1.4em;\n cursor: text;\n font-size: 14px;\n top: calc( 1.4em + 5px );\n left: 9px;\n transition: transform 0.2s ease-out, color 0.2s ease-out;\n color: #656565;\n display: flex;\n align-items: center;\n height: 28px;\n max-width: 100%;\n min-width: 0;\n}\n.iqr-text-field > div > .iqr-radio-button-label > span {\n display: block;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n padding-right: 8px;\n}\n.iqr-text-field > .iqr-input {\n flex: 1 1 auto;\n width: auto;\n}\n.iqr-text-field > .iqr-label {\n transform: translate(0, 0) scale(1);\n}\n.iqr-text-field > .iqr-label.above, .iqr-text-field.has-content > .iqr-label, .iqr-text-field:focus > .iqr-label, .iqr-text-field:focus-within > .iqr-label {\n transform: translate(-8px, -4px) translate(-1px, -1.4em) translate(0%, 0%) scale(1);\n font-weight: 500;\n height: 1.4em;\n max-width: 100%;\n}` \nimport { VersionedValue } from '../iqr-text-field'\nimport { CodeStub, Content } from '@icure/api'\nimport { generateLabel } from '../iqr-label/utils'\nimport { OptionsField } from '../common/optionsField'\n\nclass IqrRadioButtonGroup extends OptionsField<string, VersionedValue> {\n\t@property() type: 'radio' | 'checkbox' = 'radio'\n\t@state() protected inputValues: string[] = []\n\n\t//override\n\tstatic get styles(): CSSResultGroup[] {\n\t\treturn [baseCss, kendoCss]\n\t}\n\n\tprivate VALUES_SEPARATOR = '|'\n\tpublic checkboxChange() {\n\t\tif (this.handleValueChanged) {\n\t\t\tconst inputs = Array.from(this.shadowRoot?.querySelectorAll('input') || []).filter((input) => input.checked)\n\t\t\tconst value = inputs.map((i) => Array.from(i.labels || []).map((label) => label.textContent)).join(this.VALUES_SEPARATOR)\n\t\t\tthis.handleValueChanged?.(\n\t\t\t\tthis.displayedLanguage || this.defaultLanguage || 'en',\n\t\t\t\t{\n\t\t\t\t\tasString: value,\n\t\t\t\t\tcontent: new Content({\n\t\t\t\t\t\tstringValue: value,\n\t\t\t\t\t}),\n\t\t\t\t},\n\t\t\t\tundefined,\n\t\t\t\t[\n\t\t\t\t\t...(this.options || [])\n\t\t\t\t\t\t.filter((option) => inputs.find((i) => i.id === option.id))\n\t\t\t\t\t\t.map((option) =>\n\t\t\t\t\t\t\t!(option instanceof CodeStub) ? new CodeStub({ id: 'CUSTOM_OPTION|' + option.id + '|1', type: 'CUSTOM_OPTION', code: option.id, version: '1' }) : option,\n\t\t\t\t\t\t),\n\t\t\t\t],\n\t\t\t)\n\t\t}\n\t}\n\trender(): TemplateResult {\n\t\treturn html`\n\t\t\t<div class=\"iqr-text-field\">\n\t\t\t\t${generateLabel(this.label ?? '', this.labelPosition ?? 'float', this.translationProvider)}\n\t\t\t\t${this.options?.map((x) => {\n\t\t\t\t\tconst text = !(x instanceof CodeStub) ? this.translateText(x.text) || '' : this.translateText(x?.label?.[this.displayedLanguage || this.defaultLanguage || 'en'] || '')\n\t\t\t\t\treturn html`<div>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tclass=\"iqr-checkbox\"\n\t\t\t\t\t\t\ttype=\"${this.type}\"\n\t\t\t\t\t\t\tid=\"${x.id}\"\n\t\t\t\t\t\t\tname=\"${this.label}\"\n\t\t\t\t\t\t\tvalue=\"${!(x instanceof CodeStub) ? x.id : x.code}\"\n\t\t\t\t\t\t\t.checked=${this.inputValues.includes(text)}\n\t\t\t\t\t\t\t@change=${this.checkboxChange}\n\t\t\t\t\t\t\ttext=\"${text}\"\n\t\t\t\t\t\t/><label class=\"iqr-radio-button-label\" for=\"${x.id}\"><span>${text}</span></label>\n\t\t\t\t\t</div>`\n\t\t\t\t})}\n\t\t\t</div>\n\t\t`\n\t}\n\tpublic firstUpdated(): void {\n\t\tconst providedValue = this.valueProvider && this.valueProvider()\n\t\tconst displayedVersionedValue = providedValue?.versions?.find((version) => version.value)?.value\n\t\tif (displayedVersionedValue && Object.keys(displayedVersionedValue)?.length) {\n\t\t\tthis.inputValues = displayedVersionedValue[Object.keys(displayedVersionedValue)[0]].split(this.VALUES_SEPARATOR)\n\t\t} else if (this.value) this.inputValues = this.value.split(this.VALUES_SEPARATOR)\n\t}\n}\n\ncustomElements.define('iqr-radio-button', IqrRadioButtonGroup)\n"]}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
export { IqrTextFieldSchema } from './schema';
|
|
2
|
-
export { Suggestion } from './suggestion-palette';
|
|
3
|
-
export interface Meta {
|
|
4
|
-
revision: string;
|
|
5
|
-
modified?: number;
|
|
6
|
-
valueDate?: number | null;
|
|
7
|
-
owner?: {
|
|
8
|
-
id: string;
|
|
9
|
-
descr?: string;
|
|
10
|
-
} | null;
|
|
11
|
-
}
|
|
12
|
-
export interface Version {
|
|
13
|
-
revision: string;
|
|
14
|
-
modified?: number;
|
|
15
|
-
value: {
|
|
16
|
-
[language: string]: string;
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
export interface VersionedMeta {
|
|
20
|
-
id: string;
|
|
21
|
-
metas: Meta[];
|
|
22
|
-
}
|
|
23
|
-
export interface VersionedValue {
|
|
24
|
-
id: string;
|
|
25
|
-
versions: Version[];
|
|
26
|
-
}
|
|
27
|
-
export declare enum LabelPosition {
|
|
28
|
-
float = "float",
|
|
29
|
-
sideRight = "sideRight",
|
|
30
|
-
sideLeft = "sideLeft",
|
|
31
|
-
above = "above",
|
|
32
|
-
hidden = "hidden"
|
|
33
|
-
}
|
|
34
|
-
export interface Labels {
|
|
35
|
-
[position: string]: string;
|
|
36
|
-
}
|