@vonage/vivid 4.6.0 → 4.7.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 +0 -36
- package/lib/dialog/dialog.d.ts +0 -1
- package/lib/searchable-select/locale.d.ts +3 -0
- package/locales/de-DE.cjs +12 -0
- package/locales/de-DE.js +12 -0
- package/locales/en-GB.cjs +12 -0
- package/locales/en-GB.js +12 -0
- package/locales/en-US.cjs +12 -0
- package/locales/en-US.js +12 -0
- package/locales/ja-JP.cjs +12 -0
- package/locales/ja-JP.js +12 -0
- package/locales/zh-CN.cjs +12 -0
- package/locales/zh-CN.js +12 -0
- package/package.json +1 -1
- package/shared/definition21.cjs +1 -18
- package/shared/definition21.js +1 -18
- package/shared/definition43.cjs +54 -31
- package/shared/definition43.js +54 -31
- package/styles/core/all.css +1 -1
- package/styles/core/theme.css +1 -1
- package/styles/core/typography.css +1 -1
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +1 -1
- package/shared/dialog-polyfill.esm.cjs +0 -862
- package/shared/dialog-polyfill.esm.js +0 -858
package/custom-elements.json
CHANGED
|
@@ -6064,10 +6064,6 @@
|
|
|
6064
6064
|
"kind": "javascript-module",
|
|
6065
6065
|
"path": "libs/components/src/lib/dialog/dialog.ts",
|
|
6066
6066
|
"declarations": [
|
|
6067
|
-
{
|
|
6068
|
-
"kind": "variable",
|
|
6069
|
-
"name": "isDialogSupported"
|
|
6070
|
-
},
|
|
6071
6067
|
{
|
|
6072
6068
|
"kind": "class",
|
|
6073
6069
|
"description": "",
|
|
@@ -6342,14 +6338,6 @@
|
|
|
6342
6338
|
}
|
|
6343
6339
|
],
|
|
6344
6340
|
"exports": [
|
|
6345
|
-
{
|
|
6346
|
-
"kind": "js",
|
|
6347
|
-
"name": "isDialogSupported",
|
|
6348
|
-
"declaration": {
|
|
6349
|
-
"name": "isDialogSupported",
|
|
6350
|
-
"module": "libs/components/src/lib/dialog/dialog.ts"
|
|
6351
|
-
}
|
|
6352
|
-
},
|
|
6353
6341
|
{
|
|
6354
6342
|
"kind": "js",
|
|
6355
6343
|
"name": "Dialog",
|
|
@@ -11992,30 +11980,6 @@
|
|
|
11992
11980
|
{
|
|
11993
11981
|
"name": "--vvd-option-tag-accent-contrast",
|
|
11994
11982
|
"default": "var(--vvd-color-neutral-800)"
|
|
11995
|
-
},
|
|
11996
|
-
{
|
|
11997
|
-
"name": "--vvd-option-tag-accent-soft",
|
|
11998
|
-
"default": "var(--vvd-color-neutral-100)"
|
|
11999
|
-
},
|
|
12000
|
-
{
|
|
12001
|
-
"name": "--vvd-option-tag-accent-pale",
|
|
12002
|
-
"default": "var(--vvd-color-neutral-300)"
|
|
12003
|
-
},
|
|
12004
|
-
{
|
|
12005
|
-
"name": "--vvd-option-tag-accent-fierce",
|
|
12006
|
-
"default": "var(--vvd-color-neutral-700)"
|
|
12007
|
-
},
|
|
12008
|
-
{
|
|
12009
|
-
"name": "--vvd-option-tag-accent-firm-all",
|
|
12010
|
-
"default": "var(--vvd-color-neutral-600)"
|
|
12011
|
-
},
|
|
12012
|
-
{
|
|
12013
|
-
"name": "--vvd-option-tag-accent-faint",
|
|
12014
|
-
"default": "var(--vvd-color-neutral-50)"
|
|
12015
|
-
},
|
|
12016
|
-
{
|
|
12017
|
-
"name": "--vvd-option-tag-accent-dim",
|
|
12018
|
-
"default": "var(--vvd-color-neutral-200)"
|
|
12019
11983
|
}
|
|
12020
11984
|
],
|
|
12021
11985
|
"members": [
|
package/lib/dialog/dialog.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { FoundationElement } from '@microsoft/fast-foundation';
|
|
2
2
|
import { Localized } from '../../shared/patterns';
|
|
3
|
-
export declare const isDialogSupported: boolean;
|
|
4
3
|
export type IconPlacement = 'top' | 'side';
|
|
5
4
|
export declare class Dialog extends FoundationElement {
|
|
6
5
|
#private;
|
|
@@ -3,4 +3,7 @@ export interface SearchableSelectLocale {
|
|
|
3
3
|
noOptionsMessage: string;
|
|
4
4
|
noMatchesMessage: string;
|
|
5
5
|
removeTagButtonLabel: (label: string) => string;
|
|
6
|
+
optionSelectedMessage: (name: string) => string;
|
|
7
|
+
optionDeselectedMessage: (name: string) => string;
|
|
8
|
+
optionFocusedMessage: (name: string, position: number, total: number) => string;
|
|
6
9
|
}
|
package/locales/de-DE.cjs
CHANGED
|
@@ -334,6 +334,18 @@ const deDE = {
|
|
|
334
334
|
removeTagButtonLabel: (
|
|
335
335
|
/* istanbul ignore next */
|
|
336
336
|
(label) => `${label} entfernen`
|
|
337
|
+
),
|
|
338
|
+
optionSelectedMessage: (
|
|
339
|
+
/* istanbul ignore next */
|
|
340
|
+
(name) => `Option ${name} ausgewählt.`
|
|
341
|
+
),
|
|
342
|
+
optionDeselectedMessage: (
|
|
343
|
+
/* istanbul ignore next */
|
|
344
|
+
(name) => `Option ${name} entfernt.`
|
|
345
|
+
),
|
|
346
|
+
optionFocusedMessage: (
|
|
347
|
+
/* istanbul ignore next */
|
|
348
|
+
(name, position, total) => `Option ${name} fokussiert, ${position} von ${total}.`
|
|
337
349
|
)
|
|
338
350
|
}
|
|
339
351
|
};
|
package/locales/de-DE.js
CHANGED
|
@@ -332,6 +332,18 @@ const deDE = {
|
|
|
332
332
|
removeTagButtonLabel: (
|
|
333
333
|
/* istanbul ignore next */
|
|
334
334
|
(label) => `${label} entfernen`
|
|
335
|
+
),
|
|
336
|
+
optionSelectedMessage: (
|
|
337
|
+
/* istanbul ignore next */
|
|
338
|
+
(name) => `Option ${name} ausgewählt.`
|
|
339
|
+
),
|
|
340
|
+
optionDeselectedMessage: (
|
|
341
|
+
/* istanbul ignore next */
|
|
342
|
+
(name) => `Option ${name} entfernt.`
|
|
343
|
+
),
|
|
344
|
+
optionFocusedMessage: (
|
|
345
|
+
/* istanbul ignore next */
|
|
346
|
+
(name, position, total) => `Option ${name} fokussiert, ${position} von ${total}.`
|
|
335
347
|
)
|
|
336
348
|
}
|
|
337
349
|
};
|
package/locales/en-GB.cjs
CHANGED
|
@@ -166,6 +166,18 @@ const enGB = {
|
|
|
166
166
|
removeTagButtonLabel: (
|
|
167
167
|
/* istanbul ignore next */
|
|
168
168
|
(label) => `Remove ${label}`
|
|
169
|
+
),
|
|
170
|
+
optionSelectedMessage: (
|
|
171
|
+
/* istanbul ignore next */
|
|
172
|
+
(name) => `Option ${name} selected.`
|
|
173
|
+
),
|
|
174
|
+
optionDeselectedMessage: (
|
|
175
|
+
/* istanbul ignore next */
|
|
176
|
+
(name) => `Option ${name} deselected.`
|
|
177
|
+
),
|
|
178
|
+
optionFocusedMessage: (
|
|
179
|
+
/* istanbul ignore next */
|
|
180
|
+
(name, position, total) => `Option ${name} focused, ${position} of ${total}.`
|
|
169
181
|
)
|
|
170
182
|
}
|
|
171
183
|
};
|
package/locales/en-GB.js
CHANGED
|
@@ -164,6 +164,18 @@ const enGB = {
|
|
|
164
164
|
removeTagButtonLabel: (
|
|
165
165
|
/* istanbul ignore next */
|
|
166
166
|
(label) => `Remove ${label}`
|
|
167
|
+
),
|
|
168
|
+
optionSelectedMessage: (
|
|
169
|
+
/* istanbul ignore next */
|
|
170
|
+
(name) => `Option ${name} selected.`
|
|
171
|
+
),
|
|
172
|
+
optionDeselectedMessage: (
|
|
173
|
+
/* istanbul ignore next */
|
|
174
|
+
(name) => `Option ${name} deselected.`
|
|
175
|
+
),
|
|
176
|
+
optionFocusedMessage: (
|
|
177
|
+
/* istanbul ignore next */
|
|
178
|
+
(name, position, total) => `Option ${name} focused, ${position} of ${total}.`
|
|
167
179
|
)
|
|
168
180
|
}
|
|
169
181
|
};
|
package/locales/en-US.cjs
CHANGED
|
@@ -334,6 +334,18 @@ const enUS = {
|
|
|
334
334
|
removeTagButtonLabel: (
|
|
335
335
|
/* istanbul ignore next */
|
|
336
336
|
(label) => `Remove ${label}`
|
|
337
|
+
),
|
|
338
|
+
optionSelectedMessage: (
|
|
339
|
+
/* istanbul ignore next */
|
|
340
|
+
(name) => `Option ${name} selected.`
|
|
341
|
+
),
|
|
342
|
+
optionDeselectedMessage: (
|
|
343
|
+
/* istanbul ignore next */
|
|
344
|
+
(name) => `Option ${name} deselected.`
|
|
345
|
+
),
|
|
346
|
+
optionFocusedMessage: (
|
|
347
|
+
/* istanbul ignore next */
|
|
348
|
+
(name, position, total) => `Option ${name} focused, ${position} of ${total}.`
|
|
337
349
|
)
|
|
338
350
|
}
|
|
339
351
|
};
|
package/locales/en-US.js
CHANGED
|
@@ -332,6 +332,18 @@ const enUS = {
|
|
|
332
332
|
removeTagButtonLabel: (
|
|
333
333
|
/* istanbul ignore next */
|
|
334
334
|
(label) => `Remove ${label}`
|
|
335
|
+
),
|
|
336
|
+
optionSelectedMessage: (
|
|
337
|
+
/* istanbul ignore next */
|
|
338
|
+
(name) => `Option ${name} selected.`
|
|
339
|
+
),
|
|
340
|
+
optionDeselectedMessage: (
|
|
341
|
+
/* istanbul ignore next */
|
|
342
|
+
(name) => `Option ${name} deselected.`
|
|
343
|
+
),
|
|
344
|
+
optionFocusedMessage: (
|
|
345
|
+
/* istanbul ignore next */
|
|
346
|
+
(name, position, total) => `Option ${name} focused, ${position} of ${total}.`
|
|
335
347
|
)
|
|
336
348
|
}
|
|
337
349
|
};
|
package/locales/ja-JP.cjs
CHANGED
|
@@ -333,6 +333,18 @@ const jaJP = {
|
|
|
333
333
|
removeTagButtonLabel: (
|
|
334
334
|
/* istanbul ignore next */
|
|
335
335
|
(label) => `${label}を削除`
|
|
336
|
+
),
|
|
337
|
+
optionSelectedMessage: (
|
|
338
|
+
/* istanbul ignore next */
|
|
339
|
+
(name) => `オプション ${name} が選択されました。`
|
|
340
|
+
),
|
|
341
|
+
optionDeselectedMessage: (
|
|
342
|
+
/* istanbul ignore next */
|
|
343
|
+
(name) => `オプション ${name} が選択解除されました。`
|
|
344
|
+
),
|
|
345
|
+
optionFocusedMessage: (
|
|
346
|
+
/* istanbul ignore next */
|
|
347
|
+
(name, position, total) => `オプション ${name} がフォーカスされました。${position}/${total}`
|
|
336
348
|
)
|
|
337
349
|
}
|
|
338
350
|
};
|
package/locales/ja-JP.js
CHANGED
|
@@ -331,6 +331,18 @@ const jaJP = {
|
|
|
331
331
|
removeTagButtonLabel: (
|
|
332
332
|
/* istanbul ignore next */
|
|
333
333
|
(label) => `${label}を削除`
|
|
334
|
+
),
|
|
335
|
+
optionSelectedMessage: (
|
|
336
|
+
/* istanbul ignore next */
|
|
337
|
+
(name) => `オプション ${name} が選択されました。`
|
|
338
|
+
),
|
|
339
|
+
optionDeselectedMessage: (
|
|
340
|
+
/* istanbul ignore next */
|
|
341
|
+
(name) => `オプション ${name} が選択解除されました。`
|
|
342
|
+
),
|
|
343
|
+
optionFocusedMessage: (
|
|
344
|
+
/* istanbul ignore next */
|
|
345
|
+
(name, position, total) => `オプション ${name} がフォーカスされました。${position}/${total}`
|
|
334
346
|
)
|
|
335
347
|
}
|
|
336
348
|
};
|
package/locales/zh-CN.cjs
CHANGED
|
@@ -335,6 +335,18 @@ const zhCN = {
|
|
|
335
335
|
removeTagButtonLabel: (
|
|
336
336
|
/* istanbul ignore next */
|
|
337
337
|
(label) => `${label} 删除`
|
|
338
|
+
),
|
|
339
|
+
optionSelectedMessage: (
|
|
340
|
+
/* istanbul ignore next */
|
|
341
|
+
(name) => `选项 ${name} 已选择。`
|
|
342
|
+
),
|
|
343
|
+
optionDeselectedMessage: (
|
|
344
|
+
/* istanbul ignore next */
|
|
345
|
+
(name) => `选项 ${name} 已取消选择。`
|
|
346
|
+
),
|
|
347
|
+
optionFocusedMessage: (
|
|
348
|
+
/* istanbul ignore next */
|
|
349
|
+
(name, position, total) => `选项 ${name} 已聚焦, ${position} 的 ${total}。`
|
|
338
350
|
)
|
|
339
351
|
}
|
|
340
352
|
};
|
package/locales/zh-CN.js
CHANGED
|
@@ -333,6 +333,18 @@ const zhCN = {
|
|
|
333
333
|
removeTagButtonLabel: (
|
|
334
334
|
/* istanbul ignore next */
|
|
335
335
|
(label) => `${label} 删除`
|
|
336
|
+
),
|
|
337
|
+
optionSelectedMessage: (
|
|
338
|
+
/* istanbul ignore next */
|
|
339
|
+
(name) => `选项 ${name} 已选择。`
|
|
340
|
+
),
|
|
341
|
+
optionDeselectedMessage: (
|
|
342
|
+
/* istanbul ignore next */
|
|
343
|
+
(name) => `选项 ${name} 已取消选择。`
|
|
344
|
+
),
|
|
345
|
+
optionFocusedMessage: (
|
|
346
|
+
/* istanbul ignore next */
|
|
347
|
+
(name, position, total) => `选项 ${name} 已聚焦, ${position} 的 ${total}。`
|
|
336
348
|
)
|
|
337
349
|
}
|
|
338
350
|
};
|
package/package.json
CHANGED
package/shared/definition21.cjs
CHANGED
|
@@ -12,8 +12,6 @@ const when = require('./when.cjs');
|
|
|
12
12
|
const slotted = require('./slotted.cjs');
|
|
13
13
|
const classNames = require('./class-names.cjs');
|
|
14
14
|
|
|
15
|
-
const dialogPolyfillStyles = "dialog{position:absolute;left:0;right:0;width:-moz-fit-content;width:-webkit-fit-content;width:fit-content;height:-moz-fit-content;height:-webkit-fit-content;height:fit-content;margin:auto;border:solid;padding:1em;background:#fff;color:#000;display:block}dialog:not([open]){display:none}dialog+.backdrop{position:fixed;inset:0;background:#0000001a}._dialog_overlay{position:fixed;inset:0}dialog.fixed{position:fixed;top:50%;transform:translateY(-50%)}";
|
|
16
|
-
|
|
17
15
|
const styles = ".base{white-space:initial;box-sizing:border-box;padding:0;border:none;border-radius:8px;background-color:transparent;color:var(--vvd-color-canvas-text);max-block-size:var(--dialog-max-block-size, calc(100vh - 64px) );max-inline-size:var(--dialog-max-inline-size, var(--_dialog-default-max-inline-size));min-inline-size:var(--dialog-min-inline-size, 280px)}@media not all and (width >= 600px){.base{--_dialog-default-max-inline-size: 90vw}}@media (width >= 600px){.base{--_dialog-default-max-inline-size: 560px}}.base:not(.modal){z-index:var(--dialog-z-index, 1)}.base.modal{position:fixed;box-shadow:0 4px 20px #00000059}.base.modal::backdrop{background-color:var(--vvd-color-canvas-text, currentColor);opacity:.5}.base:focus-visible{box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px))}.main-wrapper{display:flex;box-sizing:border-box;flex-direction:column;gap:24px;padding-block:24px}.main-wrapper>*{box-sizing:border-box}.header{display:grid;align-items:flex-start;justify-content:space-between;inline-size:100%;padding-inline:24px}.base:not(.icon-placement-side) .header{grid-template-columns:1fr auto;grid-template-rows:auto auto auto}.base:not(.icon-placement-side) .header .icon{font-size:calc(1px*(32 + 4*clamp(-1,var(--vvd-size-density, 0),2)));grid-column:1/2;grid-row:1/2;line-height:1;margin-block-end:calc(1px*(24 + 4*clamp(-1,var(--vvd-size-density, 0),2)))}.base.icon-placement-side .header{grid-template-columns:auto 1fr auto;grid-template-rows:auto auto}.base.icon-placement-side .header .icon{font-size:calc(1px*(28 + 4*clamp(-1,var(--vvd-size-density, 0),2)))}.base.icon-placement-side .header ::slotted(*),.base.icon-placement-side .header .icon{grid-column:1/2;grid-row:1/-1;margin-inline-end:calc(1px*(32 + 4*clamp(-1,var(--vvd-size-density, 0),2))/2)}.header.border{position:relative}.header.border:after{position:absolute;bottom:-24px;left:0;background-color:var(--vvd-color-neutral-200);block-size:1px;content:\"\";inline-size:100%}.base.hide-body .header.border:after{content:none}.body:not(.full-width){padding-inline:24px}.hide-body .body{display:none}.footer{display:flex;align-items:center;justify-content:space-between;gap:24px;padding-inline:24px}.hide-footer .footer{display:none}.footer .actions{display:flex;align-self:flex-end;gap:8px}.dismiss-button{flex-shrink:0;grid-column:-2/-1;grid-row:1/-1;margin-block-start:-8px;margin-inline:4px -8px}.headline{font:var(--vvd-typography-heading-4)}.subtitle{font:var(--vvd-typography-base)}slot[name=main]{display:block;overflow:hidden auto;max-width:inherit;max-height:inherit;border-radius:inherit}";
|
|
18
16
|
|
|
19
17
|
var __defProp = Object.defineProperty;
|
|
@@ -25,16 +23,6 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
25
23
|
if (result) __defProp(target, key, result);
|
|
26
24
|
return result;
|
|
27
25
|
};
|
|
28
|
-
const isDialogSupported = Boolean(
|
|
29
|
-
window.HTMLDialogElement && window.HTMLDialogElement.prototype.showModal
|
|
30
|
-
);
|
|
31
|
-
let dialogPolyfill;
|
|
32
|
-
(async () => {
|
|
33
|
-
if (!isDialogSupported) {
|
|
34
|
-
delete window.HTMLDialogElement;
|
|
35
|
-
dialogPolyfill = await Promise.resolve().then(() => require('./dialog-polyfill.esm.cjs'));
|
|
36
|
-
}
|
|
37
|
-
})();
|
|
38
26
|
class Dialog extends index.FoundationElement {
|
|
39
27
|
constructor() {
|
|
40
28
|
super(...arguments);
|
|
@@ -86,11 +74,6 @@ class Dialog extends index.FoundationElement {
|
|
|
86
74
|
this.#dialogElement = this.shadowRoot.querySelector(
|
|
87
75
|
"dialog"
|
|
88
76
|
);
|
|
89
|
-
if (this.#dialogElement) {
|
|
90
|
-
if (dialogPolyfill) {
|
|
91
|
-
dialogPolyfill.registerDialog(this.#dialogElement);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
77
|
}
|
|
95
78
|
return this.#dialogElement;
|
|
96
79
|
}
|
|
@@ -297,7 +280,7 @@ const DialogTemplate = (context) => {
|
|
|
297
280
|
const dialogDefinition = Dialog.compose({
|
|
298
281
|
baseName: "dialog",
|
|
299
282
|
template: DialogTemplate,
|
|
300
|
-
styles
|
|
283
|
+
styles
|
|
301
284
|
});
|
|
302
285
|
const dialogRegistries = [
|
|
303
286
|
dialogDefinition(),
|
package/shared/definition21.js
CHANGED
|
@@ -10,8 +10,6 @@ import { w as when } from './when.js';
|
|
|
10
10
|
import { s as slotted } from './slotted.js';
|
|
11
11
|
import { c as classNames } from './class-names.js';
|
|
12
12
|
|
|
13
|
-
const dialogPolyfillStyles = "dialog{position:absolute;left:0;right:0;width:-moz-fit-content;width:-webkit-fit-content;width:fit-content;height:-moz-fit-content;height:-webkit-fit-content;height:fit-content;margin:auto;border:solid;padding:1em;background:#fff;color:#000;display:block}dialog:not([open]){display:none}dialog+.backdrop{position:fixed;inset:0;background:#0000001a}._dialog_overlay{position:fixed;inset:0}dialog.fixed{position:fixed;top:50%;transform:translateY(-50%)}";
|
|
14
|
-
|
|
15
13
|
const styles = ".base{white-space:initial;box-sizing:border-box;padding:0;border:none;border-radius:8px;background-color:transparent;color:var(--vvd-color-canvas-text);max-block-size:var(--dialog-max-block-size, calc(100vh - 64px) );max-inline-size:var(--dialog-max-inline-size, var(--_dialog-default-max-inline-size));min-inline-size:var(--dialog-min-inline-size, 280px)}@media not all and (width >= 600px){.base{--_dialog-default-max-inline-size: 90vw}}@media (width >= 600px){.base{--_dialog-default-max-inline-size: 560px}}.base:not(.modal){z-index:var(--dialog-z-index, 1)}.base.modal{position:fixed;box-shadow:0 4px 20px #00000059}.base.modal::backdrop{background-color:var(--vvd-color-canvas-text, currentColor);opacity:.5}.base:focus-visible{box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px))}.main-wrapper{display:flex;box-sizing:border-box;flex-direction:column;gap:24px;padding-block:24px}.main-wrapper>*{box-sizing:border-box}.header{display:grid;align-items:flex-start;justify-content:space-between;inline-size:100%;padding-inline:24px}.base:not(.icon-placement-side) .header{grid-template-columns:1fr auto;grid-template-rows:auto auto auto}.base:not(.icon-placement-side) .header .icon{font-size:calc(1px*(32 + 4*clamp(-1,var(--vvd-size-density, 0),2)));grid-column:1/2;grid-row:1/2;line-height:1;margin-block-end:calc(1px*(24 + 4*clamp(-1,var(--vvd-size-density, 0),2)))}.base.icon-placement-side .header{grid-template-columns:auto 1fr auto;grid-template-rows:auto auto}.base.icon-placement-side .header .icon{font-size:calc(1px*(28 + 4*clamp(-1,var(--vvd-size-density, 0),2)))}.base.icon-placement-side .header ::slotted(*),.base.icon-placement-side .header .icon{grid-column:1/2;grid-row:1/-1;margin-inline-end:calc(1px*(32 + 4*clamp(-1,var(--vvd-size-density, 0),2))/2)}.header.border{position:relative}.header.border:after{position:absolute;bottom:-24px;left:0;background-color:var(--vvd-color-neutral-200);block-size:1px;content:\"\";inline-size:100%}.base.hide-body .header.border:after{content:none}.body:not(.full-width){padding-inline:24px}.hide-body .body{display:none}.footer{display:flex;align-items:center;justify-content:space-between;gap:24px;padding-inline:24px}.hide-footer .footer{display:none}.footer .actions{display:flex;align-self:flex-end;gap:8px}.dismiss-button{flex-shrink:0;grid-column:-2/-1;grid-row:1/-1;margin-block-start:-8px;margin-inline:4px -8px}.headline{font:var(--vvd-typography-heading-4)}.subtitle{font:var(--vvd-typography-base)}slot[name=main]{display:block;overflow:hidden auto;max-width:inherit;max-height:inherit;border-radius:inherit}";
|
|
16
14
|
|
|
17
15
|
var __defProp = Object.defineProperty;
|
|
@@ -23,16 +21,6 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
23
21
|
if (result) __defProp(target, key, result);
|
|
24
22
|
return result;
|
|
25
23
|
};
|
|
26
|
-
const isDialogSupported = Boolean(
|
|
27
|
-
window.HTMLDialogElement && window.HTMLDialogElement.prototype.showModal
|
|
28
|
-
);
|
|
29
|
-
let dialogPolyfill;
|
|
30
|
-
(async () => {
|
|
31
|
-
if (!isDialogSupported) {
|
|
32
|
-
delete window.HTMLDialogElement;
|
|
33
|
-
dialogPolyfill = await import('./dialog-polyfill.esm.js');
|
|
34
|
-
}
|
|
35
|
-
})();
|
|
36
24
|
class Dialog extends FoundationElement {
|
|
37
25
|
constructor() {
|
|
38
26
|
super(...arguments);
|
|
@@ -84,11 +72,6 @@ class Dialog extends FoundationElement {
|
|
|
84
72
|
this.#dialogElement = this.shadowRoot.querySelector(
|
|
85
73
|
"dialog"
|
|
86
74
|
);
|
|
87
|
-
if (this.#dialogElement) {
|
|
88
|
-
if (dialogPolyfill) {
|
|
89
|
-
dialogPolyfill.registerDialog(this.#dialogElement);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
75
|
}
|
|
93
76
|
return this.#dialogElement;
|
|
94
77
|
}
|
|
@@ -295,7 +278,7 @@ const DialogTemplate = (context) => {
|
|
|
295
278
|
const dialogDefinition = Dialog.compose({
|
|
296
279
|
baseName: "dialog",
|
|
297
280
|
template: DialogTemplate,
|
|
298
|
-
styles
|
|
281
|
+
styles
|
|
299
282
|
});
|
|
300
283
|
const dialogRegistries = [
|
|
301
284
|
dialogDefinition(),
|
package/shared/definition43.cjs
CHANGED
|
@@ -20,9 +20,9 @@ const repeat = require('./repeat.cjs');
|
|
|
20
20
|
const classNames = require('./class-names.cjs');
|
|
21
21
|
const icon = require('./icon.cjs');
|
|
22
22
|
|
|
23
|
-
const styles = ".chevron{display:flex;flex-shrink:0;font:var(--vvd-typography-base-extended);transform:rotate(0);transition:transform .2s}:host([aria-expanded=true]) .chevron,:host([open]) .chevron{transform:rotate(180deg)}:host(:focus-visible){outline:none}:host{display:inline-block;inline-size:300px;--_low-ink-color: var(--vvd-color-neutral-600)}:host([disabled]){--_low-ink-color: var(--vvd-color-neutral-400);cursor:not-allowed}.control-wrapper{display:flex;flex-direction:column;gap:4px}.label{color:var(--vvd-color-canvas-text);font:var(--vvd-typography-base)}.fieldset{--_connotation-color-primary: var(--vvd-searchable-select-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-primary-text: var(--vvd-searchable-select-accent-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-searchable-select-accent-primary-increment, var(--vvd-color-neutral-800));--_connotation-color-intermediate: var(--vvd-searchable-select-accent-intermediate, var(--vvd-color-neutral-500));--_connotation-color-faint: var(--vvd-searchable-select-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-soft: var(--vvd-searchable-select-accent-soft, var(--vvd-color-neutral-100));--_connotation-color-firm: var(--vvd-searchable-select-accent-firm, var(--vvd-color-canvas-text));--_connotation-color-fierce: var(--vvd-searchable-select-accent-fierce, var(--vvd-color-neutral-700))}.fieldset{--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--_connotation-color-intermediate)}.fieldset.appearance-ghost{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.fieldset:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--_connotation-color-fierce)}.fieldset:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)).appearance-ghost{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}.fieldset:where(.disabled,:disabled){--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-100);--_appearance-color-outline: var(--vvd-color-neutral-300)}.fieldset:where(.disabled,:disabled).appearance-ghost{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.fieldset:where(.readonly):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-neutral-200);--_appearance-color-outline: var(--vvd-color-neutral-400)}.fieldset:where(.readonly):where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: var(--vvd-color-neutral-600);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.fieldset:where(.error):where(:not(.disabled,:disabled)){--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-alert-50);--_appearance-color-outline: var(--vvd-color-alert-500)}.fieldset:where(.error):where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-alert-50);--_appearance-color-outline: transparent}.fieldset:where(.success):where(:not(.disabled,:disabled)){--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-success-50);--_appearance-color-outline: var(--vvd-color-success-500)}.fieldset:where(.success):where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-success-50);--_appearance-color-outline: transparent}.fieldset{display:flex;align-items:center;justify-content:space-between;background-color:var(--_appearance-color-fill);box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);color:var(--_appearance-color-text);font:var(--vvd-typography-base);gap:8px;padding-block:8px;padding-inline:16px;transition:box-shadow .2s,background-color .2s}.fieldset:focus-within{box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px));--focus-stroke-gap-color: transparent}:host(:not([shape=pill])) .fieldset{border-radius:8px}:host([shape=pill]) .fieldset{border-radius:24px}.popup-wrapper{position:relative}.content-area{display:flex;overflow:hidden;flex:1;flex-direction:column;gap:8px;min-block-size:24px}.tag-row{display:flex;gap:8px;inline-size:100%}.tag-row.contains-only-input:not(:focus-within){display:contents}.tag-wrapper{overflow:hidden}.tag{max-inline-size:100%}input{box-sizing:border-box;flex:1;border:none;background:none;block-size:24px;font:var(--vvd-typography-base);max-inline-size:100%;min-inline-size:100px;outline:none}.contains-only-input input:not(:focus){position:absolute;block-size:0;inline-size:0;min-inline-size:0;opacity:0;pointer-events:none}.listbox{display:flex;flex-direction:column;padding:4px;gap:2px;max-block-size:var(--searchable-select-height, 408px);overflow-y:auto}.empty-message{display:flex;align-items:center;justify-content:center;color:var(--vvd-color-neutral-300);min-block-size:40px;text-align:center}::part(popup-base){inline-size:max-content;min-inline-size:100%}slot[name=icon]{font-size:20px}";
|
|
23
|
+
const styles = ".chevron{display:flex;flex-shrink:0;font:var(--vvd-typography-base-extended);transform:rotate(0);transition:transform .2s}:host([aria-expanded=true]) .chevron,:host([open]) .chevron{transform:rotate(180deg)}:host(:focus-visible){outline:none}:host{display:inline-block;inline-size:300px;--_low-ink-color: var(--vvd-color-neutral-600)}:host([disabled]){--_low-ink-color: var(--vvd-color-neutral-400);cursor:not-allowed}.control-wrapper{display:flex;flex-direction:column;gap:4px}.label{color:var(--vvd-color-canvas-text);font:var(--vvd-typography-base)}.fieldset{--_connotation-color-primary: var(--vvd-searchable-select-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-primary-text: var(--vvd-searchable-select-accent-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-searchable-select-accent-primary-increment, var(--vvd-color-neutral-800));--_connotation-color-intermediate: var(--vvd-searchable-select-accent-intermediate, var(--vvd-color-neutral-500));--_connotation-color-faint: var(--vvd-searchable-select-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-soft: var(--vvd-searchable-select-accent-soft, var(--vvd-color-neutral-100));--_connotation-color-firm: var(--vvd-searchable-select-accent-firm, var(--vvd-color-canvas-text));--_connotation-color-fierce: var(--vvd-searchable-select-accent-fierce, var(--vvd-color-neutral-700))}.fieldset{--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--_connotation-color-intermediate)}.fieldset.appearance-ghost{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.fieldset:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--_connotation-color-fierce)}.fieldset:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)).appearance-ghost{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}.fieldset:where(.disabled,:disabled){--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-100);--_appearance-color-outline: var(--vvd-color-neutral-300)}.fieldset:where(.disabled,:disabled).appearance-ghost{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.fieldset:where(.readonly):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-neutral-200);--_appearance-color-outline: var(--vvd-color-neutral-400)}.fieldset:where(.readonly):where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: var(--vvd-color-neutral-600);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.fieldset:where(.error):where(:not(.disabled,:disabled)){--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-alert-50);--_appearance-color-outline: var(--vvd-color-alert-500)}.fieldset:where(.error):where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-alert-50);--_appearance-color-outline: transparent}.fieldset:where(.success):where(:not(.disabled,:disabled)){--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-success-50);--_appearance-color-outline: var(--vvd-color-success-500)}.fieldset:where(.success):where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-success-50);--_appearance-color-outline: transparent}.fieldset{display:flex;align-items:center;justify-content:space-between;background-color:var(--_appearance-color-fill);box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);color:var(--_appearance-color-text);font:var(--vvd-typography-base);gap:8px;padding-block:8px;padding-inline:16px;transition:box-shadow .2s,background-color .2s}.fieldset:focus-within{box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px));--focus-stroke-gap-color: transparent}:host(:not([shape=pill])) .fieldset{border-radius:8px}:host([shape=pill]) .fieldset{border-radius:24px}.popup-wrapper{position:relative}.content-area{display:flex;overflow:hidden;flex:1;flex-direction:column;gap:8px;min-block-size:24px}.tag-row{display:flex;gap:8px;inline-size:100%}.tag-row.contains-only-input:not(:focus-within){display:contents}.tag-wrapper{overflow:hidden}.tag{max-inline-size:100%}input{box-sizing:border-box;flex:1;border:none;background:none;block-size:24px;font:var(--vvd-typography-base);max-inline-size:100%;min-inline-size:100px;outline:none}.contains-only-input input:not(:focus){position:absolute;block-size:0;inline-size:0;min-inline-size:0;opacity:0;pointer-events:none}.listbox{display:flex;flex-direction:column;padding:4px;gap:2px;max-block-size:var(--searchable-select-height, 408px);overflow-y:auto}.empty-message{display:flex;align-items:center;justify-content:center;color:var(--vvd-color-neutral-300);min-block-size:40px;text-align:center}::part(popup-base){inline-size:max-content;min-inline-size:100%}slot[name=icon]{font-size:20px}.visually-hidden{position:absolute;overflow:hidden;width:1px;height:1px;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}";
|
|
24
24
|
|
|
25
|
-
const optionTagStyles = ".base{--_connotation-color-contrast: var(--vvd-option-tag-accent-contrast, var(--vvd-color-neutral-800))
|
|
25
|
+
const optionTagStyles = ".base{--_connotation-color-contrast: var(--vvd-option-tag-accent-contrast, var(--vvd-color-neutral-800))}.base{position:relative;display:inline-flex;box-sizing:border-box;align-items:center;background-color:var(--fill-color);block-size:calc(1px*(24 + 4*clamp(-1,var(--vvd-size-density, 0),2)));box-shadow:inset 0 0 0 1px var(--outline-color);color:var(--text-color);column-gap:8px;font:var(--vvd-typography-base-bold);max-inline-size:100%;padding-inline:8px;user-select:none;vertical-align:middle}.base:not(.disabled){--text-color: var(--_connotation-color-contrast);--fill-color: color-mix( in srgb, var(--_connotation-color-contrast), transparent 87.5% );--outline-color: transparent}.base.disabled{--text-color: var(--vvd-color-neutral-300);--fill-color: color-mix( in srgb, var(--vvd-color-neutral-800), transparent 87.5% );--outline-color: transparent}.base:not(.shape-pill){border-radius:4px}.base.shape-pill{border-radius:16px}.label{overflow:hidden;max-inline-size:100%;text-overflow:ellipsis;white-space:nowrap}slot[name=icon]{font-size:calc(calc(1px*(24 + 4*clamp(-1,var(--vvd-size-density, 0),2))) / 1.5);line-height:1}.icon-placeholder{inline-size:calc(calc(1px*(24 + 4*clamp(-1,var(--vvd-size-density, 0),2))) / 1.5)}.remove-button{display:flex;align-items:center;border-radius:inherit;cursor:pointer;outline:none}.disabled .remove-button{pointer-events:none}.remove-button:focus-visible:before{--focus-stroke-gap-color: transparent;box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px));position:absolute;z-index:1;display:block;border-radius:inherit;content:\"\";inset:0;pointer-events:none}";
|
|
26
26
|
|
|
27
27
|
class _SearchableSelect extends index.FoundationElement {
|
|
28
28
|
}
|
|
@@ -89,13 +89,8 @@ let SearchableSelect = class extends FormAssociatedSearchableSelect {
|
|
|
89
89
|
this._filteredOptions = [];
|
|
90
90
|
this._filteredEnabledOptions = [];
|
|
91
91
|
__privateAdd(this, _suppressFilter, false);
|
|
92
|
-
// --- Highlighted option (visual focus) ---
|
|
93
|
-
/**
|
|
94
|
-
* Currently visually highlighted option as an index into _filteredEnabledOptions
|
|
95
|
-
* @internal
|
|
96
|
-
*/
|
|
97
92
|
this._highlightedOptionIndex = null;
|
|
98
|
-
this.
|
|
93
|
+
this._numElidedTags = 0;
|
|
99
94
|
this._tagRows = [];
|
|
100
95
|
this._lastTagRow = [];
|
|
101
96
|
this.clearable = false;
|
|
@@ -105,11 +100,20 @@ let SearchableSelect = class extends FormAssociatedSearchableSelect {
|
|
|
105
100
|
}
|
|
106
101
|
super.setFormValue(value, state);
|
|
107
102
|
};
|
|
103
|
+
this._changeDescription = "";
|
|
108
104
|
// --- Core ---
|
|
109
105
|
__privateAdd(this, _resizeObserver, new ResizeObserver(() => {
|
|
110
106
|
__privateMethod(this, _SearchableSelect_instances, updateTagLayout_fn).call(this);
|
|
111
107
|
}));
|
|
112
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* @internal
|
|
111
|
+
*/
|
|
112
|
+
openChanged() {
|
|
113
|
+
if (!this.open) {
|
|
114
|
+
__privateMethod(this, _SearchableSelect_instances, transitionHighlightedOptionTo_fn).call(this, null);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
113
117
|
/**
|
|
114
118
|
* @internal
|
|
115
119
|
*/
|
|
@@ -219,6 +223,7 @@ let SearchableSelect = class extends FormAssociatedSearchableSelect {
|
|
|
219
223
|
this._inputValue = __privateMethod(this, _SearchableSelect_instances, textForValue_fn).call(this, this.values[0]);
|
|
220
224
|
}
|
|
221
225
|
}
|
|
226
|
+
this._changeDescription = "";
|
|
222
227
|
}
|
|
223
228
|
/**
|
|
224
229
|
* @internal
|
|
@@ -482,22 +487,24 @@ updateSelectedOnSlottedOptions_fn = function() {
|
|
|
482
487
|
handleOptionInteraction_fn = function(option) {
|
|
483
488
|
const value = option.value;
|
|
484
489
|
let newValues;
|
|
490
|
+
const isSelection = !this.values.includes(value);
|
|
485
491
|
if (this.multiple) {
|
|
486
|
-
if (
|
|
492
|
+
if (isSelection) {
|
|
487
493
|
newValues = [...this.values, value];
|
|
488
494
|
} else {
|
|
489
495
|
newValues = this.values.filter((option2) => option2 !== value);
|
|
490
496
|
}
|
|
491
497
|
this._inputValue = "";
|
|
492
498
|
} else {
|
|
493
|
-
if (
|
|
494
|
-
newValues = [];
|
|
495
|
-
} else {
|
|
499
|
+
if (isSelection) {
|
|
496
500
|
newValues = [value];
|
|
497
501
|
this._inputValue = option.text;
|
|
502
|
+
} else {
|
|
503
|
+
newValues = [];
|
|
498
504
|
}
|
|
499
505
|
this.open = false;
|
|
500
506
|
}
|
|
507
|
+
this._changeDescription = isSelection ? this.locale.searchableSelect.optionSelectedMessage(option.text) : this.locale.searchableSelect.optionDeselectedMessage(option.text);
|
|
501
508
|
__privateMethod(this, _SearchableSelect_instances, updateValuesThroughUserInteraction_fn).call(this, newValues);
|
|
502
509
|
};
|
|
503
510
|
_clonedTagIcons = new WeakMap();
|
|
@@ -563,6 +570,11 @@ transitionHighlightedOptionTo_fn = function(index) {
|
|
|
563
570
|
const highlightedOption = this._filteredEnabledOptions[this._highlightedOptionIndex];
|
|
564
571
|
highlightedOption._highlighted = true;
|
|
565
572
|
scrollIntoView.scrollIntoView(highlightedOption, this._listbox, "nearest");
|
|
573
|
+
this._changeDescription = this.locale.searchableSelect.optionFocusedMessage(
|
|
574
|
+
highlightedOption.text,
|
|
575
|
+
this._highlightedOptionIndex + 1,
|
|
576
|
+
this._filteredEnabledOptions.length
|
|
577
|
+
);
|
|
566
578
|
}
|
|
567
579
|
};
|
|
568
580
|
selectHighlightedOption_fn = function() {
|
|
@@ -611,13 +623,13 @@ measureTagWidth_fn = function(label, removable, hasIcon) {
|
|
|
611
623
|
};
|
|
612
624
|
updateTagLayout_fn = function() {
|
|
613
625
|
if (!this.multiple) {
|
|
614
|
-
this.
|
|
626
|
+
this._numElidedTags = 0;
|
|
615
627
|
this._tagRows = [];
|
|
616
628
|
this._lastTagRow = [];
|
|
617
629
|
return;
|
|
618
630
|
}
|
|
619
631
|
if (this.externalTags) {
|
|
620
|
-
this.
|
|
632
|
+
this._numElidedTags = this.values.length;
|
|
621
633
|
this._tagRows = [];
|
|
622
634
|
this._lastTagRow = [];
|
|
623
635
|
return;
|
|
@@ -661,12 +673,12 @@ updateTagLayout_fn = function() {
|
|
|
661
673
|
rows[currentRowIndex].unshift(entry);
|
|
662
674
|
currentRowWidth += TagGapPx + tagWidth;
|
|
663
675
|
}
|
|
664
|
-
this.
|
|
676
|
+
this._numElidedTags = i + 1;
|
|
665
677
|
rows.reverse();
|
|
666
678
|
for (let i2 = 0; i2 < rows.length - 1; i2++) {
|
|
667
679
|
let lineWidth = rows[i2].map((e) => e.width).reduce((a, b) => a + b, 0) + (rows[i2].length - 1) * TagGapPx;
|
|
668
|
-
if (i2 === 0 && this.
|
|
669
|
-
lineWidth += TagGapPx + __privateMethod(this, _SearchableSelect_instances, measureTagWidth_fn).call(this, this.
|
|
680
|
+
if (i2 === 0 && this._numElidedTags) {
|
|
681
|
+
lineWidth += TagGapPx + __privateMethod(this, _SearchableSelect_instances, measureTagWidth_fn).call(this, this._numElidedTags.toString(), false, false);
|
|
670
682
|
}
|
|
671
683
|
while (rows[i2 + 1].length && lineWidth + TagGapPx + rows[i2 + 1][0].width <= rowWidth) {
|
|
672
684
|
const nextTag = rows[i2 + 1].shift();
|
|
@@ -682,7 +694,7 @@ moveTagFocusTo_fn = function(index) {
|
|
|
682
694
|
if (index === null) {
|
|
683
695
|
this._input.focus();
|
|
684
696
|
} else {
|
|
685
|
-
this.shadowRoot.querySelector(`[data-index="${index}"]`)
|
|
697
|
+
this.shadowRoot.querySelector(`[data-index="${index}"]`)?.focus();
|
|
686
698
|
}
|
|
687
699
|
};
|
|
688
700
|
nextTagIndexLeft_fn = function(index) {
|
|
@@ -771,12 +783,15 @@ __decorateClass$1([
|
|
|
771
783
|
__decorateClass$1([
|
|
772
784
|
index.observable
|
|
773
785
|
], SearchableSelect.prototype, "_filteredEnabledOptions", 2);
|
|
786
|
+
__decorateClass$1([
|
|
787
|
+
index.observable
|
|
788
|
+
], SearchableSelect.prototype, "_highlightedOptionIndex", 2);
|
|
774
789
|
__decorateClass$1([
|
|
775
790
|
index.observable
|
|
776
791
|
], SearchableSelect.prototype, "_contentArea", 2);
|
|
777
792
|
__decorateClass$1([
|
|
778
793
|
index.observable
|
|
779
|
-
], SearchableSelect.prototype, "
|
|
794
|
+
], SearchableSelect.prototype, "_numElidedTags", 2);
|
|
780
795
|
__decorateClass$1([
|
|
781
796
|
index.observable
|
|
782
797
|
], SearchableSelect.prototype, "_tagRows", 2);
|
|
@@ -789,6 +804,9 @@ __decorateClass$1([
|
|
|
789
804
|
__decorateClass$1([
|
|
790
805
|
index.attr({ mode: "boolean" })
|
|
791
806
|
], SearchableSelect.prototype, "clearable", 2);
|
|
807
|
+
__decorateClass$1([
|
|
808
|
+
index.observable
|
|
809
|
+
], SearchableSelect.prototype, "_changeDescription", 2);
|
|
792
810
|
__decorateClass$1([
|
|
793
811
|
index.observable
|
|
794
812
|
], SearchableSelect.prototype, "_anchor", 2);
|
|
@@ -875,13 +893,13 @@ const tagTemplateFactory = (context, getComponent) => {
|
|
|
875
893
|
</div>
|
|
876
894
|
`;
|
|
877
895
|
};
|
|
878
|
-
const
|
|
896
|
+
const elidedTagTemplateFactory = (context, getComponent) => {
|
|
879
897
|
const optionTagTag = context.tagFor(OptionTag);
|
|
880
898
|
return index.html`
|
|
881
899
|
<${optionTagTag}
|
|
882
900
|
class="tag"
|
|
883
901
|
tabindex="-1"
|
|
884
|
-
:label="${(x, c) => getComponent(x, c).
|
|
902
|
+
:label="${(x, c) => getComponent(x, c)._numElidedTags.toString()}"
|
|
885
903
|
:shape="${(x, c) => getComponent(x, c).shape}"
|
|
886
904
|
?disabled="${(x, c) => getComponent(x, c).disabled}"
|
|
887
905
|
@mousedown="${() => false}">
|
|
@@ -897,8 +915,8 @@ function renderFieldset(context) {
|
|
|
897
915
|
context,
|
|
898
916
|
(c) => c.parentContext.parent
|
|
899
917
|
);
|
|
900
|
-
const
|
|
901
|
-
const
|
|
918
|
+
const elidedTagTemplate = elidedTagTemplateFactory(context, (x, _) => x);
|
|
919
|
+
const nestedElidedTagTemplate = elidedTagTemplateFactory(
|
|
902
920
|
context,
|
|
903
921
|
(_, c) => c.parent
|
|
904
922
|
);
|
|
@@ -915,8 +933,8 @@ function renderFieldset(context) {
|
|
|
915
933
|
index.html`
|
|
916
934
|
<div class="tag-row">
|
|
917
935
|
${when.when(
|
|
918
|
-
(_, c) => c.isFirst && c.parent.
|
|
919
|
-
|
|
936
|
+
(_, c) => c.isFirst && c.parent._numElidedTags,
|
|
937
|
+
nestedElidedTagTemplate
|
|
920
938
|
)}
|
|
921
939
|
${repeat.repeat((x) => x, nestedTagTemplate)}
|
|
922
940
|
</div>
|
|
@@ -930,8 +948,8 @@ function renderFieldset(context) {
|
|
|
930
948
|
])}"
|
|
931
949
|
>
|
|
932
950
|
${when.when(
|
|
933
|
-
(x) => x._tagRows.length === 0 && x.
|
|
934
|
-
|
|
951
|
+
(x) => x._tagRows.length === 0 && x._numElidedTags,
|
|
952
|
+
elidedTagTemplate
|
|
935
953
|
)}
|
|
936
954
|
${repeat.repeat((x) => x._lastTagRow, tagTemplate)}
|
|
937
955
|
<input
|
|
@@ -939,10 +957,10 @@ function renderFieldset(context) {
|
|
|
939
957
|
class="control"
|
|
940
958
|
autofocus
|
|
941
959
|
autocomplete="off"
|
|
942
|
-
aria-autocomplete="
|
|
943
|
-
aria-
|
|
944
|
-
aria-expanded="${(x) => x.ariaExpanded}"
|
|
960
|
+
aria-autocomplete="list"
|
|
961
|
+
aria-expanded="${(x) => x.open}"
|
|
945
962
|
aria-haspopup="listbox"
|
|
963
|
+
aria-controls="listbox"
|
|
946
964
|
placeholder="${(x) => x.multiple && x.values.length ? "" : x.placeholder}"
|
|
947
965
|
role="combobox"
|
|
948
966
|
type="text"
|
|
@@ -967,7 +985,7 @@ function renderFieldset(context) {
|
|
|
967
985
|
:shape="${(x) => x.shape}"
|
|
968
986
|
size="super-condensed"
|
|
969
987
|
icon="close-line"
|
|
970
|
-
|
|
988
|
+
appearance="ghost-light"
|
|
971
989
|
tabindex="-1"
|
|
972
990
|
></${buttonTag}>`
|
|
973
991
|
)}
|
|
@@ -979,6 +997,9 @@ function renderControl(context) {
|
|
|
979
997
|
const popupTag = context.tagFor(definition.Popup);
|
|
980
998
|
return index.html`
|
|
981
999
|
${when.when((x) => x.label, renderLabel())}
|
|
1000
|
+
<span aria-live="assertive" aria-relevant="text" class="visually-hidden">
|
|
1001
|
+
${(x) => x._changeDescription}
|
|
1002
|
+
</span>
|
|
982
1003
|
<div>
|
|
983
1004
|
${renderFieldset(context)}
|
|
984
1005
|
<div class="popup-wrapper">
|
|
@@ -991,6 +1012,8 @@ function renderControl(context) {
|
|
|
991
1012
|
<div
|
|
992
1013
|
class="listbox"
|
|
993
1014
|
role="listbox"
|
|
1015
|
+
aria-multiselectable="${(x) => x.multiple}"
|
|
1016
|
+
aria-required="${(x) => x.required}"
|
|
994
1017
|
${ref.ref("_listbox")}
|
|
995
1018
|
@click="${(x, c) => x._onListboxClick(c.event)}"
|
|
996
1019
|
@mousedown="${() => false}"
|