@icure/form 1.1.19 → 1.1.21

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.
Files changed (47) hide show
  1. package/.yarn/install-state.gz +0 -0
  2. package/components/common/field.d.ts +7 -4
  3. package/components/common/field.js +8 -7
  4. package/components/common/field.js.map +1 -1
  5. package/components/common/metadata-buttons-bar.d.ts +44 -0
  6. package/components/common/metadata-buttons-bar.js +1329 -0
  7. package/components/common/metadata-buttons-bar.js.map +1 -0
  8. package/components/icure-button-group/index.js +21 -22
  9. package/components/icure-button-group/index.js.map +1 -1
  10. package/components/icure-date-picker/index.js +22 -23
  11. package/components/icure-date-picker/index.js.map +1 -1
  12. package/components/icure-dropdown-field/index.js +21 -22
  13. package/components/icure-dropdown-field/index.js.map +1 -1
  14. package/components/icure-form/fields/text-field/text-field.js +1 -0
  15. package/components/icure-form/fields/text-field/text-field.js.map +1 -1
  16. package/components/icure-form/fields/utils/index.d.ts +1 -1
  17. package/components/icure-form/fields/utils/index.js +1 -1
  18. package/components/icure-form/fields/utils/index.js.map +1 -1
  19. package/components/icure-form/index.d.ts +3 -0
  20. package/components/icure-form/index.js +27 -23
  21. package/components/icure-form/index.js.map +1 -1
  22. package/components/icure-form/renderer/form/form.js +3 -2
  23. package/components/icure-form/renderer/form/form.js.map +1 -1
  24. package/components/icure-form/renderer/index.d.ts +3 -1
  25. package/components/icure-form/renderer/index.js.map +1 -1
  26. package/components/icure-label/index.js +21 -22
  27. package/components/icure-label/index.js.map +1 -1
  28. package/components/icure-text-field/index.d.ts +1 -14
  29. package/components/icure-text-field/index.js +42 -160
  30. package/components/icure-text-field/index.js.map +1 -1
  31. package/components/model/index.d.ts +1 -0
  32. package/components/model/index.js.map +1 -1
  33. package/components/themes/icure-blue/index.js +7 -6
  34. package/components/themes/icure-blue/index.js.map +1 -1
  35. package/components/themes/kendo/index.js +5 -3
  36. package/components/themes/kendo/index.js.map +1 -1
  37. package/generic/model.d.ts +1 -1
  38. package/generic/model.js.map +1 -1
  39. package/icure/form-values-container.d.ts +2 -2
  40. package/icure/form-values-container.js +27 -13
  41. package/icure/form-values-container.js.map +1 -1
  42. package/package.json +1 -1
  43. package/utils/dates.js +1 -1
  44. package/utils/dates.js.map +1 -1
  45. package/utils/fields-values-provider.d.ts +1 -1
  46. package/utils/fields-values-provider.js +2 -2
  47. package/utils/fields-values-provider.js.map +1 -1
@@ -0,0 +1,1329 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
12
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
13
+ return new (P || (P = Promise))(function (resolve, reject) {
14
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
15
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
16
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
17
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
18
+ });
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ exports.MetadataButtonBar = void 0;
22
+ const lit_1 = require("lit");
23
+ const decorators_js_1 = require("lit/decorators.js");
24
+ const paths_1 = require("./styles/paths");
25
+ const date_fns_1 = require("date-fns");
26
+ const dates_1 = require("../../utils/dates");
27
+ const to_resolved_date_1 = require("app-datepicker/dist/helpers/to-resolved-date");
28
+ const constants_1 = require("app-datepicker/dist/constants");
29
+ const languages_1 = require("../../utils/languages");
30
+ // @ts-ignore
31
+ const lit_2 = require("lit");
32
+ const baseCss = (0, lit_2.css) `@charset "UTF-8";
33
+ :host {
34
+ --bg-color-1: #f44336;
35
+ }
36
+
37
+ .ProseMirror {
38
+ position: relative;
39
+ }
40
+
41
+ .ProseMirror {
42
+ width: 100%;
43
+ word-wrap: break-word;
44
+ white-space: pre-wrap;
45
+ -webkit-font-variant-ligatures: none;
46
+ font-variant-ligatures: none;
47
+ font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
48
+ }
49
+
50
+ .ProseMirror pre {
51
+ white-space: pre-wrap;
52
+ }
53
+
54
+ .ProseMirror li {
55
+ position: relative;
56
+ }
57
+
58
+ .ProseMirror-hideselection *::selection {
59
+ background: transparent;
60
+ }
61
+
62
+ .ProseMirror-hideselection *::-moz-selection {
63
+ background: transparent;
64
+ }
65
+
66
+ .ProseMirror-hideselection {
67
+ caret-color: transparent;
68
+ }
69
+
70
+ .ProseMirror-selectednode {
71
+ outline: 2px solid #8cf;
72
+ }
73
+
74
+ /* Make sure li selections wrap around markers */
75
+ li.ProseMirror-selectednode {
76
+ outline: none;
77
+ }
78
+
79
+ li.ProseMirror-selectednode:after {
80
+ content: "";
81
+ position: absolute;
82
+ left: -32px;
83
+ right: -2px;
84
+ top: -2px;
85
+ bottom: -2px;
86
+ border: 2px solid #8cf;
87
+ pointer-events: none;
88
+ }
89
+
90
+ .ProseMirror-gapcursor {
91
+ display: none;
92
+ pointer-events: none;
93
+ position: absolute;
94
+ }
95
+
96
+ .ProseMirror-gapcursor:after {
97
+ content: "";
98
+ display: block;
99
+ position: absolute;
100
+ top: -2px;
101
+ width: 20px;
102
+ border-top: 1px solid black;
103
+ animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
104
+ }
105
+
106
+ @keyframes ProseMirror-cursor-blink {
107
+ to {
108
+ visibility: hidden;
109
+ }
110
+ }
111
+ .ProseMirror-focused .ProseMirror-gapcursor {
112
+ display: block;
113
+ }
114
+
115
+ /* Add space around the hr to make clicking it easier */
116
+ .ProseMirror-example-setup-style hr {
117
+ padding: 2px 10px;
118
+ border: none;
119
+ margin: 1em 0;
120
+ }
121
+
122
+ .ProseMirror-example-setup-style hr:after {
123
+ content: "";
124
+ display: block;
125
+ height: 1px;
126
+ background: silver;
127
+ line-height: 2px;
128
+ }
129
+
130
+ .ProseMirror ul,
131
+ .ProseMirror ol {
132
+ padding-left: 30px;
133
+ }
134
+
135
+ .ProseMirror blockquote {
136
+ padding-left: 1em;
137
+ border-left: 3px solid #eee;
138
+ margin-left: 0;
139
+ margin-right: 0;
140
+ }
141
+
142
+ .ProseMirror-example-setup-style img {
143
+ cursor: default;
144
+ }
145
+
146
+ .ProseMirror-prompt {
147
+ background: white;
148
+ padding: 5px 10px 5px 15px;
149
+ border: 1px solid silver;
150
+ position: fixed;
151
+ border-radius: 3px;
152
+ z-index: 11;
153
+ box-shadow: -0.5px 2px 5px rgba(0, 0, 0, 0.2);
154
+ }
155
+
156
+ .ProseMirror-prompt h5 {
157
+ margin: 0;
158
+ font-weight: normal;
159
+ font-size: 100%;
160
+ color: #444;
161
+ }
162
+
163
+ .ProseMirror-prompt input[type=text],
164
+ .ProseMirror-prompt textarea {
165
+ background: #eee;
166
+ border: none;
167
+ outline: none;
168
+ }
169
+
170
+ .ProseMirror-prompt input[type=text] {
171
+ padding: 0 4px;
172
+ }
173
+
174
+ .ProseMirror-prompt-close {
175
+ position: absolute;
176
+ left: 2px;
177
+ top: 1px;
178
+ color: #666;
179
+ border: none;
180
+ background: transparent;
181
+ padding: 0;
182
+ }
183
+
184
+ .ProseMirror-prompt-close:after {
185
+ content: "✕";
186
+ font-size: 12px;
187
+ }
188
+
189
+ .ProseMirror-invalid {
190
+ background: #ffc;
191
+ border: 1px solid #cc7;
192
+ border-radius: 4px;
193
+ padding: 5px 10px;
194
+ position: absolute;
195
+ min-width: 10em;
196
+ }
197
+
198
+ .ProseMirror-prompt-buttons {
199
+ margin-top: 5px;
200
+ display: none;
201
+ }
202
+
203
+ #editor,
204
+ .editor {
205
+ color: rgb(101, 101, 101);
206
+ background-clip: padding-box;
207
+ border-radius: 4px;
208
+ border: 2px solid rgba(0, 0, 0, 0.2);
209
+ padding: 5px 0;
210
+ display: flex;
211
+ align-items: flex-end;
212
+ }
213
+
214
+ .ProseMirror p:last-child,
215
+ .ProseMirror h1:last-child,
216
+ .ProseMirror h2:last-child,
217
+ .ProseMirror h3:last-child,
218
+ .ProseMirror h4:last-child,
219
+ .ProseMirror h5:last-child,
220
+ .ProseMirror h6:last-child {
221
+ margin-bottom: 2px;
222
+ }
223
+
224
+ .ProseMirror {
225
+ padding: 6px 8px 2px 8px;
226
+ line-height: 1.2;
227
+ color: #274768;
228
+ font-size: 14px;
229
+ font-weight: 400;
230
+ outline: none;
231
+ }
232
+
233
+ .ProseMirror p {
234
+ margin-bottom: 1em;
235
+ }
236
+
237
+ .icure-input {
238
+ background: #edf2f7;
239
+ border-radius: 8px;
240
+ border: none;
241
+ min-height: 28px;
242
+ height: auto;
243
+ display: flex;
244
+ flex-flow: row nowrap;
245
+ align-items: flex-start;
246
+ justify-content: space-between;
247
+ }
248
+
249
+ #editor {
250
+ background: transparent;
251
+ border: none;
252
+ padding: 0;
253
+ flex-grow: 1;
254
+ display: flex;
255
+ align-items: stretch;
256
+ }
257
+ #editor.tokens-list .ProseMirror, #editor.styled-tokens-list .ProseMirror {
258
+ display: flex;
259
+ flex-direction: row;
260
+ flex-wrap: wrap;
261
+ align-items: flex-start;
262
+ }
263
+ #editor.tokens-list .ProseMirror li, #editor.styled-tokens-list .ProseMirror li {
264
+ display: inline-block;
265
+ border-radius: 8px;
266
+ padding: 2px 4px;
267
+ margin-right: 2px;
268
+ background-color: #dadada;
269
+ border-color: rgba(42, 61, 108, 0.44);
270
+ }
271
+ #editor.tokens-list .ProseMirror li span, #editor.styled-tokens-list .ProseMirror li span {
272
+ min-width: 26px;
273
+ display: inline-block;
274
+ }
275
+ #editor.tokens-list .ProseMirror li span br, #editor.styled-tokens-list .ProseMirror li span br {
276
+ display: none;
277
+ }
278
+ #editor.tokens-list .ProseMirror li span:after:hover, #editor.styled-tokens-list .ProseMirror li span:after:hover {
279
+ background: transparent url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxu cz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGlkPSJPdXRsaW5lIiB2aWV3 Qm94PSIwIDAgMjQgMjQiIHN0cm9rZT0iIzAwMDAwMCIgZmlsbD0iIzAwMDAwMCIg d2lkdGg9IjUxMiIgaGVpZ2h0PSI1MTIiPjxwYXRoIGQ9Ik0xNiw4YTEsMSwwLDAs MC0xLjQxNCwwTDEyLDEwLjU4Niw5LjQxNCw4QTEsMSwwLDAsMCw4LDkuNDE0TDEw LjU4NiwxMiw4LDE0LjU4NkExLDEsMCwwLDAsOS40MTQsMTZMMTIsMTMuNDE0LDE0 LjU4NiwxNkExLDEsMCwwLDAsMTYsMTQuNTg2TDEzLjQxNCwxMiwxNiw5LjQxNEEx LDEsMCwwLDAsMTYsOFoiLz48cGF0aCBkPSJNMTIsMEExMiwxMiwwLDEsMCwyNCwx MiwxMi4wMTMsMTIuMDEzLDAsMCwwLDEyLDBabTAsMjJBMTAsMTAsMCwxLDEsMjIs MTIsMTAuMDExLDEwLjAxMSwwLDAsMSwxMiwyMloiLz48L3N2Zz4K") no-repeat center/16px;
280
+ }
281
+ #editor.tokens-list .ProseMirror li span:after, #editor.styled-tokens-list .ProseMirror li span:after {
282
+ content: " ";
283
+ min-width: 22px;
284
+ background: transparent url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxu cz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGlkPSJPdXRsaW5lIiB2aWV3 Qm94PSIwIDAgMjQgMjQiIHN0cm9rZT0iIzg4ODg4OCIgZmlsbD0iIzg4ODg4OCIg d2lkdGg9IjUxMiIgaGVpZ2h0PSI1MTIiPjxwYXRoIGQ9Ik0xNiw4YTEsMSwwLDAs MC0xLjQxNCwwTDEyLDEwLjU4Niw5LjQxNCw4QTEsMSwwLDAsMCw4LDkuNDE0TDEw LjU4NiwxMiw4LDE0LjU4NkExLDEsMCwwLDAsOS40MTQsMTZMMTIsMTMuNDE0LDE0 LjU4NiwxNkExLDEsMCwwLDAsMTYsMTQuNTg2TDEzLjQxNCwxMiwxNiw5LjQxNEEx LDEsMCwwLDAsMTYsOFoiLz48cGF0aCBkPSJNMTIsMEExMiwxMiwwLDEsMCwyNCwx MiwxMi4wMTMsMTIuMDEzLDAsMCwwLDEyLDBabTAsMjJBMTAsMTAsMCwxLDEsMjIs MTIsMTAuMDExLDEwLjAxMSwwLDAsMSwxMiwyMloiLz48L3N2Zz4K") no-repeat center/16px;
285
+ display: inline-block;
286
+ }
287
+ #editor.items-list .ProseMirror {
288
+ display: flex;
289
+ flex-direction: column;
290
+ flex-wrap: nowrap;
291
+ align-items: flex-start;
292
+ gap: 6px;
293
+ }
294
+ #editor.items-list .ProseMirror li {
295
+ list-style-type: none;
296
+ width: 100%;
297
+ padding-bottom: 4px;
298
+ border-bottom: 1px dotted rgba(128, 128, 128, 0.5098039216);
299
+ }
300
+ #editor.items-list .ProseMirror li:last-child {
301
+ border-bottom: none;
302
+ }
303
+
304
+ #content {
305
+ position: relative;
306
+ padding: 0;
307
+ }
308
+
309
+ * {
310
+ font-family: "Roboto", Helvetica, sans-serif;
311
+ }
312
+
313
+ p {
314
+ margin-top: 0;
315
+ }
316
+
317
+ h3 {
318
+ color: #274768;
319
+ margin-top: 0;
320
+ }
321
+
322
+ .extra {
323
+ flex-shrink: 0;
324
+ display: flex;
325
+ flex-flow: row nowrap;
326
+ align-items: center;
327
+ padding: 0 8px;
328
+ transition: all 0.24s cubic-bezier(0.42, 0.01, 1, 0.62);
329
+ }
330
+
331
+ .extra > .info {
332
+ color: #809ab4;
333
+ font-size: 12px;
334
+ width: 100%;
335
+ height: auto;
336
+ overflow: hidden;
337
+ pointer-events: none;
338
+ text-align: right;
339
+ }
340
+
341
+ .extra > .info > span {
342
+ font-weight: 700;
343
+ }
344
+
345
+ .extra .buttons-container {
346
+ position: relative;
347
+ display: flex;
348
+ height: 100%;
349
+ flex-flow: row nowrap;
350
+ align-items: center;
351
+ justify-content: flex-end;
352
+ width: 0;
353
+ transition: all 0.24s cubic-bezier(0.14, 0.69, 0.87, 0.54);
354
+ }
355
+
356
+ .extra:hover .buttons-container .menu-container .btn {
357
+ animation: slideIn 0.24s ease-in forwards;
358
+ pointer-events: none;
359
+ display: unset !important;
360
+ }
361
+
362
+ .extra.forced:hover .buttons-container .menu-container .btn {
363
+ animation: none;
364
+ pointer-events: all;
365
+ }
366
+
367
+ .extra.forced .buttons-container .btn {
368
+ opacity: 1 !important;
369
+ display: unset !important;
370
+ }
371
+
372
+ .extra .buttons-container .btn.forced {
373
+ opacity: 1 !important;
374
+ display: unset !important;
375
+ }
376
+
377
+ .extra.forced .info, .extra .info.hidden {
378
+ opacity: 0 !important;
379
+ z-index: 0 !important;
380
+ }
381
+
382
+ .extra .buttons-container .btn {
383
+ border: none;
384
+ background: transparent;
385
+ position: relative;
386
+ top: 0;
387
+ display: none;
388
+ opacity: 0;
389
+ cursor: pointer;
390
+ height: 20px;
391
+ width: 10px;
392
+ margin-left: 4px;
393
+ margin-right: 4px;
394
+ padding: 0;
395
+ }
396
+
397
+ .extra .buttons-container .menu-container:last-child .btn {
398
+ margin-right: 0;
399
+ }
400
+
401
+ .extra .buttons-container .btn svg path {
402
+ fill: #809ab4;
403
+ }
404
+
405
+ .extra .buttons-container .btn.forced svg path {
406
+ fill: crimson !important;
407
+ }
408
+
409
+ .extra .buttons-container .btn:hover svg path {
410
+ fill: #274768;
411
+ }
412
+
413
+ .extra .buttons-container .menu-container .btn:hover::after {
414
+ content: attr(data-content);
415
+ position: absolute;
416
+ top: -22px;
417
+ height: 16px;
418
+ left: 50%;
419
+ transform: translateX(-50%);
420
+ border-radius: 8px;
421
+ background: #274768;
422
+ color: white;
423
+ display: flex;
424
+ flex-flow: row wrap;
425
+ align-items: center;
426
+ text-transform: capitalize;
427
+ white-space: nowrap;
428
+ padding: 0 12px;
429
+ font-size: 12px;
430
+ line-height: 0;
431
+ }
432
+
433
+ .extra .buttons-container .btn:focus,
434
+ .extra .buttons-container .btn:focus-within {
435
+ border: none;
436
+ outline: none;
437
+ }
438
+
439
+ .extra .buttons-container .menu-container .btn:hover::before {
440
+ content: "";
441
+ display: block;
442
+ border-color: #274768 transparent transparent transparent;
443
+ border-style: solid;
444
+ border-width: 4px;
445
+ position: absolute;
446
+ top: -6px;
447
+ }
448
+
449
+ @keyframes slideIn {
450
+ 0% {
451
+ top: 0;
452
+ opacity: 0;
453
+ pointer-events: none;
454
+ }
455
+ 100% {
456
+ top: 0;
457
+ opacity: 1;
458
+ pointer-events: all;
459
+ }
460
+ }
461
+ .menu-container {
462
+ display: flex;
463
+ align-items: center;
464
+ height: fit-content;
465
+ }
466
+
467
+ .value-date-menu {
468
+ width: unset !important;
469
+ }
470
+
471
+ .menu {
472
+ display: block;
473
+ position: absolute;
474
+ top: 20px;
475
+ right: 0;
476
+ z-index: 2;
477
+ background: #fff;
478
+ box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.25);
479
+ border-radius: 8px;
480
+ padding: 8px;
481
+ width: 220px;
482
+ min-height: 120px;
483
+ max-height: 320px;
484
+ overflow-y: scroll;
485
+ }
486
+ .menu .input-container {
487
+ background: #edf2f7;
488
+ border-radius: 4px;
489
+ display: flex;
490
+ flex-flow: row nowrap;
491
+ align-items: center;
492
+ justify-content: flex-start;
493
+ height: 32px;
494
+ margin-bottom: 4px;
495
+ padding: 0 4px;
496
+ }
497
+ .menu .input-container:hover {
498
+ box-shadow: 0 0 0 3px rgba(40, 151, 255, 0.2);
499
+ }
500
+ .menu .input-container:focus-within {
501
+ box-shadow: 0 0 0 3px rgba(40, 151, 255, 0.2), 0 0 0 1px rgb(40, 151, 255);
502
+ }
503
+ .menu .input-container input {
504
+ background: transparent;
505
+ border: none;
506
+ flex-grow: 1;
507
+ height: 100%;
508
+ }
509
+ .menu .input-container input:focus {
510
+ background: transparent;
511
+ border: none;
512
+ outline: none;
513
+ }
514
+
515
+ .menu-trigger:focus .menu {
516
+ display: block;
517
+ }
518
+
519
+ .menu-container .item {
520
+ height: 22px;
521
+ width: 100%;
522
+ background: transparent;
523
+ border-radius: 4px;
524
+ font-size: 14px;
525
+ color: #274768;
526
+ display: flex;
527
+ flex-flow: row nowrap;
528
+ align-items: center;
529
+ justify-content: flex-start;
530
+ box-shadow: none;
531
+ border: none;
532
+ white-space: nowrap;
533
+ overflow-x: hidden;
534
+ text-overflow: ellipsis;
535
+ }
536
+
537
+ .menu-container .item:hover {
538
+ background: #f5f9fd;
539
+ font-weight: 500;
540
+ border-radius: 4px;
541
+ }
542
+
543
+ span {
544
+ position: relative;
545
+ z-index: 1;
546
+ }
547
+
548
+ span.date {
549
+ margin-right: 1px;
550
+ }
551
+
552
+ span.time {
553
+ margin-left: 1px;
554
+ }
555
+
556
+ span.measure {
557
+ display: inline-block;
558
+ margin-right: 1px;
559
+ }
560
+
561
+ span.unit {
562
+ margin-left: 1px;
563
+ display: inline-block;
564
+ }
565
+
566
+ span[data-content]:hover::after {
567
+ position: absolute;
568
+ content: attr(data-content);
569
+ background: #274768;
570
+ color: #ffffff;
571
+ font-size: 9px;
572
+ line-height: 12px;
573
+ top: -12px;
574
+ left: 0px;
575
+ padding: 0px 2px;
576
+ }
577
+
578
+ span[data-content]::before {
579
+ position: absolute;
580
+ content: "";
581
+ top: 0;
582
+ left: 0;
583
+ width: 100%;
584
+ height: 100%;
585
+ z-index: -1;
586
+ opacity: 0.3;
587
+ }
588
+
589
+ .masked {
590
+ display: none;
591
+ }
592
+
593
+ .companion {
594
+ position: absolute;
595
+ width: 15px;
596
+ background-color: hsl(194, 100%, 50%);
597
+ color: white;
598
+ z-index: 20;
599
+ padding: 0;
600
+ text-align: center;
601
+ font-size: 14px;
602
+ font-weight: 500;
603
+ display: flex;
604
+ align-items: center;
605
+ justify-content: center;
606
+ cursor: pointer;
607
+ border-radius: 0 2px 2px 0;
608
+ }
609
+
610
+ .companion:hover {
611
+ font-weight: 700;
612
+ background: hsl(202, 100%, 50%);
613
+ }
614
+
615
+ *::selection {
616
+ background-color: hsla(194, 100%, 50%, 0.2);
617
+ }
618
+
619
+ .suggestion-palette {
620
+ position: absolute;
621
+ z-index: 20;
622
+ max-width: 380px;
623
+ font-size: 11px;
624
+ overflow: hidden;
625
+ text-overflow: ellipsis;
626
+ padding: 4px;
627
+ border: none;
628
+ border-radius: 8px;
629
+ background: white;
630
+ box-shadow: 0 1.1px 1.1px rgba(0, 0, 0, 0.022), 0 2.7px 2.7px rgba(0, 0, 0, 0.032), 0 5px 5px rgba(0, 0, 0, 0.04), 0 8.9px 8.9px rgba(0, 0, 0, 0.048), 0 16.7px 16.7px rgba(0, 0, 0, 0.058), 0 40px 40px rgba(0, 0, 0, 0.08);
631
+ }
632
+
633
+ .suggestion-palette ul {
634
+ white-space: nowrap;
635
+ list-style-type: none;
636
+ margin: 0;
637
+ padding: 0;
638
+ }
639
+
640
+ .suggestion-palette ul li {
641
+ padding: 0 8px;
642
+ font-size: 11px;
643
+ height: 20px;
644
+ box-sizing: border-box;
645
+ display: flex;
646
+ align-items: center;
647
+ justify-content: space-between;
648
+ border-radius: 4px;
649
+ color: rgb(39, 71, 104);
650
+ }
651
+ .suggestion-palette ul li svg {
652
+ height: 12px;
653
+ width: 12px;
654
+ border-radius: 4px;
655
+ transform-origin: center center;
656
+ }
657
+ .suggestion-palette ul li svg path {
658
+ fill: rgb(128, 154, 180);
659
+ }
660
+
661
+ .suggestion-palette ul li:not(:first-child) svg.tab-icn,
662
+ .suggestion-palette ul li:not(.focused) svg.return-icn,
663
+ .suggestion-palette ul.focused li:first-child svg.tab-icn {
664
+ height: 0;
665
+ width: 0;
666
+ transform: scale(0);
667
+ opacity: 0;
668
+ }
669
+
670
+ .suggestion-palette ul li.focused {
671
+ background-color: rgb(237, 242, 247);
672
+ }
673
+
674
+ .suggestion-palette ul li.focused svg.return-icn {
675
+ animation: growIn 0.24s ease-in forwards;
676
+ }
677
+
678
+ @keyframes growIn {
679
+ 0% {
680
+ transform: scale(0.5);
681
+ }
682
+ 90% {
683
+ transform: scale(1.1);
684
+ }
685
+ 100% {
686
+ transform: scale(1);
687
+ }
688
+ }
689
+ span.code-count-1::after,
690
+ span.code-count-1::before {
691
+ background: var(--bg-code-color-1);
692
+ color: var(--text-code-color-1);
693
+ }
694
+
695
+ span.code-count-2::after,
696
+ span.code-count-2::before {
697
+ background: var(--bg-code-color-1);
698
+ color: var(--text-code-color-1);
699
+ /* STRIPES */
700
+ /*background: repeating-linear-gradient(*/
701
+ /* 45deg,*/
702
+ /* var(--bg-code-color-1),*/
703
+ /* var(--bg-code-color-1) 10px,*/
704
+ /* var(--bg-code-color-2) 10px,*/
705
+ /* var(--bg-code-color-2) 20px*/
706
+ /*);*/
707
+ /* PAS STRIPES */
708
+ background: linear-gradient(90deg, var(--bg-code-color-1) 0%, var(--bg-code-color-2) 100%);
709
+ }
710
+
711
+ span.code-count-3::after,
712
+ span.code-count-3::before {
713
+ background: var(--bg-code-color-1);
714
+ color: var(--text-code-color-1);
715
+ /* STRIPES */
716
+ background: repeating-linear-gradient(45deg, var(--bg-code-color-1), var(--bg-code-color-1) 10px, var(--bg-code-color-2) 10px, var(--bg-code-color-2) 20px);
717
+ /* PAS STRIPES */
718
+ /* background: linear-gradient(90deg, var(--bg-code-color-1) 0%, var(--bg-code-color-2) 100%);*/
719
+ }
720
+
721
+ .selected-option {
722
+ padding: 2px;
723
+ margin-right: 5px;
724
+ }
725
+
726
+ .options {
727
+ display: flex;
728
+ flex-direction: column;
729
+ align-items: flex-start;
730
+ position: absolute;
731
+ top: 30px;
732
+ left: 0;
733
+ z-index: 2;
734
+ background: #fff;
735
+ box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.25);
736
+ width: auto;
737
+ min-width: 100%;
738
+ overflow-y: auto;
739
+ max-height: 280px;
740
+ }
741
+
742
+ .date-picker {
743
+ display: flex;
744
+ flex-direction: column;
745
+ align-items: flex-start;
746
+ position: absolute;
747
+ top: 30px;
748
+ right: 0;
749
+ z-index: 2;
750
+ background: #fff;
751
+ box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.25);
752
+ width: 260px;
753
+ overflow-y: auto;
754
+ max-height: 280px;
755
+ left: 0px;
756
+ }
757
+
758
+ app-date-picker {
759
+ --app-primary: #084B83;
760
+ --app-hover: #5b7da2;
761
+ --app-selected-hover: #5b7da2;
762
+ }
763
+
764
+ .option {
765
+ height: 28px;
766
+ min-height: 28px;
767
+ width: 100%;
768
+ background: transparent;
769
+ border-radius: 4px;
770
+ font-size: 14px;
771
+ color: #545454;
772
+ display: flex;
773
+ flex-flow: row nowrap;
774
+ align-items: center;
775
+ justify-content: flex-start;
776
+ box-shadow: none;
777
+ border: none;
778
+ white-space: nowrap;
779
+ overflow-x: hidden;
780
+ text-overflow: ellipsis;
781
+ padding: 4px 8px;
782
+ -webkit-user-select: none; /* Safari */
783
+ -ms-user-select: none; /* IE 10 and IE 11 */
784
+ user-select: none; /* Standard syntax */
785
+ }
786
+
787
+ .option:hover {
788
+ color: #656565;
789
+ background-color: #ededed;
790
+ }
791
+
792
+ .select-arrow {
793
+ border: none;
794
+ background: 0px 0px;
795
+ position: relative;
796
+ top: 0px;
797
+ opacity: 0.5;
798
+ cursor: pointer;
799
+ height: 20px;
800
+ width: 10px;
801
+ margin-left: 4px;
802
+ margin-right: 4px;
803
+ padding: 0px;
804
+ }
805
+
806
+ .hidden {
807
+ display: none;
808
+ }
809
+
810
+ .container {
811
+ position: relative;
812
+ }
813
+
814
+ .icure-form {
815
+ background-color: rgba(0, 0, 0, 0);
816
+ display: grid;
817
+ gap: 0 6px;
818
+ grid-template-columns: repeat(24, 1fr);
819
+ }
820
+
821
+ .group {
822
+ align-items: end;
823
+ display: grid;
824
+ }
825
+
826
+ .subform {
827
+ align-items: end;
828
+ display: grid;
829
+ position: relative;
830
+ margin: 8px -8px 8px;
831
+ padding: 0 8px 0;
832
+ min-height: 64px;
833
+ background-color: #e7f0fd;
834
+ }
835
+
836
+ .icure-form hr {
837
+ display: block;
838
+ margin-top: 20px;
839
+ border-top: 1px solid rgba(8, 75, 131, 0.13);
840
+ margin-bottom: 20px;
841
+ }
842
+ .icure-form h2 {
843
+ font-size: 14.4px;
844
+ font-weight: 700;
845
+ color: #084B83;
846
+ padding: 2px;
847
+ }
848
+ .icure-form h3 {
849
+ font-size: 13.2px;
850
+ font-weight: 500;
851
+ color: #084B83;
852
+ padding: 6px;
853
+ }
854
+ .icure-form .group.bordered {
855
+ background: #f6f6f6;
856
+ border-radius: 12px;
857
+ }
858
+ .icure-form .float-right-btn {
859
+ position: absolute;
860
+ right: 10px;
861
+ cursor: pointer;
862
+ }
863
+ .icure-form .float-right-btn.top {
864
+ top: 6px;
865
+ }
866
+ .icure-form .float-right-btn.bottom {
867
+ bottom: -8px;
868
+ }
869
+
870
+ .icure-form-field {
871
+ align-items: end;
872
+ display: grid;
873
+ }
874
+
875
+ .error {
876
+ color: red;
877
+ font-size: 12px;
878
+ }
879
+
880
+ .icure-text-field > .icure-label, .icure-button-group > .icure-label {
881
+ z-index: 1;
882
+ pointer-events: none;
883
+ line-height: 1.4em;
884
+ cursor: text;
885
+ font-size: 12px;
886
+ left: 9px;
887
+ color: #084B83;
888
+ align-items: center;
889
+ height: 28px;
890
+ max-width: 85%;
891
+ min-width: 0;
892
+ }
893
+ .icure-text-field > .icure-label.float, .icure-button-group > .icure-label.float {
894
+ display: inline-block;
895
+ height: 1.4em;
896
+ white-space: nowrap;
897
+ text-overflow: ellipsis;
898
+ overflow: hidden;
899
+ }
900
+
901
+ .icure-text-field {
902
+ position: relative;
903
+ width: 100%;
904
+ flex-direction: row;
905
+ justify-content: stretch;
906
+ align-items: center;
907
+ }
908
+ .icure-text-field > .icure-label {
909
+ transition: transform 0.2s ease-out, color 0.2s ease-out;
910
+ }
911
+ .icure-text-field > .icure-input {
912
+ flex: 1 1 auto;
913
+ width: auto;
914
+ }
915
+ .icure-text-field > .icure-label.side {
916
+ position: relative;
917
+ }
918
+ .icure-text-field > .icure-label.side.left {
919
+ order: -1;
920
+ margin-right: 1em;
921
+ }
922
+ .icure-text-field > .icure-label.side.right {
923
+ order: 1;
924
+ margin-left: 1em;
925
+ }
926
+ .icure-text-field .icure-input,
927
+ .icure-text-field .input-container {
928
+ border-radius: 2px;
929
+ padding: 0 8px;
930
+ width: 100%;
931
+ box-sizing: border-box;
932
+ border-width: 1px;
933
+ border-style: solid;
934
+ outline: 0;
935
+ font: inherit;
936
+ font-size: 14px;
937
+ line-height: 1.4em;
938
+ display: flex;
939
+ align-items: center;
940
+ vertical-align: middle;
941
+ position: relative;
942
+ -webkit-appearance: none;
943
+ background-color: #ffffff;
944
+ border-color: red;
945
+ color: #000000;
946
+ box-sizing: border-box;
947
+ }
948
+ .icure-text-field .icure-input:focus, .icure-text-field .icure-input:focus-within,
949
+ .icure-text-field .input-container:focus,
950
+ .icure-text-field .input-container:focus-within {
951
+ box-shadow: 0 2px 2px 1px rgba(0, 0, 0, 0.06);
952
+ }
953
+ .icure-text-field .icure-input:hover,
954
+ .icure-text-field .input-container:hover {
955
+ border-color: rgba(0, 0, 0, 0.15);
956
+ box-shadow: none;
957
+ }
958
+ .icure-text-field .icure-input:hover:focus, .icure-text-field .icure-input:hover:focus-within,
959
+ .icure-text-field .input-container:hover:focus,
960
+ .icure-text-field .input-container:hover:focus-within {
961
+ box-shadow: 0 2px 2px 1px rgba(0, 0, 0, 0.06);
962
+ }
963
+ .icure-text-field .icure-input .ProseMirror,
964
+ .icure-text-field .input-container .ProseMirror {
965
+ padding: 0;
966
+ font-size: 14px;
967
+ line-height: 1.4em;
968
+ color: #000000;
969
+ }
970
+ .icure-text-field .icure-input .ProseMirror .date,
971
+ .icure-text-field .input-container .ProseMirror .date {
972
+ padding: 1px;
973
+ }
974
+ .icure-text-field .icure-input .ProseMirror .time,
975
+ .icure-text-field .input-container .ProseMirror .time {
976
+ padding: 1px;
977
+ }
978
+ .icure-text-field .icure-input .ProseMirror:focus .focused,
979
+ .icure-text-field .input-container .ProseMirror:focus .focused {
980
+ background-color: rgba(0, 0, 0, 0.05);
981
+ border-radius: 3px;
982
+ border-color: rgba(0, 0, 0, 0.1);
983
+ }
984
+ .icure-text-field .icure-input > svg,
985
+ .icure-text-field .input-container > svg {
986
+ opacity: 0.5;
987
+ }
988
+ .icure-text-field .icure-input > svg path,
989
+ .icure-text-field .input-container > svg path {
990
+ fill: #656565;
991
+ }
992
+ .icure-text-field .icure-input .extra,
993
+ .icure-text-field .input-container .extra {
994
+ height: 20px;
995
+ }
996
+ .icure-text-field .icure-input .extra > .info,
997
+ .icure-text-field .input-container .extra > .info {
998
+ color: #656565;
999
+ opacity: 0.5;
1000
+ }
1001
+ .icure-text-field .icure-input .extra .buttons-container .btn svg path,
1002
+ .icure-text-field .input-container .extra .buttons-container .btn svg path {
1003
+ fill: #656565;
1004
+ opacity: 0.5;
1005
+ }
1006
+ .icure-text-field .icure-input .extra .buttons-container .btn svg path:hover,
1007
+ .icure-text-field .input-container .extra .buttons-container .btn svg path:hover {
1008
+ fill: #656565;
1009
+ opacity: 1;
1010
+ }
1011
+
1012
+ input[type=radio] {
1013
+ margin-top: -1px;
1014
+ vertical-align: middle;
1015
+ }
1016
+
1017
+ .icure-checkbox:checked {
1018
+ accent-color: #06a070;
1019
+ }
1020
+
1021
+ .icure-button-group > div {
1022
+ display: grid;
1023
+ }
1024
+ .icure-button-group > div > div {
1025
+ display: flex;
1026
+ align-items: center;
1027
+ }
1028
+ .icure-button-group > div > div > .icure-button-group-label {
1029
+ z-index: 1;
1030
+ line-height: 1.4em;
1031
+ cursor: text;
1032
+ font-size: 12px;
1033
+ top: calc(1.4em + 1px);
1034
+ left: 9px;
1035
+ transition: transform 0.2s ease-out, color 0.2s ease-out;
1036
+ color: #084B83;
1037
+ display: flex;
1038
+ align-items: center;
1039
+ height: 28px;
1040
+ max-width: 85%;
1041
+ min-width: 0;
1042
+ }
1043
+ .icure-button-group > div > div > .icure-button-group-label > span {
1044
+ display: block;
1045
+ white-space: nowrap;
1046
+ text-overflow: ellipsis;
1047
+ overflow: hidden;
1048
+ padding-right: 8px;
1049
+ }
1050
+ .icure-button-group > .icure-input {
1051
+ flex: 1 1 auto;
1052
+ width: auto;
1053
+ }
1054
+ .icure-button-group > .icure-label {
1055
+ transform: translate(0, 0) scale(1);
1056
+ }
1057
+ .icure-button-group > .icure-label.above, .icure-button-group.has-content > .icure-label, .icure-button-group:focus > .icure-label, .icure-button-group:focus-within > .icure-label {
1058
+ font-weight: 500;
1059
+ height: 1.4em;
1060
+ }`;
1061
+ class MetadataButtonBar extends lit_1.LitElement {
1062
+ constructor() {
1063
+ super(...arguments);
1064
+ this.languages = {};
1065
+ this.displayedLabels = {};
1066
+ this.handleMetadataChanged = undefined;
1067
+ this.handleLanguageSelected = undefined;
1068
+ this.ownersProvider = () => __awaiter(this, void 0, void 0, function* () { return []; });
1069
+ this.displayOwnersMenu = false;
1070
+ this.ownerInputValue = '';
1071
+ this.availableOwners = [];
1072
+ this.loadedOwners = {};
1073
+ this.displayLanguagesMenu = false;
1074
+ this.displayValueDateMenu = false;
1075
+ this.languageInputValue = '';
1076
+ this.displayVersionsMenu = false;
1077
+ }
1078
+ static get styles() {
1079
+ return [baseCss];
1080
+ }
1081
+ _handleClickOutside(event) {
1082
+ if (!event.composedPath().includes(this)) {
1083
+ this.displayVersionsMenu = false;
1084
+ this.displayLanguagesMenu = false;
1085
+ this.displayOwnersMenu = false;
1086
+ this.displayValueDateMenu = false;
1087
+ event.stopPropagation();
1088
+ }
1089
+ }
1090
+ connectedCallback() {
1091
+ super.connectedCallback();
1092
+ document.addEventListener('click', this._handleClickOutside.bind(this));
1093
+ }
1094
+ disconnectedCallback() {
1095
+ super.disconnectedCallback();
1096
+ document.removeEventListener('click', this._handleClickOutside.bind(this));
1097
+ }
1098
+ render() {
1099
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
1100
+ const metadata = this.metadata;
1101
+ const revision = this.revision;
1102
+ const revisionDate = this.revisionDate;
1103
+ const owner = metadata === null || metadata === void 0 ? void 0 : metadata.owner;
1104
+ if (owner && !this.loadedOwners[owner]) {
1105
+ this.loadedOwners = Object.assign(Object.assign({}, this.loadedOwners), { [owner]: { id: owner, text: '', terms: [], label: {} } }); // Make sure we do not loop endlessly
1106
+ this.ownersProvider &&
1107
+ this.ownersProvider([], [owner]).then((availableOwners) => (this.loadedOwners = availableOwners.reduce((acc, o) => (Object.assign(Object.assign({}, acc), { [o.id]: o })), this.loadedOwners)));
1108
+ }
1109
+ const forcedByMenu = this.displayOwnersMenu || this.displayLanguagesMenu || this.displayValueDateMenu || this.displayVersionsMenu;
1110
+ const discordantMetadata = (_b = (_a = this.metadata) === null || _a === void 0 ? void 0 : _a.discordantMetadata) === null || _b === void 0 ? void 0 : _b.call(_a);
1111
+ const forcedByOwner = (discordantMetadata === null || discordantMetadata === void 0 ? void 0 : discordantMetadata.owner) !== undefined;
1112
+ const forcedByValueDate = (discordantMetadata === null || discordantMetadata === void 0 ? void 0 : discordantMetadata.valueDate) !== undefined;
1113
+ const forcedByLanguage = this.selectedLanguage && this.defaultLanguage !== this.selectedLanguage;
1114
+ return (0, lit_1.html) ` <div id="extra" class=${'extra' + (forcedByMenu ? ' forced' : '')}>
1115
+ <div class="info ${forcedByOwner || forcedByLanguage || forcedByValueDate ? 'hidden' : ''}">•</div>
1116
+ <div class="buttons-container">
1117
+ <div class="menu-container">
1118
+ <button
1119
+ data-content="${(_d = ((metadata === null || metadata === void 0 ? void 0 : metadata.owner) ? (_c = this.loadedOwners[metadata === null || metadata === void 0 ? void 0 : metadata.owner]) === null || _c === void 0 ? void 0 : _c.text : '')) !== null && _d !== void 0 ? _d : ''}"
1120
+ @click="${() => this.toggleOwnerMenu(metadata === null || metadata === void 0 ? void 0 : metadata.owner)}"
1121
+ class="btn menu-trigger author ${forcedByOwner ? 'forced' : ''}"
1122
+ >
1123
+ ${paths_1.ownerPicto}
1124
+ </button>
1125
+ ${this.displayOwnersMenu
1126
+ ? (0, lit_1.html) `
1127
+ <div id="menu" class="menu">
1128
+ <div class="input-container">${paths_1.searchPicto} <input id="ownerSearch" @input="${this.searchOwner}" /></div>
1129
+ ${(_f = (((_e = this.availableOwners) === null || _e === void 0 ? void 0 : _e.length) ? this.availableOwners : Object.values(this.loadedOwners))) === null || _f === void 0 ? void 0 : _f.map((x) => (0, lit_1.html) `<button @click="${() => this.handleOwnerButtonClicked(x.id)}" id="${x.id}" class="item">${x.text}</button>`)}
1130
+ </div>
1131
+ `
1132
+ : ''}
1133
+ </div>
1134
+ <div class="menu-container">
1135
+ <button
1136
+ data-content="${(metadata === null || metadata === void 0 ? void 0 : metadata.valueDate) ? (0, date_fns_1.format)((0, dates_1.anyDateToDate)(metadata.valueDate), 'yyyy-MM-dd HH:mm:ss').replace(/ 00:00:00$/, '') : ''}"
1137
+ class="btn date ${forcedByValueDate ? 'forced' : ''}"
1138
+ @click="${() => this.toggleValueDateMenu()}"
1139
+ >
1140
+ ${paths_1.datePicto}
1141
+ </button>
1142
+ ${this.displayValueDateMenu
1143
+ ? (0, lit_1.html) `
1144
+ <div id="menu" class="menu value-date-menu">
1145
+ <app-date-picker
1146
+ locale="${(_g = this.defaultLanguage) !== null && _g !== void 0 ? _g : 'en'}"
1147
+ style=""
1148
+ max="${constants_1.MAX_DATE}"
1149
+ min="${(0, to_resolved_date_1.toResolvedDate)('1900-01-01')}"
1150
+ @date-updated="${this.dateUpdated}"
1151
+ ></app-date-picker>
1152
+ </div>
1153
+ `
1154
+ : ''}
1155
+ </div>
1156
+ <div class="menu-container">
1157
+ <button
1158
+ data-content="${revision === null ? 'latest' : revision ? `${revision.split('-')[0]} ${revisionDate ? `(${(0, date_fns_1.format)(new Date(revisionDate), 'yyyy-MM-dd')})` : ''}` : ''}"
1159
+ class="btn version"
1160
+ >
1161
+ ${paths_1.versionPicto}
1162
+ </button>
1163
+ </div>
1164
+ <div class="menu-container">
1165
+ <button
1166
+ data-content="${this.selectedLanguage ? (_h = (0, languages_1.languageName)(this.selectedLanguage)) !== null && _h !== void 0 ? _h : this.selectedLanguage : (_j = (0, languages_1.languageName)(this.defaultLanguage)) !== null && _j !== void 0 ? _j : this.defaultLanguage}"
1167
+ @click="${this.toggleLanguageMenu}"
1168
+ class="btn menu-trigger language ${forcedByLanguage ? 'forced' : ''}"
1169
+ >
1170
+ ${paths_1.i18nPicto}
1171
+ </button>
1172
+ ${this.displayLanguagesMenu
1173
+ ? (0, lit_1.html) `
1174
+ <div id="menu" class="menu">
1175
+ <div class="input-container">${paths_1.searchPicto} <input id="languageSearch" @input="${this.searchLanguage}" /></div>
1176
+ ${[this.defaultLanguage, ...Object.keys(this.languages).filter((x) => x !== this.defaultLanguage)]
1177
+ .filter((x) => { var _a, _b, _c; return !!x && ((_b = (_a = (0, languages_1.languageName)(x)) !== null && _a !== void 0 ? _a : this.languages[x]) !== null && _b !== void 0 ? _b : x).toLowerCase().includes(((_c = this.languageInputValue) !== null && _c !== void 0 ? _c : '').toLowerCase()); })
1178
+ .map((x) => (0, lit_1.html) `<button @click="${() => this.handleLanguageButtonClicked(x)}" id="${x}" class="item">${x ? (0, languages_1.languageName)(x) : ''}</button>`)}
1179
+ </div>
1180
+ `
1181
+ : ''}
1182
+ </div>
1183
+ </div>
1184
+ </div>`;
1185
+ }
1186
+ toggleOwnerMenu(ownerId) {
1187
+ this.displayOwnersMenu = !this.displayOwnersMenu;
1188
+ if (this.displayOwnersMenu) {
1189
+ this.displayLanguagesMenu = false;
1190
+ this.displayVersionsMenu = false;
1191
+ this.displayValueDateMenu = false;
1192
+ setTimeout(() => {
1193
+ var _a;
1194
+ ;
1195
+ (_a = this.renderRoot.querySelector('#ownerSearch')) === null || _a === void 0 ? void 0 : _a.focus();
1196
+ }, 0);
1197
+ }
1198
+ }
1199
+ searchOwner(e) {
1200
+ const text = e.target.value;
1201
+ setTimeout(() => __awaiter(this, void 0, void 0, function* () {
1202
+ var _a;
1203
+ if (((_a = this.renderRoot.querySelector('#ownerSearch')) === null || _a === void 0 ? void 0 : _a.value) === text) {
1204
+ if (this.ownersProvider) {
1205
+ const availableOwners = yield this.ownersProvider(text.split(' '));
1206
+ console.log(availableOwners);
1207
+ this.availableOwners = availableOwners;
1208
+ }
1209
+ }
1210
+ }), 300);
1211
+ }
1212
+ searchLanguage(e) {
1213
+ this.languageInputValue = e.target.value;
1214
+ }
1215
+ handleOwnerButtonClicked(id) {
1216
+ const valueId = this.valueId;
1217
+ this.handleMetadataChanged && valueId && this.handleMetadataChanged({ label: this.metadata.label, owner: id });
1218
+ this.displayOwnersMenu = false;
1219
+ }
1220
+ handleLanguageButtonClicked(id) {
1221
+ var _a;
1222
+ (_a = this.handleLanguageSelected) === null || _a === void 0 ? void 0 : _a.call(this, id);
1223
+ this.displayOwnersMenu = false;
1224
+ }
1225
+ toggleValueDateMenu() {
1226
+ this.displayValueDateMenu = !this.displayValueDateMenu;
1227
+ if (this.displayValueDateMenu) {
1228
+ this.displayOwnersMenu = false;
1229
+ this.displayLanguagesMenu = false;
1230
+ this.displayVersionsMenu = false;
1231
+ }
1232
+ }
1233
+ dateUpdated(date) {
1234
+ var _a;
1235
+ const parts = (_a = date.detail.value) === null || _a === void 0 ? void 0 : _a.split('-');
1236
+ if (parts && parts.length === 3) {
1237
+ const fuzzyDateValue = parseInt(parts[0]) * 10000 + parseInt(parts[1]) * 100 + parseInt(parts[2]);
1238
+ const valueId = this.valueId;
1239
+ this.handleMetadataChanged && this.handleMetadataChanged({ label: this.metadata.label, valueDate: fuzzyDateValue * 1000000 }, valueId);
1240
+ this.displayOwnersMenu = false;
1241
+ }
1242
+ }
1243
+ toggleLanguageMenu() {
1244
+ this.displayLanguagesMenu = !this.displayLanguagesMenu;
1245
+ if (this.displayLanguagesMenu) {
1246
+ this.displayOwnersMenu = false;
1247
+ this.displayVersionsMenu = false;
1248
+ this.displayValueDateMenu = false;
1249
+ }
1250
+ }
1251
+ }
1252
+ exports.MetadataButtonBar = MetadataButtonBar;
1253
+ __decorate([
1254
+ (0, decorators_js_1.property)(),
1255
+ __metadata("design:type", String)
1256
+ ], MetadataButtonBar.prototype, "valueId", void 0);
1257
+ __decorate([
1258
+ (0, decorators_js_1.property)(),
1259
+ __metadata("design:type", Object)
1260
+ ], MetadataButtonBar.prototype, "metadata", void 0);
1261
+ __decorate([
1262
+ (0, decorators_js_1.property)(),
1263
+ __metadata("design:type", String)
1264
+ ], MetadataButtonBar.prototype, "revision", void 0);
1265
+ __decorate([
1266
+ (0, decorators_js_1.property)(),
1267
+ __metadata("design:type", Number)
1268
+ ], MetadataButtonBar.prototype, "revisionDate", void 0);
1269
+ __decorate([
1270
+ (0, decorators_js_1.property)(),
1271
+ __metadata("design:type", String)
1272
+ ], MetadataButtonBar.prototype, "defaultLanguage", void 0);
1273
+ __decorate([
1274
+ (0, decorators_js_1.property)(),
1275
+ __metadata("design:type", String)
1276
+ ], MetadataButtonBar.prototype, "selectedLanguage", void 0);
1277
+ __decorate([
1278
+ (0, decorators_js_1.property)(),
1279
+ __metadata("design:type", Object)
1280
+ ], MetadataButtonBar.prototype, "languages", void 0);
1281
+ __decorate([
1282
+ (0, decorators_js_1.property)(),
1283
+ __metadata("design:type", Object)
1284
+ ], MetadataButtonBar.prototype, "displayedLabels", void 0);
1285
+ __decorate([
1286
+ (0, decorators_js_1.property)(),
1287
+ __metadata("design:type", Function)
1288
+ ], MetadataButtonBar.prototype, "handleMetadataChanged", void 0);
1289
+ __decorate([
1290
+ (0, decorators_js_1.property)(),
1291
+ __metadata("design:type", Function)
1292
+ ], MetadataButtonBar.prototype, "handleLanguageSelected", void 0);
1293
+ __decorate([
1294
+ (0, decorators_js_1.property)(),
1295
+ __metadata("design:type", Function)
1296
+ ], MetadataButtonBar.prototype, "ownersProvider", void 0);
1297
+ __decorate([
1298
+ (0, decorators_js_1.state)(),
1299
+ __metadata("design:type", Object)
1300
+ ], MetadataButtonBar.prototype, "displayOwnersMenu", void 0);
1301
+ __decorate([
1302
+ (0, decorators_js_1.state)(),
1303
+ __metadata("design:type", Object)
1304
+ ], MetadataButtonBar.prototype, "ownerInputValue", void 0);
1305
+ __decorate([
1306
+ (0, decorators_js_1.state)(),
1307
+ __metadata("design:type", Array)
1308
+ ], MetadataButtonBar.prototype, "availableOwners", void 0);
1309
+ __decorate([
1310
+ (0, decorators_js_1.state)(),
1311
+ __metadata("design:type", Object)
1312
+ ], MetadataButtonBar.prototype, "loadedOwners", void 0);
1313
+ __decorate([
1314
+ (0, decorators_js_1.state)(),
1315
+ __metadata("design:type", Object)
1316
+ ], MetadataButtonBar.prototype, "displayLanguagesMenu", void 0);
1317
+ __decorate([
1318
+ (0, decorators_js_1.state)(),
1319
+ __metadata("design:type", Object)
1320
+ ], MetadataButtonBar.prototype, "displayValueDateMenu", void 0);
1321
+ __decorate([
1322
+ (0, decorators_js_1.state)(),
1323
+ __metadata("design:type", Object)
1324
+ ], MetadataButtonBar.prototype, "languageInputValue", void 0);
1325
+ __decorate([
1326
+ (0, decorators_js_1.state)(),
1327
+ __metadata("design:type", Object)
1328
+ ], MetadataButtonBar.prototype, "displayVersionsMenu", void 0);
1329
+ //# sourceMappingURL=metadata-buttons-bar.js.map