@vonage/vivid 5.16.0 → 5.17.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/accordion/index.cjs +1 -1
- package/accordion/index.js +1 -1
- package/accordion-item/index.cjs +1 -1
- package/accordion-item/index.js +1 -1
- package/action-group/index.cjs +3 -3
- package/action-group/index.js +5 -5
- package/alert/index.cjs +3 -3
- package/alert/index.js +17 -17
- package/audio-player/index.cjs +16 -16
- package/audio-player/index.js +27 -27
- package/avatar/index.cjs +2 -2
- package/avatar/index.js +6 -6
- package/badge/index.cjs +2 -2
- package/badge/index.js +6 -6
- package/banner/index.cjs +3 -3
- package/banner/index.js +15 -15
- package/bundled/base-color-picker.cjs +2 -2
- package/bundled/base-color-picker.js +5 -5
- package/bundled/button.cjs +1 -1
- package/bundled/button.js +2 -2
- package/bundled/calendar-picker.template.cjs +2 -2
- package/bundled/calendar-picker.template.js +498 -498
- package/bundled/definition10.cjs +18 -30
- package/bundled/definition10.js +53 -155
- package/bundled/definition11.cjs +10 -19
- package/bundled/definition11.js +25 -74
- package/bundled/definition12.cjs +72 -18
- package/bundled/definition12.js +171 -107
- package/bundled/definition13.cjs +18 -17
- package/bundled/definition13.js +45 -65
- package/bundled/definition14.cjs +5 -10
- package/bundled/definition14.js +9 -27
- package/bundled/definition15.cjs +17 -71
- package/bundled/definition15.js +64 -181
- package/bundled/definition16.cjs +12 -4
- package/bundled/definition16.js +79 -14
- package/bundled/definition17.cjs +19 -13
- package/bundled/definition17.js +119 -70
- package/bundled/definition18.cjs +87 -12
- package/bundled/definition18.js +409 -52
- package/bundled/definition19.cjs +5 -87
- package/bundled/definition19.js +14 -422
- package/bundled/definition2.cjs +3 -3
- package/bundled/definition2.js +27 -27
- package/bundled/definition20.cjs +30 -5
- package/bundled/definition20.js +159 -9
- package/bundled/definition21.cjs +28 -19
- package/bundled/definition21.js +164 -47
- package/bundled/definition22.cjs +38 -23
- package/bundled/definition22.js +64 -82
- package/bundled/definition3.cjs +1 -1
- package/bundled/definition3.js +15 -15
- package/bundled/definition4.cjs +23 -38
- package/bundled/definition4.js +82 -64
- package/bundled/definition5.cjs +2 -2
- package/bundled/definition5.js +5 -5
- package/bundled/definition6.cjs +2 -2
- package/bundled/definition6.js +24 -24
- package/bundled/definition9.cjs +12 -30
- package/bundled/definition9.js +55 -148
- package/bundled/divider.cjs +1 -1
- package/bundled/divider.js +5 -5
- package/bundled/listbox.cjs +1 -1
- package/bundled/listbox.js +1 -1
- package/bundled/mixins.cjs +4 -4
- package/bundled/mixins.js +43 -43
- package/bundled/picker-field.template.cjs +7 -7
- package/bundled/picker-field.template.js +14 -14
- package/bundled/slider.template.cjs +7 -7
- package/bundled/slider.template.js +12 -12
- package/bundled/slottable-request.cjs +1 -1
- package/bundled/slottable-request.js +8 -38
- package/bundled/time-selection-picker.template.cjs +4 -4
- package/bundled/time-selection-picker.template.js +35 -35
- package/bundled/vivid-element.cjs +1 -1
- package/bundled/vivid-element.js +1 -1
- package/calendar/index.cjs +11 -11
- package/calendar/index.js +30 -237
- package/calendar-event/index.cjs +3 -3
- package/calendar-event/index.js +4 -4
- package/card/index.cjs +14 -11
- package/card/index.js +16 -13
- package/checkbox/index.cjs +1 -1
- package/checkbox/index.js +1 -1
- package/color-picker/definition.cjs +1 -1
- package/color-picker/definition.js +1 -1
- package/color-picker/index.cjs +6 -6
- package/color-picker/index.js +24 -24
- package/combobox/definition.cjs +1 -1
- package/combobox/definition.js +1 -1
- package/combobox/index.cjs +9 -8
- package/combobox/index.js +32 -28
- package/contextual-help/definition.cjs +1 -1
- package/contextual-help/definition.js +1 -1
- package/contextual-help/index.cjs +1 -1
- package/contextual-help/index.js +1 -1
- package/custom-elements.json +1027 -615
- package/data-grid/definition.js +1 -1
- package/data-grid/index.cjs +17 -17
- package/data-grid/index.js +261 -264
- package/date-picker/index.cjs +1 -1
- package/date-picker/index.js +12 -12
- package/date-range-picker/index.cjs +1 -1
- package/date-range-picker/index.js +7 -7
- package/date-time-picker/index.cjs +4 -4
- package/date-time-picker/index.js +24 -24
- package/dial-pad/index.cjs +3 -2
- package/dial-pad/index.js +6 -5
- package/dialog/index.cjs +4 -4
- package/dialog/index.js +5 -5
- package/divider/index.cjs +1 -1
- package/divider/index.js +1 -1
- package/fab/index.cjs +3 -3
- package/fab/index.js +8 -8
- package/file-picker/index.cjs +16 -13
- package/file-picker/index.js +31 -28
- package/header/index.cjs +4 -4
- package/header/index.js +5 -5
- package/index.cjs +24 -21
- package/index.js +11 -11
- package/lib/combobox/combobox.d.ts +0 -3
- package/lib/date-time-picker/date-time-picker.d.ts +0 -4
- package/lib/dial-pad/dial-pad.d.ts +6 -2
- package/lib/dialog/dialog.d.ts +0 -1
- package/lib/menu/menu.d.ts +0 -1
- package/lib/option/option.d.ts +0 -1
- package/lib/rich-text-editor/rte/exports.d.ts +1 -0
- package/lib/rich-text-editor/rte/features/alignment.d.ts +1 -1
- package/lib/rich-text-editor/rte/features/character-count.d.ts +21 -0
- package/lib/rich-text-editor/rte/features/font-size-picker.d.ts +1 -1
- package/lib/rich-text-editor/rte/features/internal/basic-text-blocks.d.ts +1 -1
- package/lib/rich-text-editor/rte/features/keyboard-shortcuts.d.ts +1 -1
- package/lib/rich-text-editor/rte/features/text-color-picker.d.ts +1 -1
- package/lib/rich-text-editor/rte/public-interface.d.ts +6 -0
- package/lib/searchable-select/option-tag.d.ts +0 -1
- package/lib/table/definition.d.ts +2 -1
- package/lib/table/table-header-cell.d.ts +3 -0
- package/lib/table/table-sorting-button.d.ts +415 -0
- package/lib/table/table-sorting-button.template.d.ts +3 -0
- package/locales/de-DE.cjs +4 -178
- package/locales/de-DE.js +2 -179
- package/locales/en-GB.cjs +4 -9
- package/locales/en-GB.js +2 -10
- package/locales/en-US.cjs +268 -2
- package/locales/en-US.js +265 -1
- package/locales/ja-JP.cjs +4 -171
- package/locales/ja-JP.js +2 -172
- package/locales/zh-CN.cjs +4 -172
- package/locales/zh-CN.js +2 -173
- package/menu/index.cjs +1 -1
- package/menu/index.js +1 -1
- package/menu-item/index.cjs +1 -1
- package/menu-item/index.js +1 -1
- package/nav-disclosure/index.cjs +3 -3
- package/nav-disclosure/index.js +8 -8
- package/nav-item/index.cjs +1 -1
- package/nav-item/index.js +7 -7
- package/note/index.cjs +2 -2
- package/note/index.js +6 -6
- package/number-field/index.cjs +4 -4
- package/number-field/index.js +31 -31
- package/option/definition.cjs +1 -1
- package/option/definition.js +1 -1
- package/option/index.cjs +1 -1
- package/option/index.js +1 -1
- package/package.json +7 -8
- package/pagination/index.cjs +3 -3
- package/pagination/index.js +15 -15
- package/popover/index.cjs +4 -4
- package/popover/index.js +5 -5
- package/progress/index.cjs +2 -2
- package/progress/index.js +5 -5
- package/radio/index.cjs +1 -1
- package/radio/index.js +1 -1
- package/radio-group/index.cjs +4 -4
- package/radio-group/index.js +10 -10
- package/range-slider/index.cjs +4 -4
- package/range-slider/index.js +17 -17
- package/rich-text-editor/definition.cjs +1 -0
- package/rich-text-editor/definition.js +2 -2
- package/rich-text-editor/index.cjs +13 -13
- package/rich-text-editor/index.js +1886 -1829
- package/rich-text-view/index.cjs +1 -1
- package/rich-text-view/index.js +8 -8
- package/searchable-select/index.cjs +12 -12
- package/searchable-select/index.js +25 -25
- package/select/index.cjs +1 -1
- package/select/index.js +1 -1
- package/selectable-box/index.cjs +7 -7
- package/selectable-box/index.js +11 -11
- package/shared/foundation/test-utilities/fixture.d.ts +1 -1
- package/shared/patterns/linkable.d.ts +1 -1
- package/simple-color-picker/index.cjs +3 -3
- package/simple-color-picker/index.js +10 -10
- package/split-button/index.cjs +5 -5
- package/split-button/index.js +10 -10
- package/status/index.cjs +2 -2
- package/status/index.js +12 -12
- package/switch/index.cjs +3 -3
- package/switch/index.js +5 -5
- package/tab/index.cjs +1 -1
- package/tab/index.js +1 -1
- package/tab-panel/index.cjs +1 -1
- package/tab-panel/index.js +1 -1
- package/table/definition.cjs +17 -14
- package/table/definition.js +3 -2
- package/table/index.cjs +19 -10
- package/table/index.js +69 -21
- package/tabs/index.cjs +2 -2
- package/tabs/index.js +4 -4
- package/tag/index.cjs +7 -7
- package/tag/index.js +9 -9
- package/tag-group/index.cjs +3 -3
- package/tag-group/index.js +5 -5
- package/text-area/index.cjs +2 -2
- package/text-area/index.js +12 -12
- package/text-field/definition.cjs +1 -1
- package/text-field/definition.js +1 -1
- package/text-field/index.cjs +1 -1
- package/text-field/index.js +1 -1
- package/time-picker/index.cjs +1 -1
- package/time-picker/index.js +1 -1
- package/toggletip/definition.cjs +1 -1
- package/toggletip/definition.js +1 -1
- package/toggletip/index.cjs +1 -1
- package/toggletip/index.js +1 -1
- package/tooltip/definition.cjs +1 -1
- package/tooltip/definition.js +1 -1
- package/tooltip/index.cjs +1 -1
- package/tooltip/index.js +1 -1
- package/tree-item/index.cjs +1 -1
- package/tree-item/index.js +1 -1
- package/tree-view/index.cjs +3 -3
- package/tree-view/index.js +17 -17
- package/unbundled/button.cjs +2 -2
- package/unbundled/button.js +2 -2
- package/unbundled/calendar-picker.template.cjs +4347 -9
- package/unbundled/calendar-picker.template.js +4345 -7
- package/unbundled/chunk.cjs +0 -22
- package/unbundled/definition13.cjs +1 -8
- package/unbundled/definition13.js +1 -8
- package/unbundled/definition14.cjs +2 -2
- package/unbundled/definition14.js +2 -2
- package/unbundled/definition2.cjs +1 -1
- package/unbundled/definition2.js +1 -1
- package/unbundled/definition21.cjs +1 -2
- package/unbundled/definition21.js +1 -2
- package/unbundled/definition22.cjs +7 -2
- package/unbundled/definition22.js +7 -2
- package/unbundled/definition24.cjs +98 -979
- package/unbundled/definition24.js +93 -974
- package/unbundled/definition25.cjs +37 -322
- package/unbundled/definition25.js +33 -318
- package/unbundled/definition26.cjs +317 -91
- package/unbundled/definition26.js +313 -87
- package/unbundled/definition27.cjs +94 -192
- package/unbundled/definition27.js +91 -183
- package/unbundled/definition28.cjs +387 -395
- package/unbundled/definition28.js +387 -395
- package/unbundled/definition29.cjs +189 -110
- package/unbundled/definition29.js +180 -107
- package/unbundled/definition30.cjs +520 -36
- package/unbundled/definition30.js +519 -35
- package/unbundled/definition32.cjs +477 -477
- package/unbundled/definition32.js +475 -475
- package/unbundled/definition33.cjs +87 -2
- package/unbundled/definition33.js +77 -4
- package/unbundled/definition35.cjs +2 -2
- package/unbundled/definition35.js +2 -2
- package/unbundled/definition36.cjs +1 -1
- package/unbundled/definition36.js +1 -1
- package/unbundled/definition37.cjs +6 -2
- package/unbundled/definition37.js +6 -2
- package/unbundled/definition38.cjs +7 -5
- package/unbundled/definition38.js +7 -5
- package/unbundled/definition39.cjs +1 -0
- package/unbundled/definition39.js +1 -0
- package/unbundled/definition42.cjs +22 -11
- package/unbundled/definition42.js +22 -11
- package/unbundled/definition49.cjs +3 -3
- package/unbundled/definition49.js +3 -3
- package/unbundled/definition56.cjs +437 -9506
- package/unbundled/definition56.js +340 -9415
- package/unbundled/definition57.cjs +5 -5
- package/unbundled/definition57.js +5 -5
- package/unbundled/definition58.cjs +4 -3
- package/unbundled/definition58.js +2 -1
- package/unbundled/definition59.cjs +4 -3
- package/unbundled/definition59.js +4 -3
- package/unbundled/definition62.cjs +2 -2
- package/unbundled/definition62.js +2 -2
- package/unbundled/definition64.cjs +1 -1
- package/unbundled/definition64.js +1 -1
- package/unbundled/definition71.cjs +2 -2
- package/unbundled/definition71.js +2 -2
- package/unbundled/definition72.cjs +1 -2
- package/unbundled/definition72.js +1 -2
- package/unbundled/definition75.cjs +3 -51711
- package/unbundled/definition75.js +1 -51711
- package/unbundled/listbox.cjs +1 -1
- package/unbundled/listbox.js +1 -1
- package/unbundled/localized.cjs +2 -2
- package/unbundled/localized.js +1 -1
- package/unbundled/picker-field.template.cjs +1 -1
- package/unbundled/picker-field.template.js +1 -1
- package/unbundled/slottable-request.cjs +2 -3168
- package/unbundled/slottable-request.js +3 -3097
- package/unbundled/time-selection-picker.template.cjs +1 -1
- package/unbundled/time-selection-picker.template.js +1 -1
- package/unbundled/vivid-element.cjs +1 -1
- package/unbundled/vivid-element.js +1 -1
- package/video-player/index.cjs +3 -3
- package/video-player/index.js +9 -9
- package/vivid.api.json +220 -282
- package/unbundled/chunk.js +0 -33
- package/unbundled/en-US.cjs +0 -447
- package/unbundled/en-US.js +0 -443
|
@@ -1,137 +1,363 @@
|
|
|
1
1
|
require("./chunk.cjs");
|
|
2
2
|
const require_vivid_element = require("./vivid-element.cjs");
|
|
3
|
+
const require_definition = require("./definition.cjs");
|
|
4
|
+
const require_definition$1 = require("./definition2.cjs");
|
|
3
5
|
const require_decorate = require("./decorate.cjs");
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
6
|
+
const require_affix = require("./affix.cjs");
|
|
7
|
+
const require_delegates_aria = require("./delegates-aria.cjs");
|
|
8
|
+
const require_form_associated = require("./form-associated.cjs");
|
|
9
|
+
const require_form_element = require("./form-element.cjs");
|
|
10
|
+
const require_with_success_text = require("./with-success-text.cjs");
|
|
11
|
+
const require_with_error_text = require("./with-error-text.cjs");
|
|
12
|
+
const require_with_contextual_help = require("./with-contextual-help.cjs");
|
|
13
|
+
const require_char_count = require("./char-count.cjs");
|
|
14
|
+
const require_mixins = require("./mixins.cjs");
|
|
15
|
+
const require_definition$2 = require("./definition25.cjs");
|
|
16
|
+
const require_text_field = require("./text-field.cjs");
|
|
7
17
|
let _microsoft_fast_element = require("@microsoft/fast-element");
|
|
8
18
|
let _microsoft_fast_web_utilities = require("@microsoft/fast-web-utilities");
|
|
9
|
-
//#region src/lib/
|
|
19
|
+
//#region src/lib/text-field/text-field.ts
|
|
10
20
|
/**
|
|
21
|
+
* Text field sub-types
|
|
11
22
|
* @public
|
|
12
|
-
* @component tooltip
|
|
13
|
-
* @slot anchor - Used to set the anchor element for the tooltip.
|
|
14
|
-
* @testSelector byText byText
|
|
15
|
-
* @testQuery open open true
|
|
16
|
-
* @testQuery closed open false
|
|
17
23
|
*/
|
|
18
|
-
var
|
|
24
|
+
var TextFieldType = {
|
|
25
|
+
email: "email",
|
|
26
|
+
password: "password",
|
|
27
|
+
tel: "tel",
|
|
28
|
+
text: "text",
|
|
29
|
+
url: "url"
|
|
30
|
+
};
|
|
31
|
+
var safariWorkaroundStyles = new _microsoft_fast_element.ElementStyles([`
|
|
32
|
+
._vvd-3-text-field-safari-workaround::placeholder {
|
|
33
|
+
opacity: 1 !important;
|
|
34
|
+
-webkit-text-fill-color: var(--_low-ink-color) !important;
|
|
35
|
+
}
|
|
36
|
+
`]);
|
|
37
|
+
var installSafariWorkaroundStyleIfNeeded = (forElement) => {
|
|
38
|
+
const root = forElement.getRootNode();
|
|
39
|
+
if (!safariWorkaroundStyles.isAttachedTo(root)) safariWorkaroundStyles.addStylesTo(root);
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Base class for text-field
|
|
43
|
+
*
|
|
44
|
+
* @public
|
|
45
|
+
* @component text-field
|
|
46
|
+
* @slot leading-action-items - Used to add action items to the start of the text-field.
|
|
47
|
+
* @slot action-items - Used to add action items to the end of the text-field.
|
|
48
|
+
* @slot helper-text - Describes how to use the text-field. Alternative to the `helper-text` attribute.
|
|
49
|
+
* @event {CustomEvent<undefined>} input - Fires a custom 'input' event when the value has changed
|
|
50
|
+
* @event {CustomEvent<undefined>} change - Fires a custom 'change' event when the value has changed
|
|
51
|
+
* @vueModel modelValue value input,@lazy:change `event.currentTarget.value`
|
|
52
|
+
* @testAction fill fill #control
|
|
53
|
+
* @testAction clear clear #control
|
|
54
|
+
* @testAction blur blur #control
|
|
55
|
+
* @testRef control light input[slot="_control"]
|
|
56
|
+
*/
|
|
57
|
+
var TextField = class extends require_with_contextual_help.WithContextualHelp(require_mixins.WithLightDOMFeedback(require_char_count.WithCharCount(require_with_error_text.WithErrorText(require_with_success_text.WithSuccessText(require_form_element.FormElement(require_affix.AffixIcon(require_delegates_aria.DelegatesAria(require_form_associated.FormAssociated(require_vivid_element.VividElement))))))))) {
|
|
19
58
|
constructor(..._args) {
|
|
20
59
|
super(..._args);
|
|
21
|
-
this.
|
|
60
|
+
this.proxy = document.createElement("input");
|
|
61
|
+
this.type = TextFieldType.text;
|
|
22
62
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
63
|
+
/**
|
|
64
|
+
* @internal
|
|
65
|
+
*/
|
|
66
|
+
readOnlyChanged() {
|
|
67
|
+
/* v8 ignore if -- @preserve */
|
|
68
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
69
|
+
this.proxy.readOnly = this.readOnly;
|
|
70
|
+
this.validate();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* @internal
|
|
75
|
+
*/
|
|
76
|
+
autofocusChanged() {
|
|
77
|
+
/* v8 ignore if -- @preserve */
|
|
78
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
79
|
+
this.proxy.autofocus = this.autofocus;
|
|
80
|
+
this.validate();
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* @internal
|
|
85
|
+
*/
|
|
86
|
+
placeholderChanged() {
|
|
87
|
+
/* v8 ignore if -- @preserve */
|
|
88
|
+
if (this.proxy instanceof HTMLInputElement) this.proxy.placeholder = this.placeholder;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* @internal
|
|
92
|
+
*/
|
|
93
|
+
typeChanged() {
|
|
94
|
+
/* v8 ignore if -- @preserve */
|
|
95
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
96
|
+
this.proxy.type = this.type;
|
|
97
|
+
this.validate();
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* @internal
|
|
102
|
+
*/
|
|
103
|
+
listChanged() {
|
|
104
|
+
/* v8 ignore if -- @preserve */
|
|
105
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
106
|
+
this.proxy.setAttribute("list", this.list);
|
|
107
|
+
this.validate();
|
|
108
|
+
}
|
|
26
109
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
110
|
+
/**
|
|
111
|
+
* @internal
|
|
112
|
+
*/
|
|
113
|
+
maxlengthChanged() {
|
|
114
|
+
/* v8 ignore if -- @preserve */
|
|
115
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
116
|
+
this.proxy.maxLength = this.maxlength;
|
|
117
|
+
this.validate();
|
|
118
|
+
}
|
|
30
119
|
}
|
|
31
120
|
/**
|
|
32
121
|
* @internal
|
|
33
122
|
*/
|
|
34
|
-
|
|
35
|
-
if
|
|
36
|
-
if (
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
a.removeAttribute("aria-haspopup");
|
|
52
|
-
a.removeAttribute("aria-expanded");
|
|
53
|
-
}
|
|
54
|
-
#show = () => {
|
|
55
|
-
this.open = true;
|
|
56
|
-
this.#updateAnchorExpanded();
|
|
57
|
-
};
|
|
58
|
-
#hide = () => {
|
|
59
|
-
this.open = false;
|
|
60
|
-
this.#updateAnchorExpanded();
|
|
61
|
-
};
|
|
62
|
-
#updateAnchorExpanded() {
|
|
63
|
-
if (this._anchorEl) this._anchorEl.setAttribute("aria-expanded", String(this.open));
|
|
64
|
-
}
|
|
65
|
-
#updateListeners() {
|
|
66
|
-
document.removeEventListener("keydown", this.#closeOnEscape);
|
|
67
|
-
if (this.open && this.isConnected) document.addEventListener("keydown", this.#closeOnEscape);
|
|
68
|
-
}
|
|
69
|
-
#closeOnEscape = (e) => {
|
|
70
|
-
/* v8 ignore else -- @preserve */
|
|
71
|
-
if (e.key === "Escape") this.#hide();
|
|
72
|
-
};
|
|
123
|
+
minlengthChanged() {
|
|
124
|
+
/* v8 ignore if -- @preserve */
|
|
125
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
126
|
+
this.proxy.minLength = this.minlength;
|
|
127
|
+
this.validate();
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* @internal
|
|
132
|
+
*/
|
|
133
|
+
patternChanged() {
|
|
134
|
+
/* v8 ignore if -- @preserve */
|
|
135
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
136
|
+
this.proxy.pattern = this.pattern;
|
|
137
|
+
this.validate();
|
|
138
|
+
}
|
|
139
|
+
}
|
|
73
140
|
/**
|
|
74
141
|
* @internal
|
|
75
142
|
*/
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
this
|
|
143
|
+
sizeChanged() {
|
|
144
|
+
/* v8 ignore if -- @preserve */
|
|
145
|
+
if (this.proxy instanceof HTMLInputElement) this.proxy.size = this.size;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* @internal
|
|
149
|
+
*/
|
|
150
|
+
spellcheckChanged() {
|
|
151
|
+
/* v8 ignore if -- @preserve */
|
|
152
|
+
if (this.proxy instanceof HTMLInputElement) this.proxy.spellcheck = this.spellcheck;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* @internal
|
|
156
|
+
*/
|
|
157
|
+
valueChanged(previous, next) {
|
|
158
|
+
super.valueChanged(previous, next);
|
|
159
|
+
this._updateControlValueIfNeeded();
|
|
160
|
+
if (this.charCount && this.maxlength) this._updateCharCountRemaining();
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Update the controls value only if it is actually different from the actual value.
|
|
164
|
+
* This is important as to not reset the browser's "dirtiness" flag on the input, which is used for min/maxlength
|
|
165
|
+
* constraints.
|
|
166
|
+
* @internal
|
|
167
|
+
*/
|
|
168
|
+
_updateControlValueIfNeeded() {
|
|
169
|
+
if (this.control && this.control.value !== this.value) this.control.value = this.value;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Selects all the text in the text field
|
|
173
|
+
*
|
|
174
|
+
* @public
|
|
175
|
+
*/
|
|
176
|
+
select() {
|
|
177
|
+
this.control.select();
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Handles the internal control's `input` event
|
|
181
|
+
* @internal
|
|
182
|
+
*/
|
|
183
|
+
handleTextInput(event) {
|
|
184
|
+
this.value = this.control.value;
|
|
185
|
+
event.stopPropagation();
|
|
186
|
+
this.$emit("input");
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Change event handler for inner control.
|
|
190
|
+
* @remarks
|
|
191
|
+
* "Change" events are not `composable` so they will not
|
|
192
|
+
* permeate the shadow DOM boundary. This fn effectively proxies
|
|
193
|
+
* the change event, emitting a `change` event whenever the internal
|
|
194
|
+
* control emits a `change` event
|
|
195
|
+
* @internal
|
|
196
|
+
*/
|
|
197
|
+
handleChange() {
|
|
198
|
+
this.$emit("change");
|
|
199
|
+
}
|
|
200
|
+
/** {@inheritDoc (FormAssociated:interface).validate} */
|
|
201
|
+
validate() {
|
|
202
|
+
super.validate(this.control);
|
|
203
|
+
}
|
|
204
|
+
connectedCallback() {
|
|
205
|
+
super.connectedCallback();
|
|
206
|
+
this.proxy.setAttribute("type", this.type);
|
|
207
|
+
this.validate();
|
|
208
|
+
if (this.autofocus) _microsoft_fast_element.Updates.enqueue(() => {
|
|
209
|
+
this.focus();
|
|
210
|
+
});
|
|
211
|
+
this._updateControlValueIfNeeded();
|
|
212
|
+
installSafariWorkaroundStyleIfNeeded(this);
|
|
213
|
+
this._renderCharCountRemaining();
|
|
214
|
+
}
|
|
215
|
+
focus() {
|
|
216
|
+
this.control?.focus();
|
|
217
|
+
}
|
|
218
|
+
#randomId = require_mixins.generateRandomId();
|
|
219
|
+
/**
|
|
220
|
+
* @internal
|
|
221
|
+
*/
|
|
222
|
+
get _uniqueId() {
|
|
223
|
+
return this.id || this.#randomId;
|
|
79
224
|
}
|
|
80
225
|
};
|
|
81
|
-
require_decorate.__decorate([_microsoft_fast_element.attr
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
226
|
+
require_decorate.__decorate([(0, _microsoft_fast_element.attr)({
|
|
227
|
+
attribute: "readonly",
|
|
228
|
+
mode: "boolean"
|
|
229
|
+
})], TextField.prototype, "readOnly", void 0);
|
|
230
|
+
require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ mode: "boolean" })], TextField.prototype, "autofocus", void 0);
|
|
231
|
+
require_decorate.__decorate([_microsoft_fast_element.attr], TextField.prototype, "placeholder", void 0);
|
|
232
|
+
require_decorate.__decorate([_microsoft_fast_element.attr], TextField.prototype, "type", void 0);
|
|
233
|
+
require_decorate.__decorate([_microsoft_fast_element.attr], TextField.prototype, "list", void 0);
|
|
234
|
+
require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ converter: _microsoft_fast_element.nullableNumberConverter })], TextField.prototype, "maxlength", void 0);
|
|
235
|
+
require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ converter: _microsoft_fast_element.nullableNumberConverter })], TextField.prototype, "minlength", void 0);
|
|
236
|
+
require_decorate.__decorate([_microsoft_fast_element.attr], TextField.prototype, "pattern", void 0);
|
|
237
|
+
require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ converter: _microsoft_fast_element.nullableNumberConverter })], TextField.prototype, "size", void 0);
|
|
238
|
+
require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ mode: "boolean" })], TextField.prototype, "spellcheck", void 0);
|
|
239
|
+
require_decorate.__decorate([_microsoft_fast_element.attr], TextField.prototype, "appearance", void 0);
|
|
240
|
+
require_decorate.__decorate([_microsoft_fast_element.attr], TextField.prototype, "shape", void 0);
|
|
241
|
+
require_decorate.__decorate([_microsoft_fast_element.attr], TextField.prototype, "autoComplete", void 0);
|
|
242
|
+
require_decorate.__decorate([(0, _microsoft_fast_element.attr)()], TextField.prototype, "scale", void 0);
|
|
243
|
+
require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ attribute: "inputmode" })], TextField.prototype, "inputMode", void 0);
|
|
244
|
+
require_decorate.__decorate([_microsoft_fast_element.observable], TextField.prototype, "actionItemsSlottedContent", void 0);
|
|
245
|
+
require_decorate.__decorate([_microsoft_fast_element.observable], TextField.prototype, "leadingActionItemsSlottedContent", void 0);
|
|
87
246
|
//#endregion
|
|
88
|
-
//#region src/lib/
|
|
89
|
-
var
|
|
90
|
-
var
|
|
91
|
-
|
|
247
|
+
//#region src/lib/text-field/text-field.template.ts
|
|
248
|
+
var getControlId = (id) => `vvd-text-field-control-${id}`;
|
|
249
|
+
var getStateClasses = ({ errorValidationMessage, disabled, value, readOnly, placeholder, appearance, shape, label, successText, actionItemsSlottedContent, leadingActionItemsSlottedContent, icon, scale }) => (0, _microsoft_fast_web_utilities.classNames)(["error", Boolean(errorValidationMessage)], ["disabled", disabled], ["has-value", Boolean(value)], ["readonly", readOnly], ["placeholder", Boolean(placeholder)], [`appearance-${appearance}`, Boolean(appearance)], [`shape-${shape}`, Boolean(shape)], ["no-label", !label], ["has-icon", !!icon], ["success", Boolean(successText)], ["action-items", !!actionItemsSlottedContent?.length], ["leading-action-items", !!leadingActionItemsSlottedContent?.length], ["no-leading", !(leadingActionItemsSlottedContent?.length || icon)], [`size-${scale}`, Boolean(scale)]);
|
|
250
|
+
var TextfieldTemplate = (context) => {
|
|
251
|
+
const affixIconTemplate = require_affix.affixIconTemplateFactory(context);
|
|
92
252
|
return _microsoft_fast_element.html`
|
|
93
|
-
${
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
253
|
+
<div class="base ${getStateClasses}">
|
|
254
|
+
${(0, _microsoft_fast_element.when)((x) => x.charCount && x.maxlength, (x) => x._getCharCountTemplate(context))}
|
|
255
|
+
<div
|
|
256
|
+
class="label-wrapper"
|
|
257
|
+
?hidden=${(x) => !x.label && !x._hasContextualHelp}
|
|
258
|
+
>
|
|
259
|
+
<slot class="label" name="_label"></slot>
|
|
260
|
+
<slot
|
|
261
|
+
name="contextual-help"
|
|
262
|
+
${(0, _microsoft_fast_element.slotted)("_contextualHelpSlottedContent")}
|
|
263
|
+
></slot>
|
|
264
|
+
</div>
|
|
265
|
+
${require_mixins.renderInLightDOM(_microsoft_fast_element.html`
|
|
266
|
+
${(0, _microsoft_fast_element.when)((x) => x.label, _microsoft_fast_element.html`
|
|
267
|
+
<label slot="_label" for="${(x) => getControlId(x._uniqueId)}">
|
|
268
|
+
${(x) => x.label}
|
|
269
|
+
</label>
|
|
270
|
+
`)}
|
|
271
|
+
`)}
|
|
272
|
+
<div class="fieldset">
|
|
273
|
+
<div class="leading-items-wrapper">
|
|
274
|
+
<slot
|
|
275
|
+
name="leading-action-items"
|
|
276
|
+
${(0, _microsoft_fast_element.slotted)("leadingActionItemsSlottedContent")}
|
|
277
|
+
></slot>
|
|
278
|
+
${(x) => affixIconTemplate(x.icon)}
|
|
279
|
+
</div>
|
|
280
|
+
<div class="wrapper">
|
|
281
|
+
<slot class="control" name="_control"></slot>
|
|
282
|
+
${require_mixins.renderInLightDOM(_microsoft_fast_element.html`<input
|
|
283
|
+
slot="_control"
|
|
284
|
+
id="${(x) => getControlId(x._uniqueId)}"
|
|
285
|
+
class="_vvd-3-text-field-safari-workaround"
|
|
286
|
+
@input="${(x, c) => x.handleTextInput(c.event)}"
|
|
287
|
+
@change="${(x) => x.handleChange()}"
|
|
288
|
+
@blur="${(x) => {
|
|
289
|
+
x.$emit("blur", void 0, { bubbles: false });
|
|
100
290
|
}}"
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
291
|
+
@focus="${(x) => {
|
|
292
|
+
x.$emit("focus", void 0, { bubbles: false });
|
|
293
|
+
}}"
|
|
294
|
+
?autofocus="${(x) => x.autofocus}"
|
|
295
|
+
?disabled="${(x) => x.disabled}"
|
|
296
|
+
?readonly="${(x) => x.readOnly}"
|
|
297
|
+
?required="${(x) => x.required}"
|
|
298
|
+
?spellcheck="${(x) => x.spellcheck}"
|
|
299
|
+
list="${(x) => x.list}"
|
|
300
|
+
maxlength="${(x) => x.maxlength}"
|
|
301
|
+
minlength="${(x) => x.minlength}"
|
|
302
|
+
pattern="${(x) => x.pattern}"
|
|
303
|
+
placeholder="${(x) => x.placeholder}"
|
|
304
|
+
size="${(x) => x.size}"
|
|
305
|
+
autocomplete="${(x) => x.autoComplete}"
|
|
306
|
+
type="${(x) => x.type}"
|
|
307
|
+
inputmode="${(x) => x.inputMode}"
|
|
308
|
+
aria-describedby="${(x) => x._feedbackDescribedBy} ${(x) => x.charCount && x.maxlength ? x._charCountDescribedBy : null}"
|
|
309
|
+
value="${(x) => x.initialValue}"
|
|
310
|
+
${require_delegates_aria.delegateAria()}
|
|
311
|
+
${(0, _microsoft_fast_element.ref)("control")}
|
|
312
|
+
/>`)}
|
|
313
|
+
</div>
|
|
314
|
+
<div class="action-items-wrapper">
|
|
315
|
+
<slot
|
|
316
|
+
name="action-items"
|
|
317
|
+
${(0, _microsoft_fast_element.slotted)("actionItemsSlottedContent")}
|
|
318
|
+
></slot>
|
|
319
|
+
</div>
|
|
320
|
+
</div>
|
|
321
|
+
${(x) => x._getFeedbackTemplate(context)}
|
|
322
|
+
</div>
|
|
323
|
+
`;
|
|
106
324
|
};
|
|
107
325
|
//#endregion
|
|
108
|
-
//#region src/lib/
|
|
326
|
+
//#region src/lib/text-field/definition.ts
|
|
109
327
|
/**
|
|
110
328
|
* @internal
|
|
111
329
|
*/
|
|
112
|
-
var
|
|
330
|
+
var textFieldDefinition = require_vivid_element.defineVividComponent("text-field", TextField, TextfieldTemplate, [
|
|
331
|
+
require_definition$1.iconDefinition,
|
|
332
|
+
require_mixins.feedbackMessageDefinition,
|
|
333
|
+
require_definition.visuallyHiddenDefinition,
|
|
334
|
+
require_definition$2.contextualHelpDefinition
|
|
335
|
+
], {
|
|
336
|
+
styles: require_text_field.text_field_default,
|
|
337
|
+
shadowOptions: { delegatesFocus: true }
|
|
338
|
+
});
|
|
113
339
|
/**
|
|
114
|
-
* Registers the
|
|
340
|
+
* Registers the text-field elements with the design system.
|
|
115
341
|
*
|
|
116
342
|
* @param prefix - the prefix to use for the component name
|
|
117
343
|
*/
|
|
118
|
-
var
|
|
344
|
+
var registerTextField = require_vivid_element.createRegisterFunction(textFieldDefinition);
|
|
119
345
|
//#endregion
|
|
120
|
-
Object.defineProperty(exports, "
|
|
346
|
+
Object.defineProperty(exports, "TextField", {
|
|
121
347
|
enumerable: true,
|
|
122
348
|
get: function() {
|
|
123
|
-
return
|
|
349
|
+
return TextField;
|
|
124
350
|
}
|
|
125
351
|
});
|
|
126
|
-
Object.defineProperty(exports, "
|
|
352
|
+
Object.defineProperty(exports, "registerTextField", {
|
|
127
353
|
enumerable: true,
|
|
128
354
|
get: function() {
|
|
129
|
-
return
|
|
355
|
+
return registerTextField;
|
|
130
356
|
}
|
|
131
357
|
});
|
|
132
|
-
Object.defineProperty(exports, "
|
|
358
|
+
Object.defineProperty(exports, "textFieldDefinition", {
|
|
133
359
|
enumerable: true,
|
|
134
360
|
get: function() {
|
|
135
|
-
return
|
|
361
|
+
return textFieldDefinition;
|
|
136
362
|
}
|
|
137
363
|
});
|