@icure/form 2.0.11 → 2.1.0
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.4-31bc1b0001-934b0a0460.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.4.0-e5ef5fbeba-e267c25576.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.1-3875228c32-b9bbc9c089.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.23-68ac3c21d2-aad6c9ddc4.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.1-b5bc114ced-5925326176.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.1-e3722d4f4a-de07c66945.zip +0 -0
- package/.yarn/cache/lit-npm-2.8.0-92bb1333a4-2480e733f7.zip +0 -0
- package/.yarn/cache/lit-npm-3.3.1-8f683c51f1-fb88f1ff80.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.4.1-ad68c86bb7-90f9bf59bc.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.3-95b23ed79b-2720e49795.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.3-d6540e44ad-28857d935c.zip +0 -0
- package/.yarn/cache/prosemirror-transform-npm-1.10.4-f765dfe652-7b8b3ed82c.zip +0 -0
- package/.yarn/cache/prosemirror-view-npm-1.41.2-7f800b4d2b-263f15bec9.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 +5 -2
- package/components/icure-text-field/index.js +252 -142
- 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 = '';
|
|
@@ -1157,9 +1202,14 @@ export class IcureTextField extends Field {
|
|
|
1157
1202
|
this.trToSave = undefined;
|
|
1158
1203
|
}
|
|
1159
1204
|
_handleClickOutside(event) {
|
|
1205
|
+
var _a;
|
|
1206
|
+
const pm = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll('.ProseMirror')[0];
|
|
1160
1207
|
if (!event.composedPath().includes(this)) {
|
|
1161
1208
|
event.stopPropagation();
|
|
1162
1209
|
}
|
|
1210
|
+
else if (pm && !event.composedPath().includes(pm)) {
|
|
1211
|
+
pm.focus();
|
|
1212
|
+
}
|
|
1163
1213
|
}
|
|
1164
1214
|
connectedCallback() {
|
|
1165
1215
|
super.connectedCallback();
|
|
@@ -1177,7 +1227,7 @@ export class IcureTextField extends Field {
|
|
|
1177
1227
|
}
|
|
1178
1228
|
static get styles() {
|
|
1179
1229
|
return [
|
|
1180
|
-
css `
|
|
1230
|
+
(0, lit_1.css) `
|
|
1181
1231
|
.unit::before {
|
|
1182
1232
|
content: ' ';
|
|
1183
1233
|
}
|
|
@@ -1191,13 +1241,13 @@ export class IcureTextField extends Field {
|
|
|
1191
1241
|
updateValue(tr) {
|
|
1192
1242
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
1193
1243
|
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 : (() => ({})));
|
|
1244
|
+
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
1245
|
const valuesFromField = (_d = (_c = this.primitiveTypesExtractor) === null || _c === void 0 ? void 0 : _c.call(this, tr.doc)) !== null && _d !== void 0 ? _d : [];
|
|
1196
1246
|
const unchangedIds = [];
|
|
1197
1247
|
const newAndModifiedValues = [];
|
|
1198
1248
|
valuesFromField.forEach(([tid, value]) => {
|
|
1199
1249
|
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); });
|
|
1250
|
+
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
1251
|
const idPresent = newAndModifiedValues.some(([ttid]) => ttid === tid);
|
|
1202
1252
|
if (!oldValue || idPresent) {
|
|
1203
1253
|
newAndModifiedValues.push([idPresent ? '' : tid, value]);
|
|
@@ -1224,7 +1274,7 @@ export class IcureTextField extends Field {
|
|
|
1224
1274
|
});
|
|
1225
1275
|
}
|
|
1226
1276
|
else {
|
|
1227
|
-
const [valueId] = extractSingleValue((_e = this.valueProvider) === null || _e === void 0 ? void 0 : _e.call(this));
|
|
1277
|
+
const [valueId] = (0, utils_2.extractSingleValue)((_e = this.valueProvider) === null || _e === void 0 ? void 0 : _e.call(this));
|
|
1228
1278
|
const value = (_f = this.primitiveTypeExtractor) === null || _f === void 0 ? void 0 : _f.call(this, tr.doc);
|
|
1229
1279
|
((_g = this.handleValueChanged) === null || _g === void 0 ? void 0 : _g.call(this, this.label, this.language(), value
|
|
1230
1280
|
? {
|
|
@@ -1234,31 +1284,37 @@ export class IcureTextField extends Field {
|
|
|
1234
1284
|
: undefined, valueId)) && (this.selectedRevision = undefined);
|
|
1235
1285
|
}
|
|
1236
1286
|
}
|
|
1237
|
-
|
|
1238
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t
|
|
1287
|
+
renderSync({ validationErrors }) {
|
|
1288
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
1239
1289
|
const renderHash = Math.random();
|
|
1240
1290
|
let metadata;
|
|
1241
1291
|
let rev;
|
|
1242
1292
|
let versions;
|
|
1243
|
-
const validationError =
|
|
1293
|
+
const validationError = validationErrors.length;
|
|
1244
1294
|
let valueForExistingLanguages = undefined;
|
|
1295
|
+
if (index_1.icureFormLogging) {
|
|
1296
|
+
console.log(`Rendering text-field ${this.schema} ${this.label} [${this.displayedLabels}]`);
|
|
1297
|
+
}
|
|
1245
1298
|
if (this.view) {
|
|
1246
1299
|
let parsedDoc;
|
|
1247
|
-
const data = (
|
|
1300
|
+
const data = (_a = this.valueProvider) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
1301
|
+
if (index_1.icureFormLogging) {
|
|
1302
|
+
console.log(`Data for ${this.label} is ${JSON.stringify(data)}`);
|
|
1303
|
+
}
|
|
1248
1304
|
if (this.isMultivalued()) {
|
|
1249
|
-
const values = extractValues(data, (
|
|
1305
|
+
const values = (0, utils_2.extractValues)(data, (_b = this.metadataProvider) !== null && _b !== void 0 ? _b : (() => ({})));
|
|
1250
1306
|
parsedDoc =
|
|
1251
|
-
(
|
|
1307
|
+
(_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
1308
|
}
|
|
1253
1309
|
else {
|
|
1254
1310
|
let id;
|
|
1255
|
-
[id, versions] = extractSingleValue(data);
|
|
1311
|
+
[id, versions] = (0, utils_2.extractSingleValue)(data);
|
|
1256
1312
|
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 ? (
|
|
1313
|
+
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 : '';
|
|
1314
|
+
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 : {});
|
|
1315
|
+
parsedDoc = valueForLanguage ? (_l = (_k = this.parser) === null || _k === void 0 ? void 0 : _k.parse(valueForLanguage)) !== null && _l !== void 0 ? _l : undefined : undefined;
|
|
1260
1316
|
rev = version === null || version === void 0 ? void 0 : version.revision;
|
|
1261
|
-
metadata = id && rev !== undefined ? (
|
|
1317
|
+
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
1318
|
}
|
|
1263
1319
|
if (parsedDoc) {
|
|
1264
1320
|
const selection = this.view.state.selection;
|
|
@@ -1268,16 +1324,16 @@ export class IcureTextField extends Field {
|
|
|
1268
1324
|
if (lastPos < selAnchor || lastPos < selHead) {
|
|
1269
1325
|
console.log(`Constraining selection to ${Math.min(selAnchor, lastPos)} - ${Math.min(selHead, lastPos)}`);
|
|
1270
1326
|
}
|
|
1271
|
-
const newState = EditorState.create({
|
|
1327
|
+
const newState = prosemirror_state_1.EditorState.create({
|
|
1272
1328
|
schema: this.view.state.schema,
|
|
1273
1329
|
doc: parsedDoc,
|
|
1274
1330
|
plugins: this.view.state.plugins,
|
|
1275
|
-
selection: new TextSelection(parsedDoc.resolve(Math.min(selAnchor, lastPos)), parsedDoc.resolve(Math.min(selHead, lastPos))),
|
|
1331
|
+
selection: new prosemirror_state_1.TextSelection(parsedDoc.resolve(Math.min(selAnchor, lastPos)), parsedDoc.resolve(Math.min(selHead, lastPos))),
|
|
1276
1332
|
});
|
|
1277
1333
|
this.view.updateState(newState);
|
|
1278
1334
|
}
|
|
1279
1335
|
else {
|
|
1280
|
-
this.view.updateState(EditorState.create({
|
|
1336
|
+
this.view.updateState(prosemirror_state_1.EditorState.create({
|
|
1281
1337
|
schema: this.view.state.schema,
|
|
1282
1338
|
doc: undefined,
|
|
1283
1339
|
plugins: this.view.state.plugins,
|
|
@@ -1285,39 +1341,60 @@ export class IcureTextField extends Field {
|
|
|
1285
1341
|
}));
|
|
1286
1342
|
}
|
|
1287
1343
|
}
|
|
1288
|
-
return html `
|
|
1344
|
+
return (0, lit_1.html) `
|
|
1289
1345
|
<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}
|
|
1346
|
+
${this.displayedLabels ? (0, utils_1.generateLabels)(this.displayedLabels, this.language(), this.translate ? this.translationProvider : undefined) : lit_1.nothing}
|
|
1291
1347
|
<div class="icure-input-metadata-container">
|
|
1292
1348
|
<div class="icure-input ${validationError ? 'icure-input__validationError' : ''} ${this.displayMetadata && metadata ? 'icure-input__withMetadata' : ''}">
|
|
1293
1349
|
<div id="editor" class="${this.schema}" style="min-height: calc( ${this.lines}rem + 5px )"></div>
|
|
1350
|
+
${!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
1351
|
</div>
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1352
|
+
${this.displayMetadata && metadata
|
|
1353
|
+
? (0, lit_1.html) `
|
|
1354
|
+
<div class="icure-metadata-container ${validationError ? 'icure-metadata-container__validationError' : ''}">
|
|
1355
|
+
<icure-metadata-buttons-bar
|
|
1356
|
+
.metadata="${metadata}"
|
|
1357
|
+
.revision="${rev}"
|
|
1358
|
+
.versions="${versions !== null && versions !== void 0 ? versions : []}"
|
|
1359
|
+
.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]}"
|
|
1360
|
+
.defaultLanguage="${this.defaultLanguage}"
|
|
1361
|
+
.selectedLanguage="${this.selectedLanguage}"
|
|
1362
|
+
.languages="${this.languages}"
|
|
1363
|
+
.handleReset="${() => this.reset(renderHash)}"
|
|
1364
|
+
.handleMetadataChanged="${this.handleMetadataChanged}"
|
|
1365
|
+
.handleLanguageSelected="${(iso) => (this.selectedLanguage = iso)}"
|
|
1366
|
+
.handleRevisionSelected="${(rev) => (this.selectedRevision = rev)}"
|
|
1367
|
+
.ownersProvider="${this.ownersProvider}"
|
|
1368
|
+
.existingLanguages="${valueForExistingLanguages !== null && valueForExistingLanguages !== void 0 ? valueForExistingLanguages : undefined}"
|
|
1369
|
+
/>
|
|
1370
|
+
</div>
|
|
1371
|
+
`
|
|
1315
1372
|
: ''}
|
|
1373
|
+
</div>
|
|
1374
|
+
<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
1375
|
</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
1376
|
</div>
|
|
1319
1377
|
`;
|
|
1320
1378
|
}
|
|
1379
|
+
reset(renderHash) {
|
|
1380
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1381
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1382
|
+
if (this.view) {
|
|
1383
|
+
const defaultValue = yield ((_a = this.defaultValueProvider) === null || _a === void 0 ? void 0 : _a.call(this));
|
|
1384
|
+
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['*'];
|
|
1385
|
+
const newState = prosemirror_state_1.EditorState.create({
|
|
1386
|
+
schema: this.view.state.schema,
|
|
1387
|
+
doc: (_h = (_g = this.parser) === null || _g === void 0 ? void 0 : _g.parse(contentForLanguage !== null && contentForLanguage !== void 0 ? contentForLanguage : {
|
|
1388
|
+
type: 'string',
|
|
1389
|
+
value: '',
|
|
1390
|
+
}, undefined, renderHash)) !== null && _h !== void 0 ? _h : undefined,
|
|
1391
|
+
plugins: this.view.state.plugins,
|
|
1392
|
+
selection: undefined,
|
|
1393
|
+
});
|
|
1394
|
+
this.view.updateState(newState);
|
|
1395
|
+
}
|
|
1396
|
+
});
|
|
1397
|
+
}
|
|
1321
1398
|
mouseDown() {
|
|
1322
1399
|
this.mouseCount++;
|
|
1323
1400
|
}
|
|
@@ -1335,7 +1412,7 @@ export class IcureTextField extends Field {
|
|
|
1335
1412
|
var _a;
|
|
1336
1413
|
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
1337
1414
|
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));
|
|
1415
|
+
const pms = (this.proseMirrorSchema = (0, schema_1.createSchema)(this.schema, (t, c, isC) => (isC ? this.codeColorProvider(t, c) : this.linkColorProvider(t, c)), this.codeContentProvider));
|
|
1339
1416
|
this.parser = this.makeParser(this.schema, pms);
|
|
1340
1417
|
this.serializer = this.makeSerializer(this.schema, pms);
|
|
1341
1418
|
this.primitiveTypeExtractor = this.makePrimitiveExtractor(this.schema);
|
|
@@ -1343,8 +1420,8 @@ export class IcureTextField extends Field {
|
|
|
1343
1420
|
this.codesExtractor = this.makeCodesExtractor(this.schema);
|
|
1344
1421
|
this.container = ((_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.getElementById('editor')) || undefined;
|
|
1345
1422
|
if (this.container) {
|
|
1346
|
-
const br = pms.nodes.
|
|
1347
|
-
const
|
|
1423
|
+
const br = pms.nodes.hard_break;
|
|
1424
|
+
const hard_break = (0, prosemirror_commands_1.chainCommands)(prosemirror_commands_1.exitCode, (state, dispatch) => {
|
|
1348
1425
|
dispatch && dispatch(state.tr.replaceSelectionWith(br.create()).scrollIntoView());
|
|
1349
1426
|
return true;
|
|
1350
1427
|
});
|
|
@@ -1352,32 +1429,32 @@ export class IcureTextField extends Field {
|
|
|
1352
1429
|
const link = yield this.linksProvider(sug);
|
|
1353
1430
|
return (link && cmp.view && cmp.view.state.tr.replaceWith(from, to, pms.text(sug.text, [pms.mark('link', link)]))) || undefined;
|
|
1354
1431
|
});
|
|
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 }) });
|
|
1432
|
+
const headingsKeymap = (0, prosemirror_keymap_1.keymap)([1, 2, 3, 4, 5, 6].reduce((acc, idx) => {
|
|
1433
|
+
return Object.assign(acc, { [`Mod-ctrl-${idx}`]: (0, prosemirror_commands_1.setBlockType)(pms.nodes.heading, { level: '' + idx }) });
|
|
1357
1434
|
}, {}));
|
|
1358
1435
|
//Currently take the first piece of data if it is available
|
|
1359
|
-
this.view = new EditorView(this.container, {
|
|
1360
|
-
state: EditorState.create({
|
|
1436
|
+
this.view = new prosemirror_view_1.EditorView(this.container, {
|
|
1437
|
+
state: prosemirror_state_1.EditorState.create({
|
|
1361
1438
|
doc: undefined,
|
|
1362
1439
|
schema: this.proseMirrorSchema,
|
|
1363
1440
|
plugins: [
|
|
1364
|
-
history(),
|
|
1441
|
+
(0, prosemirror_history_1.history)(),
|
|
1365
1442
|
this.links
|
|
1366
|
-
? new Plugin({
|
|
1443
|
+
? new prosemirror_state_1.Plugin({
|
|
1367
1444
|
view(editorView) {
|
|
1368
|
-
return new SelectionCompanion(editorView, () => cmp.mouseCount > 0);
|
|
1445
|
+
return new selection_companion_1.SelectionCompanion(editorView, () => cmp.mouseCount > 0);
|
|
1369
1446
|
},
|
|
1370
1447
|
})
|
|
1371
1448
|
: null,
|
|
1372
1449
|
this.suggestions
|
|
1373
|
-
? new Plugin({
|
|
1450
|
+
? new prosemirror_state_1.Plugin({
|
|
1374
1451
|
view(editorView) {
|
|
1375
|
-
return (cmp.suggestionPalette = new SuggestionPalette(pms, editorView, (terms) => cmp.suggestionProvider(terms), () => cmp.suggestionStopWords));
|
|
1452
|
+
return (cmp.suggestionPalette = new suggestion_palette_1.SuggestionPalette(pms, editorView, (terms) => cmp.suggestionProvider(terms), () => cmp.suggestionStopWords));
|
|
1376
1453
|
},
|
|
1377
1454
|
})
|
|
1378
1455
|
: null,
|
|
1379
1456
|
this.suggestions
|
|
1380
|
-
? keymap({
|
|
1457
|
+
? (0, prosemirror_keymap_1.keymap)({
|
|
1381
1458
|
Tab: () => {
|
|
1382
1459
|
return (cmp.suggestionPalette && this.view && cmp.suggestionPalette.focusOrInsert(this.view, replaceRangeWithSuggestion)) || false;
|
|
1383
1460
|
},
|
|
@@ -1392,13 +1469,35 @@ export class IcureTextField extends Field {
|
|
|
1392
1469
|
},
|
|
1393
1470
|
})
|
|
1394
1471
|
: 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':
|
|
1472
|
+
(0, prosemirror_keymap_1.keymap)({ 'Mod-z': prosemirror_history_1.undo, 'Mod-Shift-z': prosemirror_history_1.redo }),
|
|
1473
|
+
(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
1474
|
pms.nodes.heading ? headingsKeymap : null,
|
|
1398
|
-
maskPlugin(),
|
|
1399
|
-
regexpPlugin(),
|
|
1400
|
-
hasContentClassPlugin(this.shadowRoot || undefined),
|
|
1401
|
-
|
|
1475
|
+
(0, mask_plugin_1.maskPlugin)(),
|
|
1476
|
+
(0, regexp_plugin_1.regexpPlugin)(),
|
|
1477
|
+
(0, has_content_class_plugin_1.hasContentClassPlugin)(this.shadowRoot || undefined),
|
|
1478
|
+
new prosemirror_state_1.Plugin({
|
|
1479
|
+
props: {
|
|
1480
|
+
transformPasted(slice) {
|
|
1481
|
+
let ok = true;
|
|
1482
|
+
slice.content.forEach((node) => {
|
|
1483
|
+
if (!pms.nodes[node.type.name]) {
|
|
1484
|
+
ok = false;
|
|
1485
|
+
}
|
|
1486
|
+
});
|
|
1487
|
+
if (ok) {
|
|
1488
|
+
return slice;
|
|
1489
|
+
}
|
|
1490
|
+
if (pms.nodes.paragraph)
|
|
1491
|
+
return new prosemirror_model_1.Slice(prosemirror_model_1.Fragment.fromArray(slice.content
|
|
1492
|
+
.textBetween(0, slice.content.size, ' ')
|
|
1493
|
+
.split('\n')
|
|
1494
|
+
.map((line) => pms.nodes.paragraph.create({}, [pms.text(line)]))), 0, 0);
|
|
1495
|
+
else
|
|
1496
|
+
return new prosemirror_model_1.Slice(prosemirror_model_1.Fragment.fromArray([pms.text(slice.content.textBetween(0, slice.content.size, ' ').split('\n').join(' '))]), 0, 0);
|
|
1497
|
+
},
|
|
1498
|
+
},
|
|
1499
|
+
}),
|
|
1500
|
+
(0, prosemirror_keymap_1.keymap)(prosemirror_commands_1.baseKeymap),
|
|
1402
1501
|
]
|
|
1403
1502
|
.filter((x) => !!x)
|
|
1404
1503
|
.map((x) => x),
|
|
@@ -1409,7 +1508,7 @@ export class IcureTextField extends Field {
|
|
|
1409
1508
|
this.updateValue(view.state.tr);
|
|
1410
1509
|
},
|
|
1411
1510
|
focus: (view) => {
|
|
1412
|
-
this.schema === 'measure' && measureOnFocusHandler(view);
|
|
1511
|
+
this.schema === 'measure' && (0, measure_schema_1.measureOnFocusHandler)(view);
|
|
1413
1512
|
},
|
|
1414
1513
|
click: (view, event) => {
|
|
1415
1514
|
var _a;
|
|
@@ -1426,7 +1525,7 @@ export class IcureTextField extends Field {
|
|
|
1426
1525
|
},
|
|
1427
1526
|
},
|
|
1428
1527
|
dispatchTransaction: (tro) => {
|
|
1429
|
-
const tr = this.schema === 'measure' ? measureTransactionMapper(tro) : tro;
|
|
1528
|
+
const tr = this.schema === 'measure' ? (0, measure_schema_1.measureTransactionMapper)(tro) : tro;
|
|
1430
1529
|
console.log(`Setting selection to ${tr.selection.from} - ${tr.selection.to}`);
|
|
1431
1530
|
this.view && this.view.updateState(this.view.state.apply(tr));
|
|
1432
1531
|
if (this.view && tr.doc != tr.before && this.handleValueChanged) {
|
|
@@ -1446,7 +1545,7 @@ export class IcureTextField extends Field {
|
|
|
1446
1545
|
}
|
|
1447
1546
|
}
|
|
1448
1547
|
makeParser(schemaName, pms) {
|
|
1449
|
-
const tokenizer =
|
|
1548
|
+
const tokenizer = (0, markdown_it_1.default)('commonmark', { html: false });
|
|
1450
1549
|
return schemaName.includes('tokens-list')
|
|
1451
1550
|
? {
|
|
1452
1551
|
parse: (value, id, renderHash) => {
|
|
@@ -1464,7 +1563,7 @@ export class IcureTextField extends Field {
|
|
|
1464
1563
|
parse: (value) => {
|
|
1465
1564
|
var _a, _b;
|
|
1466
1565
|
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.*/, '');
|
|
1566
|
+
const dateString = (_a = (0, dates_1.anyDateToDate)(value.value)) === null || _a === void 0 ? void 0 : _a.toISOString().replace(/T.*/, '');
|
|
1468
1567
|
return pms.node('paragraph', {}, [pms.node('date', {}, value ? [pms.text(dateString !== null && dateString !== void 0 ? dateString : '')] : [])]);
|
|
1469
1568
|
}
|
|
1470
1569
|
else if ((value === null || value === void 0 ? void 0 : value.type) === 'timestamp') {
|
|
@@ -1497,11 +1596,13 @@ export class IcureTextField extends Field {
|
|
|
1497
1596
|
: schemaName === 'measure'
|
|
1498
1597
|
? {
|
|
1499
1598
|
parse: (value) => {
|
|
1500
|
-
var _a, _b;
|
|
1599
|
+
var _a, _b, _c;
|
|
1501
1600
|
if (value.type !== 'measure') {
|
|
1502
1601
|
return undefined;
|
|
1503
1602
|
}
|
|
1504
|
-
const decimal =
|
|
1603
|
+
const decimal = value.value !== undefined
|
|
1604
|
+
? 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)
|
|
1605
|
+
: '';
|
|
1505
1606
|
const unit = value.unit;
|
|
1506
1607
|
return pms.node('paragraph', {}, [pms.node('decimal', {}, decimal && decimal.length ? [pms.text(decimal)] : [])].concat(unit && unit.length ? [pms.node('unit', {}, [pms.text(unit)])] : []));
|
|
1507
1608
|
},
|
|
@@ -1509,7 +1610,14 @@ export class IcureTextField extends Field {
|
|
|
1509
1610
|
: schemaName === 'decimal'
|
|
1510
1611
|
? {
|
|
1511
1612
|
parse: (value) => {
|
|
1512
|
-
|
|
1613
|
+
var _a, _b, _c;
|
|
1614
|
+
return value.type === 'number'
|
|
1615
|
+
? pms.node('paragraph', {}, [
|
|
1616
|
+
pms.node('decimal', {}, [
|
|
1617
|
+
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)),
|
|
1618
|
+
]),
|
|
1619
|
+
])
|
|
1620
|
+
: undefined;
|
|
1513
1621
|
},
|
|
1514
1622
|
}
|
|
1515
1623
|
: schemaName === 'date-time'
|
|
@@ -1519,8 +1627,8 @@ export class IcureTextField extends Field {
|
|
|
1519
1627
|
if (value.type !== 'datetime') {
|
|
1520
1628
|
return undefined;
|
|
1521
1629
|
}
|
|
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');
|
|
1630
|
+
const date = (_a = (0, dates_1.anyDateToDate)(value.value)) === null || _a === void 0 ? void 0 : _a.toISOString().replace(/T.*/, '');
|
|
1631
|
+
const time = (_b = (0, dates_1.anyDateToDate)(value.value)) === null || _b === void 0 ? void 0 : _b.toISOString().replace(/.+?T(..):(..).*/, '$1:$2');
|
|
1524
1632
|
return pms.node('paragraph', {}, [
|
|
1525
1633
|
pms.node('date', {}, date && date.length ? [pms.text(date)] : [pms.text(' ')]),
|
|
1526
1634
|
pms.node('time', {}, time && time.length ? [pms.text(time)] : [pms.text(' ')]),
|
|
@@ -1528,7 +1636,7 @@ export class IcureTextField extends Field {
|
|
|
1528
1636
|
},
|
|
1529
1637
|
}
|
|
1530
1638
|
: schemaName === 'text-document'
|
|
1531
|
-
? new SpacePreservingMarkdownParser(new MarkdownParser(pms,
|
|
1639
|
+
? new markdown_1.SpacePreservingMarkdownParser(new prosemirror_markdown_1.MarkdownParser(pms, (0, markdown_it_1.default)('commonmark', { html: false }), {
|
|
1532
1640
|
blockquote: { block: 'blockquote' },
|
|
1533
1641
|
paragraph: { block: 'paragraph' },
|
|
1534
1642
|
list_item: { block: 'list_item' },
|
|
@@ -1547,10 +1655,10 @@ export class IcureTextField extends Field {
|
|
|
1547
1655
|
});
|
|
1548
1656
|
},
|
|
1549
1657
|
},
|
|
1550
|
-
|
|
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')
|
|
1658
|
+
hard_break: { node: 'hard_break' },
|
|
1659
|
+
em: (0, prosemirror_utils_1.hasMark)(pms.spec.marks, 'em') ? { mark: 'em' } : { ignore: true },
|
|
1660
|
+
strong: (0, prosemirror_utils_1.hasMark)(pms.spec.marks, 'strong') ? { mark: 'strong' } : { ignore: true },
|
|
1661
|
+
link: (0, prosemirror_utils_1.hasMark)(pms.spec.marks, 'link')
|
|
1554
1662
|
? {
|
|
1555
1663
|
mark: 'link',
|
|
1556
1664
|
getAttrs: (tok) => ({
|
|
@@ -1560,14 +1668,14 @@ export class IcureTextField extends Field {
|
|
|
1560
1668
|
}
|
|
1561
1669
|
: { ignore: true },
|
|
1562
1670
|
}))
|
|
1563
|
-
: new SpacePreservingMarkdownParser(new MarkdownParser(pms, {
|
|
1671
|
+
: new markdown_1.SpacePreservingMarkdownParser(new prosemirror_markdown_1.MarkdownParser(pms, {
|
|
1564
1672
|
parse: (src, env) => {
|
|
1565
1673
|
return tokenizer.parse(src, env).filter((t) => !t.type.startsWith('paragraph_'));
|
|
1566
1674
|
},
|
|
1567
1675
|
}, {
|
|
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')
|
|
1676
|
+
em: (0, prosemirror_utils_1.hasMark)(pms.spec.marks, 'em') ? { mark: 'em' } : { ignore: true },
|
|
1677
|
+
strong: (0, prosemirror_utils_1.hasMark)(pms.spec.marks, 'strong') ? { mark: 'strong' } : { ignore: true },
|
|
1678
|
+
link: (0, prosemirror_utils_1.hasMark)(pms.spec.marks, 'link')
|
|
1571
1679
|
? {
|
|
1572
1680
|
mark: 'link',
|
|
1573
1681
|
getAttrs: (tok) => ({
|
|
@@ -1581,7 +1689,7 @@ export class IcureTextField extends Field {
|
|
|
1581
1689
|
makeSerializer(schemaName, pms) {
|
|
1582
1690
|
return schemaName === 'text-document'
|
|
1583
1691
|
? {
|
|
1584
|
-
serialize: (content) => defaultMarkdownSerializer.serialize(preprocessEmptyNodes(content, pms)),
|
|
1692
|
+
serialize: (content) => prosemirror_markdown_1.defaultMarkdownSerializer.serialize((0, markdown_1.preprocessEmptyNodes)(content, pms)),
|
|
1585
1693
|
}
|
|
1586
1694
|
: {
|
|
1587
1695
|
serialize: (content) => content.textBetween(0, content.nodeSize - 2, ' '),
|
|
@@ -1604,12 +1712,12 @@ export class IcureTextField extends Field {
|
|
|
1604
1712
|
}
|
|
1605
1713
|
makePrimitiveExtractor(schemaName) {
|
|
1606
1714
|
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); }
|
|
1715
|
+
? (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
1716
|
: schemaName === 'time'
|
|
1609
1717
|
? (doc) => {
|
|
1610
1718
|
var _a;
|
|
1611
1719
|
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'));
|
|
1720
|
+
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
1721
|
console.log(`Converted time to: ${value}`);
|
|
1614
1722
|
return {
|
|
1615
1723
|
type: 'datetime',
|
|
@@ -1646,7 +1754,7 @@ export class IcureTextField extends Field {
|
|
|
1646
1754
|
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
1755
|
? {
|
|
1648
1756
|
type: 'datetime',
|
|
1649
|
-
value: parseInt(format(parse(doc.firstChild.textContent + ' ' + doc.lastChild.textContent, 'dd/MM/yyyy HH:mm:ss', new Date()), 'yyyyMMddHHmmss')),
|
|
1757
|
+
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
1758
|
}
|
|
1651
1759
|
: undefined;
|
|
1652
1760
|
}
|
|
@@ -1665,64 +1773,65 @@ export class IcureTextField extends Field {
|
|
|
1665
1773
|
: () => [];
|
|
1666
1774
|
}
|
|
1667
1775
|
}
|
|
1776
|
+
exports.IcureTextField = IcureTextField;
|
|
1668
1777
|
__decorate([
|
|
1669
|
-
property(),
|
|
1778
|
+
(0, decorators_js_1.property)(),
|
|
1670
1779
|
__metadata("design:type", Object)
|
|
1671
1780
|
], IcureTextField.prototype, "placeholder", void 0);
|
|
1672
1781
|
__decorate([
|
|
1673
|
-
property(),
|
|
1782
|
+
(0, decorators_js_1.property)(),
|
|
1674
1783
|
__metadata("design:type", Object)
|
|
1675
1784
|
], IcureTextField.prototype, "multiline", void 0);
|
|
1676
1785
|
__decorate([
|
|
1677
|
-
property(),
|
|
1786
|
+
(0, decorators_js_1.property)(),
|
|
1678
1787
|
__metadata("design:type", Object)
|
|
1679
1788
|
], IcureTextField.prototype, "lines", void 0);
|
|
1680
1789
|
__decorate([
|
|
1681
|
-
property(),
|
|
1790
|
+
(0, decorators_js_1.property)(),
|
|
1682
1791
|
__metadata("design:type", Set)
|
|
1683
1792
|
], IcureTextField.prototype, "suggestionStopWords", void 0);
|
|
1684
1793
|
__decorate([
|
|
1685
|
-
property({ type: Boolean }),
|
|
1794
|
+
(0, decorators_js_1.property)({ type: Boolean }),
|
|
1686
1795
|
__metadata("design:type", Object)
|
|
1687
1796
|
], IcureTextField.prototype, "displayOwnerMenu", void 0);
|
|
1688
1797
|
__decorate([
|
|
1689
|
-
property({ type: Boolean }),
|
|
1798
|
+
(0, decorators_js_1.property)({ type: Boolean }),
|
|
1690
1799
|
__metadata("design:type", Object)
|
|
1691
1800
|
], IcureTextField.prototype, "suggestions", void 0);
|
|
1692
1801
|
__decorate([
|
|
1693
|
-
property({ type: Boolean }),
|
|
1802
|
+
(0, decorators_js_1.property)({ type: Boolean }),
|
|
1694
1803
|
__metadata("design:type", Object)
|
|
1695
1804
|
], IcureTextField.prototype, "links", void 0);
|
|
1696
1805
|
__decorate([
|
|
1697
|
-
property(),
|
|
1806
|
+
(0, decorators_js_1.property)(),
|
|
1698
1807
|
__metadata("design:type", Function)
|
|
1699
1808
|
], IcureTextField.prototype, "linksProvider", void 0);
|
|
1700
1809
|
__decorate([
|
|
1701
|
-
property(),
|
|
1810
|
+
(0, decorators_js_1.property)(),
|
|
1702
1811
|
__metadata("design:type", Function)
|
|
1703
1812
|
], IcureTextField.prototype, "suggestionProvider", void 0);
|
|
1704
1813
|
__decorate([
|
|
1705
|
-
property(),
|
|
1814
|
+
(0, decorators_js_1.property)(),
|
|
1706
1815
|
__metadata("design:type", Function)
|
|
1707
1816
|
], IcureTextField.prototype, "codeColorProvider", void 0);
|
|
1708
1817
|
__decorate([
|
|
1709
|
-
property(),
|
|
1818
|
+
(0, decorators_js_1.property)(),
|
|
1710
1819
|
__metadata("design:type", Function)
|
|
1711
1820
|
], IcureTextField.prototype, "linkColorProvider", void 0);
|
|
1712
1821
|
__decorate([
|
|
1713
|
-
property(),
|
|
1822
|
+
(0, decorators_js_1.property)(),
|
|
1714
1823
|
__metadata("design:type", Function)
|
|
1715
1824
|
], IcureTextField.prototype, "codeContentProvider", void 0);
|
|
1716
1825
|
__decorate([
|
|
1717
|
-
property(),
|
|
1826
|
+
(0, decorators_js_1.property)(),
|
|
1718
1827
|
__metadata("design:type", String)
|
|
1719
1828
|
], IcureTextField.prototype, "schema", void 0);
|
|
1720
1829
|
__decorate([
|
|
1721
|
-
state(),
|
|
1722
|
-
__metadata("design:type", EditorView)
|
|
1830
|
+
(0, decorators_js_1.state)(),
|
|
1831
|
+
__metadata("design:type", prosemirror_view_1.EditorView)
|
|
1723
1832
|
], IcureTextField.prototype, "view", void 0);
|
|
1724
1833
|
// Register the new element with the browser.
|
|
1725
|
-
|
|
1834
|
+
class MetadataButtonBarWrapper extends lit_1.LitElement {
|
|
1726
1835
|
render() {
|
|
1727
1836
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
1728
1837
|
console.log('Rendering metadata buttons');
|
|
@@ -1738,22 +1847,23 @@ export class MetadataButtonBarWrapper extends LitElement {
|
|
|
1738
1847
|
const op = (terms, ids, specialties) => {
|
|
1739
1848
|
return parent.ownersProvider(terms, ids, specialties);
|
|
1740
1849
|
};
|
|
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]}"
|
|
1850
|
+
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
1851
|
.defaultLanguage="${parent.defaultLanguage}" .selectedLanguage="${parent.selectedLanguage}" .languages="${parent.languages}" .handleMetadataChanged="${parent.handleMetadataChanged}"
|
|
1743
1852
|
.handleLanguageSelected="${(iso) => (parent.selectedLanguage = iso)}" .handleRevisionSelected="${(rev) => (parent.selectedRevision = rev)}" .ownersProvider="${op}"
|
|
1744
1853
|
style="white-space: nowrap; padding-top: 1px" " />`;
|
|
1745
1854
|
}
|
|
1746
1855
|
}
|
|
1856
|
+
exports.MetadataButtonBarWrapper = MetadataButtonBarWrapper;
|
|
1747
1857
|
__decorate([
|
|
1748
|
-
property(),
|
|
1858
|
+
(0, decorators_js_1.property)(),
|
|
1749
1859
|
__metadata("design:type", String)
|
|
1750
1860
|
], MetadataButtonBarWrapper.prototype, "id", void 0);
|
|
1751
1861
|
__decorate([
|
|
1752
|
-
property(),
|
|
1862
|
+
(0, decorators_js_1.property)(),
|
|
1753
1863
|
__metadata("design:type", String)
|
|
1754
1864
|
], MetadataButtonBarWrapper.prototype, "rerender", void 0);
|
|
1755
1865
|
__decorate([
|
|
1756
|
-
state(),
|
|
1866
|
+
(0, decorators_js_1.state)(),
|
|
1757
1867
|
__metadata("design:type", String)
|
|
1758
1868
|
], MetadataButtonBarWrapper.prototype, "selectedRevision", void 0);
|
|
1759
1869
|
//# sourceMappingURL=index.js.map
|