@limetech/lime-elements 36.0.0-next.9 → 36.1.0-next.1
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/dist/cjs/{dateFormatter-05d80b12.js → dateFormatter-d7a8d40d.js} +1 -1
- package/dist/cjs/{format-c0047dfb.js → format-e682e922.js} +1 -1
- package/dist/cjs/lime-elements.cjs.js +1 -1
- package/dist/cjs/limel-badge.cjs.entry.js +23 -3
- package/dist/cjs/limel-button.cjs.entry.js +1 -1
- package/dist/cjs/limel-chip-set.cjs.entry.js +19 -11
- package/dist/cjs/limel-circular-progress.cjs.entry.js +1 -1
- package/dist/cjs/limel-code-editor.cjs.entry.js +1596 -2
- package/dist/cjs/limel-collapsible-section.cjs.entry.js +1 -1
- package/dist/cjs/limel-date-picker.cjs.entry.js +3 -3
- package/dist/cjs/limel-dock-button.cjs.entry.js +32 -6
- package/dist/cjs/limel-dock.cjs.entry.js +4 -7
- package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js +2 -2
- package/dist/cjs/limel-form.cjs.entry.js +1 -1
- package/dist/cjs/limel-input-field.cjs.entry.js +13 -6
- package/dist/cjs/limel-menu-list.cjs.entry.js +2 -3
- package/dist/cjs/limel-menu.cjs.entry.js +3 -14
- package/dist/cjs/limel-popover_4.cjs.entry.js +1 -1
- package/dist/cjs/limel-progress-flow-item.cjs.entry.js +1 -1
- package/dist/cjs/limel-select.cjs.entry.js +4 -5
- package/dist/cjs/limel-table.cjs.entry.js +17 -5
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{moment-5cfac5cd.js → moment-d1e35cdc.js} +2 -2
- package/dist/collection/components/badge/badge.css +13 -0
- package/dist/collection/components/badge/badge.js +30 -7
- package/dist/collection/components/badge/format.js +1 -1
- package/dist/collection/components/button/button.css +11 -7
- package/dist/collection/components/chip-set/chip-set.css +6 -2
- package/dist/collection/components/chip-set/chip-set.js +21 -13
- package/dist/collection/components/code-editor/code-editor.css +153 -1
- package/dist/collection/components/code-editor/code-editor.js +90 -2
- package/dist/collection/components/collapsible-section/collapsible-section.css +8 -7
- package/dist/collection/components/date-picker/date-picker.js +18 -1
- package/dist/collection/components/dock/dock-button/dock-button.css +15 -9
- package/dist/collection/components/dock/dock-button/dock-button.js +61 -24
- package/dist/collection/components/dock/dock.css +7 -3
- package/dist/collection/components/dock/dock.js +37 -7
- package/dist/collection/components/input-field/input-field.js +32 -7
- package/dist/collection/components/menu/menu.js +3 -14
- package/dist/collection/components/menu-list/menu-list.js +5 -25
- package/dist/collection/components/popover-surface/popover-surface.css +5 -4
- package/dist/collection/components/progress-flow/progress-flow-item/progress-flow-item.css +21 -8
- package/dist/collection/components/select/select.css +10 -11
- package/dist/collection/components/select/select.template.js +3 -4
- package/dist/collection/components/table/columns.js +1 -0
- package/dist/collection/components/table/layout.js +8 -0
- package/dist/collection/components/table/table.css +89 -61
- package/dist/collection/components/table/table.js +46 -15
- package/dist/collection/style/internal/codemirror-tooltip.scss +19 -0
- package/dist/collection/style/mixins.scss +11 -0
- package/dist/esm/{dateFormatter-2cad0292.js → dateFormatter-784c3334.js} +1 -1
- package/dist/esm/{format-a0e2d949.js → format-ce615e29.js} +1 -1
- package/dist/esm/lime-elements.js +1 -1
- package/dist/esm/limel-badge.entry.js +24 -4
- package/dist/esm/limel-button.entry.js +1 -1
- package/dist/esm/limel-chip-set.entry.js +19 -11
- package/dist/esm/limel-circular-progress.entry.js +1 -1
- package/dist/esm/limel-code-editor.entry.js +1596 -2
- package/dist/esm/limel-collapsible-section.entry.js +1 -1
- package/dist/esm/limel-date-picker.entry.js +3 -3
- package/dist/esm/limel-dock-button.entry.js +32 -6
- package/dist/esm/limel-dock.entry.js +4 -7
- package/dist/esm/limel-flatpickr-adapter.entry.js +2 -2
- package/dist/esm/limel-form.entry.js +1 -1
- package/dist/esm/limel-input-field.entry.js +13 -6
- package/dist/esm/limel-menu-list.entry.js +2 -3
- package/dist/esm/limel-menu.entry.js +3 -14
- package/dist/esm/limel-popover_4.entry.js +1 -1
- package/dist/esm/limel-progress-flow-item.entry.js +1 -1
- package/dist/esm/limel-select.entry.js +4 -5
- package/dist/esm/limel-table.entry.js +18 -6
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{moment-367e51c5.js → moment-faa8a4a8.js} +2 -2
- package/dist/lime-elements/lime-elements.css +1 -1
- package/dist/lime-elements/lime-elements.esm.js +1 -1
- package/dist/lime-elements/{p-7e571ec6.entry.js → p-0ba0c38a.entry.js} +1 -1
- package/dist/lime-elements/p-104c89e8.entry.js +1 -0
- package/dist/lime-elements/p-1390fdcb.entry.js +126 -0
- package/dist/lime-elements/{p-1dfccbc5.entry.js → p-2fc4f4ff.entry.js} +1 -1
- package/dist/lime-elements/p-3cf4aae0.entry.js +1 -0
- package/dist/lime-elements/p-4dc07252.entry.js +82 -0
- package/dist/lime-elements/p-56cf969c.entry.js +1 -0
- package/dist/lime-elements/p-5ef52589.entry.js +1 -0
- package/dist/lime-elements/p-653faf47.entry.js +1 -0
- package/dist/lime-elements/{p-d76f896d.js → p-73df4d83.js} +1 -1
- package/dist/lime-elements/{p-f08f504b.js → p-93e92a2a.js} +1 -1
- package/dist/lime-elements/p-93f42a32.entry.js +1 -0
- package/dist/lime-elements/p-945afca2.js +3 -0
- package/dist/lime-elements/{p-53e01330.entry.js → p-9a38a71e.entry.js} +1 -1
- package/dist/lime-elements/p-b0e54dc2.entry.js +1 -0
- package/dist/lime-elements/p-c15da26d.entry.js +1 -0
- package/dist/lime-elements/{p-af0ec482.entry.js → p-c544c05b.entry.js} +1 -1
- package/dist/lime-elements/p-c59cbd68.entry.js +1 -0
- package/dist/lime-elements/p-cb8db8c2.entry.js +37 -0
- package/dist/lime-elements/p-f41567a1.entry.js +1 -0
- package/dist/lime-elements/p-f5df4d4f.entry.js +1 -0
- package/dist/lime-elements/style/internal/codemirror-tooltip.scss +19 -0
- package/dist/lime-elements/style/mixins.scss +11 -0
- package/dist/types/components/badge/badge.d.ts +12 -4
- package/dist/types/components/chip-set/chip-set.d.ts +3 -2
- package/dist/types/components/code-editor/code-editor.d.ts +14 -0
- package/dist/types/components/date-picker/date-picker.d.ts +4 -0
- package/dist/types/components/dock/dock-button/dock-button.d.ts +21 -5
- package/dist/types/components/dock/dock.d.ts +11 -3
- package/dist/types/components/input-field/input-field.d.ts +6 -0
- package/dist/types/components/menu/menu.d.ts +1 -2
- package/dist/types/components/menu-list/menu-list.d.ts +2 -7
- package/dist/types/components/table/layout.d.ts +2 -0
- package/dist/types/components/table/table.d.ts +16 -1
- package/dist/types/components/table/table.types.d.ts +4 -0
- package/dist/types/components.d.ts +71 -19
- package/package.json +5 -4
- package/dist/lime-elements/p-1a2ffe75.entry.js +0 -82
- package/dist/lime-elements/p-1e59114e.entry.js +0 -1
- package/dist/lime-elements/p-3af5f9ad.js +0 -3
- package/dist/lime-elements/p-42b67933.entry.js +0 -1
- package/dist/lime-elements/p-5ad60e14.entry.js +0 -126
- package/dist/lime-elements/p-64f068a8.entry.js +0 -1
- package/dist/lime-elements/p-6884b012.entry.js +0 -1
- package/dist/lime-elements/p-6966b5df.entry.js +0 -1
- package/dist/lime-elements/p-722d32e0.entry.js +0 -1
- package/dist/lime-elements/p-75152d89.entry.js +0 -1
- package/dist/lime-elements/p-7ee4b825.entry.js +0 -1
- package/dist/lime-elements/p-97d6c4a6.entry.js +0 -1
- package/dist/lime-elements/p-b95e80c9.entry.js +0 -1
- package/dist/lime-elements/p-bd098a11.entry.js +0 -1
- package/dist/lime-elements/p-d1ee4501.entry.js +0 -37
|
@@ -343,15 +343,125 @@ div.CodeMirror-dragcursors {
|
|
|
343
343
|
/* Help users use markselection to safely style text background */
|
|
344
344
|
span.CodeMirror-selectedtext { background: none; }
|
|
345
345
|
|
|
346
|
+
/* The lint marker gutter */
|
|
347
|
+
.CodeMirror-lint-markers {
|
|
348
|
+
width: 16px;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
.CodeMirror-lint-tooltip {
|
|
352
|
+
background-color: #ffd;
|
|
353
|
+
border: 1px solid black;
|
|
354
|
+
border-radius: 4px 4px 4px 4px;
|
|
355
|
+
color: black;
|
|
356
|
+
font-family: monospace;
|
|
357
|
+
font-size: 10pt;
|
|
358
|
+
overflow: hidden;
|
|
359
|
+
padding: 2px 5px;
|
|
360
|
+
position: fixed;
|
|
361
|
+
white-space: pre;
|
|
362
|
+
white-space: pre-wrap;
|
|
363
|
+
z-index: 100;
|
|
364
|
+
max-width: 600px;
|
|
365
|
+
opacity: 0;
|
|
366
|
+
transition: opacity .4s;
|
|
367
|
+
-moz-transition: opacity .4s;
|
|
368
|
+
-webkit-transition: opacity .4s;
|
|
369
|
+
-o-transition: opacity .4s;
|
|
370
|
+
-ms-transition: opacity .4s;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
.CodeMirror-lint-mark {
|
|
374
|
+
background-position: left bottom;
|
|
375
|
+
background-repeat: repeat-x;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
.CodeMirror-lint-mark-warning {
|
|
379
|
+
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII=");
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
.CodeMirror-lint-mark-error {
|
|
383
|
+
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==");
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
.CodeMirror-lint-marker {
|
|
387
|
+
background-position: center center;
|
|
388
|
+
background-repeat: no-repeat;
|
|
389
|
+
cursor: pointer;
|
|
390
|
+
display: inline-block;
|
|
391
|
+
height: 16px;
|
|
392
|
+
width: 16px;
|
|
393
|
+
vertical-align: middle;
|
|
394
|
+
position: relative;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
.CodeMirror-lint-message {
|
|
398
|
+
padding-left: 18px;
|
|
399
|
+
background-position: top left;
|
|
400
|
+
background-repeat: no-repeat;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
.CodeMirror-lint-marker-warning, .CodeMirror-lint-message-warning {
|
|
404
|
+
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAANlBMVEX/uwDvrwD/uwD/uwD/uwD/uwD/uwD/uwD/uwD6twD/uwAAAADurwD2tQD7uAD+ugAAAAD/uwDhmeTRAAAADHRSTlMJ8mN1EYcbmiixgACm7WbuAAAAVklEQVR42n3PUQqAIBBFUU1LLc3u/jdbOJoW1P08DA9Gba8+YWJ6gNJoNYIBzAA2chBth5kLmG9YUoG0NHAUwFXwO9LuBQL1giCQb8gC9Oro2vp5rncCIY8L8uEx5ZkAAAAASUVORK5CYII=");
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
.CodeMirror-lint-marker-error, .CodeMirror-lint-message-error {
|
|
408
|
+
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAHlBMVEW7AAC7AACxAAC7AAC7AAAAAAC4AAC5AAD///+7AAAUdclpAAAABnRSTlMXnORSiwCK0ZKSAAAATUlEQVR42mWPOQ7AQAgDuQLx/z8csYRmPRIFIwRGnosRrpamvkKi0FTIiMASR3hhKW+hAN6/tIWhu9PDWiTGNEkTtIOucA5Oyr9ckPgAWm0GPBog6v4AAAAASUVORK5CYII=");
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
.CodeMirror-lint-marker-multiple {
|
|
412
|
+
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAMAAADzjKfhAAAACVBMVEUAAAAAAAC/v7914kyHAAAAAXRSTlMAQObYZgAAACNJREFUeNo1ioEJAAAIwmz/H90iFFSGJgFMe3gaLZ0od+9/AQZ0ADosbYraAAAAAElFTkSuQmCC");
|
|
413
|
+
background-repeat: no-repeat;
|
|
414
|
+
background-position: right bottom;
|
|
415
|
+
width: 100%; height: 100%;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
.CodeMirror-lint-line-error {
|
|
419
|
+
background-color: rgba(183, 76, 81, 0.08);
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
.CodeMirror-lint-line-warning {
|
|
423
|
+
background-color: rgba(255, 211, 0, 0.1);
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
.CodeMirror-foldmarker {
|
|
427
|
+
color: blue;
|
|
428
|
+
text-shadow: #b9f 1px 1px 2px, #b9f -1px -1px 2px, #b9f 1px -1px 2px, #b9f -1px 1px 2px;
|
|
429
|
+
font-family: arial;
|
|
430
|
+
line-height: .3;
|
|
431
|
+
cursor: pointer;
|
|
432
|
+
}
|
|
433
|
+
.CodeMirror-foldgutter {
|
|
434
|
+
width: .7em;
|
|
435
|
+
}
|
|
436
|
+
.CodeMirror-foldgutter-open,
|
|
437
|
+
.CodeMirror-foldgutter-folded {
|
|
438
|
+
cursor: pointer;
|
|
439
|
+
}
|
|
440
|
+
.CodeMirror-foldgutter-open:after {
|
|
441
|
+
content: "\25BE";
|
|
442
|
+
}
|
|
443
|
+
.CodeMirror-foldgutter-folded:after {
|
|
444
|
+
content: "\25B8";
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
/*
|
|
448
|
+
* This file is imported into every component!
|
|
449
|
+
*
|
|
450
|
+
* Nothing in this file may output any CSS
|
|
451
|
+
* without being explicitly called by outside code.
|
|
452
|
+
*/
|
|
346
453
|
/**
|
|
347
454
|
* @prop --code-editor-max-height: Defines how tall the code editor can get before content becomes scrollable, defaults to `10rem`.
|
|
455
|
+
* @prop --code-editor-font-size: Defines the font size of the code, defaults to `0.875rem`.
|
|
348
456
|
*/
|
|
349
457
|
:host {
|
|
350
458
|
display: flex;
|
|
351
|
-
font-size:
|
|
459
|
+
font-size: var(--code-editor-font-size, 0.875rem);
|
|
352
460
|
}
|
|
353
461
|
|
|
354
462
|
.editor {
|
|
463
|
+
display: flex;
|
|
464
|
+
align-items: stretch;
|
|
355
465
|
width: 100%;
|
|
356
466
|
}
|
|
357
467
|
.editor.is-light-mode {
|
|
@@ -477,6 +587,7 @@ span.CodeMirror-selectedtext { background: none; }
|
|
|
477
587
|
background-color: rgb(var(--code-editor-background-color));
|
|
478
588
|
border-radius: 0.25rem;
|
|
479
589
|
height: auto;
|
|
590
|
+
width: 100%;
|
|
480
591
|
}
|
|
481
592
|
.cm-s-lime .CodeMirror-scroll {
|
|
482
593
|
max-height: var(--code-editor-max-height, 10rem);
|
|
@@ -518,4 +629,45 @@ span.CodeMirror-selectedtext { background: none; }
|
|
|
518
629
|
bottom: -0.4rem;
|
|
519
630
|
left: 0;
|
|
520
631
|
right: 0;
|
|
632
|
+
}
|
|
633
|
+
.cm-s-lime .CodeMirror-lint-marker-error,
|
|
634
|
+
.cm-s-lime .CodeMirror-lint-message-error {
|
|
635
|
+
background-image: url("data:image/svg+xml; utf8, <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><defs/><path fill='rgb(255,255,255)' d='M7.219 5.781L5.78 7.22 14.563 16 5.78 24.781 7.22 26.22 16 17.437l8.781 8.782 1.438-1.438L17.437 16l8.782-8.781L24.78 5.78 16 14.563z'/></svg>");
|
|
636
|
+
background-color: rgb(var(--color-red-default));
|
|
637
|
+
background-size: 0.75rem;
|
|
638
|
+
border-radius: 50%;
|
|
639
|
+
}
|
|
640
|
+
.cm-s-lime .CodeMirror-foldmarker {
|
|
641
|
+
position: relative;
|
|
642
|
+
transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease-out;
|
|
643
|
+
box-shadow: var(--button-shadow-normal);
|
|
644
|
+
color: transparent;
|
|
645
|
+
text-shadow: none;
|
|
646
|
+
padding: 0 0.5rem;
|
|
647
|
+
border-radius: 1rem;
|
|
648
|
+
background-image: url("data:image/svg+xml; utf8, <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' xml:space='preserve'><circle cx='16' cy='16' r='2'/><circle cx='26' cy='16' r='2'/><circle cx='6' cy='16' r='2'/></svg>");
|
|
649
|
+
background-size: contain;
|
|
650
|
+
background-repeat: no-repeat;
|
|
651
|
+
background-position: center;
|
|
652
|
+
}
|
|
653
|
+
.cm-s-lime .CodeMirror-foldmarker:hover {
|
|
654
|
+
box-shadow: var(--button-shadow-hovered);
|
|
655
|
+
}
|
|
656
|
+
.cm-s-lime .CodeMirror-foldmarker:active {
|
|
657
|
+
box-shadow: var(--button-shadow-pressed);
|
|
658
|
+
transform: translate3d(0, 0.08rem, 0);
|
|
659
|
+
}
|
|
660
|
+
.is-dark-mode .cm-s-lime .CodeMirror-foldmarker {
|
|
661
|
+
background-color: rgb(var(--contrast-1200));
|
|
662
|
+
}
|
|
663
|
+
.cm-s-lime [class^=CodeMirror-foldgutter] {
|
|
664
|
+
color: var(--code-editor-neutral-text-color);
|
|
665
|
+
transition: opacity 0.2s ease;
|
|
666
|
+
opacity: 0.4;
|
|
667
|
+
}
|
|
668
|
+
.cm-s-lime [class^=CodeMirror-foldgutter]:hover {
|
|
669
|
+
opacity: 1;
|
|
670
|
+
}
|
|
671
|
+
.cm-s-lime .CodeMirror-foldgutter-folded {
|
|
672
|
+
opacity: 0.7;
|
|
521
673
|
}
|
|
@@ -1,14 +1,20 @@
|
|
|
1
|
-
import { Component, h, Prop, Element, Event, State, } from '@stencil/core';
|
|
1
|
+
import { Component, h, Prop, Element, Event, State, Watch, } from '@stencil/core';
|
|
2
2
|
import CodeMirror from 'codemirror';
|
|
3
3
|
import 'codemirror/mode/javascript/javascript';
|
|
4
4
|
import 'codemirror/addon/selection/active-line';
|
|
5
5
|
import 'codemirror/addon/edit/matchbrackets';
|
|
6
|
+
import 'codemirror/addon/lint/lint';
|
|
7
|
+
import 'codemirror/addon/lint/json-lint';
|
|
8
|
+
import 'codemirror/addon/fold/foldgutter';
|
|
9
|
+
import 'codemirror/addon/fold/brace-fold';
|
|
10
|
+
import jslint from 'jsonlint-mod';
|
|
6
11
|
/**
|
|
7
12
|
* Currently this component support syntax highlighting for `javascript`,
|
|
8
13
|
`json` and `typescript` formats.
|
|
9
14
|
*
|
|
10
15
|
* @exampleComponent limel-example-code-editor
|
|
11
16
|
* @exampleComponent limel-example-code-editor-readonly-with-line-numbers
|
|
17
|
+
* @exampleComponent limel-example-code-editor-fold-lint
|
|
12
18
|
*/
|
|
13
19
|
export class CodeEditor {
|
|
14
20
|
constructor() {
|
|
@@ -24,6 +30,14 @@ export class CodeEditor {
|
|
|
24
30
|
* Displays line numbers in the editor
|
|
25
31
|
*/
|
|
26
32
|
this.lineNumbers = false;
|
|
33
|
+
/**
|
|
34
|
+
* Allows the user to fold code
|
|
35
|
+
*/
|
|
36
|
+
this.fold = false;
|
|
37
|
+
/**
|
|
38
|
+
* Enables linting of JSON content
|
|
39
|
+
*/
|
|
40
|
+
this.lint = false;
|
|
27
41
|
/**
|
|
28
42
|
* Select color scheme for the editor
|
|
29
43
|
*/
|
|
@@ -65,16 +79,37 @@ export class CodeEditor {
|
|
|
65
79
|
}
|
|
66
80
|
this.editor = this.createEditor();
|
|
67
81
|
}
|
|
82
|
+
watchValue(newValue) {
|
|
83
|
+
if (!this.editor) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
const currentValue = this.editor.getValue();
|
|
87
|
+
if (newValue === currentValue) {
|
|
88
|
+
// Circuit breaker for when the change comes from the editor itself
|
|
89
|
+
// The caret position will be reset without this
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
this.editor.getDoc().setValue(newValue || '');
|
|
93
|
+
}
|
|
68
94
|
createEditor() {
|
|
69
95
|
const options = this.getOptions();
|
|
70
96
|
const editor = CodeMirror(this.host.shadowRoot.querySelector('.editor'), options);
|
|
71
97
|
editor.on('change', this.handleChange);
|
|
98
|
+
// Replace tab with spaces and use the actual indent setting for
|
|
99
|
+
// the space count
|
|
100
|
+
editor.setOption('extraKeys', {
|
|
101
|
+
Tab: (codeMirror) => {
|
|
102
|
+
const spaces = Array(codeMirror.getOption('indentUnit') + 1).join(' ');
|
|
103
|
+
codeMirror.replaceSelection(spaces);
|
|
104
|
+
},
|
|
105
|
+
});
|
|
72
106
|
return editor;
|
|
73
107
|
}
|
|
74
108
|
getOptions() {
|
|
75
109
|
let mode = this.language;
|
|
76
110
|
const TAB_SIZE = 4;
|
|
77
111
|
let theme = 'lime light';
|
|
112
|
+
const gutters = [];
|
|
78
113
|
if (this.isDarkMode()) {
|
|
79
114
|
theme = 'lime dark';
|
|
80
115
|
}
|
|
@@ -83,6 +118,13 @@ export class CodeEditor {
|
|
|
83
118
|
name: 'application/json',
|
|
84
119
|
json: true,
|
|
85
120
|
};
|
|
121
|
+
if (this.lint) {
|
|
122
|
+
gutters.push('CodeMirror-lint-markers');
|
|
123
|
+
if (!('jsonlint' in window)) {
|
|
124
|
+
// eslint-disable-next-line @typescript-eslint/dot-notation
|
|
125
|
+
window['jsonlint'] = jslint;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
86
128
|
}
|
|
87
129
|
else if (this.language === 'typescript') {
|
|
88
130
|
mode = {
|
|
@@ -90,9 +132,12 @@ export class CodeEditor {
|
|
|
90
132
|
typescript: true,
|
|
91
133
|
};
|
|
92
134
|
}
|
|
135
|
+
if (this.fold) {
|
|
136
|
+
gutters.push('CodeMirror-foldgutter');
|
|
137
|
+
}
|
|
93
138
|
return {
|
|
94
139
|
mode: mode,
|
|
95
|
-
value: this.value,
|
|
140
|
+
value: this.value || '',
|
|
96
141
|
theme: theme,
|
|
97
142
|
readOnly: this.readonly,
|
|
98
143
|
tabSize: TAB_SIZE,
|
|
@@ -100,6 +145,9 @@ export class CodeEditor {
|
|
|
100
145
|
lineNumbers: this.lineNumbers,
|
|
101
146
|
styleActiveLine: true,
|
|
102
147
|
matchBrackets: true,
|
|
148
|
+
lint: this.lint,
|
|
149
|
+
foldGutter: this.fold,
|
|
150
|
+
gutters: gutters,
|
|
103
151
|
};
|
|
104
152
|
}
|
|
105
153
|
isDarkMode() {
|
|
@@ -208,6 +256,42 @@ export class CodeEditor {
|
|
|
208
256
|
"reflect": false,
|
|
209
257
|
"defaultValue": "false"
|
|
210
258
|
},
|
|
259
|
+
"fold": {
|
|
260
|
+
"type": "boolean",
|
|
261
|
+
"mutable": false,
|
|
262
|
+
"complexType": {
|
|
263
|
+
"original": "boolean",
|
|
264
|
+
"resolved": "boolean",
|
|
265
|
+
"references": {}
|
|
266
|
+
},
|
|
267
|
+
"required": false,
|
|
268
|
+
"optional": false,
|
|
269
|
+
"docs": {
|
|
270
|
+
"tags": [],
|
|
271
|
+
"text": "Allows the user to fold code"
|
|
272
|
+
},
|
|
273
|
+
"attribute": "fold",
|
|
274
|
+
"reflect": false,
|
|
275
|
+
"defaultValue": "false"
|
|
276
|
+
},
|
|
277
|
+
"lint": {
|
|
278
|
+
"type": "boolean",
|
|
279
|
+
"mutable": false,
|
|
280
|
+
"complexType": {
|
|
281
|
+
"original": "boolean",
|
|
282
|
+
"resolved": "boolean",
|
|
283
|
+
"references": {}
|
|
284
|
+
},
|
|
285
|
+
"required": false,
|
|
286
|
+
"optional": false,
|
|
287
|
+
"docs": {
|
|
288
|
+
"tags": [],
|
|
289
|
+
"text": "Enables linting of JSON content"
|
|
290
|
+
},
|
|
291
|
+
"attribute": "lint",
|
|
292
|
+
"reflect": false,
|
|
293
|
+
"defaultValue": "false"
|
|
294
|
+
},
|
|
211
295
|
"colorScheme": {
|
|
212
296
|
"type": "string",
|
|
213
297
|
"mutable": false,
|
|
@@ -252,4 +336,8 @@ export class CodeEditor {
|
|
|
252
336
|
}
|
|
253
337
|
}]; }
|
|
254
338
|
static get elementRef() { return "host"; }
|
|
339
|
+
static get watchers() { return [{
|
|
340
|
+
"propName": "value",
|
|
341
|
+
"methodName": "watchValue"
|
|
342
|
+
}]; }
|
|
255
343
|
}
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
/**
|
|
64
64
|
* @prop --closed-header-background-color: background color for header when closed
|
|
65
65
|
* @prop --open-header-background-color: background color for header when open
|
|
66
|
-
* @prop --header-stroke-color: color of the animated icons that
|
|
66
|
+
* @prop --header-stroke-color: color of the animated icons that visualize collapsed or normal states of the headers, as well as the divider line on headers
|
|
67
67
|
* @prop --body-background-color: background color for body
|
|
68
68
|
* @prop --body-padding: space around content of the body
|
|
69
69
|
*/
|
|
@@ -92,6 +92,13 @@
|
|
|
92
92
|
background-color: var(--closed-header-background-color, rgb(var(--contrast-200)));
|
|
93
93
|
border-radius: var(--border-radius-of-header);
|
|
94
94
|
}
|
|
95
|
+
.section__header:focus {
|
|
96
|
+
outline: none;
|
|
97
|
+
}
|
|
98
|
+
.section__header:focus-visible {
|
|
99
|
+
outline: none;
|
|
100
|
+
box-shadow: var(--shadow-depth-8-focused);
|
|
101
|
+
}
|
|
95
102
|
section.open .section__header {
|
|
96
103
|
background-color: var(--open-header-background-color, rgb(var(--contrast-100)));
|
|
97
104
|
border-radius: var(--border-radius-of-header) var(--border-radius-of-header) 0 0;
|
|
@@ -102,12 +109,6 @@ section.open .section__header:hover {
|
|
|
102
109
|
.section__header:hover {
|
|
103
110
|
background-color: var(--open-header-background-color, rgb(var(--contrast-300)));
|
|
104
111
|
}
|
|
105
|
-
.section__header:focus {
|
|
106
|
-
outline: none;
|
|
107
|
-
}
|
|
108
|
-
.section__header:focus-visible {
|
|
109
|
-
box-shadow: var(--shadow-depth-8-focused);
|
|
110
|
-
}
|
|
111
112
|
|
|
112
113
|
.section__header__title {
|
|
113
114
|
-moz-osx-font-smoothing: grayscale;
|
|
@@ -114,7 +114,7 @@ export class DatePicker {
|
|
|
114
114
|
}
|
|
115
115
|
const dropdownZIndex = getComputedStyle(this.host).getPropertyValue('--dropdown-z-index');
|
|
116
116
|
return [
|
|
117
|
-
h("limel-input-field", Object.assign({ disabled: this.disabled, readonly: this.readonly, invalid: this.invalid, label: this.label, helperText: this.helperText, required: this.required, value: this.formattedValue, onFocus: this.showCalendar, onBlur: this.hideCalendar, onClick: this.onInputClick, onChange: this.handleInputElementChange, ref: (el) => (this.textField = el) }, inputProps)),
|
|
117
|
+
h("limel-input-field", Object.assign({ disabled: this.disabled, readonly: this.readonly, invalid: this.invalid, label: this.label, placeholder: this.placeholder, helperText: this.helperText, required: this.required, value: this.formattedValue, onFocus: this.showCalendar, onBlur: this.hideCalendar, onClick: this.onInputClick, onChange: this.handleInputElementChange, ref: (el) => (this.textField = el) }, inputProps)),
|
|
118
118
|
h("limel-portal", { containerId: this.portalId, visible: this.showPortal, containerStyle: { 'z-index': dropdownZIndex } },
|
|
119
119
|
h("limel-flatpickr-adapter", { format: this.internalFormat, language: this.language, type: this.type, value: this.value, ref: (el) => (this.datePickerCalendar = el), isOpen: this.showPortal, onChange: this.handleCalendarChange })),
|
|
120
120
|
];
|
|
@@ -298,6 +298,23 @@ export class DatePicker {
|
|
|
298
298
|
"attribute": "label",
|
|
299
299
|
"reflect": true
|
|
300
300
|
},
|
|
301
|
+
"placeholder": {
|
|
302
|
+
"type": "string",
|
|
303
|
+
"mutable": false,
|
|
304
|
+
"complexType": {
|
|
305
|
+
"original": "string",
|
|
306
|
+
"resolved": "string",
|
|
307
|
+
"references": {}
|
|
308
|
+
},
|
|
309
|
+
"required": false,
|
|
310
|
+
"optional": false,
|
|
311
|
+
"docs": {
|
|
312
|
+
"tags": [],
|
|
313
|
+
"text": "The placeholder text shown inside the input field, when the field is focused and empty"
|
|
314
|
+
},
|
|
315
|
+
"attribute": "placeholder",
|
|
316
|
+
"reflect": true
|
|
317
|
+
},
|
|
301
318
|
"helperText": {
|
|
302
319
|
"type": "string",
|
|
303
320
|
"mutable": false,
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
*/
|
|
13
13
|
.button {
|
|
14
14
|
all: unset;
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease-out;
|
|
15
17
|
box-sizing: border-box;
|
|
16
18
|
display: flex;
|
|
17
19
|
align-items: center;
|
|
@@ -25,20 +27,20 @@
|
|
|
25
27
|
color: var(--limel-dock-item-text-color);
|
|
26
28
|
background-color: var(--dock-background-color);
|
|
27
29
|
}
|
|
28
|
-
.button:
|
|
29
|
-
box-shadow: var(--shadow-depth-8-focused);
|
|
30
|
-
}
|
|
31
|
-
.dock-item:not(.selected) .button:not(.disabled) {
|
|
32
|
-
cursor: pointer;
|
|
33
|
-
transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease-out;
|
|
34
|
-
}
|
|
35
|
-
.dock-item:not(.selected) .button:not(.disabled):hover {
|
|
30
|
+
.button:hover {
|
|
36
31
|
box-shadow: var(--button-shadow-hovered);
|
|
37
32
|
}
|
|
38
|
-
.
|
|
33
|
+
.button:active {
|
|
39
34
|
box-shadow: var(--button-shadow-pressed);
|
|
40
35
|
transform: translate3d(0, 0.08rem, 0);
|
|
41
36
|
}
|
|
37
|
+
.button:focus {
|
|
38
|
+
outline: none;
|
|
39
|
+
}
|
|
40
|
+
.button:focus-visible {
|
|
41
|
+
outline: none;
|
|
42
|
+
box-shadow: var(--shadow-depth-8-focused);
|
|
43
|
+
}
|
|
42
44
|
.button:hover {
|
|
43
45
|
z-index: 1;
|
|
44
46
|
}
|
|
@@ -47,12 +49,16 @@
|
|
|
47
49
|
background-color: var(--dock-item-background-color--selected, rgb(var(--contrast-200)));
|
|
48
50
|
box-shadow: var(--button-shadow-inset);
|
|
49
51
|
}
|
|
52
|
+
.button.selected:focus-visible {
|
|
53
|
+
box-shadow: var(--button-shadow-inset), var(--shadow-depth-8-focused);
|
|
54
|
+
}
|
|
50
55
|
.button.selected .icon {
|
|
51
56
|
color: var(--limel-dock-item-text--selected);
|
|
52
57
|
}
|
|
53
58
|
|
|
54
59
|
limel-popover {
|
|
55
60
|
display: grid;
|
|
61
|
+
grid-template-columns: 100%;
|
|
56
62
|
}
|
|
57
63
|
|
|
58
64
|
.text {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, Event, h, Prop, State } from '@stencil/core';
|
|
1
|
+
import { Component, Event, h, Prop, State, Watch, } from '@stencil/core';
|
|
2
2
|
import { createRandomString } from '../../../util/random-string';
|
|
3
3
|
/**
|
|
4
4
|
* @private
|
|
@@ -6,17 +6,26 @@ import { createRandomString } from '../../../util/random-string';
|
|
|
6
6
|
export class DockButton {
|
|
7
7
|
constructor() {
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* When the dock is expanded or collapsed, dock items
|
|
10
|
+
* show labels and tooltips as suitable for the layout.
|
|
10
11
|
*/
|
|
11
12
|
this.expanded = false;
|
|
12
13
|
/**
|
|
13
|
-
*
|
|
14
|
+
* When dock is using mobile layout, dock items
|
|
15
|
+
* show labels and tooltips as suitable for the layout.
|
|
14
16
|
*/
|
|
15
17
|
this.useMobileLayout = false;
|
|
18
|
+
/**
|
|
19
|
+
* Indicated whether the popover that renders a component is open.
|
|
20
|
+
*/
|
|
16
21
|
this.isOpen = false;
|
|
17
22
|
this.openPopover = (event) => {
|
|
18
23
|
event.stopPropagation();
|
|
19
24
|
this.isOpen = true;
|
|
25
|
+
this.menuOpen.emit(this.item);
|
|
26
|
+
};
|
|
27
|
+
this.setCustomComponentElement = (element) => {
|
|
28
|
+
this.customComponentElement = element;
|
|
20
29
|
};
|
|
21
30
|
this.onPopoverClose = () => {
|
|
22
31
|
this.isOpen = false;
|
|
@@ -24,7 +33,13 @@ export class DockButton {
|
|
|
24
33
|
};
|
|
25
34
|
this.handleClick = (event) => {
|
|
26
35
|
event.stopPropagation();
|
|
27
|
-
this.
|
|
36
|
+
this.itemSelected.emit(this.item);
|
|
37
|
+
};
|
|
38
|
+
this.focusCustomComponentElement = () => {
|
|
39
|
+
var _a, _b, _c;
|
|
40
|
+
if ((_b = (_a = this.customComponentElement) === null || _a === void 0 ? void 0 : _a.shadowRoot) === null || _b === void 0 ? void 0 : _b.delegatesFocus) {
|
|
41
|
+
(_c = this.customComponentElement) === null || _c === void 0 ? void 0 : _c.focus();
|
|
42
|
+
}
|
|
28
43
|
};
|
|
29
44
|
this.tooltipId = createRandomString();
|
|
30
45
|
}
|
|
@@ -35,12 +50,19 @@ export class DockButton {
|
|
|
35
50
|
}
|
|
36
51
|
return this.renderButton(this.handleClick);
|
|
37
52
|
}
|
|
53
|
+
openWatcher() {
|
|
54
|
+
if (!this.isOpen) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const observer = new IntersectionObserver(this.focusCustomComponentElement);
|
|
58
|
+
observer.observe(this.customComponentElement);
|
|
59
|
+
}
|
|
38
60
|
renderPopover() {
|
|
39
61
|
var _a;
|
|
40
62
|
const CustomComponent = (_a = this.item) === null || _a === void 0 ? void 0 : _a.dockMenu.componentName;
|
|
41
63
|
return (h("limel-popover", { openDirection: this.useMobileLayout ? 'top' : 'right', open: this.isOpen || this.item.dockMenu.menuOpen, onClose: this.onPopoverClose },
|
|
42
64
|
this.renderButton(this.openPopover, 'trigger'),
|
|
43
|
-
h(CustomComponent, Object.assign({}, (this.item.dockMenu.props || {}), { onClose: this.onPopoverClose }))));
|
|
65
|
+
h(CustomComponent, Object.assign({ ref: this.setCustomComponentElement }, (this.item.dockMenu.props || {}), { onClose: this.onPopoverClose }))));
|
|
44
66
|
}
|
|
45
67
|
renderButton(handleClick, slot) {
|
|
46
68
|
var _a;
|
|
@@ -95,11 +117,8 @@ export class DockButton {
|
|
|
95
117
|
"required": true,
|
|
96
118
|
"optional": false,
|
|
97
119
|
"docs": {
|
|
98
|
-
"tags": [
|
|
99
|
-
|
|
100
|
-
"text": undefined
|
|
101
|
-
}],
|
|
102
|
-
"text": ""
|
|
120
|
+
"tags": [],
|
|
121
|
+
"text": "Item that is placed in the dock."
|
|
103
122
|
}
|
|
104
123
|
},
|
|
105
124
|
"expanded": {
|
|
@@ -113,11 +132,8 @@ export class DockButton {
|
|
|
113
132
|
"required": false,
|
|
114
133
|
"optional": true,
|
|
115
134
|
"docs": {
|
|
116
|
-
"tags": [
|
|
117
|
-
|
|
118
|
-
"text": undefined
|
|
119
|
-
}],
|
|
120
|
-
"text": ""
|
|
135
|
+
"tags": [],
|
|
136
|
+
"text": "When the dock is expanded or collapsed, dock items\nshow labels and tooltips as suitable for the layout."
|
|
121
137
|
},
|
|
122
138
|
"attribute": "expanded",
|
|
123
139
|
"reflect": true,
|
|
@@ -134,11 +150,8 @@ export class DockButton {
|
|
|
134
150
|
"required": false,
|
|
135
151
|
"optional": true,
|
|
136
152
|
"docs": {
|
|
137
|
-
"tags": [
|
|
138
|
-
|
|
139
|
-
"text": undefined
|
|
140
|
-
}],
|
|
141
|
-
"text": ""
|
|
153
|
+
"tags": [],
|
|
154
|
+
"text": "When dock is using mobile layout, dock items\nshow labels and tooltips as suitable for the layout."
|
|
142
155
|
},
|
|
143
156
|
"attribute": "use-mobile-layout",
|
|
144
157
|
"reflect": true,
|
|
@@ -149,14 +162,34 @@ export class DockButton {
|
|
|
149
162
|
"isOpen": {}
|
|
150
163
|
}; }
|
|
151
164
|
static get events() { return [{
|
|
152
|
-
"method": "
|
|
153
|
-
"name": "
|
|
165
|
+
"method": "itemSelected",
|
|
166
|
+
"name": "itemSelected",
|
|
154
167
|
"bubbles": true,
|
|
155
168
|
"cancelable": true,
|
|
156
169
|
"composed": true,
|
|
157
170
|
"docs": {
|
|
158
171
|
"tags": [],
|
|
159
|
-
"text": "Fired when
|
|
172
|
+
"text": "Fired when a dock item has been selected from the dock."
|
|
173
|
+
},
|
|
174
|
+
"complexType": {
|
|
175
|
+
"original": "DockItem",
|
|
176
|
+
"resolved": "DockItem",
|
|
177
|
+
"references": {
|
|
178
|
+
"DockItem": {
|
|
179
|
+
"location": "import",
|
|
180
|
+
"path": "../dock.types"
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}, {
|
|
185
|
+
"method": "menuOpen",
|
|
186
|
+
"name": "menuOpen",
|
|
187
|
+
"bubbles": true,
|
|
188
|
+
"cancelable": true,
|
|
189
|
+
"composed": true,
|
|
190
|
+
"docs": {
|
|
191
|
+
"tags": [],
|
|
192
|
+
"text": "Fired when a dock menu is opened."
|
|
160
193
|
},
|
|
161
194
|
"complexType": {
|
|
162
195
|
"original": "DockItem",
|
|
@@ -176,7 +209,7 @@ export class DockButton {
|
|
|
176
209
|
"composed": true,
|
|
177
210
|
"docs": {
|
|
178
211
|
"tags": [],
|
|
179
|
-
"text": ""
|
|
212
|
+
"text": "Fired when the popover is closed."
|
|
180
213
|
},
|
|
181
214
|
"complexType": {
|
|
182
215
|
"original": "void",
|
|
@@ -184,4 +217,8 @@ export class DockButton {
|
|
|
184
217
|
"references": {}
|
|
185
218
|
}
|
|
186
219
|
}]; }
|
|
220
|
+
static get watchers() { return [{
|
|
221
|
+
"propName": "isOpen",
|
|
222
|
+
"methodName": "openWatcher"
|
|
223
|
+
}]; }
|
|
187
224
|
}
|
|
@@ -92,15 +92,19 @@ nav::-webkit-scrollbar {
|
|
|
92
92
|
box-shadow: var(--button-shadow-pressed);
|
|
93
93
|
transform: translate3d(0, 0.08rem, 0);
|
|
94
94
|
}
|
|
95
|
+
.expand-shrink:focus {
|
|
96
|
+
outline: none;
|
|
97
|
+
}
|
|
98
|
+
.expand-shrink:focus-visible {
|
|
99
|
+
outline: none;
|
|
100
|
+
box-shadow: var(--shadow-depth-8-focused);
|
|
101
|
+
}
|
|
95
102
|
.expand-shrink.expanded {
|
|
96
103
|
justify-content: flex-end;
|
|
97
104
|
}
|
|
98
105
|
.expand-shrink.expanded limel-icon {
|
|
99
106
|
transform: rotateY(180deg);
|
|
100
107
|
}
|
|
101
|
-
.expand-shrink:focus-visible {
|
|
102
|
-
box-shadow: var(--shadow-depth-8-focused);
|
|
103
|
-
}
|
|
104
108
|
.expand-shrink limel-icon {
|
|
105
109
|
width: calc(var(--dock-expand-shrink-button-height) - 0.25rem);
|
|
106
110
|
color: var(--dock-item-icon-color, var(--limel-dock-item-text-color));
|