@limetech/lime-elements 36.0.0-next.2 → 36.0.0-next.22
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/lime-elements.cjs.js +1 -1
- package/dist/cjs/limel-button.cjs.entry.js +32 -16
- package/dist/cjs/limel-chip-set.cjs.entry.js +1 -3
- package/dist/cjs/limel-code-editor.cjs.entry.js +1588 -2
- package/dist/cjs/{limel-color-picker-palette_2.cjs.entry.js → limel-color-picker-palette.cjs.entry.js} +0 -112
- package/dist/cjs/limel-date-picker.cjs.entry.js +3 -3
- package/dist/cjs/limel-dock-button.cjs.entry.js +86 -0
- package/dist/cjs/limel-dock.cjs.entry.js +104 -0
- package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js +5 -11
- package/dist/cjs/limel-form.cjs.entry.js +1 -1
- package/dist/cjs/limel-icon-button.cjs.entry.js +2 -35
- package/dist/cjs/limel-input-field.cjs.entry.js +13 -6
- package/dist/cjs/{limel-list_3.cjs.entry.js → limel-list_2.cjs.entry.js} +0 -2018
- package/dist/cjs/limel-popover_4.cjs.entry.js +239 -0
- package/dist/cjs/limel-portal.cjs.entry.js +2024 -0
- package/dist/cjs/limel-select.cjs.entry.js +4 -5
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{moment-5cfac5cd.js → moment-d1e35cdc.js} +2 -2
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/button/button.css +40 -4
- package/dist/collection/components/button/button.js +56 -20
- package/dist/collection/components/chip-set/chip-set.js +1 -3
- package/dist/collection/components/code-editor/code-editor.css +153 -1
- package/dist/collection/components/code-editor/code-editor.js +82 -2
- package/dist/collection/components/date-picker/date-picker.js +18 -1
- package/dist/collection/components/date-picker/pickers/MonthPicker.js +1 -3
- package/dist/collection/components/date-picker/pickers/QuarterPicker.js +1 -3
- package/dist/collection/components/date-picker/pickers/YearPicker.js +1 -3
- package/dist/collection/components/dock/dock-button/dock-button.css +72 -0
- package/dist/collection/components/dock/dock-button/dock-button.js +204 -0
- package/dist/collection/components/dock/dock.css +107 -0
- package/dist/collection/components/dock/dock.js +300 -0
- package/dist/collection/components/dock/dock.types.js +1 -0
- package/dist/collection/components/icon-button/icon-button.css +21 -20
- package/dist/collection/components/icon-button/icon-button.js +2 -52
- package/dist/collection/components/input-field/input-field.js +32 -7
- package/dist/collection/components/select/select.css +8 -10
- package/dist/collection/components/select/select.template.js +3 -4
- package/dist/collection/style/internal/codemirror-tooltip.scss +19 -0
- package/dist/esm/{dateFormatter-2cad0292.js → dateFormatter-784c3334.js} +1 -1
- package/dist/esm/lime-elements.js +1 -1
- package/dist/esm/limel-button.entry.js +33 -17
- package/dist/esm/limel-chip-set.entry.js +1 -3
- package/dist/esm/limel-code-editor.entry.js +1588 -2
- package/dist/esm/{limel-color-picker-palette_2.entry.js → limel-color-picker-palette.entry.js} +2 -113
- package/dist/esm/limel-date-picker.entry.js +3 -3
- package/dist/esm/limel-dock-button.entry.js +82 -0
- package/dist/esm/limel-dock.entry.js +100 -0
- package/dist/esm/limel-flatpickr-adapter.entry.js +5 -11
- package/dist/esm/limel-form.entry.js +1 -1
- package/dist/esm/limel-icon-button.entry.js +2 -35
- package/dist/esm/limel-input-field.entry.js +13 -6
- package/dist/esm/{limel-list_3.entry.js → limel-list_2.entry.js} +1 -2018
- package/dist/esm/limel-popover_4.entry.js +232 -0
- package/dist/esm/limel-portal.entry.js +2020 -0
- package/dist/esm/limel-select.entry.js +4 -5
- 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-009de50e.entry.js +1 -0
- package/dist/lime-elements/p-0aedee4b.entry.js +1 -0
- package/dist/lime-elements/{p-7e571ec6.entry.js → p-0ba0c38a.entry.js} +1 -1
- package/dist/lime-elements/{p-08251941.entry.js → p-19f72dab.entry.js} +1 -1
- package/dist/lime-elements/p-1dfccbc5.entry.js +1 -0
- package/dist/lime-elements/p-212895da.entry.js +1 -0
- package/dist/lime-elements/p-457cf741.entry.js +37 -0
- package/dist/lime-elements/p-6b1bc80f.entry.js +1 -0
- package/dist/lime-elements/{p-d76f896d.js → p-73df4d83.js} +1 -1
- package/dist/lime-elements/p-93cd2268.entry.js +1 -0
- package/dist/lime-elements/p-93f42a32.entry.js +1 -0
- package/dist/lime-elements/p-945afca2.js +3 -0
- package/dist/lime-elements/p-aaa11eb2.entry.js +1 -0
- package/dist/lime-elements/p-bd098a11.entry.js +1 -0
- package/dist/lime-elements/{p-af0ec482.entry.js → p-c544c05b.entry.js} +1 -1
- package/dist/lime-elements/p-f41567a1.entry.js +1 -0
- package/dist/lime-elements/style/internal/codemirror-tooltip.scss +19 -0
- package/dist/types/components/button/button.d.ts +10 -3
- 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 +48 -0
- package/dist/types/components/dock/dock.d.ts +83 -0
- package/dist/types/components/dock/dock.types.d.ts +53 -0
- package/dist/types/components/icon-button/icon-button.d.ts +0 -11
- package/dist/types/components/input-field/input-field.d.ts +6 -0
- package/dist/types/components.d.ts +167 -4
- package/dist/types/interface.d.ts +1 -0
- package/package.json +5 -5
- package/dist/cjs/limel-popover-surface.cjs.entry.js +0 -32
- package/dist/cjs/limel-tooltip_2.cjs.entry.js +0 -102
- package/dist/esm/limel-popover-surface.entry.js +0 -28
- package/dist/esm/limel-tooltip_2.entry.js +0 -97
- package/dist/lime-elements/p-22569fb6.entry.js +0 -1
- package/dist/lime-elements/p-3af5f9ad.js +0 -3
- package/dist/lime-elements/p-404e1465.entry.js +0 -1
- package/dist/lime-elements/p-6966b5df.entry.js +0 -1
- package/dist/lime-elements/p-705334c1.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-87453b45.entry.js +0 -1
- package/dist/lime-elements/p-bd8c9384.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,6 +79,18 @@ 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);
|
|
@@ -75,6 +101,7 @@ export class CodeEditor {
|
|
|
75
101
|
let mode = this.language;
|
|
76
102
|
const TAB_SIZE = 4;
|
|
77
103
|
let theme = 'lime light';
|
|
104
|
+
const gutters = [];
|
|
78
105
|
if (this.isDarkMode()) {
|
|
79
106
|
theme = 'lime dark';
|
|
80
107
|
}
|
|
@@ -83,6 +110,13 @@ export class CodeEditor {
|
|
|
83
110
|
name: 'application/json',
|
|
84
111
|
json: true,
|
|
85
112
|
};
|
|
113
|
+
if (this.lint) {
|
|
114
|
+
gutters.push('CodeMirror-lint-markers');
|
|
115
|
+
if (!('jsonlint' in window)) {
|
|
116
|
+
// eslint-disable-next-line @typescript-eslint/dot-notation
|
|
117
|
+
window['jsonlint'] = jslint;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
86
120
|
}
|
|
87
121
|
else if (this.language === 'typescript') {
|
|
88
122
|
mode = {
|
|
@@ -90,9 +124,12 @@ export class CodeEditor {
|
|
|
90
124
|
typescript: true,
|
|
91
125
|
};
|
|
92
126
|
}
|
|
127
|
+
if (this.fold) {
|
|
128
|
+
gutters.push('CodeMirror-foldgutter');
|
|
129
|
+
}
|
|
93
130
|
return {
|
|
94
131
|
mode: mode,
|
|
95
|
-
value: this.value,
|
|
132
|
+
value: this.value || '',
|
|
96
133
|
theme: theme,
|
|
97
134
|
readOnly: this.readonly,
|
|
98
135
|
tabSize: TAB_SIZE,
|
|
@@ -100,6 +137,9 @@ export class CodeEditor {
|
|
|
100
137
|
lineNumbers: this.lineNumbers,
|
|
101
138
|
styleActiveLine: true,
|
|
102
139
|
matchBrackets: true,
|
|
140
|
+
lint: this.lint,
|
|
141
|
+
foldGutter: this.fold,
|
|
142
|
+
gutters: gutters,
|
|
103
143
|
};
|
|
104
144
|
}
|
|
105
145
|
isDarkMode() {
|
|
@@ -208,6 +248,42 @@ export class CodeEditor {
|
|
|
208
248
|
"reflect": false,
|
|
209
249
|
"defaultValue": "false"
|
|
210
250
|
},
|
|
251
|
+
"fold": {
|
|
252
|
+
"type": "boolean",
|
|
253
|
+
"mutable": false,
|
|
254
|
+
"complexType": {
|
|
255
|
+
"original": "boolean",
|
|
256
|
+
"resolved": "boolean",
|
|
257
|
+
"references": {}
|
|
258
|
+
},
|
|
259
|
+
"required": false,
|
|
260
|
+
"optional": false,
|
|
261
|
+
"docs": {
|
|
262
|
+
"tags": [],
|
|
263
|
+
"text": "Allows the user to fold code"
|
|
264
|
+
},
|
|
265
|
+
"attribute": "fold",
|
|
266
|
+
"reflect": false,
|
|
267
|
+
"defaultValue": "false"
|
|
268
|
+
},
|
|
269
|
+
"lint": {
|
|
270
|
+
"type": "boolean",
|
|
271
|
+
"mutable": false,
|
|
272
|
+
"complexType": {
|
|
273
|
+
"original": "boolean",
|
|
274
|
+
"resolved": "boolean",
|
|
275
|
+
"references": {}
|
|
276
|
+
},
|
|
277
|
+
"required": false,
|
|
278
|
+
"optional": false,
|
|
279
|
+
"docs": {
|
|
280
|
+
"tags": [],
|
|
281
|
+
"text": "Enables linting of JSON content"
|
|
282
|
+
},
|
|
283
|
+
"attribute": "lint",
|
|
284
|
+
"reflect": false,
|
|
285
|
+
"defaultValue": "false"
|
|
286
|
+
},
|
|
211
287
|
"colorScheme": {
|
|
212
288
|
"type": "string",
|
|
213
289
|
"mutable": false,
|
|
@@ -252,4 +328,8 @@ export class CodeEditor {
|
|
|
252
328
|
}
|
|
253
329
|
}]; }
|
|
254
330
|
static get elementRef() { return "host"; }
|
|
331
|
+
static get watchers() { return [{
|
|
332
|
+
"propName": "value",
|
|
333
|
+
"methodName": "watchValue"
|
|
334
|
+
}]; }
|
|
255
335
|
}
|
|
@@ -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,
|
|
@@ -74,9 +74,7 @@ export class MonthPicker extends Picker {
|
|
|
74
74
|
})));
|
|
75
75
|
}
|
|
76
76
|
renderMonth(month, fp) {
|
|
77
|
-
return (h("div", { className: "datepicker-month",
|
|
78
|
-
// eslint-disable-next-line react/jsx-no-bind
|
|
79
|
-
onClick: () => {
|
|
77
|
+
return (h("div", { className: "datepicker-month", onClick: () => {
|
|
80
78
|
const date = moment([fp.currentYear]).month(month).toDate();
|
|
81
79
|
fp.setDate(date, true);
|
|
82
80
|
fp.close();
|
|
@@ -78,9 +78,7 @@ export class QuarterPicker extends Picker {
|
|
|
78
78
|
})));
|
|
79
79
|
}
|
|
80
80
|
renderQuarter(quarter, fp) {
|
|
81
|
-
return (h("div", { className: "datepicker-quarter", id: `datepicker-quarter-${quarter}`,
|
|
82
|
-
// eslint-disable-next-line react/jsx-no-bind
|
|
83
|
-
onClick: () => {
|
|
81
|
+
return (h("div", { className: "datepicker-quarter", id: `datepicker-quarter-${quarter}`, onClick: () => {
|
|
84
82
|
const date = moment([fp.currentYear])
|
|
85
83
|
.quarter(quarter)
|
|
86
84
|
.toDate();
|
|
@@ -106,9 +106,7 @@ export class YearPicker extends Picker {
|
|
|
106
106
|
})));
|
|
107
107
|
}
|
|
108
108
|
renderYear(year, fp) {
|
|
109
|
-
return (h("div", { className: "datepicker-year",
|
|
110
|
-
// eslint-disable-next-line react/jsx-no-bind
|
|
111
|
-
onClick: () => {
|
|
109
|
+
return (h("div", { className: "datepicker-year", onClick: () => {
|
|
112
110
|
const date = moment(year).toDate();
|
|
113
111
|
fp.setDate(date, true);
|
|
114
112
|
fp.close();
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This file is imported into every component!
|
|
3
|
+
*
|
|
4
|
+
* Nothing in this file may output any CSS
|
|
5
|
+
* without being explicitly called by outside code.
|
|
6
|
+
*/
|
|
7
|
+
/*
|
|
8
|
+
* This file is imported into every component!
|
|
9
|
+
*
|
|
10
|
+
* Nothing in this file may output any CSS
|
|
11
|
+
* without being explicitly used by outside code.
|
|
12
|
+
*/
|
|
13
|
+
.button {
|
|
14
|
+
all: unset;
|
|
15
|
+
box-sizing: border-box;
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
position: relative;
|
|
19
|
+
width: 100%;
|
|
20
|
+
height: var(--dock-item-height);
|
|
21
|
+
border-radius: 0.375rem;
|
|
22
|
+
font-size: 0.875rem;
|
|
23
|
+
padding: 0 0.5rem;
|
|
24
|
+
min-width: var(--dock-item-height);
|
|
25
|
+
color: var(--limel-dock-item-text-color);
|
|
26
|
+
background-color: var(--dock-background-color);
|
|
27
|
+
}
|
|
28
|
+
.button:focus-visible {
|
|
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 {
|
|
36
|
+
box-shadow: var(--button-shadow-hovered);
|
|
37
|
+
}
|
|
38
|
+
.dock-item:not(.selected) .button:not(.disabled):active {
|
|
39
|
+
box-shadow: var(--button-shadow-pressed);
|
|
40
|
+
transform: translate3d(0, 0.08rem, 0);
|
|
41
|
+
}
|
|
42
|
+
.button:hover {
|
|
43
|
+
z-index: 1;
|
|
44
|
+
}
|
|
45
|
+
.button.selected {
|
|
46
|
+
color: var(--limel-dock-item-text-color--selected);
|
|
47
|
+
background-color: var(--dock-item-background-color--selected, rgb(var(--contrast-200)));
|
|
48
|
+
box-shadow: var(--button-shadow-inset);
|
|
49
|
+
}
|
|
50
|
+
.button.selected .icon {
|
|
51
|
+
color: var(--limel-dock-item-text--selected);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
limel-popover {
|
|
55
|
+
display: grid;
|
|
56
|
+
grid-template-columns: 100%;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.text {
|
|
60
|
+
overflow: hidden;
|
|
61
|
+
white-space: nowrap;
|
|
62
|
+
text-overflow: ellipsis;
|
|
63
|
+
padding-left: 0.5rem;
|
|
64
|
+
padding-right: 0.75rem;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.icon {
|
|
68
|
+
flex-shrink: 0;
|
|
69
|
+
width: calc(var(--dock-item-height) - 1rem);
|
|
70
|
+
height: calc(var(--dock-item-height) - 1rem);
|
|
71
|
+
color: var(--dock-item-icon-color, var(--limel-dock-item-text-color));
|
|
72
|
+
}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { Component, Event, h, Prop, State } from '@stencil/core';
|
|
2
|
+
import { createRandomString } from '../../../util/random-string';
|
|
3
|
+
/**
|
|
4
|
+
* @private
|
|
5
|
+
*/
|
|
6
|
+
export class DockButton {
|
|
7
|
+
constructor() {
|
|
8
|
+
/**
|
|
9
|
+
* When the dock is expanded or collapsed, dock items
|
|
10
|
+
* show labels and tooltips as suitable for the layout.
|
|
11
|
+
*/
|
|
12
|
+
this.expanded = false;
|
|
13
|
+
/**
|
|
14
|
+
* When dock is using mobile layout, dock items
|
|
15
|
+
* show labels and tooltips as suitable for the layout.
|
|
16
|
+
*/
|
|
17
|
+
this.useMobileLayout = false;
|
|
18
|
+
/**
|
|
19
|
+
* Indicated whether the popover that renders a component is open.
|
|
20
|
+
*/
|
|
21
|
+
this.isOpen = false;
|
|
22
|
+
this.openPopover = (event) => {
|
|
23
|
+
event.stopPropagation();
|
|
24
|
+
this.isOpen = true;
|
|
25
|
+
this.menuOpen.emit(this.item);
|
|
26
|
+
};
|
|
27
|
+
this.onPopoverClose = () => {
|
|
28
|
+
this.isOpen = false;
|
|
29
|
+
this.close.emit();
|
|
30
|
+
};
|
|
31
|
+
this.handleClick = (event) => {
|
|
32
|
+
event.stopPropagation();
|
|
33
|
+
this.itemSelected.emit(this.item);
|
|
34
|
+
};
|
|
35
|
+
this.tooltipId = createRandomString();
|
|
36
|
+
}
|
|
37
|
+
render() {
|
|
38
|
+
var _a, _b;
|
|
39
|
+
if ((_b = (_a = this.item) === null || _a === void 0 ? void 0 : _a.dockMenu) === null || _b === void 0 ? void 0 : _b.componentName) {
|
|
40
|
+
return this.renderPopover();
|
|
41
|
+
}
|
|
42
|
+
return this.renderButton(this.handleClick);
|
|
43
|
+
}
|
|
44
|
+
renderPopover() {
|
|
45
|
+
var _a;
|
|
46
|
+
const CustomComponent = (_a = this.item) === null || _a === void 0 ? void 0 : _a.dockMenu.componentName;
|
|
47
|
+
return (h("limel-popover", { openDirection: this.useMobileLayout ? 'top' : 'right', open: this.isOpen || this.item.dockMenu.menuOpen, onClose: this.onPopoverClose },
|
|
48
|
+
this.renderButton(this.openPopover, 'trigger'),
|
|
49
|
+
h(CustomComponent, Object.assign({}, (this.item.dockMenu.props || {}), { onClose: this.onPopoverClose }))));
|
|
50
|
+
}
|
|
51
|
+
renderButton(handleClick, slot) {
|
|
52
|
+
var _a;
|
|
53
|
+
return (h("button", { slot: slot, tabindex: "0", id: this.tooltipId, type: "button", class: {
|
|
54
|
+
button: true,
|
|
55
|
+
selected: (_a = this.item) === null || _a === void 0 ? void 0 : _a.selected,
|
|
56
|
+
}, onClick: handleClick },
|
|
57
|
+
this.renderIcon(),
|
|
58
|
+
this.renderLabel(),
|
|
59
|
+
this.renderTooltip()));
|
|
60
|
+
}
|
|
61
|
+
renderIcon() {
|
|
62
|
+
if (!this.item.icon) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
return h("limel-icon", { name: this.item.icon, class: "icon" });
|
|
66
|
+
}
|
|
67
|
+
renderLabel() {
|
|
68
|
+
if (this.expanded) {
|
|
69
|
+
return h("span", { class: "text" }, this.item.label);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
renderTooltip() {
|
|
73
|
+
if (!this.expanded && this.item.label) {
|
|
74
|
+
return (h("limel-tooltip", { elementId: this.tooltipId, label: this.item.label, helperLabel: this.item.helperLabel }));
|
|
75
|
+
}
|
|
76
|
+
if (this.expanded && this.item.helperLabel) {
|
|
77
|
+
return (h("limel-tooltip", { elementId: this.tooltipId, label: this.item.helperLabel }));
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
static get is() { return "limel-dock-button"; }
|
|
81
|
+
static get originalStyleUrls() { return {
|
|
82
|
+
"$": ["dock-button.scss"]
|
|
83
|
+
}; }
|
|
84
|
+
static get styleUrls() { return {
|
|
85
|
+
"$": ["dock-button.css"]
|
|
86
|
+
}; }
|
|
87
|
+
static get properties() { return {
|
|
88
|
+
"item": {
|
|
89
|
+
"type": "unknown",
|
|
90
|
+
"mutable": false,
|
|
91
|
+
"complexType": {
|
|
92
|
+
"original": "DockItem",
|
|
93
|
+
"resolved": "DockItem",
|
|
94
|
+
"references": {
|
|
95
|
+
"DockItem": {
|
|
96
|
+
"location": "import",
|
|
97
|
+
"path": "../dock.types"
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"required": true,
|
|
102
|
+
"optional": false,
|
|
103
|
+
"docs": {
|
|
104
|
+
"tags": [],
|
|
105
|
+
"text": "Item that is placed in the dock."
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"expanded": {
|
|
109
|
+
"type": "boolean",
|
|
110
|
+
"mutable": false,
|
|
111
|
+
"complexType": {
|
|
112
|
+
"original": "boolean",
|
|
113
|
+
"resolved": "boolean",
|
|
114
|
+
"references": {}
|
|
115
|
+
},
|
|
116
|
+
"required": false,
|
|
117
|
+
"optional": true,
|
|
118
|
+
"docs": {
|
|
119
|
+
"tags": [],
|
|
120
|
+
"text": "When the dock is expanded or collapsed, dock items\nshow labels and tooltips as suitable for the layout."
|
|
121
|
+
},
|
|
122
|
+
"attribute": "expanded",
|
|
123
|
+
"reflect": true,
|
|
124
|
+
"defaultValue": "false"
|
|
125
|
+
},
|
|
126
|
+
"useMobileLayout": {
|
|
127
|
+
"type": "boolean",
|
|
128
|
+
"mutable": false,
|
|
129
|
+
"complexType": {
|
|
130
|
+
"original": "boolean",
|
|
131
|
+
"resolved": "boolean",
|
|
132
|
+
"references": {}
|
|
133
|
+
},
|
|
134
|
+
"required": false,
|
|
135
|
+
"optional": true,
|
|
136
|
+
"docs": {
|
|
137
|
+
"tags": [],
|
|
138
|
+
"text": "When dock is using mobile layout, dock items\nshow labels and tooltips as suitable for the layout."
|
|
139
|
+
},
|
|
140
|
+
"attribute": "use-mobile-layout",
|
|
141
|
+
"reflect": true,
|
|
142
|
+
"defaultValue": "false"
|
|
143
|
+
}
|
|
144
|
+
}; }
|
|
145
|
+
static get states() { return {
|
|
146
|
+
"isOpen": {}
|
|
147
|
+
}; }
|
|
148
|
+
static get events() { return [{
|
|
149
|
+
"method": "itemSelected",
|
|
150
|
+
"name": "itemSelected",
|
|
151
|
+
"bubbles": true,
|
|
152
|
+
"cancelable": true,
|
|
153
|
+
"composed": true,
|
|
154
|
+
"docs": {
|
|
155
|
+
"tags": [],
|
|
156
|
+
"text": "Fired when a dock item has been selected from the dock."
|
|
157
|
+
},
|
|
158
|
+
"complexType": {
|
|
159
|
+
"original": "DockItem",
|
|
160
|
+
"resolved": "DockItem",
|
|
161
|
+
"references": {
|
|
162
|
+
"DockItem": {
|
|
163
|
+
"location": "import",
|
|
164
|
+
"path": "../dock.types"
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}, {
|
|
169
|
+
"method": "menuOpen",
|
|
170
|
+
"name": "menuOpen",
|
|
171
|
+
"bubbles": true,
|
|
172
|
+
"cancelable": true,
|
|
173
|
+
"composed": true,
|
|
174
|
+
"docs": {
|
|
175
|
+
"tags": [],
|
|
176
|
+
"text": "Fired when a dock menu is opened."
|
|
177
|
+
},
|
|
178
|
+
"complexType": {
|
|
179
|
+
"original": "DockItem",
|
|
180
|
+
"resolved": "DockItem",
|
|
181
|
+
"references": {
|
|
182
|
+
"DockItem": {
|
|
183
|
+
"location": "import",
|
|
184
|
+
"path": "../dock.types"
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}, {
|
|
189
|
+
"method": "close",
|
|
190
|
+
"name": "close",
|
|
191
|
+
"bubbles": true,
|
|
192
|
+
"cancelable": true,
|
|
193
|
+
"composed": true,
|
|
194
|
+
"docs": {
|
|
195
|
+
"tags": [],
|
|
196
|
+
"text": "Fired when the popover is closed."
|
|
197
|
+
},
|
|
198
|
+
"complexType": {
|
|
199
|
+
"original": "void",
|
|
200
|
+
"resolved": "void",
|
|
201
|
+
"references": {}
|
|
202
|
+
}
|
|
203
|
+
}]; }
|
|
204
|
+
}
|