@nldd/design-system 0.11.0 → 0.13.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 +2726 -617
- package/dist/components/actions/button-group/button-group.d.ts +4 -3
- package/dist/components/actions/button-group/button-group.d.ts.map +1 -1
- package/dist/components/actions/button-group/button-group.js +4 -3
- package/dist/components/actions/button-group/button-group.js.map +1 -1
- package/dist/components/actions/button-group/button-group.styles.d.ts.map +1 -1
- package/dist/components/actions/button-group/button-group.styles.js +6 -6
- package/dist/components/actions/button-group/button-group.styles.js.map +1 -1
- package/dist/components/actions/menu/menu.d.ts.map +1 -1
- package/dist/components/actions/menu/menu.js +3 -0
- package/dist/components/actions/menu/menu.js.map +1 -1
- package/dist/components/components.js +21704 -19266
- package/dist/components/content/avatar/avatar.d.ts +2 -1
- package/dist/components/content/avatar/avatar.d.ts.map +1 -1
- package/dist/components/content/avatar/avatar.js +12 -1
- package/dist/components/content/avatar/avatar.js.map +1 -1
- package/dist/components/content/avatar-group/avatar-group.d.ts +30 -2
- package/dist/components/content/avatar-group/avatar-group.d.ts.map +1 -1
- package/dist/components/content/avatar-group/avatar-group.i18n.d.ts +1 -0
- package/dist/components/content/avatar-group/avatar-group.i18n.d.ts.map +1 -1
- package/dist/components/content/avatar-group/avatar-group.i18n.js +1 -0
- package/dist/components/content/avatar-group/avatar-group.i18n.js.map +1 -1
- package/dist/components/content/avatar-group/avatar-group.js +96 -7
- package/dist/components/content/avatar-group/avatar-group.js.map +1 -1
- package/dist/components/content/avatar-group/avatar-group.styles.d.ts.map +1 -1
- package/dist/components/content/avatar-group/avatar-group.styles.js +35 -1
- package/dist/components/content/avatar-group/avatar-group.styles.js.map +1 -1
- package/dist/components/content/avatar-group/avatar-group.template.d.ts +1 -0
- package/dist/components/content/avatar-group/avatar-group.template.d.ts.map +1 -1
- package/dist/components/content/avatar-group/avatar-group.template.js +52 -29
- package/dist/components/content/avatar-group/avatar-group.template.js.map +1 -1
- 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 +180 -14
- 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 +32 -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 +19 -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 +19 -4
- package/dist/components/content/icon/icon-registry.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.map +1 -1
- package/dist/components/content/tooltip/tooltip.js +2 -0
- package/dist/components/content/tooltip/tooltip.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-zNX9A6d3.js → icon-BJHKWhY5.js} +39 -8
- package/dist/components/{icon-button-Cntrg4_E.js → icon-button-DhBIq6lN.js} +75 -2
- 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 +43 -6
- package/dist/components/inputs/code-editor/code-editor.styles.js.map +1 -1
- package/dist/components/inputs/date-picker/date-picker.d.ts +2 -2
- package/dist/components/inputs/date-picker/date-picker.i18n.d.ts +1 -1
- package/dist/components/inputs/date-picker/date-picker.i18n.js +1 -1
- package/dist/components/inputs/date-picker/date-picker.i18n.js.map +1 -1
- package/dist/components/inputs/date-picker/date-picker.template.js +1 -1
- package/dist/components/inputs/date-picker/date-picker.template.js.map +1 -1
- package/dist/components/inputs/file-field/file-field.d.ts +86 -10
- package/dist/components/inputs/file-field/file-field.d.ts.map +1 -1
- package/dist/components/inputs/file-field/file-field.drop.d.ts +34 -0
- package/dist/components/inputs/file-field/file-field.drop.d.ts.map +1 -0
- package/dist/components/inputs/file-field/file-field.drop.js +176 -0
- package/dist/components/inputs/file-field/file-field.drop.js.map +1 -0
- package/dist/components/inputs/file-field/file-field.i18n.d.ts +20 -1
- package/dist/components/inputs/file-field/file-field.i18n.d.ts.map +1 -1
- package/dist/components/inputs/file-field/file-field.i18n.js +20 -1
- package/dist/components/inputs/file-field/file-field.i18n.js.map +1 -1
- package/dist/components/inputs/file-field/file-field.js +283 -15
- package/dist/components/inputs/file-field/file-field.js.map +1 -1
- package/dist/components/inputs/file-field/file-field.styles.d.ts.map +1 -1
- package/dist/components/inputs/file-field/file-field.styles.js +245 -10
- package/dist/components/inputs/file-field/file-field.styles.js.map +1 -1
- package/dist/components/inputs/file-field/file-field.template.d.ts +1 -0
- package/dist/components/inputs/file-field/file-field.template.d.ts.map +1 -1
- package/dist/components/inputs/file-field/file-field.template.js +167 -28
- package/dist/components/inputs/file-field/file-field.template.js.map +1 -1
- package/dist/components/inputs/file-field/file-field.truncate.d.ts +22 -0
- package/dist/components/inputs/file-field/file-field.truncate.d.ts.map +1 -0
- package/dist/components/inputs/file-field/file-field.truncate.js +62 -0
- package/dist/components/inputs/file-field/file-field.truncate.js.map +1 -0
- 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.code-copy.d.ts +10 -0
- package/dist/components/inputs/text-editor/text-editor.code-copy.d.ts.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.code-copy.js +141 -0
- package/dist/components/inputs/text-editor/text-editor.code-copy.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 +305 -0
- package/dist/components/inputs/text-editor/text-editor.hidden-syntax.js.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.i18n.d.ts +5 -0
- package/dist/components/inputs/text-editor/text-editor.i18n.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.i18n.js +7 -0
- package/dist/components/inputs/text-editor/text-editor.i18n.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.js +126 -315
- 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 +32 -188
- 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 +72 -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 +301 -60
- 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/text-editor/text-editor.tasks.d.ts +17 -0
- package/dist/components/inputs/text-editor/text-editor.tasks.d.ts.map +1 -0
- package/dist/components/inputs/text-editor/text-editor.tasks.js +109 -0
- package/dist/components/inputs/text-editor/text-editor.tasks.js.map +1 -0
- package/dist/components/layout/page-sections/hero/hero-corner.styles.d.ts.map +1 -1
- package/dist/components/layout/page-sections/hero/hero-corner.styles.js +61 -0
- package/dist/components/layout/page-sections/hero/hero-corner.styles.js.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.d.ts +1 -1
- package/dist/components/layout/page-sections/hero/hero.js +1 -1
- package/dist/components/layout/popover/popover.d.ts +6 -0
- package/dist/components/layout/popover/popover.d.ts.map +1 -1
- package/dist/components/layout/popover/popover.js +16 -0
- package/dist/components/layout/popover/popover.js.map +1 -1
- package/dist/components/layout/popover/popover.styles.d.ts.map +1 -1
- package/dist/components/layout/popover/popover.styles.js +13 -0
- package/dist/components/layout/popover/popover.styles.js.map +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.d.ts.map +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.js +5 -0
- package/dist/components/navigation/document-tab-bar/document-tab-bar.js.map +1 -1
- package/dist/components/navigation/menu-bar/menu-bar.d.ts.map +1 -1
- package/dist/components/navigation/menu-bar/menu-bar.js +2 -0
- package/dist/components/navigation/menu-bar/menu-bar.js.map +1 -1
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.d.ts.map +1 -1
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.js +3 -0
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.js.map +1 -1
- package/dist/components/status-and-feedback/banner/banner.d.ts +1 -1
- package/dist/components/status-and-feedback/banner/banner.js +2 -2
- package/dist/components/status-and-feedback/banner/banner.js.map +1 -1
- package/dist/components/status-and-feedback/notification/notification.d.ts +3 -2
- package/dist/components/status-and-feedback/notification/notification.d.ts.map +1 -1
- package/dist/components/status-and-feedback/notification/notification.js +9 -4
- 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 +18 -0
- 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.i18n.d.ts +1 -1
- package/dist/components/status-and-feedback/progress-bar/progress-bar.i18n.js +1 -1
- package/dist/components/status-and-feedback/progress-bar/progress-bar.i18n.js.map +1 -1
- package/dist/components/status-and-feedback/progress-bar/progress-bar.js +1 -1
- package/dist/components/status-and-feedback/progress-bar/progress-bar.js.map +1 -1
- package/dist/components/status-and-feedback/progress-circle/progress-circle.i18n.d.ts +1 -1
- package/dist/components/status-and-feedback/progress-circle/progress-circle.i18n.js +1 -1
- package/dist/components/status-and-feedback/progress-circle/progress-circle.i18n.js.map +1 -1
- package/dist/components/status-and-feedback/progress-circle/progress-circle.js +1 -1
- package/dist/components/status-and-feedback/progress-circle/progress-circle.js.map +1 -1
- package/dist/css/rich-text.css +61 -1
- package/dist/css/themes/donkergeel.css +12 -3
- package/dist/css/themes/geel.css +12 -3
- package/dist/css/themes.css +24 -6
- package/dist/css/variables.css +16 -10
- package/dist/nldd.min.js +2217 -1329
- package/dist/translations/en-US.d.ts.map +1 -1
- package/dist/translations/en-US.js +34 -4
- package/dist/translations/en-US.js.map +1 -1
- package/dist/translations/fy.d.ts.map +1 -1
- package/dist/translations/fy.js +29 -4
- package/dist/translations/fy.js.map +1 -1
- package/dist/translations/nl.generated.d.ts +34 -4
- package/dist/translations/nl.generated.d.ts.map +1 -1
- package/dist/translations/pap-AW.d.ts.map +1 -1
- package/dist/translations/pap-AW.js +29 -4
- package/dist/translations/pap-AW.js.map +1 -1
- package/dist/translations/pap-CW.d.ts.map +1 -1
- package/dist/translations/pap-CW.js +29 -4
- package/dist/translations/pap-CW.js.map +1 -1
- package/dist/types/vue.d.ts +43 -39
- package/dist/utilities/carried-context.d.ts +20 -0
- package/dist/utilities/carried-context.d.ts.map +1 -0
- package/dist/utilities/carried-context.js +76 -0
- package/dist/utilities/carried-context.js.map +1 -0
- 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/languages.d.ts +5 -1
- package/dist/utilities/codemirror/languages.d.ts.map +1 -1
- package/dist/utilities/codemirror/languages.js +21 -1
- package/dist/utilities/codemirror/languages.js.map +1 -1
- package/dist/utilities/dismiss-from-title-bar.d.ts +1 -1
- package/dist/utilities/dismiss-from-title-bar.js +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
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
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { LitElement } from 'lit';
|
|
8
|
+
import { property } from 'lit/decorators.js';
|
|
9
|
+
import { EditorView, placeholder as cmPlaceholder } from '@codemirror/view';
|
|
10
|
+
import { Compartment, EditorState } from '@codemirror/state';
|
|
11
|
+
import { FormAssociated } from '../form-associated-mixin.js';
|
|
12
|
+
import { reflectNonDefault } from '../reflect-non-default.js';
|
|
13
|
+
import { DescribedBy } from '../described-by-mixin.js';
|
|
14
|
+
import { NLDDCodeMirrorElement } from './codemirror-element.js';
|
|
15
|
+
/**
|
|
16
|
+
* Shared base for the CodeMirror editors that are form controls
|
|
17
|
+
* (nldd-code-editor, nldd-text-editor). nldd-code-viewer is not one, so this
|
|
18
|
+
* sits between NLDDCodeMirrorElement and the two editors.
|
|
19
|
+
*
|
|
20
|
+
* It owns what a form control needs and both editors did the same way: the
|
|
21
|
+
* value and its `input`/`change` events, editable and read-only, the
|
|
22
|
+
* placeholder, the textbox attributes (label, id, aria-readonly,
|
|
23
|
+
* aria-required), form association and reset, a press on the padding that
|
|
24
|
+
* starts editing, and the warning for a missing label. A subclass adds its own
|
|
25
|
+
* extensions after `inputExtensions()` and can shape three things:
|
|
26
|
+
* `docToValue()`, `contentAttributes()` and `beforeChangeCheck()`.
|
|
27
|
+
*/
|
|
28
|
+
export class NLDDCodeMirrorInput extends DescribedBy(FormAssociated(NLDDCodeMirrorElement)) {
|
|
29
|
+
constructor() {
|
|
30
|
+
super(...arguments);
|
|
31
|
+
this.value = '';
|
|
32
|
+
this.inputId = '';
|
|
33
|
+
this.placeholder = '';
|
|
34
|
+
this.disabled = false;
|
|
35
|
+
this.name = '';
|
|
36
|
+
this.readonly = false;
|
|
37
|
+
this.required = false;
|
|
38
|
+
this.rows = 6;
|
|
39
|
+
this.accessibleLabel = '';
|
|
40
|
+
/**
|
|
41
|
+
* Marks the control as invalid.
|
|
42
|
+
*
|
|
43
|
+
* Announced and not drawn. What is wrong belongs in an
|
|
44
|
+
* nldd-validation-list, in words: a red ring around a single
|
|
45
|
+
* checkbox or radio would say the option is wrong, while it is the question
|
|
46
|
+
* that is unanswered. `aria-invalid` still goes on the control, because
|
|
47
|
+
* choosing not to show something is not a reason to keep quiet about it.
|
|
48
|
+
*/
|
|
49
|
+
this.invalid = false;
|
|
50
|
+
this._initialValue = '';
|
|
51
|
+
this._valueAtFocus = '';
|
|
52
|
+
this._accessibleLabelWarned = false;
|
|
53
|
+
this._editableCompartment = new Compartment();
|
|
54
|
+
this._placeholderCompartment = new Compartment();
|
|
55
|
+
this._attrsCompartment = new Compartment();
|
|
56
|
+
this._onScrollerPointerDown = (event) => {
|
|
57
|
+
// Only the scroller's own padding, not the content or a gutter inside it.
|
|
58
|
+
if (event.target !== this.view?.scrollDOM)
|
|
59
|
+
return;
|
|
60
|
+
this.focusFromPoint(event.clientX, event.clientY);
|
|
61
|
+
event.preventDefault();
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/** The value for a document. Default: the document itself. */
|
|
65
|
+
docToValue(doc) {
|
|
66
|
+
return doc;
|
|
67
|
+
}
|
|
68
|
+
/** Attributes of the content element beyond label, id, aria-readonly and
|
|
69
|
+
* aria-required. Default: none. */
|
|
70
|
+
contentAttributes() {
|
|
71
|
+
return {};
|
|
72
|
+
}
|
|
73
|
+
/** Runs on blur, before the value is compared with the one at focus, so a
|
|
74
|
+
* subclass can settle the document first. Default: nothing. */
|
|
75
|
+
beforeChangeCheck(_view) { }
|
|
76
|
+
/** The extensions every input needs. A subclass puts these in its own
|
|
77
|
+
* `buildExtensions()`, next to what is its own. */
|
|
78
|
+
inputExtensions() {
|
|
79
|
+
return [
|
|
80
|
+
this._placeholderCompartment.of(this._placeholderExtension()),
|
|
81
|
+
this._editableCompartment.of(this._editableExtension()),
|
|
82
|
+
this._attrsCompartment.of(this._attrsExtension()),
|
|
83
|
+
EditorView.updateListener.of((u) => {
|
|
84
|
+
if (u.docChanged)
|
|
85
|
+
this._onDocChanged();
|
|
86
|
+
}),
|
|
87
|
+
EditorView.domEventHandlers({
|
|
88
|
+
focus: () => {
|
|
89
|
+
this._valueAtFocus = this.value;
|
|
90
|
+
},
|
|
91
|
+
blur: (_event, view) => {
|
|
92
|
+
this.beforeChangeCheck(view);
|
|
93
|
+
if (this.value !== this._valueAtFocus)
|
|
94
|
+
this._emitChange();
|
|
95
|
+
},
|
|
96
|
+
}),
|
|
97
|
+
];
|
|
98
|
+
}
|
|
99
|
+
_editableExtension() {
|
|
100
|
+
// Readonly stays focusable and selectable (read and copy); disabled is inert.
|
|
101
|
+
return [EditorView.editable.of(!this.disabled), EditorState.readOnly.of(this.disabled || this.readonly)];
|
|
102
|
+
}
|
|
103
|
+
_placeholderExtension() {
|
|
104
|
+
return this.placeholder ? cmPlaceholder(this.placeholder) : [];
|
|
105
|
+
}
|
|
106
|
+
_attrsExtension() {
|
|
107
|
+
const attrs = { ...this.contentAttributes() };
|
|
108
|
+
if (this.accessibleLabel)
|
|
109
|
+
attrs['aria-label'] = this.accessibleLabel;
|
|
110
|
+
if (this.inputId)
|
|
111
|
+
attrs['id'] = this.inputId;
|
|
112
|
+
// Not editable either way, so it is read-only to assistive tech (WCAG 4.1.2).
|
|
113
|
+
if (this.readonly || this.disabled)
|
|
114
|
+
attrs['aria-readonly'] = 'true';
|
|
115
|
+
if (this.required)
|
|
116
|
+
attrs['aria-required'] = 'true';
|
|
117
|
+
return EditorView.contentAttributes.of(attrs);
|
|
118
|
+
}
|
|
119
|
+
/** Build the textbox attributes again, after something `contentAttributes()`
|
|
120
|
+
* reads has changed. */
|
|
121
|
+
refreshContentAttributes() {
|
|
122
|
+
this.reconfigure(this._attrsCompartment, this._attrsExtension());
|
|
123
|
+
}
|
|
124
|
+
firstUpdated() {
|
|
125
|
+
this._initialValue = this.value;
|
|
126
|
+
this.style.setProperty(this.rowsProperty, String(this.rows));
|
|
127
|
+
this.mountEditor(this.docToValue(this.value));
|
|
128
|
+
this.onEditorMounted();
|
|
129
|
+
}
|
|
130
|
+
/* Runs on the initial mount and on every re-mount after a detach/reattach
|
|
131
|
+
* (e.g. Vue <KeepAlive>): the view and its scroller are rebuilt, so the
|
|
132
|
+
* padding forwarder goes on again. A subclass calls super first. */
|
|
133
|
+
onEditorMounted() {
|
|
134
|
+
// A press on the scroller's own padding (outside .cm-content) doesn't place
|
|
135
|
+
// a caret; forward it to the nearest line so the padding is clickable too.
|
|
136
|
+
this.view?.scrollDOM.addEventListener('pointerdown', this._onScrollerPointerDown);
|
|
137
|
+
this.commitFormValue();
|
|
138
|
+
this._checkAccessibleLabel();
|
|
139
|
+
}
|
|
140
|
+
updated(changed) {
|
|
141
|
+
if (changed.has('rows')) {
|
|
142
|
+
this.style.setProperty(this.rowsProperty, String(this.rows));
|
|
143
|
+
}
|
|
144
|
+
if (this.view) {
|
|
145
|
+
if (changed.has('value')) {
|
|
146
|
+
// Only an outside change goes into the document: the echo of the user's
|
|
147
|
+
// own typing already matches it. Such a change while focused must not look
|
|
148
|
+
// like an edit on the next blur, so the baseline moves along.
|
|
149
|
+
if (this.docToValue(this.doc) !== this.value) {
|
|
150
|
+
this.setDoc(this.docToValue(this.value));
|
|
151
|
+
this._valueAtFocus = this.value;
|
|
152
|
+
}
|
|
153
|
+
this.commitFormValue();
|
|
154
|
+
}
|
|
155
|
+
if (changed.has('disabled') || changed.has('readonly')) {
|
|
156
|
+
this.reconfigure(this._editableCompartment, this._editableExtension());
|
|
157
|
+
}
|
|
158
|
+
if (changed.has('placeholder')) {
|
|
159
|
+
this.reconfigure(this._placeholderCompartment, this._placeholderExtension());
|
|
160
|
+
}
|
|
161
|
+
if (['accessibleLabel', 'inputId', 'disabled', 'readonly', 'required'].some((name) => changed.has(name))) {
|
|
162
|
+
this.refreshContentAttributes();
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
this._checkAccessibleLabel();
|
|
166
|
+
}
|
|
167
|
+
_onDocChanged() {
|
|
168
|
+
const text = this.docToValue(this.doc);
|
|
169
|
+
if (text === this.value)
|
|
170
|
+
return;
|
|
171
|
+
this.value = text;
|
|
172
|
+
this.commitFormValue();
|
|
173
|
+
this.dispatchEvent(new CustomEvent('input', {
|
|
174
|
+
detail: { value: text },
|
|
175
|
+
bubbles: true,
|
|
176
|
+
composed: true,
|
|
177
|
+
}));
|
|
178
|
+
}
|
|
179
|
+
_emitChange() {
|
|
180
|
+
this.commitFormValue();
|
|
181
|
+
this.dispatchEvent(new CustomEvent('change', {
|
|
182
|
+
detail: { value: this.value },
|
|
183
|
+
bubbles: true,
|
|
184
|
+
composed: true,
|
|
185
|
+
}));
|
|
186
|
+
}
|
|
187
|
+
/* From updated(), not firstUpdated(): a parent nldd-form-field sets input-id
|
|
188
|
+
* slightly after the first render, so an earlier check would warn for the
|
|
189
|
+
* standard form-field usage. It warns once if the label is still missing. */
|
|
190
|
+
_checkAccessibleLabel() {
|
|
191
|
+
if (this._accessibleLabelWarned)
|
|
192
|
+
return;
|
|
193
|
+
if (this.accessibleLabel || this.inputId)
|
|
194
|
+
return;
|
|
195
|
+
this._accessibleLabelWarned = true;
|
|
196
|
+
console.warn(`<${this.localName}>: 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).`);
|
|
197
|
+
}
|
|
198
|
+
formValue() {
|
|
199
|
+
return this.value;
|
|
200
|
+
}
|
|
201
|
+
formResetCallback() {
|
|
202
|
+
this.value = this._initialValue;
|
|
203
|
+
}
|
|
204
|
+
formStateRestoreCallback(state) {
|
|
205
|
+
if (typeof state === 'string')
|
|
206
|
+
this.value = state;
|
|
207
|
+
}
|
|
208
|
+
/** CodeMirror builds the textbox; the host is only its container. */
|
|
209
|
+
describedTarget() {
|
|
210
|
+
return this.shadowRoot?.querySelector('.cm-content') ?? null;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
NLDDCodeMirrorInput.shadowRootOptions = {
|
|
214
|
+
...LitElement.shadowRootOptions,
|
|
215
|
+
delegatesFocus: true,
|
|
216
|
+
};
|
|
217
|
+
/** Says this is the control an nldd-form-field is about, so the field can
|
|
218
|
+
* find it, name it and move focus into it. See nldd-form-field. */
|
|
219
|
+
NLDDCodeMirrorInput.isFormInput = true;
|
|
220
|
+
__decorate([
|
|
221
|
+
property({ type: String })
|
|
222
|
+
], NLDDCodeMirrorInput.prototype, "value", void 0);
|
|
223
|
+
__decorate([
|
|
224
|
+
property({ type: String, attribute: 'input-id' })
|
|
225
|
+
], NLDDCodeMirrorInput.prototype, "inputId", void 0);
|
|
226
|
+
__decorate([
|
|
227
|
+
property({ reflect: true, converter: reflectNonDefault('') })
|
|
228
|
+
], NLDDCodeMirrorInput.prototype, "placeholder", void 0);
|
|
229
|
+
__decorate([
|
|
230
|
+
property({ type: Boolean, reflect: true })
|
|
231
|
+
], NLDDCodeMirrorInput.prototype, "disabled", void 0);
|
|
232
|
+
__decorate([
|
|
233
|
+
property({ reflect: true, converter: reflectNonDefault('') })
|
|
234
|
+
], NLDDCodeMirrorInput.prototype, "name", void 0);
|
|
235
|
+
__decorate([
|
|
236
|
+
property({ type: Boolean, reflect: true })
|
|
237
|
+
], NLDDCodeMirrorInput.prototype, "readonly", void 0);
|
|
238
|
+
__decorate([
|
|
239
|
+
property({ type: Boolean, reflect: true })
|
|
240
|
+
], NLDDCodeMirrorInput.prototype, "required", void 0);
|
|
241
|
+
__decorate([
|
|
242
|
+
property({ type: Number })
|
|
243
|
+
], NLDDCodeMirrorInput.prototype, "rows", void 0);
|
|
244
|
+
__decorate([
|
|
245
|
+
property({ type: String, attribute: 'accessible-label' })
|
|
246
|
+
], NLDDCodeMirrorInput.prototype, "accessibleLabel", void 0);
|
|
247
|
+
__decorate([
|
|
248
|
+
property({ type: Boolean, reflect: true })
|
|
249
|
+
], NLDDCodeMirrorInput.prototype, "invalid", void 0);
|
|
250
|
+
//# sourceMappingURL=codemirror-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codemirror-input.js","sourceRoot":"","sources":["../../../src/utilities/codemirror/codemirror-input.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAA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AC;qDAC1B;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;qDAC1B;AAGjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDAClB;AAGT;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC;4DACrC;AAYrB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;oDAC3B"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import { LanguageSupport } from '@codemirror/language';
|
|
1
|
+
import { LanguageDescription, LanguageSupport } from '@codemirror/language';
|
|
2
2
|
export declare function isLanguageSupported(name: string): boolean;
|
|
3
3
|
export declare function loadLanguage(name: string): Promise<LanguageSupport> | undefined;
|
|
4
|
+
/** The supported languages as CodeMirror language descriptions, for a parser
|
|
5
|
+
* that highlights code nested in another language (a code block in markdown).
|
|
6
|
+
* Each one loads its grammar only when a block names it. */
|
|
7
|
+
export declare const nestedLanguages: LanguageDescription[];
|
|
4
8
|
//# sourceMappingURL=languages.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"languages.d.ts","sourceRoot":"","sources":["../../../src/utilities/codemirror/languages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAkB,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"languages.d.ts","sourceRoot":"","sources":["../../../src/utilities/codemirror/languages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAkB,MAAM,sBAAsB,CAAC;AA4B5F,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,GAAG,SAAS,CAc/E;AAeD;;6DAE6D;AAC7D,eAAO,MAAM,eAAe,EAAE,mBAAmB,EAI9C,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LanguageSupport, StreamLanguage } from '@codemirror/language';
|
|
1
|
+
import { LanguageDescription, LanguageSupport, StreamLanguage } from '@codemirror/language';
|
|
2
2
|
const loaders = {
|
|
3
3
|
json: async () => (await import('@codemirror/lang-json')).json(),
|
|
4
4
|
yaml: async () => (await import('@codemirror/lang-yaml')).yaml(),
|
|
@@ -36,4 +36,24 @@ export function loadLanguage(name) {
|
|
|
36
36
|
}
|
|
37
37
|
return pending;
|
|
38
38
|
}
|
|
39
|
+
/** Other names a code block may give for a supported language, as people write
|
|
40
|
+
* them after the backticks. */
|
|
41
|
+
const ALIASES = {
|
|
42
|
+
javascript: ['js', 'jsx', 'mjs', 'cjs'],
|
|
43
|
+
typescript: ['ts', 'tsx'],
|
|
44
|
+
python: ['py'],
|
|
45
|
+
bash: ['sh', 'shell', 'zsh', 'console'],
|
|
46
|
+
yaml: ['yml'],
|
|
47
|
+
markdown: ['md'],
|
|
48
|
+
html: ['htm'],
|
|
49
|
+
rust: ['rs'],
|
|
50
|
+
};
|
|
51
|
+
/** The supported languages as CodeMirror language descriptions, for a parser
|
|
52
|
+
* that highlights code nested in another language (a code block in markdown).
|
|
53
|
+
* Each one loads its grammar only when a block names it. */
|
|
54
|
+
export const nestedLanguages = Object.keys(loaders).map((name) => LanguageDescription.of({
|
|
55
|
+
name,
|
|
56
|
+
alias: ALIASES[name] ?? [],
|
|
57
|
+
load: () => loadLanguage(name),
|
|
58
|
+
}));
|
|
39
59
|
//# sourceMappingURL=languages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"languages.js","sourceRoot":"","sources":["../../../src/utilities/codemirror/languages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"languages.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AAC,CAAC;QACH,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC1B,CAAC;IACD,OAAO,OAAO,CAAC;AAChB,CAAC;AAED;gCACgC;AAChC,MAAM,OAAO,GAA6B;IACzC,UAAU,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;IACvC,UAAU,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC;IACzB,MAAM,EAAE,CAAC,IAAI,CAAC;IACd,IAAI,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,CAAC;IACvC,IAAI,EAAE,CAAC,KAAK,CAAC;IACb,QAAQ,EAAE,CAAC,IAAI,CAAC;IAChB,IAAI,EAAE,CAAC,KAAK,CAAC;IACb,IAAI,EAAE,CAAC,IAAI,CAAC;CACZ,CAAC;AAEF;;6DAE6D;AAC7D,MAAM,CAAC,MAAM,eAAe,GAA0B,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,mBAAmB,CAAC,EAAE,CAAC;IAC/G,IAAI;IACJ,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE;IAC1B,IAAI,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAE;CAC/B,CAAC,CAAC,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* True when a bubbling `dismiss` event originates from an `nldd-top-title-bar`'s
|
|
3
3
|
* close button.
|
|
4
4
|
*
|
|
5
|
-
* Overlay containers (`nldd-sheet`, `nldd-window`) listen for bubbling `dismiss`
|
|
5
|
+
* Overlay containers (`nldd-sheet`, `nldd-window`, `nldd-popover`) listen for bubbling `dismiss`
|
|
6
6
|
* events to close themselves. But nested components fire their own `dismiss` for
|
|
7
7
|
* their own element — an `nldd-token`'s remove button, an `nldd-banner`, an
|
|
8
8
|
* `nldd-document-tab-bar` — and those must NOT close the container. Only the
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* True when a bubbling `dismiss` event originates from an `nldd-top-title-bar`'s
|
|
3
3
|
* close button.
|
|
4
4
|
*
|
|
5
|
-
* Overlay containers (`nldd-sheet`, `nldd-window`) listen for bubbling `dismiss`
|
|
5
|
+
* Overlay containers (`nldd-sheet`, `nldd-window`, `nldd-popover`) listen for bubbling `dismiss`
|
|
6
6
|
* events to close themselves. But nested components fire their own `dismiss` for
|
|
7
7
|
* their own element — an `nldd-token`'s remove button, an `nldd-banner`, an
|
|
8
8
|
* `nldd-document-tab-bar` — and those must NOT close the container. Only the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nldd/design-system",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "Designsysteem voor de Nederlandse Digitale Dienst",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/components/components.js",
|
|
@@ -620,6 +620,7 @@
|
|
|
620
620
|
"@codemirror/lang-yaml": "^6.1.3",
|
|
621
621
|
"@codemirror/language": "^6.12.4",
|
|
622
622
|
"@codemirror/legacy-modes": "^6.5.3",
|
|
623
|
+
"@codemirror/merge": "^6.12.2",
|
|
623
624
|
"@codemirror/state": "^6.7.0",
|
|
624
625
|
"@codemirror/view": "^6.43.4",
|
|
625
626
|
"@floating-ui/dom": "^1.7.6",
|