@limetech/lime-elements 36.0.0-next.8 → 36.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +1 -1
- package/dist/cjs/limel-chip-set.cjs.entry.js +19 -11
- 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 +6 -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/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 +53 -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/lime-elements.js +1 -1
- package/dist/esm/limel-button.entry.js +1 -1
- package/dist/esm/limel-chip-set.entry.js +19 -11
- 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 +6 -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-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-93f42a32.entry.js +1 -0
- package/dist/lime-elements/p-945afca2.js +3 -0
- 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/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 +15 -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 -15
- 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-5ad60e14.entry.js +0 -126
- package/dist/lime-elements/p-64f068a8.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-b18cf477.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
|
@@ -2875,13 +2875,17 @@ limel-icon.mdc-chip__icon.mdc-chip__icon--leading {
|
|
|
2875
2875
|
.clear-all-button:hover {
|
|
2876
2876
|
background-color: #757580;
|
|
2877
2877
|
}
|
|
2878
|
-
.clear-all-button:focus
|
|
2879
|
-
opacity: 1;
|
|
2878
|
+
.clear-all-button:focus {
|
|
2880
2879
|
outline: none;
|
|
2881
2880
|
}
|
|
2882
2881
|
.clear-all-button:focus-visible {
|
|
2882
|
+
outline: none;
|
|
2883
2883
|
box-shadow: var(--shadow-depth-8-focused);
|
|
2884
2884
|
}
|
|
2885
|
+
.clear-all-button:focus, .has-chips:not(.mdc-text-field--disabled):hover .clear-all-button, .has-chips:not(.mdc-text-field--disabled).mdc-text-field--focused .clear-all-button {
|
|
2886
|
+
opacity: 1;
|
|
2887
|
+
outline: none;
|
|
2888
|
+
}
|
|
2885
2889
|
:not(.has-chips) .clear-all-button, .has-chips.mdc-text-field--disabled .clear-all-button {
|
|
2886
2890
|
display: none;
|
|
2887
2891
|
}
|
|
@@ -242,19 +242,27 @@ export class ChipSet {
|
|
|
242
242
|
'lime-notched-outline--notched': !!(this.value.length || this.editMode),
|
|
243
243
|
}, "dropzone-tip": this.dropZoneTip() },
|
|
244
244
|
h("div", { class: "mdc-notched-outline__leading" }),
|
|
245
|
-
|
|
246
|
-
h("label", { class: {
|
|
247
|
-
'mdc-floating-label': true,
|
|
248
|
-
'mdc-text-field--disabled': this.readonly || this.disabled,
|
|
249
|
-
'mdc-floating-label--required': this.required,
|
|
250
|
-
'lime-floating-label--float-above': !!(this.value.length || this.editMode),
|
|
251
|
-
}, htmlFor: "input-element" }, this.label)),
|
|
245
|
+
this.renderLabel(),
|
|
252
246
|
h("div", { class: "mdc-notched-outline__trailing" })),
|
|
253
247
|
this.renderLeadingIcon(),
|
|
254
248
|
this.renderClearAllChipsButton()),
|
|
255
249
|
this.renderHelperLine(),
|
|
256
250
|
];
|
|
257
251
|
}
|
|
252
|
+
renderLabel() {
|
|
253
|
+
const labelClassList = {
|
|
254
|
+
'mdc-floating-label': true,
|
|
255
|
+
'mdc-text-field--no-label': !this.label,
|
|
256
|
+
'mdc-text-field--disabled': this.readonly || this.disabled,
|
|
257
|
+
'mdc-floating-label--required': this.required,
|
|
258
|
+
'lime-floating-label--float-above': !!(this.value.length || this.editMode),
|
|
259
|
+
};
|
|
260
|
+
if (!this.label) {
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
return (h("div", { class: "mdc-notched-outline__notch" },
|
|
264
|
+
h("label", { class: labelClassList, htmlFor: "input-element" }, this.label)));
|
|
265
|
+
}
|
|
258
266
|
isFull() {
|
|
259
267
|
return !!this.maxItems && this.value.length >= this.maxItems;
|
|
260
268
|
}
|
|
@@ -351,10 +359,10 @@ export class ChipSet {
|
|
|
351
359
|
}
|
|
352
360
|
renderDefaultChip(chip) {
|
|
353
361
|
return (h("div", { class: `mdc-chip ${chip.selected ? SELECTED_CHIP_CLASS : ''}`, role: "row", id: `${chip.id}` },
|
|
354
|
-
chip.icon ? this.
|
|
355
|
-
chip.text ? this.
|
|
362
|
+
chip.icon ? this.renderChipIcon(chip) : null,
|
|
363
|
+
chip.text ? this.renderChipLabel(chip) : null));
|
|
356
364
|
}
|
|
357
|
-
|
|
365
|
+
renderChipLabel(chip) {
|
|
358
366
|
const attributes = {};
|
|
359
367
|
if (chip.href) {
|
|
360
368
|
attributes.href = getHref(chip.href);
|
|
@@ -379,8 +387,8 @@ export class ChipSet {
|
|
|
379
387
|
'mdc-chip--selected': this.inputChipIndexSelected === index,
|
|
380
388
|
disabled: this.disabled,
|
|
381
389
|
}, role: "row", id: `${chip.id}`, onClick: this.catchInputChipClicks },
|
|
382
|
-
chip.icon ? this.
|
|
383
|
-
this.
|
|
390
|
+
chip.icon ? this.renderChipIcon(chip) : null,
|
|
391
|
+
this.renderChipLabel(chip),
|
|
384
392
|
this.renderChipRemoveButton(chip)),
|
|
385
393
|
this.renderDelimiter(),
|
|
386
394
|
];
|
|
@@ -388,7 +396,7 @@ export class ChipSet {
|
|
|
388
396
|
catchInputChipClicks(event) {
|
|
389
397
|
event.stopPropagation();
|
|
390
398
|
}
|
|
391
|
-
|
|
399
|
+
renderChipIcon(chip) {
|
|
392
400
|
const style = {};
|
|
393
401
|
if (chip.iconFillColor) {
|
|
394
402
|
style['--icon-color'] = chip.iconFillColor;
|
|
@@ -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 {
|