@nldd/design-system 0.10.0 → 0.12.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/custom-elements.json +3084 -784
- package/dist/components/actions/button/button.d.ts +10 -0
- package/dist/components/actions/button/button.d.ts.map +1 -1
- package/dist/components/actions/button/button.js +23 -0
- package/dist/components/actions/button/button.js.map +1 -1
- package/dist/components/actions/button/button.styles.d.ts.map +1 -1
- package/dist/components/actions/button/button.styles.js +22 -0
- package/dist/components/actions/button/button.styles.js.map +1 -1
- package/dist/components/actions/button/button.template.d.ts +1 -0
- package/dist/components/actions/button/button.template.d.ts.map +1 -1
- package/dist/components/actions/button/button.template.js +20 -2
- package/dist/components/actions/button/button.template.js.map +1 -1
- package/dist/components/actions/icon-button/icon-button.d.ts +10 -0
- package/dist/components/actions/icon-button/icon-button.d.ts.map +1 -1
- package/dist/components/actions/icon-button/icon-button.js +23 -0
- package/dist/components/actions/icon-button/icon-button.js.map +1 -1
- package/dist/components/actions/icon-button/icon-button.template.d.ts.map +1 -1
- package/dist/components/actions/icon-button/icon-button.template.js +10 -3
- package/dist/components/actions/icon-button/icon-button.template.js.map +1 -1
- package/dist/components/actions/menu/menu.styles.js +1 -1
- package/dist/components/actions/split-button/split-button.d.ts +8 -0
- package/dist/components/actions/split-button/split-button.d.ts.map +1 -1
- package/dist/components/actions/split-button/split-button.js +20 -0
- package/dist/components/actions/split-button/split-button.js.map +1 -1
- package/dist/components/actions/split-button/split-button.template.d.ts.map +1 -1
- package/dist/components/actions/split-button/split-button.template.js +4 -0
- package/dist/components/actions/split-button/split-button.template.js.map +1 -1
- package/dist/components/components.js +2857 -1993
- package/dist/components/content/code-viewer/code-viewer.d.ts +14 -1
- package/dist/components/content/code-viewer/code-viewer.d.ts.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.diff.d.ts +40 -0
- package/dist/components/content/code-viewer/code-viewer.diff.d.ts.map +1 -0
- package/dist/components/content/code-viewer/code-viewer.diff.js +261 -0
- package/dist/components/content/code-viewer/code-viewer.diff.js.map +1 -0
- package/dist/components/content/code-viewer/code-viewer.i18n.d.ts +5 -0
- package/dist/components/content/code-viewer/code-viewer.i18n.d.ts.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.i18n.js +9 -0
- package/dist/components/content/code-viewer/code-viewer.i18n.js.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.js +98 -6
- package/dist/components/content/code-viewer/code-viewer.js.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.styles.d.ts.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.styles.js +134 -1
- package/dist/components/content/code-viewer/code-viewer.styles.js.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.template.d.ts.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.template.js +5 -4
- package/dist/components/content/code-viewer/code-viewer.template.js.map +1 -1
- package/dist/components/content/icon/icon-aliases.d.ts.map +1 -1
- package/dist/components/content/icon/icon-aliases.js +13 -4
- package/dist/components/content/icon/icon-aliases.js.map +1 -1
- package/dist/components/content/icon/icon-gallery-status.d.ts.map +1 -1
- package/dist/components/content/icon/icon-gallery-status.js +9 -0
- package/dist/components/content/icon/icon-gallery-status.js.map +1 -1
- package/dist/components/content/icon/icon-registry.d.ts.map +1 -1
- package/dist/components/content/icon/icon-registry.js +9 -2
- package/dist/components/content/icon/icon-registry.js.map +1 -1
- package/dist/components/content/keyboard-shortcut/keyboard-shortcut.d.ts +3 -3
- package/dist/components/content/keyboard-shortcut/keyboard-shortcut.d.ts.map +1 -1
- package/dist/components/content/keyboard-shortcut/keyboard-shortcut.js +6 -21
- package/dist/components/content/keyboard-shortcut/keyboard-shortcut.js.map +1 -1
- package/dist/components/content/keyboard-shortcut/keyboard-shortcut.styles.d.ts.map +1 -1
- package/dist/components/content/keyboard-shortcut/keyboard-shortcut.styles.js +3 -0
- package/dist/components/content/keyboard-shortcut/keyboard-shortcut.styles.js.map +1 -1
- package/dist/components/content/rich-text/rich-text.d.ts +10 -0
- package/dist/components/content/rich-text/rich-text.d.ts.map +1 -1
- package/dist/components/content/rich-text/rich-text.js +10 -0
- package/dist/components/content/rich-text/rich-text.js.map +1 -1
- package/dist/components/content/tooltip/tooltip.d.ts +14 -0
- package/dist/components/content/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/content/tooltip/tooltip.js +45 -6
- package/dist/components/content/tooltip/tooltip.js.map +1 -1
- package/dist/components/content/tooltip/tooltip.styles.d.ts.map +1 -1
- package/dist/components/content/tooltip/tooltip.styles.js +13 -0
- package/dist/components/content/tooltip/tooltip.styles.js.map +1 -1
- package/dist/components/content/tooltip/tooltip.template.d.ts.map +1 -1
- package/dist/components/content/tooltip/tooltip.template.js +18 -2
- package/dist/components/content/tooltip/tooltip.template.js.map +1 -1
- package/dist/components/{dist-Bo5Jeyfn.js → dist-B5E3q-ea.js} +2 -1
- package/dist/components/{dist-DbNhCpS5.js → dist-BFw_yEMS.js} +2 -1
- package/dist/components/{dist-DnZmcpbQ.js → dist-BNLAXAyO.js} +2 -1
- package/dist/components/{dist-DkqAbJH8.js → dist-BOVSVPSz.js} +1 -1
- package/dist/components/{dist-Ch3gNAuT.js → dist-BPB3rWnd.js} +2 -1
- package/dist/components/{dist-Bud_7w5g.js → dist-BWlUmyq3.js} +34 -2869
- package/dist/components/dist-CC8oiVtm.js +366 -0
- package/dist/components/dist-COKR0tYU.js +2860 -0
- package/dist/components/{dist-CaxHkqR2.js → dist-Co-tsc9S.js} +4 -3
- package/dist/components/{dist-iC2RTM0V.js → dist-D_9ZyZ5v.js} +3 -2
- package/dist/components/{dist-BB5mlo7D.js → dist-Dn9pjiud.js} +3 -2
- package/dist/components/{dist-B2QcygzG.js → dist-Dz28se9B.js} +2 -1
- package/dist/components/{dist-CA0yDFIt.js → dist-IPm8ilWf.js} +3 -2
- package/dist/components/{icon-D_ZGezHx.js → icon-DFhgRf3P.js} +19 -7
- package/dist/components/{icon-button-BVhiOwX9.js → icon-button-Sxkh5cVr.js} +526 -61
- package/dist/components/inputs/code-editor/code-editor.d.ts +4 -54
- package/dist/components/inputs/code-editor/code-editor.d.ts.map +1 -1
- package/dist/components/inputs/code-editor/code-editor.js +22 -262
- package/dist/components/inputs/code-editor/code-editor.js.map +1 -1
- package/dist/components/inputs/code-editor/code-editor.styles.d.ts.map +1 -1
- package/dist/components/inputs/code-editor/code-editor.styles.js +9 -1
- package/dist/components/inputs/code-editor/code-editor.styles.js.map +1 -1
- package/dist/components/inputs/date-picker/date-picker.styles.d.ts.map +1 -1
- package/dist/components/inputs/date-picker/date-picker.styles.js +29 -5
- package/dist/components/inputs/date-picker/date-picker.styles.js.map +1 -1
- package/dist/components/inputs/search-field/search-field.d.ts +11 -0
- package/dist/components/inputs/search-field/search-field.d.ts.map +1 -1
- package/dist/components/inputs/search-field/search-field.js +30 -1
- package/dist/components/inputs/search-field/search-field.js.map +1 -1
- package/dist/components/inputs/search-field/search-field.styles.d.ts.map +1 -1
- package/dist/components/inputs/search-field/search-field.styles.js +18 -0
- package/dist/components/inputs/search-field/search-field.styles.js.map +1 -1
- package/dist/components/inputs/search-field/search-field.template.d.ts.map +1 -1
- package/dist/components/inputs/search-field/search-field.template.js +12 -0
- package/dist/components/inputs/search-field/search-field.template.js.map +1 -1
- package/dist/components/inputs/segmented-control/segmented-control.d.ts +10 -0
- package/dist/components/inputs/segmented-control/segmented-control.d.ts.map +1 -1
- package/dist/components/inputs/segmented-control/segmented-control.js +25 -1
- package/dist/components/inputs/segmented-control/segmented-control.js.map +1 -1
- package/dist/components/inputs/segmented-control/segmented-control.template.d.ts.map +1 -1
- package/dist/components/inputs/segmented-control/segmented-control.template.js +20 -3
- package/dist/components/inputs/segmented-control/segmented-control.template.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.annotation-sentinels.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.annotation-sentinels.js +9 -7
- package/dist/components/inputs/text-editor/text-editor.annotation-sentinels.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.annotations.js +1 -1
- package/dist/components/inputs/text-editor/text-editor.annotations.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.clipboard.d.ts +16 -0
- package/dist/components/inputs/text-editor/text-editor.clipboard.d.ts.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.clipboard.js +50 -0
- package/dist/components/inputs/text-editor/text-editor.clipboard.js.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.commands.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.commands.js +31 -58
- package/dist/components/inputs/text-editor/text-editor.commands.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.d.ts +17 -64
- package/dist/components/inputs/text-editor/text-editor.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.drag.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.drag.js +2 -1
- package/dist/components/inputs/text-editor/text-editor.drag.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.focus-selection.d.ts +3 -0
- package/dist/components/inputs/text-editor/text-editor.focus-selection.d.ts.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.focus-selection.js +55 -0
- package/dist/components/inputs/text-editor/text-editor.focus-selection.js.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.hidden-syntax.d.ts +6 -0
- package/dist/components/inputs/text-editor/text-editor.hidden-syntax.d.ts.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.hidden-syntax.js +257 -0
- package/dist/components/inputs/text-editor/text-editor.hidden-syntax.js.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.js +93 -313
- package/dist/components/inputs/text-editor/text-editor.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.keymap.d.ts +6 -0
- package/dist/components/inputs/text-editor/text-editor.keymap.d.ts.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.keymap.js +38 -0
- package/dist/components/inputs/text-editor/text-editor.keymap.js.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.links.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.links.js +11 -9
- package/dist/components/inputs/text-editor/text-editor.links.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.markdown.d.ts +1 -17
- package/dist/components/inputs/text-editor/text-editor.markdown.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.markdown.js +26 -186
- package/dist/components/inputs/text-editor/text-editor.markdown.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.mention.d.ts +52 -0
- package/dist/components/inputs/text-editor/text-editor.mention.d.ts.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.mention.js +186 -0
- package/dist/components/inputs/text-editor/text-editor.mention.js.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.mentions.d.ts +0 -16
- package/dist/components/inputs/text-editor/text-editor.mentions.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.mentions.js +1 -41
- package/dist/components/inputs/text-editor/text-editor.mentions.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.selection.d.ts +13 -0
- package/dist/components/inputs/text-editor/text-editor.selection.d.ts.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.selection.js +62 -0
- package/dist/components/inputs/text-editor/text-editor.selection.js.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.spellcheck.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.spellcheck.js +4 -6
- package/dist/components/inputs/text-editor/text-editor.spellcheck.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.styles.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.styles.js +185 -64
- package/dist/components/inputs/text-editor/text-editor.styles.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.syntax.d.ts +22 -0
- package/dist/components/inputs/text-editor/text-editor.syntax.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.syntax.js +44 -0
- package/dist/components/inputs/text-editor/text-editor.syntax.js.map +1 -1
- package/dist/components/inputs/toggle-button/toggle-button.d.ts +10 -0
- package/dist/components/inputs/toggle-button/toggle-button.d.ts.map +1 -1
- package/dist/components/inputs/toggle-button/toggle-button.js +25 -1
- package/dist/components/inputs/toggle-button/toggle-button.js.map +1 -1
- package/dist/components/inputs/toggle-button/toggle-button.template.d.ts.map +1 -1
- package/dist/components/inputs/toggle-button/toggle-button.template.js +21 -7
- package/dist/components/inputs/toggle-button/toggle-button.template.js.map +1 -1
- package/dist/components/layout/card/card.styles.js +4 -4
- package/dist/components/layout/container/container.d.ts +2 -0
- package/dist/components/layout/container/container.d.ts.map +1 -1
- package/dist/components/layout/container/container.js +9 -0
- package/dist/components/layout/container/container.js.map +1 -1
- package/dist/components/layout/container/container.styles.d.ts.map +1 -1
- package/dist/components/layout/container/container.styles.js +13 -0
- package/dist/components/layout/container/container.styles.js.map +1 -1
- package/dist/components/lists-and-tables/cells/step-cell/step-cell.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/cells/step-cell/step-cell.styles.js +9 -5
- package/dist/components/lists-and-tables/cells/step-cell/step-cell.styles.js.map +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.styles.d.ts.map +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.styles.js +16 -15
- package/dist/components/navigation/document-tab-bar/document-tab-bar.styles.js.map +1 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.styles.js +2 -2
- package/dist/components/navigation/tab-bar/tab-bar.styles.js +9 -9
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.d.ts +16 -9
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.d.ts.map +1 -1
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.js +16 -9
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.js.map +1 -1
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.styles.d.ts.map +1 -1
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.styles.js +23 -18
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.styles.js.map +1 -1
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.template.d.ts.map +1 -1
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.template.js +19 -21
- package/dist/components/status-and-feedback/activity-indicator/activity-indicator.template.js.map +1 -1
- package/dist/components/status-and-feedback/inline-dialog/inline-dialog.styles.js +1 -1
- package/dist/components/status-and-feedback/notification/notification.d.ts +2 -1
- package/dist/components/status-and-feedback/notification/notification.d.ts.map +1 -1
- package/dist/components/status-and-feedback/notification/notification.js +5 -2
- package/dist/components/status-and-feedback/notification/notification.js.map +1 -1
- package/dist/components/status-and-feedback/notification/notification.styles.d.ts.map +1 -1
- package/dist/components/status-and-feedback/notification/notification.styles.js +19 -1
- package/dist/components/status-and-feedback/notification/notification.styles.js.map +1 -1
- package/dist/components/status-and-feedback/notification/notifications-area.d.ts.map +1 -1
- package/dist/components/status-and-feedback/notification/notifications-area.js +14 -0
- package/dist/components/status-and-feedback/notification/notifications-area.js.map +1 -1
- package/dist/components/status-and-feedback/progress-bar/progress-bar.styles.js +4 -4
- package/dist/components/status-and-feedback/progress-circle/progress-circle.styles.js +3 -3
- package/dist/components/status-and-feedback/progress-circle/progress-circle.template.js +1 -1
- package/dist/components/status-and-feedback/progress-circle/progress-circle.template.js.map +1 -1
- package/dist/components/status-and-feedback/step-bar/step-bar.styles.d.ts.map +1 -1
- package/dist/components/status-and-feedback/step-bar/step-bar.styles.js +7 -5
- package/dist/components/status-and-feedback/step-bar/step-bar.styles.js.map +1 -1
- package/dist/css/rich-text.css +61 -1
- package/dist/css/themes/bruin.css +108 -64
- package/dist/css/themes/donkerblauw.css +108 -64
- package/dist/css/themes/donkerbruin.css +88 -64
- package/dist/css/themes/donkergeel.css +149 -94
- package/dist/css/themes/donkergroen.css +93 -64
- package/dist/css/themes/geel.css +149 -94
- package/dist/css/themes/groen.css +108 -64
- package/dist/css/themes/hemelblauw.css +108 -64
- package/dist/css/themes/lichtblauw.css +111 -64
- package/dist/css/themes/mintgroen.css +111 -64
- package/dist/css/themes/mosgroen.css +108 -64
- package/dist/css/themes/oranje.css +162 -99
- package/dist/css/themes/paars.css +115 -64
- package/dist/css/themes/robijnrood.css +159 -96
- package/dist/css/themes/rood.css +159 -96
- package/dist/css/themes/roze.css +118 -64
- package/dist/css/themes/violet.css +93 -64
- package/dist/css/themes.css +2047 -1247
- package/dist/css/variables.css +142 -70
- package/dist/nldd.min.js +1468 -998
- package/dist/translations/en-US.d.ts.map +1 -1
- package/dist/translations/en-US.js +5 -0
- package/dist/translations/en-US.js.map +1 -1
- package/dist/translations/nl.generated.d.ts +5 -0
- package/dist/translations/nl.generated.d.ts.map +1 -1
- package/dist/types/vue.d.ts +138 -32
- package/dist/utilities/codemirror/codemirror-input.d.ts +90 -0
- package/dist/utilities/codemirror/codemirror-input.d.ts.map +1 -0
- package/dist/utilities/codemirror/codemirror-input.js +250 -0
- package/dist/utilities/codemirror/codemirror-input.js.map +1 -0
- package/dist/utilities/codemirror/theme.js +1 -1
- package/dist/utilities/codemirror/theme.js.map +1 -1
- package/dist/utilities/shortcut.d.ts +50 -0
- package/dist/utilities/shortcut.d.ts.map +1 -0
- package/dist/utilities/shortcut.js +77 -0
- package/dist/utilities/shortcut.js.map +1 -0
- package/package.json +2 -1
|
@@ -40,78 +40,29 @@
|
|
|
40
40
|
* @fires change - When the content is committed on blur (detail: { value })
|
|
41
41
|
*/
|
|
42
42
|
import { type PropertyValues } from 'lit';
|
|
43
|
-
import { type FormValue } from '../../../utilities/form-associated-mixin.js';
|
|
44
43
|
import { type Extension } from '@codemirror/state';
|
|
45
|
-
import {
|
|
44
|
+
import { NLDDCodeMirrorInput } from '../../../utilities/codemirror/codemirror-input.js';
|
|
46
45
|
export type ResizeMode = 'none' | 'vertical' | 'auto';
|
|
47
46
|
export type CodeEditorAppearance = 'input-field' | 'simple';
|
|
48
|
-
declare
|
|
49
|
-
export declare class NLDDCodeEditor extends NLDDCodeEditor_base {
|
|
50
|
-
static shadowRootOptions: {
|
|
51
|
-
delegatesFocus: boolean;
|
|
52
|
-
clonable?: boolean;
|
|
53
|
-
customElementRegistry?: CustomElementRegistry;
|
|
54
|
-
mode: ShadowRootMode;
|
|
55
|
-
serializable?: boolean;
|
|
56
|
-
slotAssignment?: SlotAssignmentMode;
|
|
57
|
-
};
|
|
47
|
+
export declare class NLDDCodeEditor extends NLDDCodeMirrorInput {
|
|
58
48
|
static styles: import("lit").CSSResult;
|
|
59
|
-
/** Says this is the control an nldd-form-field is about, so the field can
|
|
60
|
-
* find it, name it and move focus into it. See nldd-form-field. */
|
|
61
|
-
static isFormInput: boolean;
|
|
62
|
-
private _initialValue;
|
|
63
|
-
private _valueAtFocus;
|
|
64
|
-
private _accessibleLabelWarned;
|
|
65
|
-
value: string;
|
|
66
|
-
inputId: string;
|
|
67
|
-
placeholder: string;
|
|
68
|
-
disabled: boolean;
|
|
69
|
-
name: string;
|
|
70
|
-
readonly: boolean;
|
|
71
|
-
required: boolean;
|
|
72
49
|
wrap: boolean;
|
|
73
|
-
rows: number;
|
|
74
50
|
resize: ResizeMode;
|
|
75
51
|
appearance: CodeEditorAppearance;
|
|
76
52
|
language: string;
|
|
77
53
|
lineNumbers: boolean;
|
|
78
|
-
accessibleLabel: string;
|
|
79
54
|
private _container;
|
|
80
|
-
|
|
55
|
+
protected readonly rowsProperty = "--_code-editor-rows";
|
|
81
56
|
private _wrapCompartment;
|
|
82
57
|
private _lineNumbersCompartment;
|
|
83
|
-
private _placeholderCompartment;
|
|
84
|
-
private _attrsCompartment;
|
|
85
58
|
private _languageCompartment;
|
|
86
|
-
/**
|
|
87
|
-
* Marks the control as invalid.
|
|
88
|
-
*
|
|
89
|
-
* Announced and not drawn. What is wrong belongs in an
|
|
90
|
-
* nldd-validation-list, in words: a red ring around a single
|
|
91
|
-
* checkbox or radio would say the option is wrong, while it is the question
|
|
92
|
-
* that is unanswered. `aria-invalid` still goes on the control, because
|
|
93
|
-
* choosing not to show something is not a reason to keep quiet about it.
|
|
94
|
-
*/
|
|
95
|
-
invalid: boolean;
|
|
96
59
|
protected getEditorParent(): HTMLElement | null | undefined;
|
|
97
60
|
protected buildExtensions(): Extension[];
|
|
98
|
-
private _editableExtension;
|
|
99
|
-
private _placeholderExtension;
|
|
100
61
|
private _lineNumbersExtension;
|
|
101
|
-
|
|
102
|
-
firstUpdated(): void;
|
|
62
|
+
protected contentAttributes(): Record<string, string>;
|
|
103
63
|
protected onEditorMounted(): void;
|
|
104
64
|
updated(changed: PropertyValues): void;
|
|
105
65
|
private _applyLanguage;
|
|
106
|
-
private _onDocChanged;
|
|
107
|
-
private _emitChange;
|
|
108
|
-
private _onScrollerPointerDown;
|
|
109
|
-
private _checkAccessibleLabel;
|
|
110
|
-
formValue(): FormValue;
|
|
111
|
-
formResetCallback(): void;
|
|
112
|
-
formStateRestoreCallback(state: File | string | FormData | null): void;
|
|
113
|
-
/** CodeMirror builds the textbox; the host is only its container. */
|
|
114
|
-
describedTarget(): Element | null;
|
|
115
66
|
render(): import("lit-html").TemplateResult;
|
|
116
67
|
}
|
|
117
68
|
declare global {
|
|
@@ -119,5 +70,4 @@ declare global {
|
|
|
119
70
|
'nldd-code-editor': NLDDCodeEditor;
|
|
120
71
|
}
|
|
121
72
|
}
|
|
122
|
-
export {};
|
|
123
73
|
//# sourceMappingURL=code-editor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-editor.d.ts","sourceRoot":"","sources":["../../../../src/components/inputs/code-editor/code-editor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"code-editor.d.ts","sourceRoot":"","sources":["../../../../src/components/inputs/code-editor/code-editor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAI1C,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEhE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mDAAmD,CAAC;AAMxF,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,CAAC;AACtD,MAAM,MAAM,oBAAoB,GAAG,aAAa,GAAG,QAAQ,CAAC;AAE5D,qBACa,cAAe,SAAQ,mBAAmB;IAEtD,OAAgB,MAAM,0BAAoB;IAG1C,IAAI,UAAS;IAGb,MAAM,EAAE,UAAU,CAAU;IAG5B,UAAU,EAAE,oBAAoB,CAAY;IAG5C,QAAQ,SAAM;IAGd,WAAW,UAAS;IAGpB,OAAO,CAAC,UAAU,CAAe;IAEjC,SAAS,CAAC,QAAQ,CAAC,YAAY,yBAAyB;IAGxD,OAAO,CAAC,gBAAgB,CAAqB;IAC7C,OAAO,CAAC,uBAAuB,CAAqB;IACpD,OAAO,CAAC,oBAAoB,CAAqB;IAEjD,SAAS,CAAC,eAAe,IAAI,WAAW,GAAG,IAAI,GAAG,SAAS;IAI3D,SAAS,CAAC,eAAe,IAAI,SAAS,EAAE;IAaxC,OAAO,CAAC,qBAAqB;cAgBV,iBAAiB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;cAM3C,eAAe,IAAI,IAAI;IAKjC,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;YAcjC,cAAc;IAoBnB,MAAM;CAGf;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,kBAAkB,EAAE,cAAc,CAAC;KACnC;CACD"}
|
|
@@ -4,105 +4,29 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
/**
|
|
8
|
-
* Nederlandse Digitale Dienst Code Editor Component (Lit + TypeScript)
|
|
9
|
-
*
|
|
10
|
-
* A monospace editor for code, YAML, JSON and other technical content, built
|
|
11
|
-
* on CodeMirror 6 (via NLDDCodeMirrorElement). Visually pairs with
|
|
12
|
-
* nldd-code-viewer for a matching read-only surface.
|
|
13
|
-
*
|
|
14
|
-
* Default `appearance="simple"` is a bare, flush editor (no frame, no focus ring)
|
|
15
|
-
* for use inside an nldd-form-field or a consumer composition that owns its own
|
|
16
|
-
* chrome and focus treatment; the caret is rendered as a prominent accent as
|
|
17
|
-
* the focus cue. `appearance="input-field"` adds the framed surface (border ring, tinted
|
|
18
|
-
* fill, inner padding, radius) and a focus ring for standalone use.
|
|
19
|
-
*
|
|
20
|
-
* The simple variant has no surrounding space of its own: let a layout
|
|
21
|
-
* container own the spacing and forward clicks with `focusFromPoint()` so
|
|
22
|
-
* clicking the padding still starts editing.
|
|
23
|
-
*
|
|
24
|
-
* Optional `language` enables lazy syntax highlighting; `line-numbers` adds a
|
|
25
|
-
* gutter (click a number to move the caret to that line).
|
|
26
|
-
*
|
|
27
|
-
* @element nldd-code-editor
|
|
28
|
-
*
|
|
29
|
-
* @attr {string} value - Editor content
|
|
30
|
-
* @attr {string} placeholder - Placeholder text shown while empty
|
|
31
|
-
* @attr {string} input-id - Sets the id on the editable element. Set automatically by nldd-form-field.
|
|
32
|
-
* @attr {boolean} disabled - Disabled state
|
|
33
|
-
* @attr {string} name - Field name for form submission
|
|
34
|
-
* @attr {boolean} readonly - Readonly state (focusable and selectable, not editable)
|
|
35
|
-
* @attr {boolean} required - Required state
|
|
36
|
-
* @attr {boolean} wrap - Wrap long lines instead of horizontal scroll
|
|
37
|
-
* @attr {number} rows - Minimum visible rows (the floor in every resize mode). Default: 6.
|
|
38
|
-
* @attr {string} resize - 'none' (fixed) | 'vertical' (drag) | 'auto' (grow, default)
|
|
39
|
-
* @attr {string} appearance - 'simple' (default, bare) | 'input-field' (framed surface)
|
|
40
|
-
* @attr {string} language - Highlight grammar (yaml, json, javascript, typescript, css, html, xml, bash, markdown, rust, gherkin, toml, sql, python). Empty disables highlighting.
|
|
41
|
-
* @attr {boolean} line-numbers - Show a line-number gutter
|
|
42
|
-
* @attr {string} accessible-label - Accessible label forwarded to the editor. Set automatically by nldd-form-field.
|
|
43
|
-
* @attr {boolean} invalid - Marks the control as invalid. Announced with aria-invalid; nothing is drawn for it.
|
|
44
|
-
*
|
|
45
|
-
* @fires input - When the content changes (detail: { value })
|
|
46
|
-
* @fires change - When the content is committed on blur (detail: { value })
|
|
47
|
-
*/
|
|
48
|
-
import { LitElement } from 'lit';
|
|
49
7
|
import { customElement, property, query } from 'lit/decorators.js';
|
|
50
|
-
import { FormAssociated } from '../../../utilities/form-associated-mixin.js';
|
|
51
8
|
import { reflectNonDefault } from '../../../utilities/reflect-non-default.js';
|
|
52
|
-
import { EditorView, keymap, drawSelection, lineNumbers as cmLineNumbers
|
|
53
|
-
import { Compartment
|
|
9
|
+
import { EditorView, keymap, drawSelection, lineNumbers as cmLineNumbers } from '@codemirror/view';
|
|
10
|
+
import { Compartment } from '@codemirror/state';
|
|
54
11
|
import { defaultKeymap, history, historyKeymap } from '@codemirror/commands';
|
|
55
|
-
import {
|
|
12
|
+
import { NLDDCodeMirrorInput } from '../../../utilities/codemirror/codemirror-input.js';
|
|
56
13
|
import { nlddCodeMirrorTheme } from '../../../utilities/codemirror/theme.js';
|
|
57
14
|
import { loadLanguage } from '../../../utilities/codemirror/languages.js';
|
|
58
15
|
import { codeEditorStyles } from './code-editor.styles.js';
|
|
59
16
|
import { codeEditorTemplate } from './code-editor.template.js';
|
|
60
|
-
|
|
61
|
-
let NLDDCodeEditor = class NLDDCodeEditor extends DescribedBy(FormAssociated(NLDDCodeMirrorElement)) {
|
|
17
|
+
let NLDDCodeEditor = class NLDDCodeEditor extends NLDDCodeMirrorInput {
|
|
62
18
|
constructor() {
|
|
63
19
|
super(...arguments);
|
|
64
|
-
this._initialValue = '';
|
|
65
|
-
this._valueAtFocus = '';
|
|
66
|
-
this._accessibleLabelWarned = false;
|
|
67
|
-
this.value = '';
|
|
68
|
-
this.inputId = '';
|
|
69
|
-
this.placeholder = '';
|
|
70
|
-
this.disabled = false;
|
|
71
|
-
this.name = '';
|
|
72
|
-
this.readonly = false;
|
|
73
|
-
this.required = false;
|
|
74
20
|
this.wrap = false;
|
|
75
|
-
this.rows = 6;
|
|
76
21
|
this.resize = 'auto';
|
|
77
22
|
this.appearance = 'simple';
|
|
78
23
|
this.language = '';
|
|
79
24
|
this.lineNumbers = false;
|
|
80
|
-
this.
|
|
25
|
+
this.rowsProperty = '--_code-editor-rows';
|
|
81
26
|
// Compartments let us reconfigure single concerns without rebuilding state.
|
|
82
|
-
this._editableCompartment = new Compartment();
|
|
83
27
|
this._wrapCompartment = new Compartment();
|
|
84
28
|
this._lineNumbersCompartment = new Compartment();
|
|
85
|
-
this._placeholderCompartment = new Compartment();
|
|
86
|
-
this._attrsCompartment = new Compartment();
|
|
87
29
|
this._languageCompartment = new Compartment();
|
|
88
|
-
/**
|
|
89
|
-
* Marks the control as invalid.
|
|
90
|
-
*
|
|
91
|
-
* Announced and not drawn. What is wrong belongs in an
|
|
92
|
-
* nldd-validation-list, in words: a red ring around a single
|
|
93
|
-
* checkbox or radio would say the option is wrong, while it is the question
|
|
94
|
-
* that is unanswered. `aria-invalid` still goes on the control, because
|
|
95
|
-
* choosing not to show something is not a reason to keep quiet about it.
|
|
96
|
-
*/
|
|
97
|
-
this.invalid = false;
|
|
98
|
-
this._onScrollerPointerDown = (event) => {
|
|
99
|
-
// Only the scroller's own padding — not the content/gutter inside it.
|
|
100
|
-
// pointerdown covers mouse, touch and pen in one event.
|
|
101
|
-
if (event.target !== this.view?.scrollDOM)
|
|
102
|
-
return;
|
|
103
|
-
this.focusFromPoint(event.clientX, event.clientY);
|
|
104
|
-
event.preventDefault();
|
|
105
|
-
};
|
|
106
30
|
}
|
|
107
31
|
getEditorParent() {
|
|
108
32
|
return this._container;
|
|
@@ -113,36 +37,12 @@ let NLDDCodeEditor = class NLDDCodeEditor extends DescribedBy(FormAssociated(NLD
|
|
|
113
37
|
history(),
|
|
114
38
|
drawSelection(),
|
|
115
39
|
keymap.of([...defaultKeymap, ...historyKeymap]),
|
|
116
|
-
this.
|
|
40
|
+
...this.inputExtensions(),
|
|
117
41
|
this._wrapCompartment.of(this.wrap ? EditorView.lineWrapping : []),
|
|
118
42
|
this._lineNumbersCompartment.of(this._lineNumbersExtension()),
|
|
119
|
-
this._editableCompartment.of(this._editableExtension()),
|
|
120
|
-
this._attrsCompartment.of(this._attrsExtension()),
|
|
121
43
|
this._languageCompartment.of([]),
|
|
122
|
-
EditorView.updateListener.of((u) => {
|
|
123
|
-
if (u.docChanged)
|
|
124
|
-
this._onDocChanged();
|
|
125
|
-
}),
|
|
126
|
-
EditorView.domEventHandlers({
|
|
127
|
-
focus: () => {
|
|
128
|
-
this._valueAtFocus = this.value;
|
|
129
|
-
},
|
|
130
|
-
blur: () => {
|
|
131
|
-
if (this.value !== this._valueAtFocus)
|
|
132
|
-
this._emitChange();
|
|
133
|
-
},
|
|
134
|
-
}),
|
|
135
44
|
];
|
|
136
45
|
}
|
|
137
|
-
_editableExtension() {
|
|
138
|
-
// Readonly stays focusable/selectable (read + copy); disabled is inert.
|
|
139
|
-
const editable = !this.disabled;
|
|
140
|
-
const readOnly = this.disabled || this.readonly;
|
|
141
|
-
return [EditorView.editable.of(editable), EditorState.readOnly.of(readOnly)];
|
|
142
|
-
}
|
|
143
|
-
_placeholderExtension() {
|
|
144
|
-
return this.placeholder ? cmPlaceholder(this.placeholder) : [];
|
|
145
|
-
}
|
|
146
46
|
_lineNumbersExtension() {
|
|
147
47
|
if (!this.lineNumbers)
|
|
148
48
|
return [];
|
|
@@ -157,88 +57,31 @@ let NLDDCodeEditor = class NLDDCodeEditor extends DescribedBy(FormAssociated(NLD
|
|
|
157
57
|
},
|
|
158
58
|
});
|
|
159
59
|
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
const attrs = {
|
|
165
|
-
'role': 'textbox',
|
|
166
|
-
'aria-multiline': 'true',
|
|
167
|
-
};
|
|
168
|
-
if (this.accessibleLabel)
|
|
169
|
-
attrs['aria-label'] = this.accessibleLabel;
|
|
170
|
-
if (this.inputId)
|
|
171
|
-
attrs['id'] = this.inputId;
|
|
172
|
-
// disabled makes the field inert (contenteditable=false); readonly keeps it
|
|
173
|
-
// focusable but non-editable. Either way it's not editable, so reflect
|
|
174
|
-
// aria-readonly. aria-required mirrors the required constraint.
|
|
175
|
-
if (this.readonly || this.disabled)
|
|
176
|
-
attrs['aria-readonly'] = 'true';
|
|
177
|
-
if (this.required)
|
|
178
|
-
attrs['aria-required'] = 'true';
|
|
179
|
-
return EditorView.contentAttributes.of(attrs);
|
|
180
|
-
}
|
|
181
|
-
firstUpdated() {
|
|
182
|
-
this._initialValue = this.value;
|
|
183
|
-
this.style.setProperty('--_code-editor-rows', String(this.rows));
|
|
184
|
-
this.mountEditor(this.value);
|
|
185
|
-
this.onEditorMounted();
|
|
60
|
+
// CodeMirror's content is a bare contenteditable; give it the textbox
|
|
61
|
+
// semantics a native <textarea> had, so screen readers announce it (WCAG 4.1.2).
|
|
62
|
+
contentAttributes() {
|
|
63
|
+
return { 'role': 'textbox', 'aria-multiline': 'true' };
|
|
186
64
|
}
|
|
187
65
|
/* Runs on the initial mount and on every re-mount after a detach/reattach
|
|
188
|
-
* (e.g. Vue <KeepAlive>): the view
|
|
189
|
-
* padding-click forwarder and language must be (re)applied here. */
|
|
66
|
+
* (e.g. Vue <KeepAlive>): the view is rebuilt, so the language goes on again. */
|
|
190
67
|
onEditorMounted() {
|
|
191
|
-
|
|
192
|
-
// place a caret; forward it to the nearest line so the padding is
|
|
193
|
-
// clickable too. CM attaches its own handlers to the content, not the
|
|
194
|
-
// scroller, so this is a plain listener on the scroller element.
|
|
195
|
-
this.view?.scrollDOM.addEventListener('pointerdown', this._onScrollerPointerDown);
|
|
196
|
-
this.commitFormValue();
|
|
68
|
+
super.onEditorMounted();
|
|
197
69
|
if (this.language)
|
|
198
70
|
void this._applyLanguage();
|
|
199
|
-
this._checkAccessibleLabel();
|
|
200
71
|
}
|
|
201
72
|
updated(changed) {
|
|
202
|
-
|
|
203
|
-
|
|
73
|
+
super.updated(changed);
|
|
74
|
+
if (!this.view)
|
|
75
|
+
return;
|
|
76
|
+
if (changed.has('wrap')) {
|
|
77
|
+
this.reconfigure(this._wrapCompartment, this.wrap ? EditorView.lineWrapping : []);
|
|
78
|
+
}
|
|
79
|
+
if (changed.has('lineNumbers')) {
|
|
80
|
+
this.reconfigure(this._lineNumbersCompartment, this._lineNumbersExtension());
|
|
204
81
|
}
|
|
205
|
-
if (
|
|
206
|
-
|
|
207
|
-
const docWas = this.doc;
|
|
208
|
-
this.setDoc(this.value);
|
|
209
|
-
this.commitFormValue();
|
|
210
|
-
// A programmatic value change while focused must not look like a user edit
|
|
211
|
-
// on the next blur: if setDoc actually moved the doc (i.e. this wasn't the
|
|
212
|
-
// echo of the user's own typing, where the doc already equals value),
|
|
213
|
-
// advance the focus-time baseline too.
|
|
214
|
-
if (docWas !== this.value)
|
|
215
|
-
this._valueAtFocus = this.value;
|
|
216
|
-
}
|
|
217
|
-
if (changed.has('disabled') || changed.has('readonly')) {
|
|
218
|
-
this.reconfigure(this._editableCompartment, this._editableExtension());
|
|
219
|
-
}
|
|
220
|
-
// readonly/required/disabled also drive the content's aria-readonly/
|
|
221
|
-
// aria-required, so refresh the attrs compartment when they change.
|
|
222
|
-
if (changed.has('disabled') || changed.has('readonly') || changed.has('required')) {
|
|
223
|
-
this.reconfigure(this._attrsCompartment, this._attrsExtension());
|
|
224
|
-
}
|
|
225
|
-
if (changed.has('wrap')) {
|
|
226
|
-
this.reconfigure(this._wrapCompartment, this.wrap ? EditorView.lineWrapping : []);
|
|
227
|
-
}
|
|
228
|
-
if (changed.has('lineNumbers')) {
|
|
229
|
-
this.reconfigure(this._lineNumbersCompartment, this._lineNumbersExtension());
|
|
230
|
-
}
|
|
231
|
-
if (changed.has('placeholder')) {
|
|
232
|
-
this.reconfigure(this._placeholderCompartment, this._placeholderExtension());
|
|
233
|
-
}
|
|
234
|
-
if (changed.has('accessibleLabel') || changed.has('inputId')) {
|
|
235
|
-
this.reconfigure(this._attrsCompartment, this._attrsExtension());
|
|
236
|
-
}
|
|
237
|
-
if (changed.has('language')) {
|
|
238
|
-
void this._applyLanguage();
|
|
239
|
-
}
|
|
82
|
+
if (changed.has('language')) {
|
|
83
|
+
void this._applyLanguage();
|
|
240
84
|
}
|
|
241
|
-
this._checkAccessibleLabel();
|
|
242
85
|
}
|
|
243
86
|
async _applyLanguage() {
|
|
244
87
|
const lang = this.language;
|
|
@@ -261,91 +104,14 @@ let NLDDCodeEditor = class NLDDCodeEditor extends DescribedBy(FormAssociated(NLD
|
|
|
261
104
|
this.reconfigure(this._languageCompartment, []);
|
|
262
105
|
}
|
|
263
106
|
}
|
|
264
|
-
_onDocChanged() {
|
|
265
|
-
const text = this.doc;
|
|
266
|
-
if (text === this.value)
|
|
267
|
-
return;
|
|
268
|
-
this.value = text;
|
|
269
|
-
this.commitFormValue();
|
|
270
|
-
this.dispatchEvent(new CustomEvent('input', {
|
|
271
|
-
detail: { value: text },
|
|
272
|
-
bubbles: true,
|
|
273
|
-
composed: true,
|
|
274
|
-
}));
|
|
275
|
-
}
|
|
276
|
-
_emitChange() {
|
|
277
|
-
this.commitFormValue();
|
|
278
|
-
this.dispatchEvent(new CustomEvent('change', {
|
|
279
|
-
detail: { value: this.value },
|
|
280
|
-
bubbles: true,
|
|
281
|
-
composed: true,
|
|
282
|
-
}));
|
|
283
|
-
}
|
|
284
|
-
/* Ran from updated(), not firstUpdated(): a parent nldd-form-field sets
|
|
285
|
-
* input-id slightly after our first render, so checking earlier triggers
|
|
286
|
-
* a spurious warning for the standard form-field usage. We re-check on
|
|
287
|
-
* every update and warn once if the missing label is still missing. */
|
|
288
|
-
_checkAccessibleLabel() {
|
|
289
|
-
if (this._accessibleLabelWarned)
|
|
290
|
-
return;
|
|
291
|
-
if (this.accessibleLabel || this.inputId)
|
|
292
|
-
return;
|
|
293
|
-
this._accessibleLabelWarned = true;
|
|
294
|
-
console.warn('<nldd-code-editor>: No accessible-label or input-id provided. Use nldd-form-field for labeled usage, or set accessible-label for screen reader accessibility (WCAG SC 4.1.2).');
|
|
295
|
-
}
|
|
296
|
-
formValue() {
|
|
297
|
-
return this.value;
|
|
298
|
-
}
|
|
299
|
-
formResetCallback() {
|
|
300
|
-
this.value = this._initialValue;
|
|
301
|
-
}
|
|
302
|
-
formStateRestoreCallback(state) {
|
|
303
|
-
if (typeof state === 'string')
|
|
304
|
-
this.value = state;
|
|
305
|
-
}
|
|
306
|
-
/** CodeMirror builds the textbox; the host is only its container. */
|
|
307
|
-
describedTarget() {
|
|
308
|
-
return this.shadowRoot?.querySelector('.cm-content') ?? null;
|
|
309
|
-
}
|
|
310
107
|
render() {
|
|
311
108
|
return codeEditorTemplate(this);
|
|
312
109
|
}
|
|
313
110
|
};
|
|
314
|
-
NLDDCodeEditor.shadowRootOptions = {
|
|
315
|
-
...LitElement.shadowRootOptions,
|
|
316
|
-
delegatesFocus: true,
|
|
317
|
-
};
|
|
318
111
|
NLDDCodeEditor.styles = codeEditorStyles;
|
|
319
|
-
/** Says this is the control an nldd-form-field is about, so the field can
|
|
320
|
-
* find it, name it and move focus into it. See nldd-form-field. */
|
|
321
|
-
NLDDCodeEditor.isFormInput = true;
|
|
322
|
-
__decorate([
|
|
323
|
-
property({ type: String })
|
|
324
|
-
], NLDDCodeEditor.prototype, "value", void 0);
|
|
325
|
-
__decorate([
|
|
326
|
-
property({ type: String, attribute: 'input-id' })
|
|
327
|
-
], NLDDCodeEditor.prototype, "inputId", void 0);
|
|
328
|
-
__decorate([
|
|
329
|
-
property({ reflect: true, converter: reflectNonDefault('') })
|
|
330
|
-
], NLDDCodeEditor.prototype, "placeholder", void 0);
|
|
331
|
-
__decorate([
|
|
332
|
-
property({ type: Boolean, reflect: true })
|
|
333
|
-
], NLDDCodeEditor.prototype, "disabled", void 0);
|
|
334
|
-
__decorate([
|
|
335
|
-
property({ reflect: true, converter: reflectNonDefault('') })
|
|
336
|
-
], NLDDCodeEditor.prototype, "name", void 0);
|
|
337
|
-
__decorate([
|
|
338
|
-
property({ type: Boolean, reflect: true })
|
|
339
|
-
], NLDDCodeEditor.prototype, "readonly", void 0);
|
|
340
|
-
__decorate([
|
|
341
|
-
property({ type: Boolean, reflect: true })
|
|
342
|
-
], NLDDCodeEditor.prototype, "required", void 0);
|
|
343
112
|
__decorate([
|
|
344
113
|
property({ type: Boolean, reflect: true })
|
|
345
114
|
], NLDDCodeEditor.prototype, "wrap", void 0);
|
|
346
|
-
__decorate([
|
|
347
|
-
property({ type: Number })
|
|
348
|
-
], NLDDCodeEditor.prototype, "rows", void 0);
|
|
349
115
|
__decorate([
|
|
350
116
|
property({ reflect: true, converter: reflectNonDefault('auto') })
|
|
351
117
|
], NLDDCodeEditor.prototype, "resize", void 0);
|
|
@@ -358,15 +124,9 @@ __decorate([
|
|
|
358
124
|
__decorate([
|
|
359
125
|
property({ type: Boolean, reflect: true, attribute: 'line-numbers' })
|
|
360
126
|
], NLDDCodeEditor.prototype, "lineNumbers", void 0);
|
|
361
|
-
__decorate([
|
|
362
|
-
property({ type: String, attribute: 'accessible-label' })
|
|
363
|
-
], NLDDCodeEditor.prototype, "accessibleLabel", void 0);
|
|
364
127
|
__decorate([
|
|
365
128
|
query('.code-editor')
|
|
366
129
|
], NLDDCodeEditor.prototype, "_container", void 0);
|
|
367
|
-
__decorate([
|
|
368
|
-
property({ type: Boolean, reflect: true })
|
|
369
|
-
], NLDDCodeEditor.prototype, "invalid", void 0);
|
|
370
130
|
NLDDCodeEditor = __decorate([
|
|
371
131
|
customElement('nldd-code-editor')
|
|
372
132
|
], NLDDCodeEditor);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-editor.js","sourceRoot":"","sources":["../../../../src/components/inputs/code-editor/code-editor.ts"],"names":[],"mappings":";;;;;;
|
|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CAAC;IAEQ,MAAM;QACd,OAAO,kBAAkB,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;;AA3Ge,qBAAM,GAAG,gBAAgB,AAAnB,CAAoB;AAG1C;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4CAC9B;AAGb;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,iBAAiB,CAAa,MAAM,CAAC,EAAE,CAAC;8CAClD;AAG5B;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,iBAAiB,CAAuB,QAAQ,CAAC,EAAE,CAAC;kDAC9C;AAG5C;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,iBAAiB,CAAS,EAAE,CAAC,EAAE,CAAC;gDACxD;AAGd;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;mDAClD;AAGZ;IADP,KAAK,CAAC,cAAc,CAAC;kDACW;AApBrB,cAAc;IAD1B,aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CA8G1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-editor.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/inputs/code-editor/code-editor.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"code-editor.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/inputs/code-editor/code-editor.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB,yBAwI5B,CAAC"}
|
|
@@ -10,6 +10,7 @@ export const codeEditorStyles = css `
|
|
|
10
10
|
|
|
11
11
|
:host {
|
|
12
12
|
--_code-editor-caret-width: var(--primitives-border-width-regular);
|
|
13
|
+
--_code-editor-caret-color: var(--components-code-editor-caret-color);
|
|
13
14
|
--_code-editor-corner-radius: 0;
|
|
14
15
|
--_code-editor-background-color: transparent;
|
|
15
16
|
--_code-editor-border-color: transparent;
|
|
@@ -77,6 +78,8 @@ export const codeEditorStyles = css `
|
|
|
77
78
|
:host([disabled]) .code-editor {
|
|
78
79
|
opacity: var(--primitives-opacity-disabled);
|
|
79
80
|
pointer-events: none;
|
|
81
|
+
-webkit-user-select: none;
|
|
82
|
+
user-select: none;
|
|
80
83
|
}
|
|
81
84
|
|
|
82
85
|
/* Focus ring only on the input-field variant. The simple variant relies on a
|
|
@@ -107,10 +110,15 @@ export const codeEditorStyles = css `
|
|
|
107
110
|
tab-size: 2;
|
|
108
111
|
}
|
|
109
112
|
|
|
113
|
+
/* Read-only, like a native read-only field: select and copy, but no caret. */
|
|
114
|
+
:host([readonly]) .cm-cursorLayer {
|
|
115
|
+
visibility: hidden;
|
|
116
|
+
}
|
|
117
|
+
|
|
110
118
|
/* Accent caret. The doubled class is purely for specificity — it outweighs
|
|
111
119
|
CodeMirror's theme cursor color without depending on an attribute. */
|
|
112
120
|
:host .cm-cursor.cm-cursor {
|
|
113
|
-
border-left-color: var(--
|
|
121
|
+
border-left-color: var(--_code-editor-caret-color);
|
|
114
122
|
border-left-width: var(--_code-editor-caret-width);
|
|
115
123
|
}
|
|
116
124
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-editor.styles.js","sourceRoot":"","sources":["../../../../src/components/inputs/code-editor/code-editor.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAE7E,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"code-editor.styles.js","sourceRoot":"","sources":["../../../../src/components/inputs/code-editor/code-editor.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAE7E,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA4B/B,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4GrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/inputs/date-picker/date-picker.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"date-picker.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/inputs/date-picker/date-picker.styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB,yBA6X5B,CAAC"}
|
|
@@ -31,12 +31,17 @@ export const datePickerStyles = css `
|
|
|
31
31
|
--_date-picker-day-indicator-inset: var(--primitives-space-2);
|
|
32
32
|
--_date-picker-day-indicator-size: calc(var(--_date-picker-day-size) - var(--_date-picker-day-indicator-inset) * 2);
|
|
33
33
|
--_date-picker-day-indicator-corner-radius: var(--_date-picker-day-corner-radius);
|
|
34
|
-
--_date-picker-day-is-in-range-background-color:
|
|
34
|
+
--_date-picker-day-is-in-range-background-color: var(--components-date-picker-day-is-in-range-background-color);
|
|
35
|
+
--_date-picker-day-is-in-range-is-hovered-background-color: var(--components-date-picker-day-is-in-range-is-hovered-background-color);
|
|
35
36
|
--_date-picker-day-is-in-range-content-color: var(--semantics-content-color);
|
|
36
37
|
--_date-picker-day-is-today-border-color: light-dark(var(--primitives-color-neutral-250), var(--primitives-color-neutral-400));
|
|
38
|
+
--_date-picker-day-is-today-is-in-range-border-color: var(--components-date-picker-day-is-today-is-in-range-border-color);
|
|
39
|
+
--_date-picker-day-is-today-is-selected-border-color: var(--components-date-picker-day-is-today-is-selected-border-color);
|
|
37
40
|
--_date-picker-day-is-hovered-background-color: light-dark(var(--primitives-color-neutral-100), var(--primitives-color-neutral-150));
|
|
38
41
|
--_date-picker-day-is-selected-background-color: var(--semantics-controls-is-selected-indicator-color);
|
|
39
42
|
--_date-picker-day-is-selected-content-color: var(--semantics-controls-is-selected-contrast-color);
|
|
43
|
+
--_date-picker-day-is-selected-is-hovered-background-color: var(--semantics-controls-is-selected-is-hovered-indicator-color);
|
|
44
|
+
--_date-picker-day-is-selected-is-hovered-content-color: var(--semantics-controls-is-selected-is-hovered-contrast-color);
|
|
40
45
|
--_date-picker-day-is-outside-month-content-color: var(--semantics-content-secondary-color);
|
|
41
46
|
--_date-picker-day-is-unavailable-content-color: var(--semantics-content-secondary-color);
|
|
42
47
|
|
|
@@ -257,6 +262,14 @@ export const datePickerStyles = css `
|
|
|
257
262
|
border: var(--primitives-border-width-regular) solid var(--_date-picker-day-is-today-border-color);
|
|
258
263
|
}
|
|
259
264
|
|
|
265
|
+
.date-picker__day.is-today.is-in-range .date-picker__day-indicator {
|
|
266
|
+
border-color: var(--_date-picker-day-is-today-is-in-range-border-color);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.date-picker__day.is-today.is-selected .date-picker__day-indicator {
|
|
270
|
+
border-color: var(--_date-picker-day-is-today-is-selected-border-color);
|
|
271
|
+
}
|
|
272
|
+
|
|
260
273
|
/* Touch reports a hover after a tap and keeps it until you touch something
|
|
261
274
|
else, so a day stays lit long after you picked it. Only pointers that can
|
|
262
275
|
really hover. */
|
|
@@ -264,6 +277,10 @@ export const datePickerStyles = css `
|
|
|
264
277
|
.date-picker__day:hover .date-picker__day-indicator {
|
|
265
278
|
background-color: var(--_date-picker-day-is-hovered-background-color);
|
|
266
279
|
}
|
|
280
|
+
|
|
281
|
+
.date-picker__day.is-in-range:hover .date-picker__day-indicator {
|
|
282
|
+
background-color: var(--_date-picker-day-is-in-range-is-hovered-background-color);
|
|
283
|
+
}
|
|
267
284
|
}
|
|
268
285
|
|
|
269
286
|
/* :focus, not :focus-visible. Arrow keys move focus programmatically, and the
|
|
@@ -298,13 +315,20 @@ export const datePickerStyles = css `
|
|
|
298
315
|
color: var(--_date-picker-day-is-selected-content-color);
|
|
299
316
|
}
|
|
300
317
|
|
|
301
|
-
|
|
302
|
-
outweigh the plain selected rule. */
|
|
303
|
-
.date-picker__day.is-selected .date-picker__day-indicator,
|
|
304
|
-
.date-picker__day.is-selected:hover .date-picker__day-indicator {
|
|
318
|
+
.date-picker__day.is-selected .date-picker__day-indicator {
|
|
305
319
|
background-color: var(--_date-picker-day-is-selected-background-color);
|
|
306
320
|
}
|
|
307
321
|
|
|
322
|
+
@media (hover: hover) {
|
|
323
|
+
.date-picker__day.is-selected:hover {
|
|
324
|
+
color: var(--_date-picker-day-is-selected-is-hovered-content-color);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.date-picker__day.is-selected:hover .date-picker__day-indicator {
|
|
328
|
+
background-color: var(--_date-picker-day-is-selected-is-hovered-background-color);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
308
332
|
.date-picker__day.is-unavailable {
|
|
309
333
|
color: var(--_date-picker-day-is-unavailable-content-color);
|
|
310
334
|
text-decoration: line-through;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker.styles.js","sourceRoot":"","sources":["../../../../src/components/inputs/date-picker/date-picker.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAE7E,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAA
|
|
1
|
+
{"version":3,"file":"date-picker.styles.js","sourceRoot":"","sources":["../../../../src/components/inputs/date-picker/date-picker.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAE7E,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA6C/B,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgVrB,CAAC"}
|