@icure/form 2.0.11 → 2.1.2
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/.yarn/cache/@babel-runtime-npm-7.28.6-f40c99aeef-42d8a868c2.zip +0 -0
- package/.yarn/cache/@icure-api-npm-5.3.18-99d397b97c-0da319f009.zip +0 -0
- package/.yarn/cache/@icure-motss-app-datepicker-npm-6.0.0-rc.40-ca1da7abbb-9bbe2bed34.zip +0 -0
- package/.yarn/cache/@lit-labs-ssr-dom-shim-npm-1.5.1-3b3c832bd1-22c404c481.zip +0 -0
- package/.yarn/cache/@lit-reactive-element-npm-1.6.3-4828441e51-79b58631c3.zip +0 -0
- package/.yarn/cache/@lit-reactive-element-npm-2.1.2-2c713bebce-e0ed931b9c.zip +0 -0
- package/.yarn/cache/@lit-task-npm-1.0.3-48f265b3e9-790b6a2603.zip +0 -0
- package/.yarn/cache/@material-animation-npm-14.0.0-canary.53b3cad2f.0-06a813cdea-9b5190654c.zip +0 -0
- package/.yarn/cache/@material-base-npm-14.0.0-canary.53b3cad2f.0-d195c1fdc4-9f4928d115.zip +0 -0
- package/.yarn/cache/@material-button-npm-14.0.0-canary.53b3cad2f.0-d4b070f508-873295c56a.zip +0 -0
- package/.yarn/cache/@material-density-npm-14.0.0-canary.53b3cad2f.0-48c1f65059-a23f00edfe.zip +0 -0
- package/.yarn/cache/@material-dialog-npm-14.0.0-canary.53b3cad2f.0-96168fa294-c1a498b81a.zip +0 -0
- package/.yarn/cache/@material-dom-npm-14.0.0-canary.53b3cad2f.0-ac009dc871-f5817f76dd.zip +0 -0
- package/.yarn/cache/@material-elevation-npm-14.0.0-canary.53b3cad2f.0-3312f06793-2f8945c7b6.zip +0 -0
- package/.yarn/cache/@material-feature-targeting-npm-14.0.0-canary.53b3cad2f.0-a919042d50-e7a1ed68f9.zip +0 -0
- package/.yarn/cache/@material-floating-label-npm-14.0.0-canary.53b3cad2f.0-eb8f330f2f-5295dc481d.zip +0 -0
- package/.yarn/cache/@material-focus-ring-npm-14.0.0-canary.53b3cad2f.0-b22f851a2e-92273b1247.zip +0 -0
- package/.yarn/cache/@material-icon-button-npm-14.0.0-canary.53b3cad2f.0-e158d26048-19b51665f2.zip +0 -0
- package/.yarn/cache/@material-line-ripple-npm-14.0.0-canary.53b3cad2f.0-d089468db9-6518961487.zip +0 -0
- package/.yarn/cache/@material-list-npm-14.0.0-canary.53b3cad2f.0-df9ce05084-6c977f518d.zip +0 -0
- package/.yarn/cache/@material-menu-npm-14.0.0-canary.53b3cad2f.0-9489b592c8-71b6a1f4dd.zip +0 -0
- package/.yarn/cache/@material-menu-surface-npm-14.0.0-canary.53b3cad2f.0-52212f38f4-ad48e168ca.zip +0 -0
- package/.yarn/cache/@material-mwc-base-npm-0.27.0-79caf3ef2b-07af17edfc.zip +0 -0
- package/.yarn/cache/@material-mwc-button-npm-0.27.0-4b85f2b26f-2ef5cc0951.zip +0 -0
- package/.yarn/cache/@material-mwc-checkbox-npm-0.27.0-e837031d8e-ba53a6ea8c.zip +0 -0
- package/.yarn/cache/@material-mwc-dialog-npm-0.27.0-77c6071543-ffab528e8e.zip +0 -0
- package/.yarn/cache/@material-mwc-floating-label-npm-0.27.0-80e62b22c0-fbbf4f2e42.zip +0 -0
- package/.yarn/cache/@material-mwc-icon-button-npm-0.27.0-41f82f135b-7315c0735b.zip +0 -0
- package/.yarn/cache/@material-mwc-icon-npm-0.27.0-98c9e8509f-6dfa5115d5.zip +0 -0
- package/.yarn/cache/@material-mwc-line-ripple-npm-0.27.0-e6704221e0-6862ede0f4.zip +0 -0
- package/.yarn/cache/@material-mwc-list-npm-0.27.0-5344fc9de4-6c2ae4f1c6.zip +0 -0
- package/.yarn/cache/@material-mwc-menu-npm-0.27.0-7c2bb47797-126f733659.zip +0 -0
- package/.yarn/cache/@material-mwc-notched-outline-npm-0.27.0-0e0d1c4d5f-2739032f76.zip +0 -0
- package/.yarn/cache/@material-mwc-radio-npm-0.27.0-aa2098a280-0b0a0a6b99.zip +0 -0
- package/.yarn/cache/@material-mwc-ripple-npm-0.27.0-ed37672f08-9cd73fdfe4.zip +0 -0
- package/.yarn/cache/@material-mwc-textfield-npm-0.27.0-dabd704f55-978c893aca.zip +0 -0
- package/.yarn/cache/@material-notched-outline-npm-14.0.0-canary.53b3cad2f.0-ecacde98db-1a9f8db4d8.zip +0 -0
- package/.yarn/cache/@material-radio-npm-14.0.0-canary.53b3cad2f.0-c50de64d41-898554f2b3.zip +0 -0
- package/.yarn/cache/@material-ripple-npm-14.0.0-canary.53b3cad2f.0-49060bfe7e-08b71917e2.zip +0 -0
- package/.yarn/cache/@material-rtl-npm-14.0.0-canary.53b3cad2f.0-daca794b76-3c1b8b48c6.zip +0 -0
- package/.yarn/cache/@material-shape-npm-14.0.0-canary.53b3cad2f.0-5bcff722a6-6ad9b020c0.zip +0 -0
- package/.yarn/cache/@material-textfield-npm-14.0.0-canary.53b3cad2f.0-4414808dda-7072e3c9df.zip +0 -0
- package/.yarn/cache/@material-theme-npm-14.0.0-canary.53b3cad2f.0-9a24e7b046-fd44e92917.zip +0 -0
- package/.yarn/cache/@material-tokens-npm-14.0.0-canary.53b3cad2f.0-f1c87523da-efa909f861.zip +0 -0
- package/.yarn/cache/@material-touch-target-npm-14.0.0-canary.53b3cad2f.0-fa6a2d0875-dbc13cbe7a.zip +0 -0
- package/.yarn/cache/@material-typography-npm-14.0.0-canary.53b3cad2f.0-f4a58946f1-fa2671df40.zip +0 -0
- package/.yarn/cache/@types-linkify-it-npm-5.0.0-576a16b976-ec98e03aa8.zip +0 -0
- package/.yarn/cache/@types-markdown-it-npm-14.1.2-d0c4e12c49-ad66e0b377.zip +0 -0
- package/.yarn/cache/@types-mdurl-npm-2.0.0-2f4116c0b0-78746e96c6.zip +0 -0
- package/.yarn/cache/@types-trusted-types-npm-2.0.7-a07fc44f59-8e4202766a.zip +0 -0
- package/.yarn/cache/@webcomponents-webcomponentsjs-npm-2.8.0-36c07db4d2-186373c030.zip +0 -0
- package/.yarn/cache/argparse-npm-2.0.1-faff7999e6-83644b5649.zip +0 -0
- package/.yarn/cache/big-integer-npm-1.6.52-4bec75720c-6e86885787.zip +0 -0
- package/.yarn/cache/blocking-elements-npm-0.1.1-423f51c76e-9a34084405.zip +0 -0
- package/.yarn/cache/date-fns-npm-2.30.0-895c790e0f-f7be015232.zip +0 -0
- package/.yarn/cache/entities-npm-4.5.0-7cdb83b832-853f8ebd5b.zip +0 -0
- package/.yarn/cache/fast-deep-equal-npm-3.1.3-790edcfcf5-e21a9d8d84.zip +0 -0
- package/.yarn/cache/libphonenumber-js-npm-1.12.34-cd35ce8e26-e4bb10ba42.zip +0 -0
- package/.yarn/cache/linkify-it-npm-5.0.0-adb5f9c96f-b0b86cadaf.zip +0 -0
- package/.yarn/cache/lit-element-npm-3.3.3-2f9f9e38c0-29a596fa55.zip +0 -0
- package/.yarn/cache/lit-element-npm-4.2.2-70d4af2233-554254b87c.zip +0 -0
- package/.yarn/cache/lit-html-npm-2.8.0-82f88d6ebf-2d70df0724.zip +0 -0
- package/.yarn/cache/lit-html-npm-3.3.2-4a3e00215f-7fe23502ca.zip +0 -0
- package/.yarn/cache/lit-npm-2.8.0-92bb1333a4-2480e733f7.zip +0 -0
- package/.yarn/cache/lit-npm-3.3.2-7dea58471e-2136d4beac.zip +0 -0
- package/.yarn/cache/lodash-npm-4.17.21-6382451519-eb835a2e51.zip +0 -0
- package/.yarn/cache/markdown-it-npm-14.1.0-e337d75bfe-07296b45eb.zip +0 -0
- package/.yarn/cache/mdurl-npm-2.0.0-3259713daf-880bc289ef.zip +0 -0
- package/.yarn/cache/moment-npm-2.30.1-1c51a5c631-859236bab1.zip +0 -0
- package/.yarn/cache/orderedmap-npm-2.1.1-64b8a0684f-082cf970b0.zip +0 -0
- package/.yarn/cache/prosemirror-commands-npm-1.7.1-5b2afb6640-2316c40ea2.zip +0 -0
- package/.yarn/cache/prosemirror-history-npm-1.5.0-e639d02880-6afb0e1d17.zip +0 -0
- package/.yarn/cache/prosemirror-keymap-npm-1.2.3-0e7e0c8195-0a2eed2771.zip +0 -0
- package/.yarn/cache/prosemirror-markdown-npm-1.13.2-6e2f179fd8-ce9fcb3b13.zip +0 -0
- package/.yarn/cache/prosemirror-model-npm-1.25.4-e7ee2df3df-ab5aa609df.zip +0 -0
- package/.yarn/cache/prosemirror-schema-basic-npm-1.2.4-8f943ded01-10ed022990.zip +0 -0
- package/.yarn/cache/prosemirror-schema-list-npm-1.5.1-7b138c5fed-6c7041e5b8.zip +0 -0
- package/.yarn/cache/prosemirror-state-npm-1.4.4-8b7e3a396c-1b5dba46c2.zip +0 -0
- package/.yarn/cache/prosemirror-transform-npm-1.10.5-5b3b4f5f61-6f5921e53a.zip +0 -0
- package/.yarn/cache/prosemirror-view-npm-1.41.5-39b37df338-ee47e9091a.zip +0 -0
- package/.yarn/cache/punycode.js-npm-2.3.1-9084ecbbf5-13466d7ed5.zip +0 -0
- package/.yarn/cache/rope-sequence-npm-1.3.4-3b09587e5f-95cca2f99a.zip +0 -0
- package/.yarn/cache/text-encoding-npm-0.7.0-ff0c4af052-b6109a843f.zip +0 -0
- package/.yarn/cache/tslib-npm-2.8.1-66590b21b8-e4aba30e63.zip +0 -0
- package/.yarn/cache/uc.micro-npm-2.1.0-c45282c865-3719735824.zip +0 -0
- package/.yarn/cache/uuid-encoder-npm-1.2.0-6a9a810c6d-dd06230f08.zip +0 -0
- package/.yarn/cache/uuid-npm-8.3.2-eca0baba53-5575a8a75c.zip +0 -0
- package/.yarn/cache/uuid-npm-9.0.1-39a8442bc6-39931f6da7.zip +0 -0
- package/.yarn/cache/w3c-keyname-npm-2.2.8-66d7d5317a-95bafa4c04.zip +0 -0
- package/.yarn/cache/wicg-inert-npm-3.1.3-38590e83f2-45b3cfec63.zip +0 -0
- package/.yarn/install-state.gz +0 -0
- package/components/common/field-with-options.d.ts +2 -2
- package/components/common/field-with-options.js +8 -5
- package/components/common/field-with-options.js.map +1 -1
- package/components/common/field.d.ts +10 -3
- package/components/common/field.js +46 -21
- package/components/common/field.js.map +1 -1
- package/components/common/index.js +17 -1
- package/components/common/index.js.map +1 -1
- package/components/common/metadata-buttons-bar.d.ts +2 -1
- package/components/common/metadata-buttons-bar.js +113 -77
- package/components/common/metadata-buttons-bar.js.map +1 -1
- package/components/common/styles/paths.d.ts +1 -0
- package/components/common/styles/paths.js +41 -25
- package/components/common/styles/paths.js.map +1 -1
- package/components/common/utils.js +21 -11
- package/components/common/utils.js.map +1 -1
- package/components/icure-button/index.d.ts +1 -1
- package/components/icure-button/index.js +73 -29
- package/components/icure-button/index.js.map +1 -1
- package/components/icure-button-group/index.d.ts +5 -3
- package/components/icure-button-group/index.js +101 -61
- package/components/icure-button-group/index.js.map +1 -1
- package/components/icure-date-picker/index.d.ts +6 -3
- package/components/icure-date-picker/index.js +87 -43
- package/components/icure-date-picker/index.js.map +1 -1
- package/components/icure-dropdown-field/index.d.ts +5 -2
- package/components/icure-dropdown-field/index.js +82 -38
- package/components/icure-dropdown-field/index.js.map +1 -1
- package/components/icure-form/fields/button/button.js +17 -13
- package/components/icure-form/fields/button/button.js.map +1 -1
- package/components/icure-form/fields/button/index.js +17 -1
- package/components/icure-form/fields/button/index.js.map +1 -1
- package/components/icure-form/fields/button-group/checkbox.d.ts +2 -1
- package/components/icure-form/fields/button-group/checkbox.js +15 -11
- package/components/icure-form/fields/button-group/checkbox.js.map +1 -1
- package/components/icure-form/fields/button-group/index.js +18 -2
- package/components/icure-form/fields/button-group/index.js.map +1 -1
- package/components/icure-form/fields/button-group/radio-button.d.ts +2 -1
- package/components/icure-form/fields/button-group/radio-button.js +15 -11
- package/components/icure-form/fields/button-group/radio-button.js.map +1 -1
- package/components/icure-form/fields/date-picker/date-picker.d.ts +2 -1
- package/components/icure-form/fields/date-picker/date-picker.js +13 -9
- package/components/icure-form/fields/date-picker/date-picker.js.map +1 -1
- package/components/icure-form/fields/date-picker/date-time-picker.d.ts +2 -1
- package/components/icure-form/fields/date-picker/date-time-picker.js +13 -9
- package/components/icure-form/fields/date-picker/date-time-picker.js.map +1 -1
- package/components/icure-form/fields/date-picker/index.js +19 -3
- package/components/icure-form/fields/date-picker/index.js.map +1 -1
- package/components/icure-form/fields/date-picker/time-picker.d.ts +2 -1
- package/components/icure-form/fields/date-picker/time-picker.js +13 -9
- package/components/icure-form/fields/date-picker/time-picker.js.map +1 -1
- package/components/icure-form/fields/dropdown/dropdown-field.d.ts +1 -1
- package/components/icure-form/fields/dropdown/dropdown-field.js +15 -11
- package/components/icure-form/fields/dropdown/dropdown-field.js.map +1 -1
- package/components/icure-form/fields/dropdown/index.js +17 -1
- package/components/icure-form/fields/dropdown/index.js.map +1 -1
- package/components/icure-form/fields/index.js +26 -10
- package/components/icure-form/fields/index.js.map +1 -1
- package/components/icure-form/fields/items-list-field/index.js +17 -1
- package/components/icure-form/fields/items-list-field/index.js.map +1 -1
- package/components/icure-form/fields/items-list-field/items-list-field.d.ts +2 -1
- package/components/icure-form/fields/items-list-field/items-list-field.js +12 -8
- package/components/icure-form/fields/items-list-field/items-list-field.js.map +1 -1
- package/components/icure-form/fields/label/index.js +17 -1
- package/components/icure-form/fields/label/index.js.map +1 -1
- package/components/icure-form/fields/label/label.js +15 -11
- package/components/icure-form/fields/label/label.js.map +1 -1
- package/components/icure-form/fields/measure-field/index.js +17 -1
- package/components/icure-form/fields/measure-field/index.js.map +1 -1
- package/components/icure-form/fields/measure-field/measure-field.d.ts +2 -1
- package/components/icure-form/fields/measure-field/measure-field.js +14 -9
- package/components/icure-form/fields/measure-field/measure-field.js.map +1 -1
- package/components/icure-form/fields/number-field/index.js +17 -1
- package/components/icure-form/fields/number-field/index.js.map +1 -1
- package/components/icure-form/fields/number-field/number-field.d.ts +2 -1
- package/components/icure-form/fields/number-field/number-field.js +14 -9
- package/components/icure-form/fields/number-field/number-field.js.map +1 -1
- package/components/icure-form/fields/text-field/index.js +17 -1
- package/components/icure-form/fields/text-field/index.js.map +1 -1
- package/components/icure-form/fields/text-field/text-field.d.ts +2 -1
- package/components/icure-form/fields/text-field/text-field.js +26 -21
- package/components/icure-form/fields/text-field/text-field.js.map +1 -1
- package/components/icure-form/fields/token-field/index.js +17 -1
- package/components/icure-form/fields/token-field/index.js.map +1 -1
- package/components/icure-form/fields/token-field/token-field.d.ts +2 -1
- package/components/icure-form/fields/token-field/token-field.js +13 -9
- package/components/icure-form/fields/token-field/token-field.js.map +1 -1
- package/components/icure-form/fields/utils/index.js +13 -5
- package/components/icure-form/fields/utils/index.js.map +1 -1
- package/components/icure-form/index.d.ts +6 -2
- package/components/icure-form/index.js +138 -44
- package/components/icure-form/index.js.map +1 -1
- package/components/icure-form/renderer/form/form-selection-button.js +67 -27
- package/components/icure-form/renderer/form/form-selection-button.js.map +1 -1
- package/components/icure-form/renderer/form/form.js +264 -219
- package/components/icure-form/renderer/form/form.js.map +1 -1
- package/components/icure-form/renderer/index.d.ts +1 -1
- package/components/icure-form/renderer/index.js +2 -1
- package/components/icure-form/renderer/index.js.map +1 -1
- package/components/icure-label/index.js +70 -26
- package/components/icure-label/index.js.map +1 -1
- package/components/icure-text-field/index.d.ts +8 -2
- package/components/icure-text-field/index.js +309 -145
- package/components/icure-text-field/index.js.map +1 -1
- package/components/icure-text-field/plugin/caret-fix-plugin.js +7 -3
- package/components/icure-text-field/plugin/caret-fix-plugin.js.map +1 -1
- package/components/icure-text-field/plugin/has-content-class-plugin.js +7 -3
- package/components/icure-text-field/plugin/has-content-class-plugin.js.map +1 -1
- package/components/icure-text-field/plugin/mask-plugin.js +11 -7
- package/components/icure-text-field/plugin/mask-plugin.js.map +1 -1
- package/components/icure-text-field/plugin/regexp-plugin.js +9 -5
- package/components/icure-text-field/plugin/regexp-plugin.js.map +1 -1
- package/components/icure-text-field/prosemirror-commands.js +14 -10
- package/components/icure-text-field/prosemirror-commands.js.map +1 -1
- package/components/icure-text-field/prosemirror-utils.js +4 -1
- package/components/icure-text-field/prosemirror-utils.js.map +1 -1
- package/components/icure-text-field/schema/common-marks.js +7 -3
- package/components/icure-text-field/schema/common-marks.js.map +1 -1
- package/components/icure-text-field/schema/date-time-schema.js +8 -3
- package/components/icure-text-field/schema/date-time-schema.js.map +1 -1
- package/components/icure-text-field/schema/decimal-schema.js +4 -1
- package/components/icure-text-field/schema/decimal-schema.js.map +1 -1
- package/components/icure-text-field/schema/index.js +20 -17
- package/components/icure-text-field/schema/index.js.map +1 -1
- package/components/icure-text-field/schema/items-list-schema.js +6 -3
- package/components/icure-text-field/schema/items-list-schema.js.map +1 -1
- package/components/icure-text-field/schema/markdown-schema.js +10 -28
- package/components/icure-text-field/schema/markdown-schema.js.map +1 -1
- package/components/icure-text-field/schema/measure-schema.js +12 -6
- package/components/icure-text-field/schema/measure-schema.js.map +1 -1
- package/components/icure-text-field/schema/token-schema.js +8 -5
- package/components/icure-text-field/schema/token-schema.js.map +1 -1
- package/components/icure-text-field/schema/utils.js +6 -2
- package/components/icure-text-field/schema/utils.js.map +1 -1
- package/components/icure-text-field/selection-companion.js +5 -1
- package/components/icure-text-field/selection-companion.js.map +1 -1
- package/components/icure-text-field/suggestion-palette.js +10 -3
- package/components/icure-text-field/suggestion-palette.js.map +1 -1
- package/components/index.js +21 -5
- package/components/index.js.map +1 -1
- package/components/model/index.js +46 -22
- package/components/model/index.js.map +1 -1
- package/components/themes/default/index.js +32 -30
- package/components/themes/default/index.js.map +1 -1
- package/components/themes/icure-blue/index.js +104 -47
- package/components/themes/icure-blue/index.js.map +1 -1
- package/components/themes/kendo/index.js +55 -49
- package/components/themes/kendo/index.js.map +1 -1
- package/conversion/ckmeans-grouping.js +10 -3
- package/conversion/ckmeans-grouping.js.map +1 -1
- package/conversion/ckmeans.js +3 -1
- package/conversion/ckmeans.js.map +1 -1
- package/conversion/icure-convert.js +21 -18
- package/conversion/icure-convert.js.map +1 -1
- package/generic/index.js +17 -1
- package/generic/index.js.map +1 -1
- package/generic/model.d.ts +5 -4
- package/generic/model.js +2 -1
- package/generic/model.js.map +1 -1
- package/icure/form-values-container.d.ts +21 -13
- package/icure/form-values-container.js +265 -163
- package/icure/form-values-container.js.map +1 -1
- package/icure/icure-utils.js +21 -10
- package/icure/icure-utils.js.map +1 -1
- package/icure/index.js +18 -2
- package/icure/index.js.map +1 -1
- package/icure/model.js +2 -1
- package/index.d.ts +1 -0
- package/index.js +19 -1
- package/index.js.map +1 -1
- package/package.json +16 -13
- package/utils/code-utils.js +19 -11
- package/utils/code-utils.js.map +1 -1
- package/utils/dates.js +20 -9
- package/utils/dates.js.map +1 -1
- package/utils/fields-values-provider.d.ts +1 -1
- package/utils/fields-values-provider.js +28 -11
- package/utils/fields-values-provider.js.map +1 -1
- package/utils/interpreter.d.ts +2 -3
- package/utils/interpreter.js +16 -3
- package/utils/interpreter.js.map +1 -1
- package/utils/languages.js +8 -3
- package/utils/languages.js.map +1 -1
- package/utils/markdown.js +11 -6
- package/utils/markdown.js.map +1 -1
- package/utils/no-lodash.js +8 -3
- package/utils/no-lodash.js.map +1 -1
- package/utils/primitive.d.ts +1 -1
- package/utils/primitive.js +16 -11
- package/utils/primitive.js.map +1 -1
- package/utils/form-value-container.d.ts +0 -3
- package/utils/form-value-container.js +0 -30
- package/utils/form-value-container.js.map +0 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -16,31 +17,56 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
16
17
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
17
18
|
});
|
|
18
19
|
};
|
|
20
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
21
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
22
|
+
};
|
|
23
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
+
exports.MetadataButtonBarWrapper = exports.IcureTextField = void 0;
|
|
19
25
|
// Import the LitElement base class and html helper function
|
|
20
26
|
//@ts-ignore
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const
|
|
27
|
+
const lit_1 = require("lit");
|
|
28
|
+
const decorators_js_1 = require("lit/decorators.js");
|
|
29
|
+
const prosemirror_state_1 = require("prosemirror-state");
|
|
30
|
+
const prosemirror_view_1 = require("prosemirror-view");
|
|
31
|
+
const prosemirror_model_1 = require("prosemirror-model");
|
|
32
|
+
const prosemirror_history_1 = require("prosemirror-history");
|
|
33
|
+
const prosemirror_keymap_1 = require("prosemirror-keymap");
|
|
34
|
+
const prosemirror_commands_1 = require("prosemirror-commands");
|
|
35
|
+
const prosemirror_schema_list_1 = require("prosemirror-schema-list");
|
|
36
|
+
const schema_1 = require("./schema");
|
|
37
|
+
const markdown_it_1 = __importDefault(require("markdown-it"));
|
|
38
|
+
const prosemirror_markdown_1 = require("prosemirror-markdown");
|
|
39
|
+
const prosemirror_commands_2 = require("./prosemirror-commands");
|
|
40
|
+
const selection_companion_1 = require("./selection-companion");
|
|
41
|
+
const suggestion_palette_1 = require("./suggestion-palette");
|
|
42
|
+
const prosemirror_utils_1 = require("./prosemirror-utils");
|
|
43
|
+
const mask_plugin_1 = require("./plugin/mask-plugin");
|
|
44
|
+
const has_content_class_plugin_1 = require("./plugin/has-content-class-plugin");
|
|
45
|
+
const regexp_plugin_1 = require("./plugin/regexp-plugin");
|
|
46
|
+
const date_fns_1 = require("date-fns");
|
|
47
|
+
const common_1 = require("../common");
|
|
48
|
+
const model_1 = require("../model");
|
|
49
|
+
const utils_1 = require("../common/utils");
|
|
50
|
+
const baseCss = (0, lit_1.css) `@charset "UTF-8";
|
|
51
|
+
.tab-container .tab-bar li {
|
|
52
|
+
display: inline-block;
|
|
53
|
+
padding: 8px 16px;
|
|
54
|
+
cursor: pointer;
|
|
55
|
+
color: #000000;
|
|
56
|
+
font-size: 14px;
|
|
57
|
+
font-weight: 500;
|
|
58
|
+
}
|
|
59
|
+
.tab-container .tab-bar li.active {
|
|
60
|
+
background-color: #656565;
|
|
61
|
+
color: white;
|
|
62
|
+
}
|
|
63
|
+
.tab-container .tab-content .tab {
|
|
64
|
+
display: none;
|
|
65
|
+
}
|
|
66
|
+
.tab-container .tab-content .tab.active {
|
|
67
|
+
display: block;
|
|
68
|
+
}
|
|
69
|
+
|
|
44
70
|
:host {
|
|
45
71
|
--bg-color-1: #f44336;
|
|
46
72
|
}
|
|
@@ -89,15 +115,15 @@ const baseCss = css `@charset "UTF-8";
|
|
|
89
115
|
margin-right: 0;
|
|
90
116
|
}
|
|
91
117
|
|
|
92
|
-
.ProseMirror-hideselection {
|
|
93
|
-
caret-color: transparent;
|
|
94
|
-
}
|
|
95
118
|
.ProseMirror-hideselection *::selection {
|
|
96
119
|
background: transparent;
|
|
97
120
|
}
|
|
98
121
|
.ProseMirror-hideselection *::-moz-selection {
|
|
99
122
|
background: transparent;
|
|
100
123
|
}
|
|
124
|
+
.ProseMirror-hideselection {
|
|
125
|
+
caret-color: transparent;
|
|
126
|
+
}
|
|
101
127
|
|
|
102
128
|
.ProseMirror-selectednode {
|
|
103
129
|
outline: 2px solid #8cf;
|
|
@@ -888,13 +914,13 @@ app-date-picker {
|
|
|
888
914
|
margin-bottom: 20px;
|
|
889
915
|
}
|
|
890
916
|
.icure-form h2 {
|
|
891
|
-
font-size:
|
|
917
|
+
font-size: add-two(12px, 0, 1.2);
|
|
892
918
|
font-weight: 700;
|
|
893
919
|
color: #084B83;
|
|
894
920
|
padding: 2px;
|
|
895
921
|
}
|
|
896
922
|
.icure-form h3 {
|
|
897
|
-
font-size:
|
|
923
|
+
font-size: add-two(12px, 0, 1.1);
|
|
898
924
|
font-weight: 500;
|
|
899
925
|
color: #084B83;
|
|
900
926
|
padding: 6px;
|
|
@@ -926,17 +952,16 @@ app-date-picker {
|
|
|
926
952
|
line-height: 1.4em;
|
|
927
953
|
cursor: text;
|
|
928
954
|
font-size: 12px;
|
|
929
|
-
left:
|
|
955
|
+
left: add-two(8px, 1px);
|
|
930
956
|
color: #084B83;
|
|
931
957
|
align-items: center;
|
|
932
|
-
|
|
958
|
+
text-wrap: auto;
|
|
959
|
+
min-height: 28px;
|
|
933
960
|
max-width: 85%;
|
|
934
961
|
min-width: 0;
|
|
935
962
|
}
|
|
936
963
|
.icure-text-field .icure-label.float, .icure-button-group .icure-label.float {
|
|
937
964
|
display: flex;
|
|
938
|
-
white-space: nowrap;
|
|
939
|
-
text-overflow: ellipsis;
|
|
940
965
|
overflow: hidden;
|
|
941
966
|
}
|
|
942
967
|
|
|
@@ -971,7 +996,6 @@ app-date-picker {
|
|
|
971
996
|
border-style: solid;
|
|
972
997
|
border-color: #DDE3E7;
|
|
973
998
|
border-radius: 2px;
|
|
974
|
-
box-sizing: border-box;
|
|
975
999
|
outline: 0;
|
|
976
1000
|
font: inherit;
|
|
977
1001
|
font-size: 14px;
|
|
@@ -984,6 +1008,25 @@ app-date-picker {
|
|
|
984
1008
|
background-color: #ffffff;
|
|
985
1009
|
color: #000000;
|
|
986
1010
|
}
|
|
1011
|
+
.icure-text-field .icure-input .reset-button,
|
|
1012
|
+
.icure-text-field .input-container .reset-button {
|
|
1013
|
+
position: absolute;
|
|
1014
|
+
right: 0;
|
|
1015
|
+
border: none;
|
|
1016
|
+
background: transparent;
|
|
1017
|
+
top: 0;
|
|
1018
|
+
opacity: 0.5;
|
|
1019
|
+
cursor: pointer;
|
|
1020
|
+
height: 20px;
|
|
1021
|
+
margin-left: 4px;
|
|
1022
|
+
margin-right: 4px;
|
|
1023
|
+
padding: 0;
|
|
1024
|
+
}
|
|
1025
|
+
.icure-text-field .icure-input .reset-button svg,
|
|
1026
|
+
.icure-text-field .input-container .reset-button svg {
|
|
1027
|
+
width: 15px;
|
|
1028
|
+
height: 15px;
|
|
1029
|
+
}
|
|
987
1030
|
.icure-text-field .icure-input__validationError,
|
|
988
1031
|
.icure-text-field .input-container__validationError {
|
|
989
1032
|
border-color: red;
|
|
@@ -1097,8 +1140,8 @@ input[type=radio] {
|
|
|
1097
1140
|
line-height: 1.4em;
|
|
1098
1141
|
cursor: text;
|
|
1099
1142
|
font-size: 12px;
|
|
1100
|
-
top:
|
|
1101
|
-
left:
|
|
1143
|
+
top: add-three(1.4em, 1px, 0);
|
|
1144
|
+
left: add-two(8px, 1px);
|
|
1102
1145
|
transition: transform 0.2s ease-out, color 0.2s ease-out;
|
|
1103
1146
|
color: #084B83;
|
|
1104
1147
|
display: flex;
|
|
@@ -1125,12 +1168,14 @@ input[type=radio] {
|
|
|
1125
1168
|
font-weight: 500;
|
|
1126
1169
|
height: 1.4em;
|
|
1127
1170
|
}`;
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1171
|
+
const utils_2 = require("../icure-form/fields/utils");
|
|
1172
|
+
const markdown_1 = require("../../utils/markdown");
|
|
1173
|
+
const measure_schema_1 = require("./schema/measure-schema");
|
|
1174
|
+
const dates_1 = require("../../utils/dates");
|
|
1175
|
+
const index_1 = require("../../index");
|
|
1176
|
+
const paths_1 = require("../common/styles/paths");
|
|
1132
1177
|
// Extend the LitElement base class
|
|
1133
|
-
|
|
1178
|
+
class IcureTextField extends common_1.Field {
|
|
1134
1179
|
constructor() {
|
|
1135
1180
|
super();
|
|
1136
1181
|
this.placeholder = '';
|
|
@@ -1152,14 +1197,21 @@ export class IcureTextField extends Field {
|
|
|
1152
1197
|
this.primitiveTypeExtractor = () => undefined;
|
|
1153
1198
|
this.primitiveTypesExtractor = () => [];
|
|
1154
1199
|
this.codesExtractor = () => [];
|
|
1200
|
+
this.pasteWarning = false;
|
|
1155
1201
|
this.windowListeners = [];
|
|
1156
1202
|
this.mouseCount = 0;
|
|
1157
1203
|
this.trToSave = undefined;
|
|
1204
|
+
this.pasteWarningTimeout = undefined;
|
|
1158
1205
|
}
|
|
1159
1206
|
_handleClickOutside(event) {
|
|
1207
|
+
var _a;
|
|
1208
|
+
const pm = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll('.ProseMirror')[0];
|
|
1160
1209
|
if (!event.composedPath().includes(this)) {
|
|
1161
1210
|
event.stopPropagation();
|
|
1162
1211
|
}
|
|
1212
|
+
else if (pm && !event.composedPath().includes(pm)) {
|
|
1213
|
+
pm.focus();
|
|
1214
|
+
}
|
|
1163
1215
|
}
|
|
1164
1216
|
connectedCallback() {
|
|
1165
1217
|
super.connectedCallback();
|
|
@@ -1177,10 +1229,30 @@ export class IcureTextField extends Field {
|
|
|
1177
1229
|
}
|
|
1178
1230
|
static get styles() {
|
|
1179
1231
|
return [
|
|
1180
|
-
css `
|
|
1232
|
+
(0, lit_1.css) `
|
|
1181
1233
|
.unit::before {
|
|
1182
1234
|
content: ' ';
|
|
1183
1235
|
}
|
|
1236
|
+
.paste-warning {
|
|
1237
|
+
background-color: #fff3cd;
|
|
1238
|
+
border: 1px solid #ffc107;
|
|
1239
|
+
color: #856404;
|
|
1240
|
+
padding: 0.5rem;
|
|
1241
|
+
margin-top: 0.25rem;
|
|
1242
|
+
border-radius: 4px;
|
|
1243
|
+
font-size: 0.875rem;
|
|
1244
|
+
animation: fadeIn 0.3s ease-in;
|
|
1245
|
+
}
|
|
1246
|
+
@keyframes fadeIn {
|
|
1247
|
+
from {
|
|
1248
|
+
opacity: 0;
|
|
1249
|
+
transform: translateY(-10px);
|
|
1250
|
+
}
|
|
1251
|
+
to {
|
|
1252
|
+
opacity: 1;
|
|
1253
|
+
transform: translateY(0);
|
|
1254
|
+
}
|
|
1255
|
+
}
|
|
1184
1256
|
`,
|
|
1185
1257
|
baseCss,
|
|
1186
1258
|
];
|
|
@@ -1191,13 +1263,13 @@ export class IcureTextField extends Field {
|
|
|
1191
1263
|
updateValue(tr) {
|
|
1192
1264
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
1193
1265
|
if (this.isMultivalued()) {
|
|
1194
|
-
const values = extractValues((_a = this.valueProvider) === null || _a === void 0 ? void 0 : _a.call(this), (_b = this.metadataProvider) !== null && _b !== void 0 ? _b : (() => ({})));
|
|
1266
|
+
const values = (0, utils_2.extractValues)((_a = this.valueProvider) === null || _a === void 0 ? void 0 : _a.call(this), (_b = this.metadataProvider) !== null && _b !== void 0 ? _b : (() => ({})));
|
|
1195
1267
|
const valuesFromField = (_d = (_c = this.primitiveTypesExtractor) === null || _c === void 0 ? void 0 : _c.call(this, tr.doc)) !== null && _d !== void 0 ? _d : [];
|
|
1196
1268
|
const unchangedIds = [];
|
|
1197
1269
|
const newAndModifiedValues = [];
|
|
1198
1270
|
valuesFromField.forEach(([tid, value]) => {
|
|
1199
1271
|
const id = tid.length > 0 ? tid : undefined;
|
|
1200
|
-
const oldValue = id && values.find(([vid, v]) => { var _a, _b; return vid === id && pteq((_b = (_a = v[0].value) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b[this.language()], value); });
|
|
1272
|
+
const oldValue = id && values.find(([vid, v]) => { var _a, _b; return vid === id && (0, model_1.pteq)((_b = (_a = v[0].value) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b[this.language()], value); });
|
|
1201
1273
|
const idPresent = newAndModifiedValues.some(([ttid]) => ttid === tid);
|
|
1202
1274
|
if (!oldValue || idPresent) {
|
|
1203
1275
|
newAndModifiedValues.push([idPresent ? '' : tid, value]);
|
|
@@ -1224,7 +1296,7 @@ export class IcureTextField extends Field {
|
|
|
1224
1296
|
});
|
|
1225
1297
|
}
|
|
1226
1298
|
else {
|
|
1227
|
-
const [valueId] = extractSingleValue((_e = this.valueProvider) === null || _e === void 0 ? void 0 : _e.call(this));
|
|
1299
|
+
const [valueId] = (0, utils_2.extractSingleValue)((_e = this.valueProvider) === null || _e === void 0 ? void 0 : _e.call(this));
|
|
1228
1300
|
const value = (_f = this.primitiveTypeExtractor) === null || _f === void 0 ? void 0 : _f.call(this, tr.doc);
|
|
1229
1301
|
((_g = this.handleValueChanged) === null || _g === void 0 ? void 0 : _g.call(this, this.label, this.language(), value
|
|
1230
1302
|
? {
|
|
@@ -1234,31 +1306,37 @@ export class IcureTextField extends Field {
|
|
|
1234
1306
|
: undefined, valueId)) && (this.selectedRevision = undefined);
|
|
1235
1307
|
}
|
|
1236
1308
|
}
|
|
1237
|
-
|
|
1238
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t
|
|
1309
|
+
renderSync({ validationErrors }) {
|
|
1310
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
1239
1311
|
const renderHash = Math.random();
|
|
1240
1312
|
let metadata;
|
|
1241
1313
|
let rev;
|
|
1242
1314
|
let versions;
|
|
1243
|
-
const validationError =
|
|
1315
|
+
const validationError = validationErrors.length;
|
|
1244
1316
|
let valueForExistingLanguages = undefined;
|
|
1317
|
+
if (index_1.icureFormLogging) {
|
|
1318
|
+
console.log(`Rendering text-field ${this.schema} ${this.label} [${this.displayedLabels}]`);
|
|
1319
|
+
}
|
|
1245
1320
|
if (this.view) {
|
|
1246
1321
|
let parsedDoc;
|
|
1247
|
-
const data = (
|
|
1322
|
+
const data = (_a = this.valueProvider) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
1323
|
+
if (index_1.icureFormLogging) {
|
|
1324
|
+
console.log(`Data for ${this.label} is ${JSON.stringify(data)}`);
|
|
1325
|
+
}
|
|
1248
1326
|
if (this.isMultivalued()) {
|
|
1249
|
-
const values = extractValues(data, (
|
|
1327
|
+
const values = (0, utils_2.extractValues)(data, (_b = this.metadataProvider) !== null && _b !== void 0 ? _b : (() => ({})));
|
|
1250
1328
|
parsedDoc =
|
|
1251
|
-
(
|
|
1329
|
+
(_d = (_c = this.proseMirrorSchema) === null || _c === void 0 ? void 0 : _c.topNodeType.createAndFill({}, values.map(([id, value]) => { var _a, _b, _c, _d, _e; return (_a = this.parser) === null || _a === void 0 ? void 0 : _a.parse((_e = (_d = (_c = (_b = value === null || value === void 0 ? void 0 : value[0]) === null || _b === void 0 ? void 0 : _b.value) === null || _c === void 0 ? void 0 : _c.content) === null || _d === void 0 ? void 0 : _d[this.language()]) !== null && _e !== void 0 ? _e : '', id, renderHash); }).filter((x) => !!x))) !== null && _d !== void 0 ? _d : undefined;
|
|
1252
1330
|
}
|
|
1253
1331
|
else {
|
|
1254
1332
|
let id;
|
|
1255
|
-
[id, versions] = extractSingleValue(data);
|
|
1333
|
+
[id, versions] = (0, utils_2.extractSingleValue)(data);
|
|
1256
1334
|
const version = this.selectedRevision ? versions === null || versions === void 0 ? void 0 : versions.find((v) => v.revision === this.selectedRevision) : versions === null || versions === void 0 ? void 0 : versions[0];
|
|
1257
|
-
const valueForLanguage = (
|
|
1258
|
-
valueForExistingLanguages = Object.keys((
|
|
1259
|
-
parsedDoc = valueForLanguage ? (
|
|
1335
|
+
const valueForLanguage = (_g = (_f = (_e = version === null || version === void 0 ? void 0 : version.value) === null || _e === void 0 ? void 0 : _e.content) === null || _f === void 0 ? void 0 : _f[this.language()]) !== null && _g !== void 0 ? _g : '';
|
|
1336
|
+
valueForExistingLanguages = Object.keys((_j = (_h = version === null || version === void 0 ? void 0 : version.value) === null || _h === void 0 ? void 0 : _h.content) !== null && _j !== void 0 ? _j : {});
|
|
1337
|
+
parsedDoc = valueForLanguage ? (_l = (_k = this.parser) === null || _k === void 0 ? void 0 : _k.parse(valueForLanguage)) !== null && _l !== void 0 ? _l : undefined : undefined;
|
|
1260
1338
|
rev = version === null || version === void 0 ? void 0 : version.revision;
|
|
1261
|
-
metadata = id && rev !== undefined ? (
|
|
1339
|
+
metadata = id && rev !== undefined ? (_r = (_q = (_p = (_m = this.metadataProvider) === null || _m === void 0 ? void 0 : _m.call(this, id, (_o = versions === null || versions === void 0 ? void 0 : versions.map((v) => v.revision)) !== null && _o !== void 0 ? _o : [])) === null || _p === void 0 ? void 0 : _p[id]) === null || _q === void 0 ? void 0 : _q.find((m) => m.revision === rev)) === null || _r === void 0 ? void 0 : _r.value : undefined;
|
|
1262
1340
|
}
|
|
1263
1341
|
if (parsedDoc) {
|
|
1264
1342
|
const selection = this.view.state.selection;
|
|
@@ -1268,16 +1346,16 @@ export class IcureTextField extends Field {
|
|
|
1268
1346
|
if (lastPos < selAnchor || lastPos < selHead) {
|
|
1269
1347
|
console.log(`Constraining selection to ${Math.min(selAnchor, lastPos)} - ${Math.min(selHead, lastPos)}`);
|
|
1270
1348
|
}
|
|
1271
|
-
const newState = EditorState.create({
|
|
1349
|
+
const newState = prosemirror_state_1.EditorState.create({
|
|
1272
1350
|
schema: this.view.state.schema,
|
|
1273
1351
|
doc: parsedDoc,
|
|
1274
1352
|
plugins: this.view.state.plugins,
|
|
1275
|
-
selection: new TextSelection(parsedDoc.resolve(Math.min(selAnchor, lastPos)), parsedDoc.resolve(Math.min(selHead, lastPos))),
|
|
1353
|
+
selection: new prosemirror_state_1.TextSelection(parsedDoc.resolve(Math.min(selAnchor, lastPos)), parsedDoc.resolve(Math.min(selHead, lastPos))),
|
|
1276
1354
|
});
|
|
1277
1355
|
this.view.updateState(newState);
|
|
1278
1356
|
}
|
|
1279
1357
|
else {
|
|
1280
|
-
this.view.updateState(EditorState.create({
|
|
1358
|
+
this.view.updateState(prosemirror_state_1.EditorState.create({
|
|
1281
1359
|
schema: this.view.state.schema,
|
|
1282
1360
|
doc: undefined,
|
|
1283
1361
|
plugins: this.view.state.plugins,
|
|
@@ -1285,39 +1363,61 @@ export class IcureTextField extends Field {
|
|
|
1285
1363
|
}));
|
|
1286
1364
|
}
|
|
1287
1365
|
}
|
|
1288
|
-
return html `
|
|
1366
|
+
return (0, lit_1.html) `
|
|
1289
1367
|
<div id="root" class="${this.visible ? 'icure-text-field' : 'hidden'}" data-placeholder=${this.placeholder}>
|
|
1290
|
-
${this.displayedLabels ? generateLabels(this.displayedLabels, this.language(), this.translate ? this.translationProvider : undefined) : nothing}
|
|
1368
|
+
${this.displayedLabels ? (0, utils_1.generateLabels)(this.displayedLabels, this.language(), this.translate ? this.translationProvider : undefined) : lit_1.nothing}
|
|
1291
1369
|
<div class="icure-input-metadata-container">
|
|
1292
1370
|
<div class="icure-input ${validationError ? 'icure-input__validationError' : ''} ${this.displayMetadata && metadata ? 'icure-input__withMetadata' : ''}">
|
|
1293
1371
|
<div id="editor" class="${this.schema}" style="min-height: calc( ${this.lines}rem + 5px )"></div>
|
|
1372
|
+
${!this.displayMetadata && this.defaultValueProvider ? (0, lit_1.html) `<div id="reset" class="reset-button" @click="${() => __awaiter(this, void 0, void 0, function* () { return yield this.reset(renderHash); })}">${paths_1.resetPicto}</div` : lit_1.nothing}
|
|
1294
1373
|
</div>
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1374
|
+
${this.displayMetadata && metadata
|
|
1375
|
+
? (0, lit_1.html) `
|
|
1376
|
+
<div class="icure-metadata-container ${validationError ? 'icure-metadata-container__validationError' : ''}">
|
|
1377
|
+
<icure-metadata-buttons-bar
|
|
1378
|
+
.metadata="${metadata}"
|
|
1379
|
+
.revision="${rev}"
|
|
1380
|
+
.versions="${versions !== null && versions !== void 0 ? versions : []}"
|
|
1381
|
+
.valueId="${(_t = (0, utils_2.extractSingleValue)((_s = this.valueProvider) === null || _s === void 0 ? void 0 : _s.call(this))) === null || _t === void 0 ? void 0 : _t[0]}"
|
|
1382
|
+
.defaultLanguage="${this.defaultLanguage}"
|
|
1383
|
+
.selectedLanguage="${this.selectedLanguage}"
|
|
1384
|
+
.languages="${this.languages}"
|
|
1385
|
+
.handleReset="${() => this.reset(renderHash)}"
|
|
1386
|
+
.handleMetadataChanged="${this.handleMetadataChanged}"
|
|
1387
|
+
.handleLanguageSelected="${(iso) => (this.selectedLanguage = iso)}"
|
|
1388
|
+
.handleRevisionSelected="${(rev) => (this.selectedRevision = rev)}"
|
|
1389
|
+
.ownersProvider="${this.ownersProvider}"
|
|
1390
|
+
.existingLanguages="${valueForExistingLanguages !== null && valueForExistingLanguages !== void 0 ? valueForExistingLanguages : undefined}"
|
|
1391
|
+
/>
|
|
1392
|
+
</div>
|
|
1393
|
+
`
|
|
1315
1394
|
: ''}
|
|
1395
|
+
</div>
|
|
1396
|
+
${this.pasteWarning ? (0, lit_1.html) `<div class="paste-warning">⚠️ Invalid paste content. The pasted content could not be inserted into this field.</div>` : lit_1.nothing}
|
|
1397
|
+
<div class="error">${validationErrors.map(([, error]) => { var _a; return (0, lit_1.html) `<div>${(_a = this.translationProvider) === null || _a === void 0 ? void 0 : _a.call(this, this.language(), error)}</div>`; })}</div>
|
|
1316
1398
|
</div>
|
|
1317
|
-
<div class="error">${(_w = this.validationErrorsProvider) === null || _w === void 0 ? void 0 : _w.call(this).map(([, error]) => { var _a; return html `<div>${(_a = this.translationProvider) === null || _a === void 0 ? void 0 : _a.call(this, this.language(), error)}</div>`; })}</div>
|
|
1318
1399
|
</div>
|
|
1319
1400
|
`;
|
|
1320
1401
|
}
|
|
1402
|
+
reset(renderHash) {
|
|
1403
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1404
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1405
|
+
if (this.view) {
|
|
1406
|
+
const defaultValue = yield ((_a = this.defaultValueProvider) === null || _a === void 0 ? void 0 : _a.call(this));
|
|
1407
|
+
const contentForLanguage = (_e = (_c = (_b = defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.content) === null || _b === void 0 ? void 0 : _b[this.language()]) !== null && _c !== void 0 ? _c : (_d = defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.content) === null || _d === void 0 ? void 0 : _d[this.defaultLanguage]) !== null && _e !== void 0 ? _e : (_f = defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.content) === null || _f === void 0 ? void 0 : _f['*'];
|
|
1408
|
+
const newState = prosemirror_state_1.EditorState.create({
|
|
1409
|
+
schema: this.view.state.schema,
|
|
1410
|
+
doc: (_h = (_g = this.parser) === null || _g === void 0 ? void 0 : _g.parse(contentForLanguage !== null && contentForLanguage !== void 0 ? contentForLanguage : {
|
|
1411
|
+
type: 'string',
|
|
1412
|
+
value: '',
|
|
1413
|
+
}, undefined, renderHash)) !== null && _h !== void 0 ? _h : undefined,
|
|
1414
|
+
plugins: this.view.state.plugins,
|
|
1415
|
+
selection: undefined,
|
|
1416
|
+
});
|
|
1417
|
+
this.view.updateState(newState);
|
|
1418
|
+
}
|
|
1419
|
+
});
|
|
1420
|
+
}
|
|
1321
1421
|
mouseDown() {
|
|
1322
1422
|
this.mouseCount++;
|
|
1323
1423
|
}
|
|
@@ -1331,20 +1431,35 @@ export class IcureTextField extends Field {
|
|
|
1331
1431
|
});
|
|
1332
1432
|
}
|
|
1333
1433
|
}
|
|
1434
|
+
showPasteWarning() {
|
|
1435
|
+
// Clear any existing timeout
|
|
1436
|
+
if (this.pasteWarningTimeout !== undefined) {
|
|
1437
|
+
window.clearTimeout(this.pasteWarningTimeout);
|
|
1438
|
+
}
|
|
1439
|
+
// Show the warning
|
|
1440
|
+
this.pasteWarning = true;
|
|
1441
|
+
// Auto-hide after 3 seconds
|
|
1442
|
+
this.pasteWarningTimeout = window.setTimeout(() => {
|
|
1443
|
+
this.pasteWarning = false;
|
|
1444
|
+
this.pasteWarningTimeout = undefined;
|
|
1445
|
+
}, 3000);
|
|
1446
|
+
}
|
|
1334
1447
|
firstUpdated() {
|
|
1335
1448
|
var _a;
|
|
1336
1449
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
1337
1450
|
const cmp = this;
|
|
1338
|
-
const pms = (this.proseMirrorSchema = createSchema(this.schema, (t, c, isC) => (isC ? this.codeColorProvider(t, c) : this.linkColorProvider(t, c)), this.codeContentProvider));
|
|
1339
|
-
|
|
1340
|
-
this.
|
|
1451
|
+
const pms = (this.proseMirrorSchema = (0, schema_1.createSchema)(this.schema, (t, c, isC) => (isC ? this.codeColorProvider(t, c) : this.linkColorProvider(t, c)), this.codeContentProvider));
|
|
1452
|
+
const parser = this.makeParser(this.schema, pms);
|
|
1453
|
+
this.parser = parser;
|
|
1454
|
+
const serializer = this.makeSerializer(this.schema, pms);
|
|
1455
|
+
this.serializer = serializer;
|
|
1341
1456
|
this.primitiveTypeExtractor = this.makePrimitiveExtractor(this.schema);
|
|
1342
1457
|
this.primitiveTypesExtractor = this.makePrimitivesExtractor(this.schema);
|
|
1343
1458
|
this.codesExtractor = this.makeCodesExtractor(this.schema);
|
|
1344
1459
|
this.container = ((_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('editor')) || undefined;
|
|
1345
1460
|
if (this.container) {
|
|
1346
|
-
const br = pms.nodes.
|
|
1347
|
-
const
|
|
1461
|
+
const br = pms.nodes.hard_break;
|
|
1462
|
+
const hard_break = (0, prosemirror_commands_1.chainCommands)(prosemirror_commands_1.exitCode, (state, dispatch) => {
|
|
1348
1463
|
dispatch && dispatch(state.tr.replaceSelectionWith(br.create()).scrollIntoView());
|
|
1349
1464
|
return true;
|
|
1350
1465
|
});
|
|
@@ -1352,32 +1467,32 @@ export class IcureTextField extends Field {
|
|
|
1352
1467
|
const link = yield this.linksProvider(sug);
|
|
1353
1468
|
return (link && cmp.view && cmp.view.state.tr.replaceWith(from, to, pms.text(sug.text, [pms.mark('link', link)]))) || undefined;
|
|
1354
1469
|
});
|
|
1355
|
-
const headingsKeymap = keymap([1, 2, 3, 4, 5, 6].reduce((acc, idx) => {
|
|
1356
|
-
return Object.assign(acc, { [`Mod-ctrl-${idx}`]: setBlockType(pms.nodes.heading, { level: '' + idx }) });
|
|
1470
|
+
const headingsKeymap = (0, prosemirror_keymap_1.keymap)([1, 2, 3, 4, 5, 6].reduce((acc, idx) => {
|
|
1471
|
+
return Object.assign(acc, { [`Mod-ctrl-${idx}`]: (0, prosemirror_commands_1.setBlockType)(pms.nodes.heading, { level: '' + idx }) });
|
|
1357
1472
|
}, {}));
|
|
1358
1473
|
//Currently take the first piece of data if it is available
|
|
1359
|
-
this.view = new EditorView(this.container, {
|
|
1360
|
-
state: EditorState.create({
|
|
1474
|
+
this.view = new prosemirror_view_1.EditorView(this.container, {
|
|
1475
|
+
state: prosemirror_state_1.EditorState.create({
|
|
1361
1476
|
doc: undefined,
|
|
1362
1477
|
schema: this.proseMirrorSchema,
|
|
1363
1478
|
plugins: [
|
|
1364
|
-
history(),
|
|
1479
|
+
(0, prosemirror_history_1.history)(),
|
|
1365
1480
|
this.links
|
|
1366
|
-
? new Plugin({
|
|
1481
|
+
? new prosemirror_state_1.Plugin({
|
|
1367
1482
|
view(editorView) {
|
|
1368
|
-
return new SelectionCompanion(editorView, () => cmp.mouseCount > 0);
|
|
1483
|
+
return new selection_companion_1.SelectionCompanion(editorView, () => cmp.mouseCount > 0);
|
|
1369
1484
|
},
|
|
1370
1485
|
})
|
|
1371
1486
|
: null,
|
|
1372
1487
|
this.suggestions
|
|
1373
|
-
? new Plugin({
|
|
1488
|
+
? new prosemirror_state_1.Plugin({
|
|
1374
1489
|
view(editorView) {
|
|
1375
|
-
return (cmp.suggestionPalette = new SuggestionPalette(pms, editorView, (terms) => cmp.suggestionProvider(terms), () => cmp.suggestionStopWords));
|
|
1490
|
+
return (cmp.suggestionPalette = new suggestion_palette_1.SuggestionPalette(pms, editorView, (terms) => cmp.suggestionProvider(terms), () => cmp.suggestionStopWords));
|
|
1376
1491
|
},
|
|
1377
1492
|
})
|
|
1378
1493
|
: null,
|
|
1379
1494
|
this.suggestions
|
|
1380
|
-
? keymap({
|
|
1495
|
+
? (0, prosemirror_keymap_1.keymap)({
|
|
1381
1496
|
Tab: () => {
|
|
1382
1497
|
return (cmp.suggestionPalette && this.view && cmp.suggestionPalette.focusOrInsert(this.view, replaceRangeWithSuggestion)) || false;
|
|
1383
1498
|
},
|
|
@@ -1392,13 +1507,47 @@ export class IcureTextField extends Field {
|
|
|
1392
1507
|
},
|
|
1393
1508
|
})
|
|
1394
1509
|
: null,
|
|
1395
|
-
keymap({ 'Mod-z': undo, 'Mod-Shift-z': redo }),
|
|
1396
|
-
keymap(Object.assign({}, pms.marks.strong ? { 'Mod-b': toggleMark(pms.marks.strong) } : {}, pms.marks.em ? { 'Mod-i': toggleMark(pms.marks.em) } : {}, pms.nodes.paragraph ? { 'Alt-ArrowUp': joinUp } : {}, pms.nodes.paragraph ? { 'Alt-ArrowDown': joinDown } : {}, pms.nodes.paragraph ? { 'Alt-Enter':
|
|
1510
|
+
(0, prosemirror_keymap_1.keymap)({ 'Mod-z': prosemirror_history_1.undo, 'Mod-Shift-z': prosemirror_history_1.redo }),
|
|
1511
|
+
(0, prosemirror_keymap_1.keymap)(Object.assign({}, pms.marks.strong ? { 'Mod-b': (0, prosemirror_commands_1.toggleMark)(pms.marks.strong) } : {}, pms.marks.em ? { 'Mod-i': (0, prosemirror_commands_1.toggleMark)(pms.marks.em) } : {}, pms.nodes.paragraph ? { 'Alt-ArrowUp': prosemirror_commands_1.joinUp } : {}, pms.nodes.paragraph ? { 'Alt-ArrowDown': prosemirror_commands_1.joinDown } : {}, pms.nodes.paragraph ? { 'Alt-Enter': hard_break } : {}, pms.nodes.paragraph ? { 'Shift-Enter': hard_break } : {}, pms.nodes.ordered_list ? { 'Shift-ctrl-1': (0, prosemirror_schema_list_1.wrapInList)(pms.nodes.ordered_list) } : {}, pms.nodes.bullet_list ? { 'Shift-ctrl-*': (0, prosemirror_schema_list_1.wrapInList)(pms.nodes.bullet_list) } : {}, pms.nodes.blockquote ? { 'Shift-ctrl-w': (0, prosemirror_commands_2.wrapInIfNeeded)(pms.nodes.blockquote) } : {}, pms.nodes.blockquote ? { 'Shift-ctrl-u': (0, prosemirror_commands_2.unwrapFrom)(pms.nodes.blockquote) } : {}, pms.nodes.paragraph ? { 'Mod-ctrl-0': (0, prosemirror_commands_1.setBlockType)(pms.nodes.paragraph) } : {}, pms.nodes.paragraph ? { 'Shift-ctrl-0': (0, prosemirror_commands_1.setBlockType)(pms.nodes.paragraph) } : {}, pms.nodes.list_item ? { Enter: (0, prosemirror_schema_list_1.splitListItem)(pms.nodes.list_item) } : {}, pms.nodes.ordered_list || pms.nodes.bullet_list ? { 'Mod-(': (0, prosemirror_schema_list_1.liftListItem)(pms.nodes.list_item) } : {}, pms.nodes.ordered_list || pms.nodes.bullet_list ? { 'Mod-[': (0, prosemirror_schema_list_1.liftListItem)(pms.nodes.list_item) } : {}, pms.nodes.ordered_list || pms.nodes.bullet_list ? { 'Mod-)': (0, prosemirror_schema_list_1.sinkListItem)(pms.nodes.list_item) } : {}, pms.nodes.ordered_list || pms.nodes.bullet_list ? { 'Mod-]': (0, prosemirror_schema_list_1.sinkListItem)(pms.nodes.list_item) } : {})),
|
|
1397
1512
|
pms.nodes.heading ? headingsKeymap : null,
|
|
1398
|
-
maskPlugin(),
|
|
1399
|
-
regexpPlugin(),
|
|
1400
|
-
hasContentClassPlugin(this.shadowRoot || undefined),
|
|
1401
|
-
|
|
1513
|
+
(0, mask_plugin_1.maskPlugin)(),
|
|
1514
|
+
(0, regexp_plugin_1.regexpPlugin)(),
|
|
1515
|
+
(0, has_content_class_plugin_1.hasContentClassPlugin)(this.shadowRoot || undefined),
|
|
1516
|
+
new prosemirror_state_1.Plugin({
|
|
1517
|
+
props: {
|
|
1518
|
+
transformPasted(slice) {
|
|
1519
|
+
var _a;
|
|
1520
|
+
let ok = true;
|
|
1521
|
+
slice.content.forEach((node) => {
|
|
1522
|
+
if (!pms.nodes[node.type.name]) {
|
|
1523
|
+
ok = false;
|
|
1524
|
+
}
|
|
1525
|
+
});
|
|
1526
|
+
const newSlice = ok
|
|
1527
|
+
? slice
|
|
1528
|
+
: !!pms.nodes.paragraph
|
|
1529
|
+
? new prosemirror_model_1.Slice(prosemirror_model_1.Fragment.fromArray(slice.content
|
|
1530
|
+
.textBetween(0, slice.content.size, ' ')
|
|
1531
|
+
.split('\n')
|
|
1532
|
+
.map((line) => pms.nodes.paragraph.create({}, [pms.text(line)]))), 0, 0)
|
|
1533
|
+
: new prosemirror_model_1.Slice(prosemirror_model_1.Fragment.fromArray([pms.text(slice.content.textBetween(0, slice.content.size, ' ').split('\n').join(' '))]), 0, 0);
|
|
1534
|
+
try {
|
|
1535
|
+
const parsed = parser.parse({ type: 'string', value: (_a = newSlice === null || newSlice === void 0 ? void 0 : newSlice.content) === null || _a === void 0 ? void 0 : _a.content.map((n) => serializer.serialize(n)).join('') });
|
|
1536
|
+
if (!parsed) {
|
|
1537
|
+
cmp.showPasteWarning();
|
|
1538
|
+
return new prosemirror_model_1.Slice(prosemirror_model_1.Fragment.fromArray([]), 0, 0);
|
|
1539
|
+
}
|
|
1540
|
+
return newSlice;
|
|
1541
|
+
}
|
|
1542
|
+
catch (e) {
|
|
1543
|
+
//Invalid paste content
|
|
1544
|
+
cmp.showPasteWarning();
|
|
1545
|
+
return new prosemirror_model_1.Slice(prosemirror_model_1.Fragment.fromArray([]), 0, 0);
|
|
1546
|
+
}
|
|
1547
|
+
},
|
|
1548
|
+
},
|
|
1549
|
+
}),
|
|
1550
|
+
(0, prosemirror_keymap_1.keymap)(prosemirror_commands_1.baseKeymap),
|
|
1402
1551
|
]
|
|
1403
1552
|
.filter((x) => !!x)
|
|
1404
1553
|
.map((x) => x),
|
|
@@ -1409,7 +1558,7 @@ export class IcureTextField extends Field {
|
|
|
1409
1558
|
this.updateValue(view.state.tr);
|
|
1410
1559
|
},
|
|
1411
1560
|
focus: (view) => {
|
|
1412
|
-
this.schema === 'measure' && measureOnFocusHandler(view);
|
|
1561
|
+
this.schema === 'measure' && (0, measure_schema_1.measureOnFocusHandler)(view);
|
|
1413
1562
|
},
|
|
1414
1563
|
click: (view, event) => {
|
|
1415
1564
|
var _a;
|
|
@@ -1426,7 +1575,7 @@ export class IcureTextField extends Field {
|
|
|
1426
1575
|
},
|
|
1427
1576
|
},
|
|
1428
1577
|
dispatchTransaction: (tro) => {
|
|
1429
|
-
const tr = this.schema === 'measure' ? measureTransactionMapper(tro) : tro;
|
|
1578
|
+
const tr = this.schema === 'measure' ? (0, measure_schema_1.measureTransactionMapper)(tro) : tro;
|
|
1430
1579
|
console.log(`Setting selection to ${tr.selection.from} - ${tr.selection.to}`);
|
|
1431
1580
|
this.view && this.view.updateState(this.view.state.apply(tr));
|
|
1432
1581
|
if (this.view && tr.doc != tr.before && this.handleValueChanged) {
|
|
@@ -1446,7 +1595,7 @@ export class IcureTextField extends Field {
|
|
|
1446
1595
|
}
|
|
1447
1596
|
}
|
|
1448
1597
|
makeParser(schemaName, pms) {
|
|
1449
|
-
const tokenizer =
|
|
1598
|
+
const tokenizer = (0, markdown_it_1.default)('commonmark', { html: false });
|
|
1450
1599
|
return schemaName.includes('tokens-list')
|
|
1451
1600
|
? {
|
|
1452
1601
|
parse: (value, id, renderHash) => {
|
|
@@ -1464,7 +1613,7 @@ export class IcureTextField extends Field {
|
|
|
1464
1613
|
parse: (value) => {
|
|
1465
1614
|
var _a, _b;
|
|
1466
1615
|
if ((value === null || value === void 0 ? void 0 : value.type) === 'datetime') {
|
|
1467
|
-
const dateString = (_a = anyDateToDate(value.value)) === null || _a === void 0 ? void 0 : _a.toISOString().replace(/T.*/, '');
|
|
1616
|
+
const dateString = (_a = (0, dates_1.anyDateToDate)(value.value)) === null || _a === void 0 ? void 0 : _a.toISOString().replace(/T.*/, '');
|
|
1468
1617
|
return pms.node('paragraph', {}, [pms.node('date', {}, value ? [pms.text(dateString !== null && dateString !== void 0 ? dateString : '')] : [])]);
|
|
1469
1618
|
}
|
|
1470
1619
|
else if ((value === null || value === void 0 ? void 0 : value.type) === 'timestamp') {
|
|
@@ -1497,11 +1646,13 @@ export class IcureTextField extends Field {
|
|
|
1497
1646
|
: schemaName === 'measure'
|
|
1498
1647
|
? {
|
|
1499
1648
|
parse: (value) => {
|
|
1500
|
-
var _a, _b;
|
|
1649
|
+
var _a, _b, _c;
|
|
1501
1650
|
if (value.type !== 'measure') {
|
|
1502
1651
|
return undefined;
|
|
1503
1652
|
}
|
|
1504
|
-
const decimal =
|
|
1653
|
+
const decimal = value.value !== undefined
|
|
1654
|
+
? value.value.toFixed(((_a = this.styleOptions) === null || _a === void 0 ? void 0 : _a.decimalPlaces) || ((_c = (_b = this.styleOptions) === null || _b === void 0 ? void 0 : _b.decimalPlaces) === null || _c === void 0 ? void 0 : _c.toString()) === '0' ? parseInt(this.styleOptions.decimalPlaces.toString()) : 2)
|
|
1655
|
+
: '';
|
|
1505
1656
|
const unit = value.unit;
|
|
1506
1657
|
return pms.node('paragraph', {}, [pms.node('decimal', {}, decimal && decimal.length ? [pms.text(decimal)] : [])].concat(unit && unit.length ? [pms.node('unit', {}, [pms.text(unit)])] : []));
|
|
1507
1658
|
},
|
|
@@ -1509,7 +1660,14 @@ export class IcureTextField extends Field {
|
|
|
1509
1660
|
: schemaName === 'decimal'
|
|
1510
1661
|
? {
|
|
1511
1662
|
parse: (value) => {
|
|
1512
|
-
|
|
1663
|
+
var _a, _b, _c;
|
|
1664
|
+
return value.type === 'number'
|
|
1665
|
+
? pms.node('paragraph', {}, [
|
|
1666
|
+
pms.node('decimal', {}, [
|
|
1667
|
+
pms.text(value.value.toFixed(((_a = this.styleOptions) === null || _a === void 0 ? void 0 : _a.decimalPlaces) || ((_c = (_b = this.styleOptions) === null || _b === void 0 ? void 0 : _b.decimalPlaces) === null || _c === void 0 ? void 0 : _c.toString()) === '0' ? parseInt(this.styleOptions.decimalPlaces.toString()) : 2)),
|
|
1668
|
+
]),
|
|
1669
|
+
])
|
|
1670
|
+
: undefined;
|
|
1513
1671
|
},
|
|
1514
1672
|
}
|
|
1515
1673
|
: schemaName === 'date-time'
|
|
@@ -1519,8 +1677,8 @@ export class IcureTextField extends Field {
|
|
|
1519
1677
|
if (value.type !== 'datetime') {
|
|
1520
1678
|
return undefined;
|
|
1521
1679
|
}
|
|
1522
|
-
const date = (_a = anyDateToDate(value.value)) === null || _a === void 0 ? void 0 : _a.toISOString().replace(/T.*/, '');
|
|
1523
|
-
const time = (_b = anyDateToDate(value.value)) === null || _b === void 0 ? void 0 : _b.toISOString().replace(/.+?T(..):(..).*/, '$1:$2');
|
|
1680
|
+
const date = (_a = (0, dates_1.anyDateToDate)(value.value)) === null || _a === void 0 ? void 0 : _a.toISOString().replace(/T.*/, '');
|
|
1681
|
+
const time = (_b = (0, dates_1.anyDateToDate)(value.value)) === null || _b === void 0 ? void 0 : _b.toISOString().replace(/.+?T(..):(..).*/, '$1:$2');
|
|
1524
1682
|
return pms.node('paragraph', {}, [
|
|
1525
1683
|
pms.node('date', {}, date && date.length ? [pms.text(date)] : [pms.text(' ')]),
|
|
1526
1684
|
pms.node('time', {}, time && time.length ? [pms.text(time)] : [pms.text(' ')]),
|
|
@@ -1528,7 +1686,7 @@ export class IcureTextField extends Field {
|
|
|
1528
1686
|
},
|
|
1529
1687
|
}
|
|
1530
1688
|
: schemaName === 'text-document'
|
|
1531
|
-
? new SpacePreservingMarkdownParser(new MarkdownParser(pms,
|
|
1689
|
+
? new markdown_1.SpacePreservingMarkdownParser(new prosemirror_markdown_1.MarkdownParser(pms, (0, markdown_it_1.default)('commonmark', { html: false }), {
|
|
1532
1690
|
blockquote: { block: 'blockquote' },
|
|
1533
1691
|
paragraph: { block: 'paragraph' },
|
|
1534
1692
|
list_item: { block: 'list_item' },
|
|
@@ -1547,10 +1705,10 @@ export class IcureTextField extends Field {
|
|
|
1547
1705
|
});
|
|
1548
1706
|
},
|
|
1549
1707
|
},
|
|
1550
|
-
hardbreak: { node: '
|
|
1551
|
-
em: hasMark(pms.spec.marks, 'em') ? { mark: 'em' } : { ignore: true },
|
|
1552
|
-
strong: hasMark(pms.spec.marks, 'strong') ? { mark: 'strong' } : { ignore: true },
|
|
1553
|
-
link: hasMark(pms.spec.marks, 'link')
|
|
1708
|
+
hardbreak: { node: 'hard_break' },
|
|
1709
|
+
em: (0, prosemirror_utils_1.hasMark)(pms.spec.marks, 'em') ? { mark: 'em' } : { ignore: true },
|
|
1710
|
+
strong: (0, prosemirror_utils_1.hasMark)(pms.spec.marks, 'strong') ? { mark: 'strong' } : { ignore: true },
|
|
1711
|
+
link: (0, prosemirror_utils_1.hasMark)(pms.spec.marks, 'link')
|
|
1554
1712
|
? {
|
|
1555
1713
|
mark: 'link',
|
|
1556
1714
|
getAttrs: (tok) => ({
|
|
@@ -1560,14 +1718,14 @@ export class IcureTextField extends Field {
|
|
|
1560
1718
|
}
|
|
1561
1719
|
: { ignore: true },
|
|
1562
1720
|
}))
|
|
1563
|
-
: new SpacePreservingMarkdownParser(new MarkdownParser(pms, {
|
|
1721
|
+
: new markdown_1.SpacePreservingMarkdownParser(new prosemirror_markdown_1.MarkdownParser(pms, {
|
|
1564
1722
|
parse: (src, env) => {
|
|
1565
|
-
return tokenizer.parse(src, env).filter((t) =>
|
|
1723
|
+
return tokenizer.parse(src, env).filter((t) => ['inline', 'em', 'strong', 'link'].some((typ) => t.type.startsWith(typ)));
|
|
1566
1724
|
},
|
|
1567
1725
|
}, {
|
|
1568
|
-
em: hasMark(pms.spec.marks, 'em') ? { mark: 'em' } : { ignore: true },
|
|
1569
|
-
strong: hasMark(pms.spec.marks, 'strong') ? { mark: 'strong' } : { ignore: true },
|
|
1570
|
-
link: hasMark(pms.spec.marks, 'link')
|
|
1726
|
+
em: (0, prosemirror_utils_1.hasMark)(pms.spec.marks, 'em') ? { mark: 'em' } : { ignore: true },
|
|
1727
|
+
strong: (0, prosemirror_utils_1.hasMark)(pms.spec.marks, 'strong') ? { mark: 'strong' } : { ignore: true },
|
|
1728
|
+
link: (0, prosemirror_utils_1.hasMark)(pms.spec.marks, 'link')
|
|
1571
1729
|
? {
|
|
1572
1730
|
mark: 'link',
|
|
1573
1731
|
getAttrs: (tok) => ({
|
|
@@ -1581,7 +1739,7 @@ export class IcureTextField extends Field {
|
|
|
1581
1739
|
makeSerializer(schemaName, pms) {
|
|
1582
1740
|
return schemaName === 'text-document'
|
|
1583
1741
|
? {
|
|
1584
|
-
serialize: (content) => defaultMarkdownSerializer.serialize(preprocessEmptyNodes(content, pms)),
|
|
1742
|
+
serialize: (content) => prosemirror_markdown_1.defaultMarkdownSerializer.serialize((0, markdown_1.preprocessEmptyNodes)(content, pms)),
|
|
1585
1743
|
}
|
|
1586
1744
|
: {
|
|
1587
1745
|
serialize: (content) => content.textBetween(0, content.nodeSize - 2, ' '),
|
|
@@ -1604,12 +1762,12 @@ export class IcureTextField extends Field {
|
|
|
1604
1762
|
}
|
|
1605
1763
|
makePrimitiveExtractor(schemaName) {
|
|
1606
1764
|
return schemaName === 'date'
|
|
1607
|
-
? (doc) => { var _a; return (((_a = doc === null || doc === void 0 ? void 0 : doc.firstChild) === null || _a === void 0 ? void 0 : _a.textContent) ? { type: 'datetime', value: parseInt(format(parse(doc.firstChild.textContent, 'dd/MM/yyyy', new Date()), 'yyyyMMdd')) } : undefined); }
|
|
1765
|
+
? (doc) => { var _a; return (((_a = doc === null || doc === void 0 ? void 0 : doc.firstChild) === null || _a === void 0 ? void 0 : _a.textContent) ? { type: 'datetime', value: parseInt((0, date_fns_1.format)((0, date_fns_1.parse)(doc.firstChild.textContent, 'dd/MM/yyyy', new Date()), 'yyyyMMdd')) } : undefined); }
|
|
1608
1766
|
: schemaName === 'time'
|
|
1609
1767
|
? (doc) => {
|
|
1610
1768
|
var _a;
|
|
1611
1769
|
if (((_a = doc === null || doc === void 0 ? void 0 : doc.firstChild) === null || _a === void 0 ? void 0 : _a.textContent) && !doc.firstChild.textContent.startsWith('--:')) {
|
|
1612
|
-
const value = parseInt(format(parse(doc.firstChild.textContent.replaceAll('-', '0'), 'HH:mm:ss', new Date()), 'HHmmss'));
|
|
1770
|
+
const value = parseInt((0, date_fns_1.format)((0, date_fns_1.parse)(doc.firstChild.textContent.replaceAll('-', '0'), 'HH:mm:ss', new Date()), 'HHmmss'));
|
|
1613
1771
|
console.log(`Converted time to: ${value}`);
|
|
1614
1772
|
return {
|
|
1615
1773
|
type: 'datetime',
|
|
@@ -1646,7 +1804,7 @@ export class IcureTextField extends Field {
|
|
|
1646
1804
|
return ((_a = doc === null || doc === void 0 ? void 0 : doc.firstChild) === null || _a === void 0 ? void 0 : _a.textContent) && ((_b = doc === null || doc === void 0 ? void 0 : doc.lastChild) === null || _b === void 0 ? void 0 : _b.textContent)
|
|
1647
1805
|
? {
|
|
1648
1806
|
type: 'datetime',
|
|
1649
|
-
value: parseInt(format(parse(doc.firstChild.textContent + ' ' + doc.lastChild.textContent, 'dd/MM/yyyy HH:mm:ss', new Date()), 'yyyyMMddHHmmss')),
|
|
1807
|
+
value: parseInt((0, date_fns_1.format)((0, date_fns_1.parse)(doc.firstChild.textContent + ' ' + doc.lastChild.textContent, 'dd/MM/yyyy HH:mm:ss', new Date()), 'yyyyMMddHHmmss')),
|
|
1650
1808
|
}
|
|
1651
1809
|
: undefined;
|
|
1652
1810
|
}
|
|
@@ -1665,64 +1823,69 @@ export class IcureTextField extends Field {
|
|
|
1665
1823
|
: () => [];
|
|
1666
1824
|
}
|
|
1667
1825
|
}
|
|
1826
|
+
exports.IcureTextField = IcureTextField;
|
|
1668
1827
|
__decorate([
|
|
1669
|
-
property(),
|
|
1828
|
+
(0, decorators_js_1.property)(),
|
|
1670
1829
|
__metadata("design:type", Object)
|
|
1671
1830
|
], IcureTextField.prototype, "placeholder", void 0);
|
|
1672
1831
|
__decorate([
|
|
1673
|
-
property(),
|
|
1832
|
+
(0, decorators_js_1.property)(),
|
|
1674
1833
|
__metadata("design:type", Object)
|
|
1675
1834
|
], IcureTextField.prototype, "multiline", void 0);
|
|
1676
1835
|
__decorate([
|
|
1677
|
-
property(),
|
|
1836
|
+
(0, decorators_js_1.property)(),
|
|
1678
1837
|
__metadata("design:type", Object)
|
|
1679
1838
|
], IcureTextField.prototype, "lines", void 0);
|
|
1680
1839
|
__decorate([
|
|
1681
|
-
property(),
|
|
1840
|
+
(0, decorators_js_1.property)(),
|
|
1682
1841
|
__metadata("design:type", Set)
|
|
1683
1842
|
], IcureTextField.prototype, "suggestionStopWords", void 0);
|
|
1684
1843
|
__decorate([
|
|
1685
|
-
property({ type: Boolean }),
|
|
1844
|
+
(0, decorators_js_1.property)({ type: Boolean }),
|
|
1686
1845
|
__metadata("design:type", Object)
|
|
1687
1846
|
], IcureTextField.prototype, "displayOwnerMenu", void 0);
|
|
1688
1847
|
__decorate([
|
|
1689
|
-
property({ type: Boolean }),
|
|
1848
|
+
(0, decorators_js_1.property)({ type: Boolean }),
|
|
1690
1849
|
__metadata("design:type", Object)
|
|
1691
1850
|
], IcureTextField.prototype, "suggestions", void 0);
|
|
1692
1851
|
__decorate([
|
|
1693
|
-
property({ type: Boolean }),
|
|
1852
|
+
(0, decorators_js_1.property)({ type: Boolean }),
|
|
1694
1853
|
__metadata("design:type", Object)
|
|
1695
1854
|
], IcureTextField.prototype, "links", void 0);
|
|
1696
1855
|
__decorate([
|
|
1697
|
-
property(),
|
|
1856
|
+
(0, decorators_js_1.property)(),
|
|
1698
1857
|
__metadata("design:type", Function)
|
|
1699
1858
|
], IcureTextField.prototype, "linksProvider", void 0);
|
|
1700
1859
|
__decorate([
|
|
1701
|
-
property(),
|
|
1860
|
+
(0, decorators_js_1.property)(),
|
|
1702
1861
|
__metadata("design:type", Function)
|
|
1703
1862
|
], IcureTextField.prototype, "suggestionProvider", void 0);
|
|
1704
1863
|
__decorate([
|
|
1705
|
-
property(),
|
|
1864
|
+
(0, decorators_js_1.property)(),
|
|
1706
1865
|
__metadata("design:type", Function)
|
|
1707
1866
|
], IcureTextField.prototype, "codeColorProvider", void 0);
|
|
1708
1867
|
__decorate([
|
|
1709
|
-
property(),
|
|
1868
|
+
(0, decorators_js_1.property)(),
|
|
1710
1869
|
__metadata("design:type", Function)
|
|
1711
1870
|
], IcureTextField.prototype, "linkColorProvider", void 0);
|
|
1712
1871
|
__decorate([
|
|
1713
|
-
property(),
|
|
1872
|
+
(0, decorators_js_1.property)(),
|
|
1714
1873
|
__metadata("design:type", Function)
|
|
1715
1874
|
], IcureTextField.prototype, "codeContentProvider", void 0);
|
|
1716
1875
|
__decorate([
|
|
1717
|
-
property(),
|
|
1876
|
+
(0, decorators_js_1.property)(),
|
|
1718
1877
|
__metadata("design:type", String)
|
|
1719
1878
|
], IcureTextField.prototype, "schema", void 0);
|
|
1720
1879
|
__decorate([
|
|
1721
|
-
state(),
|
|
1722
|
-
__metadata("design:type", EditorView)
|
|
1880
|
+
(0, decorators_js_1.state)(),
|
|
1881
|
+
__metadata("design:type", prosemirror_view_1.EditorView)
|
|
1723
1882
|
], IcureTextField.prototype, "view", void 0);
|
|
1883
|
+
__decorate([
|
|
1884
|
+
(0, decorators_js_1.state)(),
|
|
1885
|
+
__metadata("design:type", Object)
|
|
1886
|
+
], IcureTextField.prototype, "pasteWarning", void 0);
|
|
1724
1887
|
// Register the new element with the browser.
|
|
1725
|
-
|
|
1888
|
+
class MetadataButtonBarWrapper extends lit_1.LitElement {
|
|
1726
1889
|
render() {
|
|
1727
1890
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
1728
1891
|
console.log('Rendering metadata buttons');
|
|
@@ -1738,22 +1901,23 @@ export class MetadataButtonBarWrapper extends LitElement {
|
|
|
1738
1901
|
const op = (terms, ids, specialties) => {
|
|
1739
1902
|
return parent.ownersProvider(terms, ids, specialties);
|
|
1740
1903
|
};
|
|
1741
|
-
return html `<icure-metadata-buttons-bar .metadata="${metadata}" .revision="${rev}" .versions="${versions}" .valueId="${(_o = extractSingleValue((_m = parent.valueProvider) === null || _m === void 0 ? void 0 : _m.call(parent))) === null || _o === void 0 ? void 0 : _o[0]}"
|
|
1904
|
+
return (0, lit_1.html) `<icure-metadata-buttons-bar .metadata="${metadata}" .revision="${rev}" .versions="${versions}" .valueId="${(_o = (0, utils_2.extractSingleValue)((_m = parent.valueProvider) === null || _m === void 0 ? void 0 : _m.call(parent))) === null || _o === void 0 ? void 0 : _o[0]}"
|
|
1742
1905
|
.defaultLanguage="${parent.defaultLanguage}" .selectedLanguage="${parent.selectedLanguage}" .languages="${parent.languages}" .handleMetadataChanged="${parent.handleMetadataChanged}"
|
|
1743
1906
|
.handleLanguageSelected="${(iso) => (parent.selectedLanguage = iso)}" .handleRevisionSelected="${(rev) => (parent.selectedRevision = rev)}" .ownersProvider="${op}"
|
|
1744
1907
|
style="white-space: nowrap; padding-top: 1px" " />`;
|
|
1745
1908
|
}
|
|
1746
1909
|
}
|
|
1910
|
+
exports.MetadataButtonBarWrapper = MetadataButtonBarWrapper;
|
|
1747
1911
|
__decorate([
|
|
1748
|
-
property(),
|
|
1912
|
+
(0, decorators_js_1.property)(),
|
|
1749
1913
|
__metadata("design:type", String)
|
|
1750
1914
|
], MetadataButtonBarWrapper.prototype, "id", void 0);
|
|
1751
1915
|
__decorate([
|
|
1752
|
-
property(),
|
|
1916
|
+
(0, decorators_js_1.property)(),
|
|
1753
1917
|
__metadata("design:type", String)
|
|
1754
1918
|
], MetadataButtonBarWrapper.prototype, "rerender", void 0);
|
|
1755
1919
|
__decorate([
|
|
1756
|
-
state(),
|
|
1920
|
+
(0, decorators_js_1.state)(),
|
|
1757
1921
|
__metadata("design:type", String)
|
|
1758
1922
|
], MetadataButtonBarWrapper.prototype, "selectedRevision", void 0);
|
|
1759
1923
|
//# sourceMappingURL=index.js.map
|