@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
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defaultTranslationProvider = exports.languageName = exports.languages = void 0;
|
|
4
|
+
exports.languages = {
|
|
5
|
+
en: 'English',
|
|
6
|
+
fr: 'French',
|
|
7
|
+
es: 'Spanish',
|
|
8
|
+
nl: 'Dutch',
|
|
9
|
+
de: 'German',
|
|
10
|
+
};
|
|
11
|
+
const languageName = (iso) => exports.languages[iso] || iso;
|
|
12
|
+
exports.languageName = languageName;
|
|
13
|
+
const defaultTranslationProvider = (translations) => (language, text) => { var _a, _b, _c; return (_c = (_b = (_a = translations === null || translations === void 0 ? void 0 : translations.find((tt) => tt.language === language)) === null || _a === void 0 ? void 0 : _a.translations) === null || _b === void 0 ? void 0 : _b[text]) !== null && _c !== void 0 ? _c : text; };
|
|
14
|
+
exports.defaultTranslationProvider = defaultTranslationProvider;
|
|
15
|
+
//# sourceMappingURL=languages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"languages.js","sourceRoot":"","sources":["../../tmp/utils/languages.ts"],"names":[],"mappings":";;;AAEa,QAAA,SAAS,GAAG;IACxB,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,OAAO;IACX,EAAE,EAAE,QAAQ;CACZ,CAAA;AAEM,MAAM,YAAY,GAAG,CAAC,GAAW,EAAU,EAAE,CAAC,iBAAS,CAAC,GAAG,CAAC,IAAI,GAAG,CAAA;AAA7D,QAAA,YAAY,gBAAiD;AAEnE,MAAM,0BAA0B,GAAG,CAAC,YAAgC,EAAE,EAAE,CAAC,CAAC,QAAgB,EAAE,IAAY,EAAE,EAAE,mBAClH,OAAA,MAAA,MAAA,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,KAAK,QAAQ,CAAC,0CAAE,YAAY,0CAAG,IAAI,CAAC,mCAAI,IAAI,CAAA,EAAA,CAAA;AADtE,QAAA,0BAA0B,8BAC4C","sourcesContent":["import { TranslationTable } from '../components/model'\n\nexport const languages = {\n\ten: 'English',\n\tfr: 'French',\n\tes: 'Spanish',\n\tnl: 'Dutch',\n\tde: 'German',\n}\n\nexport const languageName = (iso: string): string => languages[iso] || iso\n\nexport const defaultTranslationProvider = (translations: TranslationTable[]) => (language: string, text: string) =>\n\ttranslations?.find((tt) => tt.language === language)?.translations?.[text] ?? text\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { MarkdownParser } from 'prosemirror-markdown';
|
|
2
|
+
import { Node as ProsemirrorNode, Schema } from 'prosemirror-model';
|
|
3
|
+
export declare class SpacePreservingMarkdownParser {
|
|
4
|
+
private mkdp;
|
|
5
|
+
constructor(mkdp: MarkdownParser);
|
|
6
|
+
parse(value: string): ProsemirrorNode | null;
|
|
7
|
+
}
|
|
8
|
+
export declare const preprocessEmptyNodes: (node: ProsemirrorNode, schema: Schema) => ProsemirrorNode;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.preprocessEmptyNodes = exports.SpacePreservingMarkdownParser = void 0;
|
|
4
|
+
const prosemirror_model_1 = require("prosemirror-model");
|
|
5
|
+
class SpacePreservingMarkdownParser {
|
|
6
|
+
constructor(mkdp) {
|
|
7
|
+
this.mkdp = mkdp;
|
|
8
|
+
}
|
|
9
|
+
parse(value) {
|
|
10
|
+
var _a;
|
|
11
|
+
const node = this.mkdp.parse(value);
|
|
12
|
+
const trailingSpaces = (_a = value.match(/([ ]+)$/)) === null || _a === void 0 ? void 0 : _a[1];
|
|
13
|
+
if (node && trailingSpaces) {
|
|
14
|
+
const appendTextToLastTextChild = (node, text) => {
|
|
15
|
+
if (node.isText) {
|
|
16
|
+
return node.withText(node.text + text);
|
|
17
|
+
}
|
|
18
|
+
const lastChild = node.lastChild;
|
|
19
|
+
if (lastChild) {
|
|
20
|
+
return node.copy(node.content.replaceChild(node.childCount - 1, appendTextToLastTextChild(lastChild, text)));
|
|
21
|
+
}
|
|
22
|
+
return node;
|
|
23
|
+
};
|
|
24
|
+
return appendTextToLastTextChild(node, trailingSpaces);
|
|
25
|
+
}
|
|
26
|
+
return node;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.SpacePreservingMarkdownParser = SpacePreservingMarkdownParser;
|
|
30
|
+
const preprocessEmptyNodes = (node, schema) => {
|
|
31
|
+
var _a;
|
|
32
|
+
const content = node.content;
|
|
33
|
+
if (node.isText) {
|
|
34
|
+
return node.withText(((_a = node.text) !== null && _a !== void 0 ? _a : '').replace(/^( +)/g, (x) => x.replace(/ /g, '\u00a0')));
|
|
35
|
+
}
|
|
36
|
+
if (node.isBlock && node.type.name === 'paragraph' && content.size === 0) {
|
|
37
|
+
return node.copy(prosemirror_model_1.Fragment.fromArray([schema.text('\u00a0')]));
|
|
38
|
+
}
|
|
39
|
+
if (content.childCount === 0) {
|
|
40
|
+
return node;
|
|
41
|
+
}
|
|
42
|
+
let idx = 0;
|
|
43
|
+
const iterate = {
|
|
44
|
+
next: () => {
|
|
45
|
+
if (content.childCount === idx)
|
|
46
|
+
return { value: content.child(idx - 1), done: true };
|
|
47
|
+
return { value: content.child(idx++), done: false };
|
|
48
|
+
},
|
|
49
|
+
[Symbol.iterator]() {
|
|
50
|
+
return this;
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
const originals = Array.from(iterate);
|
|
54
|
+
const treated = originals.map((n) => (0, exports.preprocessEmptyNodes)(n, schema));
|
|
55
|
+
return node.copy(prosemirror_model_1.Fragment.fromArray(treated));
|
|
56
|
+
};
|
|
57
|
+
exports.preprocessEmptyNodes = preprocessEmptyNodes;
|
|
58
|
+
//# sourceMappingURL=markdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown.js","sourceRoot":"","sources":["../../tmp/utils/markdown.ts"],"names":[],"mappings":";;;AACA,yDAA6E;AAE7E,MAAa,6BAA6B;IACzC,YAAoB,IAAoB;QAApB,SAAI,GAAJ,IAAI,CAAgB;IAAG,CAAC;IAE5C,KAAK,CAAC,KAAa;;QAClB,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QACnC,MAAM,cAAc,GAAG,MAAA,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,0CAAG,CAAC,CAAC,CAAA;QAClD,IAAI,IAAI,IAAI,cAAc,EAAE;YAC3B,MAAM,yBAAyB,GAAG,CAAC,IAAqB,EAAE,IAAY,EAAmB,EAAE;gBAC1F,IAAI,IAAI,CAAC,MAAM,EAAE;oBAChB,OAAQ,IAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,CAAA;iBAC/C;gBACD,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAA;gBAChC,IAAI,SAAS,EAAE;oBACd,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,GAAG,CAAC,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AC,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAA;QACpD,CAAC;QACD,CAAC,MAAM,CAAC,QAAQ,CAAC;YAChB,OAAO,IAAI,CAAA;QACZ,CAAC;KACD,CAAA;IACD,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IACrC,MAAM,OAAO,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,4BAAoB,EAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAA;IACrE,OAAO,IAAI,CAAC,IAAI,CAAC,4BAAQ,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;AAC9C,CAAC,CAAA;AAxBY,QAAA,oBAAoB,wBAwBhC","sourcesContent":["import { MarkdownParser } from 'prosemirror-markdown'\nimport { Fragment, Node as ProsemirrorNode, Schema } from 'prosemirror-model'\n\nexport class SpacePreservingMarkdownParser {\n\tconstructor(private mkdp: MarkdownParser) {}\n\n\tparse(value: string): ProsemirrorNode | null {\n\t\tconst node = this.mkdp.parse(value)\n\t\tconst trailingSpaces = value.match(/([ ]+)$/)?.[1]\n\t\tif (node && trailingSpaces) {\n\t\t\tconst appendTextToLastTextChild = (node: ProsemirrorNode, text: string): ProsemirrorNode => {\n\t\t\t\tif (node.isText) {\n\t\t\t\t\treturn (node as any).withText(node.text + text)\n\t\t\t\t}\n\t\t\t\tconst lastChild = node.lastChild\n\t\t\t\tif (lastChild) {\n\t\t\t\t\treturn node.copy(node.content.replaceChild(node.childCount - 1, appendTextToLastTextChild(lastChild, text)))\n\t\t\t\t}\n\t\t\t\treturn node\n\t\t\t}\n\n\t\t\treturn appendTextToLastTextChild(node, trailingSpaces)\n\t\t}\n\t\treturn node\n\t}\n}\n\nexport const preprocessEmptyNodes = (node: ProsemirrorNode, schema: Schema): ProsemirrorNode => {\n\tconst content = node.content\n\tif (node.isText) {\n\t\treturn (node as any).withText((node.text ?? '').replace(/^( +)/g, (x) => x.replace(/ /g, '\\u00a0')))\n\t}\n\tif (node.isBlock && node.type.name === 'paragraph' && content.size === 0) {\n\t\treturn node.copy(Fragment.fromArray([schema.text('\\u00a0')]))\n\t}\n\tif (content.childCount === 0) {\n\t\treturn node\n\t}\n\tlet idx = 0\n\tconst iterate = {\n\t\tnext: () => {\n\t\t\tif (content.childCount === idx) return { value: content.child(idx - 1), done: true }\n\t\t\treturn { value: content.child(idx++), done: false }\n\t\t},\n\t\t[Symbol.iterator]() {\n\t\t\treturn this\n\t\t},\n\t}\n\tconst originals = Array.from(iterate)\n\tconst treated = originals.map((n) => preprocessEmptyNodes(n, schema))\n\treturn node.copy(Fragment.fromArray(treated))\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PrimitiveType } from '../components/model';
|
|
2
|
+
import { Content } from '@icure/api';
|
|
3
|
+
export declare const normalizeUnit: (value: number, unit?: string) => number;
|
|
4
|
+
export type ParsedPrimitiveType = number | string | boolean | Date | ParsedPrimitiveType[];
|
|
5
|
+
export declare const parsePrimitive: (value: PrimitiveType) => ParsedPrimitiveType | undefined;
|
|
6
|
+
export declare const primitiveTypeToContent: (language: string, value: PrimitiveType) => Content;
|
|
7
|
+
export declare const contentToPrimitiveType: (language: string, content: Content | undefined) => PrimitiveType | undefined;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.contentToPrimitiveType = exports.primitiveTypeToContent = exports.parsePrimitive = exports.normalizeUnit = void 0;
|
|
4
|
+
const icure_utils_1 = require("./icure-utils");
|
|
5
|
+
const normalizeUnit = (value, unit) => {
|
|
6
|
+
if (!unit) {
|
|
7
|
+
return value;
|
|
8
|
+
}
|
|
9
|
+
switch (unit) {
|
|
10
|
+
case 'kg':
|
|
11
|
+
return value;
|
|
12
|
+
case 'g':
|
|
13
|
+
return value / 1000;
|
|
14
|
+
case 'mg':
|
|
15
|
+
return value / 1000000;
|
|
16
|
+
case 'l':
|
|
17
|
+
return value;
|
|
18
|
+
case 'ml':
|
|
19
|
+
return value / 1000;
|
|
20
|
+
case 'cl':
|
|
21
|
+
return value / 100;
|
|
22
|
+
case 'm':
|
|
23
|
+
return value;
|
|
24
|
+
case 'cm':
|
|
25
|
+
return value / 100;
|
|
26
|
+
case 'mm':
|
|
27
|
+
return value / 1000;
|
|
28
|
+
case 's':
|
|
29
|
+
return value;
|
|
30
|
+
case 'min':
|
|
31
|
+
return value * 60;
|
|
32
|
+
case 'h':
|
|
33
|
+
return value * 60 * 60;
|
|
34
|
+
case 'd':
|
|
35
|
+
return value * 60 * 60 * 24;
|
|
36
|
+
case 'week':
|
|
37
|
+
return value * 60 * 60 * 24 * 7;
|
|
38
|
+
case 'month':
|
|
39
|
+
return value * 60 * 60 * 24 * 30;
|
|
40
|
+
case 'year':
|
|
41
|
+
return value * 60 * 60 * 24 * 365.25;
|
|
42
|
+
}
|
|
43
|
+
return value;
|
|
44
|
+
};
|
|
45
|
+
exports.normalizeUnit = normalizeUnit;
|
|
46
|
+
const parsePrimitive = (value) => {
|
|
47
|
+
switch (value.type) {
|
|
48
|
+
case 'measure':
|
|
49
|
+
const normalizedValue = value.value ? (0, exports.normalizeUnit)(+value.value, value.unit) : undefined;
|
|
50
|
+
return normalizedValue;
|
|
51
|
+
case 'datetime':
|
|
52
|
+
return (0, icure_utils_1.anyDateToDate)(value.value);
|
|
53
|
+
case 'timestamp':
|
|
54
|
+
return (0, icure_utils_1.anyDateToDate)(value.value);
|
|
55
|
+
case 'number':
|
|
56
|
+
return +value.value;
|
|
57
|
+
case 'boolean':
|
|
58
|
+
return value.value;
|
|
59
|
+
case 'string':
|
|
60
|
+
return value.value;
|
|
61
|
+
case 'compound':
|
|
62
|
+
return Object.values(value.value)
|
|
63
|
+
.map(exports.parsePrimitive)
|
|
64
|
+
.filter((x) => x !== undefined);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
exports.parsePrimitive = parsePrimitive;
|
|
68
|
+
const primitiveTypeToContent = (language, value) => {
|
|
69
|
+
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (value.type === 'number' ? { numberValue: value.value } : {})), (value.type === 'measure'
|
|
70
|
+
? {
|
|
71
|
+
measureValue: {
|
|
72
|
+
value: value.value,
|
|
73
|
+
unit: value.unit,
|
|
74
|
+
},
|
|
75
|
+
}
|
|
76
|
+
: {})), (value.type === 'string' ? { stringValue: value.value } : {})), (value.type === 'datetime' ? { fuzzyDateValue: value.value } : {})), (value.type === 'boolean' ? { booleanValue: value.value } : {})), (value.type === 'timestamp' ? { instantValue: value.value } : {})), (value.type === 'compound'
|
|
77
|
+
? {
|
|
78
|
+
compoundValue: Object.entries(value.value).map(([label, value]) => ({
|
|
79
|
+
label,
|
|
80
|
+
content: {
|
|
81
|
+
[language]: (0, exports.primitiveTypeToContent)(language, value),
|
|
82
|
+
},
|
|
83
|
+
})),
|
|
84
|
+
}
|
|
85
|
+
: {}));
|
|
86
|
+
};
|
|
87
|
+
exports.primitiveTypeToContent = primitiveTypeToContent;
|
|
88
|
+
const contentToPrimitiveType = (language, content) => {
|
|
89
|
+
var _a, _b, _c, _d, _e, _f;
|
|
90
|
+
if (!content) {
|
|
91
|
+
return undefined;
|
|
92
|
+
}
|
|
93
|
+
if (content.numberValue || content.numberValue === 0) {
|
|
94
|
+
return { type: 'number', value: content.numberValue };
|
|
95
|
+
}
|
|
96
|
+
if (((_a = content.measureValue) === null || _a === void 0 ? void 0 : _a.value) || ((_b = content.measureValue) === null || _b === void 0 ? void 0 : _b.value) === 0 || ((_d = (_c = content.measureValue) === null || _c === void 0 ? void 0 : _c.unit) === null || _d === void 0 ? void 0 : _d.length)) {
|
|
97
|
+
return { type: 'measure', value: (_e = content.measureValue) === null || _e === void 0 ? void 0 : _e.value, unit: (_f = content.measureValue) === null || _f === void 0 ? void 0 : _f.unit };
|
|
98
|
+
}
|
|
99
|
+
if (content.stringValue) {
|
|
100
|
+
return { type: 'string', value: content.stringValue };
|
|
101
|
+
}
|
|
102
|
+
if (content.fuzzyDateValue) {
|
|
103
|
+
return { type: 'datetime', value: content.fuzzyDateValue };
|
|
104
|
+
}
|
|
105
|
+
if (content.booleanValue) {
|
|
106
|
+
return { type: 'boolean', value: content.booleanValue };
|
|
107
|
+
}
|
|
108
|
+
if (content.instantValue) {
|
|
109
|
+
return { type: 'timestamp', value: content.instantValue };
|
|
110
|
+
}
|
|
111
|
+
if (content.compoundValue) {
|
|
112
|
+
return {
|
|
113
|
+
type: 'compound',
|
|
114
|
+
value: content.compoundValue.reduce((acc, { label, content }) => {
|
|
115
|
+
const primitiveValue = (0, exports.contentToPrimitiveType)(language, content === null || content === void 0 ? void 0 : content[language]);
|
|
116
|
+
return label && primitiveValue ? Object.assign(Object.assign({}, acc), { [label]: primitiveValue }) : acc;
|
|
117
|
+
}, {}),
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
return undefined;
|
|
121
|
+
};
|
|
122
|
+
exports.contentToPrimitiveType = contentToPrimitiveType;
|
|
123
|
+
//# sourceMappingURL=primitive.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primitive.js","sourceRoot":"","sources":["../../tmp/utils/primitive.ts"],"names":[],"mappings":";;;AACA,+CAA6C;AAGtC,MAAM,aAAa,GAAG,CAAC,KAAa,EAAE,IAAa,EAAU,EAAE;IACrE,IAAI,CAAC,IAAI,EAAE;QACV,OAAO,KAAK,CAAA;KACZ;IACD,QAAQ,IAAI,EAAE;QACb,KAAK,IAAI;YACR,OAAO,KAAK,CAAA;QACb,KAAK,GAAG;YACP,OAAO,KAAK,GAAG,IAAI,CAAA;QACpB,KAAK,IAAI;YACR,OAAO,KAAK,GAAG,OAAO,CAAA;QACvB,KAAK,GAAG;YACP,OAAO,KAAK,CAAA;QACb,KAAK,IAAI;YACR,OAAO,KAAK,GAAG,IAAI,CAAA;QACpB,KAAK,IAAI;YACR,OA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KAAK,EAAE,OAAO,CAAC,WAAW,EAAE,CAAA;KACrD;IACD,IAAI,OAAO,CAAC,cAAc,EAAE;QAC3B,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,CAAC,cAAc,EAAE,CAAA;KAC1D;IACD,IAAI,OAAO,CAAC,YAAY,EAAE;QACzB,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,CAAC,YAAY,EAAE,CAAA;KACvD;IACD,IAAI,OAAO,CAAC,YAAY,EAAE;QACzB,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,CAAC,YAAY,EAAE,CAAA;KACzD;IACD,IAAI,OAAO,CAAC,aAAa,EAAE;QAC1B,OAAO;YACN,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,GAAuC,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE;gBACnG,MAAM,cAAc,GAAG,IAAA,8BAAsB,EAAC,QAAQ,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAG,QAAQ,CAAC,CAAC,CAAA;gBAC5E,OAAO,KAAK,IAAI,cAAc,CAAC,CAAC,iCAAM,GAAG,KAAE,CAAC,KAAK,CAAC,EAAE,cAAc,IAAG,CAAC,CAAC,GAAG,CAAA;YAC3E,CAAC,EAAE,EAAE,CAAC;SACN,CAAA;KACD;IAED,OAAO,SAAS,CAAA;AACjB,CAAC,CAAA;AAjCY,QAAA,sBAAsB,0BAiClC","sourcesContent":["import { BooleanType, CompoundType, DateTimeType, MeasureType, NumberType, PrimitiveType, StringType, TimestampType } from '../components/model'\nimport { anyDateToDate } from './icure-utils'\nimport { Content } from '@icure/api'\n\nexport const normalizeUnit = (value: number, unit?: string): number => {\n\tif (!unit) {\n\t\treturn value\n\t}\n\tswitch (unit) {\n\t\tcase 'kg':\n\t\t\treturn value\n\t\tcase 'g':\n\t\t\treturn value / 1000\n\t\tcase 'mg':\n\t\t\treturn value / 1000000\n\t\tcase 'l':\n\t\t\treturn value\n\t\tcase 'ml':\n\t\t\treturn value / 1000\n\t\tcase 'cl':\n\t\t\treturn value / 100\n\t\tcase 'm':\n\t\t\treturn value\n\t\tcase 'cm':\n\t\t\treturn value / 100\n\t\tcase 'mm':\n\t\t\treturn value / 1000\n\t\tcase 's':\n\t\t\treturn value\n\t\tcase 'min':\n\t\t\treturn value * 60\n\t\tcase 'h':\n\t\t\treturn value * 60 * 60\n\t\tcase 'd':\n\t\t\treturn value * 60 * 60 * 24\n\t\tcase 'week':\n\t\t\treturn value * 60 * 60 * 24 * 7\n\t\tcase 'month':\n\t\t\treturn value * 60 * 60 * 24 * 30\n\t\tcase 'year':\n\t\t\treturn value * 60 * 60 * 24 * 365.25\n\t}\n\treturn value\n}\n\nexport type ParsedPrimitiveType = number | string | boolean | Date | ParsedPrimitiveType[]\nexport const parsePrimitive = (value: PrimitiveType): ParsedPrimitiveType | undefined => {\n\tswitch (value.type) {\n\t\tcase 'measure':\n\t\t\tconst normalizedValue = value.value ? normalizeUnit(+value.value, value.unit) : undefined\n\t\t\treturn normalizedValue\n\t\tcase 'datetime':\n\t\t\treturn anyDateToDate(value.value)\n\t\tcase 'timestamp':\n\t\t\treturn anyDateToDate(value.value)\n\t\tcase 'number':\n\t\t\treturn +value.value\n\t\tcase 'boolean':\n\t\t\treturn value.value\n\t\tcase 'string':\n\t\t\treturn value.value\n\t\tcase 'compound':\n\t\t\treturn Object.values(value.value)\n\t\t\t\t.map(parsePrimitive)\n\t\t\t\t.filter((x) => x !== undefined) as ParsedPrimitiveType[]\n\t}\n}\n\nexport const primitiveTypeToContent = (language: string, value: PrimitiveType): Content => {\n\treturn {\n\t\t...(value.type === 'number' ? { numberValue: (value as NumberType).value } : {}),\n\t\t...(value.type === 'measure'\n\t\t\t? {\n\t\t\t\t\tmeasureValue: {\n\t\t\t\t\t\tvalue: (value as MeasureType).value,\n\t\t\t\t\t\tunit: (value as MeasureType).unit,\n\t\t\t\t\t},\n\t\t\t }\n\t\t\t: {}),\n\t\t...(value.type === 'string' ? { stringValue: (value as StringType).value } : {}),\n\t\t...(value.type === 'datetime' ? { fuzzyDateValue: (value as DateTimeType).value } : {}),\n\t\t...(value.type === 'boolean' ? { booleanValue: (value as BooleanType).value } : {}),\n\t\t...(value.type === 'timestamp' ? { instantValue: (value as TimestampType).value } : {}),\n\t\t...(value.type === 'compound'\n\t\t\t? {\n\t\t\t\t\tcompoundValue: Object.entries((value as CompoundType).value).map(([label, value]) => ({\n\t\t\t\t\t\tlabel,\n\t\t\t\t\t\tcontent: {\n\t\t\t\t\t\t\t[language]: primitiveTypeToContent(language, value),\n\t\t\t\t\t\t},\n\t\t\t\t\t})),\n\t\t\t }\n\t\t\t: {}),\n\t}\n}\n\nexport const contentToPrimitiveType = (language: string, content: Content | undefined): PrimitiveType | undefined => {\n\tif (!content) {\n\t\treturn undefined\n\t}\n\tif (content.numberValue || content.numberValue === 0) {\n\t\treturn { type: 'number', value: content.numberValue }\n\t}\n\tif (content.measureValue?.value || content.measureValue?.value === 0 || content.measureValue?.unit?.length) {\n\t\treturn { type: 'measure', value: content.measureValue?.value, unit: content.measureValue?.unit }\n\t}\n\tif (content.stringValue) {\n\t\treturn { type: 'string', value: content.stringValue }\n\t}\n\tif (content.fuzzyDateValue) {\n\t\treturn { type: 'datetime', value: content.fuzzyDateValue }\n\t}\n\tif (content.booleanValue) {\n\t\treturn { type: 'boolean', value: content.booleanValue }\n\t}\n\tif (content.instantValue) {\n\t\treturn { type: 'timestamp', value: content.instantValue }\n\t}\n\tif (content.compoundValue) {\n\t\treturn {\n\t\t\ttype: 'compound',\n\t\t\tvalue: content.compoundValue.reduce((acc: { [label: string]: PrimitiveType }, { label, content }) => {\n\t\t\t\tconst primitiveValue = contentToPrimitiveType(language, content?.[language])\n\t\t\t\treturn label && primitiveValue ? { ...acc, [label]: primitiveValue } : acc\n\t\t\t}, {}),\n\t\t}\n\t}\n\n\treturn undefined\n}\n"]}
|
package/.eslintrc
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"parser": "@typescript-eslint/parser",
|
|
3
|
-
"parserOptions": {
|
|
4
|
-
"ecmaVersion": 2020,
|
|
5
|
-
"sourceType": "module",
|
|
6
|
-
"ecmaFeatures": {}
|
|
7
|
-
},
|
|
8
|
-
"plugins": [
|
|
9
|
-
"@typescript-eslint"
|
|
10
|
-
],
|
|
11
|
-
"extends":[
|
|
12
|
-
"plugin:@typescript-eslint/recommended",
|
|
13
|
-
"plugin:prettier/recommended"
|
|
14
|
-
],
|
|
15
|
-
"env": {
|
|
16
|
-
"browser": true,
|
|
17
|
-
"node": true,
|
|
18
|
-
"es6": true
|
|
19
|
-
},
|
|
20
|
-
"rules": {
|
|
21
|
-
"semi": ["error", "never", { "beforeStatementContinuationChars": "never"}],
|
|
22
|
-
"prettier/prettier": [
|
|
23
|
-
"error",
|
|
24
|
-
{
|
|
25
|
-
"endOfLine": "auto"
|
|
26
|
-
}
|
|
27
|
-
],
|
|
28
|
-
"max-len": ["error", {"code": 190, "ignoreStrings": true, "ignoreTemplateLiterals": true}],
|
|
29
|
-
"jsx-a11y/no-static-element-interactions": 0,
|
|
30
|
-
"@typescript-eslint/ban-ts-comment": 0,
|
|
31
|
-
"@typescript-eslint/no-namespace": 0
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
}
|