@vonage/vivid 3.51.0 → 3.53.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/README.md +1 -1
- 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/alert/index.cjs +3 -3
- package/alert/index.js +3 -3
- package/appearance-ui/index.cjs +19 -11
- package/appearance-ui/index.js +19 -11
- package/audio-player/index.cjs +4 -3
- package/audio-player/index.js +4 -3
- package/avatar/index.cjs +1 -1
- package/avatar/index.js +1 -1
- package/badge/index.cjs +1 -1
- package/badge/index.js +1 -1
- package/banner/index.cjs +2 -2
- package/banner/index.js +2 -2
- package/breadcrumb-item/index.cjs +1 -1
- package/breadcrumb-item/index.js +1 -1
- package/button/index.cjs +2 -2
- package/button/index.js +2 -2
- package/card/index.cjs +2 -2
- package/card/index.js +2 -2
- package/checkbox/index.cjs +3 -2
- package/checkbox/index.js +3 -2
- package/combobox/index.cjs +5 -8
- package/combobox/index.js +5 -8
- package/custom-elements.json +2310 -769
- package/data-grid/index.cjs +1 -1
- package/data-grid/index.js +1 -1
- package/date-picker/index.cjs +7 -9
- package/date-picker/index.js +7 -9
- package/date-range-picker/index.cjs +7 -9
- package/date-range-picker/index.js +7 -9
- package/dial-pad/index.cjs +33 -0
- package/dial-pad/index.js +31 -0
- package/dialog/index.cjs +4 -4
- package/dialog/index.js +4 -4
- package/divider/index.cjs +1 -1
- package/divider/index.js +1 -1
- package/elevation/index.cjs +1 -1
- package/elevation/index.js +1 -1
- package/empty-state/index.cjs +2 -2
- package/empty-state/index.js +2 -2
- package/fab/index.cjs +2 -2
- package/fab/index.js +2 -2
- package/file-picker/index.cjs +4 -5
- package/file-picker/index.js +4 -5
- package/header/index.cjs +2 -2
- package/header/index.js +2 -2
- package/icon/index.cjs +1 -1
- package/icon/index.js +1 -1
- package/index.cjs +135 -123
- package/index.js +48 -46
- package/layout/index.cjs +1 -1
- package/layout/index.js +1 -1
- package/lib/avatar/definition.d.ts +1 -1
- package/lib/button/button.d.ts +1 -0
- package/lib/button/definition.d.ts +1 -1
- package/lib/calendar-event/definition.d.ts +1 -1
- package/lib/components.d.ts +3 -0
- package/lib/dial-pad/definition.d.ts +3 -0
- package/lib/dial-pad/dial-pad.d.ts +14 -0
- package/lib/dial-pad/dial-pad.template.d.ts +4 -0
- package/lib/dial-pad/locale.d.ts +18 -0
- package/lib/enums.d.ts +6 -0
- package/lib/layout/definition.d.ts +1 -1
- package/lib/menu-item/menu-item.d.ts +3 -0
- package/lib/range-slider/definition.d.ts +3 -0
- package/lib/range-slider/locale.d.ts +4 -0
- package/lib/range-slider/range-slider.d.ts +32 -0
- package/lib/range-slider/range-slider.form-associated.d.ts +10 -0
- package/lib/range-slider/range-slider.template.d.ts +4 -0
- package/lib/range-slider/utils/lerp.d.ts +2 -0
- package/lib/range-slider/utils/roundToStepValue.d.ts +1 -0
- package/lib/slider/slider.template.d.ts +1 -0
- package/lib/split-button/definition.d.ts +1 -1
- package/lib/text-anchor/definition.d.ts +1 -0
- package/lib/text-anchor/text-anchor.d.ts +5 -0
- package/lib/video-player/definition.d.ts +3 -0
- package/lib/video-player/locale.d.ts +1 -0
- package/lib/video-player/video-player.d.ts +17 -0
- package/lib/video-player/video-player.template.d.ts +4 -0
- package/listbox/index.cjs +25 -24
- package/listbox/index.js +25 -24
- package/locales/en-GB.cjs +34 -0
- package/locales/en-GB.js +34 -0
- package/locales/en-US.cjs +202 -0
- package/locales/en-US.js +202 -0
- package/locales/ja-JP.cjs +202 -1
- package/locales/ja-JP.js +202 -1
- package/locales/zh-CN.cjs +203 -0
- package/locales/zh-CN.js +203 -0
- package/menu/index.cjs +7 -7
- package/menu/index.js +7 -7
- package/menu-item/index.cjs +4 -4
- package/menu-item/index.js +4 -4
- package/nav/index.cjs +1 -1
- package/nav/index.js +1 -1
- package/nav-disclosure/index.cjs +2 -2
- package/nav-disclosure/index.js +2 -2
- package/nav-item/index.cjs +2 -2
- package/nav-item/index.js +2 -2
- package/note/index.cjs +2 -2
- package/note/index.js +2 -2
- package/number-field/index.cjs +5 -6
- package/number-field/index.js +5 -6
- package/option/index.cjs +2 -2
- package/option/index.js +2 -2
- package/package.json +34 -34
- package/pagination/index.cjs +3 -3
- package/pagination/index.js +3 -3
- package/popup/index.cjs +4 -4
- package/popup/index.js +4 -4
- package/progress/index.cjs +1 -1
- package/progress/index.js +1 -1
- package/progress-ring/index.cjs +1 -1
- package/progress-ring/index.js +1 -1
- package/radio/index.cjs +1 -1
- package/radio/index.js +1 -1
- package/radio-group/index.cjs +1 -1
- package/radio-group/index.js +1 -1
- package/range-slider/index.cjs +22 -0
- package/range-slider/index.js +20 -0
- package/select/index.cjs +7 -6
- package/select/index.js +7 -6
- package/selectable-box/index.cjs +5 -4
- package/selectable-box/index.js +5 -4
- package/shared/Reflector.cjs +5 -1
- package/shared/Reflector.js +5 -1
- package/shared/affix.cjs +11 -4
- package/shared/affix.js +12 -4
- package/shared/anchored.cjs +8 -2
- package/shared/anchored.js +8 -2
- package/shared/applyMixinsWithObservables.cjs +15 -0
- package/shared/applyMixinsWithObservables.js +13 -0
- package/shared/definition.cjs +9 -4
- package/shared/definition.js +9 -4
- package/shared/definition10.cjs +5 -5
- package/shared/definition10.js +5 -5
- package/shared/definition11.cjs +77 -49
- package/shared/definition11.js +78 -50
- package/shared/definition12.cjs +12 -14
- package/shared/definition12.js +12 -14
- package/shared/definition13.cjs +118 -75
- package/shared/definition13.js +118 -75
- package/shared/definition14.cjs +34 -33
- package/shared/definition14.js +34 -33
- package/shared/definition15.cjs +24 -12
- package/shared/definition15.js +24 -12
- package/shared/definition16.cjs +38 -43
- package/shared/definition16.js +38 -43
- package/shared/definition17.cjs +126 -66
- package/shared/definition17.js +127 -67
- package/shared/definition18.cjs +31 -15
- package/shared/definition18.js +31 -15
- package/shared/definition19.cjs +117 -81
- package/shared/definition19.js +117 -81
- package/shared/definition2.cjs +10 -5
- package/shared/definition2.js +10 -5
- package/shared/definition20.cjs +187 -227
- package/shared/definition20.js +183 -223
- package/shared/definition21.cjs +262 -69
- package/shared/definition21.js +261 -67
- package/shared/definition22.cjs +66 -61
- package/shared/definition22.js +64 -60
- package/shared/definition23.cjs +42 -77
- package/shared/definition23.js +41 -76
- package/shared/definition24.cjs +65 -2350
- package/shared/definition24.js +64 -2349
- package/shared/definition25.cjs +2402 -48
- package/shared/definition25.js +2401 -47
- package/shared/definition26.cjs +62 -28
- package/shared/definition26.js +61 -27
- package/shared/definition27.cjs +28 -54
- package/shared/definition27.js +27 -53
- package/shared/definition28.cjs +39 -819
- package/shared/definition28.js +38 -817
- package/shared/definition29.cjs +893 -54
- package/shared/definition29.js +893 -55
- package/shared/definition3.cjs +7 -10
- package/shared/definition3.js +7 -10
- package/shared/definition30.cjs +69 -85
- package/shared/definition30.js +68 -84
- package/shared/definition31.cjs +86 -23
- package/shared/definition31.js +86 -23
- package/shared/definition32.cjs +24 -14
- package/shared/definition32.js +23 -13
- package/shared/definition33.cjs +11 -53
- package/shared/definition33.js +10 -52
- package/shared/definition34.cjs +28 -500
- package/shared/definition34.js +28 -500
- package/shared/definition35.cjs +447 -194
- package/shared/definition35.js +447 -192
- package/shared/definition36.cjs +258 -188
- package/shared/definition36.js +255 -187
- package/shared/definition37.cjs +204 -78
- package/shared/definition37.js +203 -76
- package/shared/definition38.cjs +55 -51
- package/shared/definition38.js +52 -49
- package/shared/definition39.cjs +65 -423
- package/shared/definition39.js +64 -422
- package/shared/definition4.cjs +24 -12
- package/shared/definition4.js +24 -12
- package/shared/definition40.cjs +447 -35
- package/shared/definition40.js +444 -32
- package/shared/definition41.cjs +35 -678
- package/shared/definition41.js +34 -677
- package/shared/definition42.cjs +544 -99
- package/shared/definition42.js +543 -98
- package/shared/definition43.cjs +696 -77
- package/shared/definition43.js +695 -76
- package/shared/definition44.cjs +113 -563
- package/shared/definition44.js +112 -561
- package/shared/definition45.cjs +77 -117
- package/shared/definition45.js +75 -115
- package/shared/definition46.cjs +474 -86
- package/shared/definition46.js +474 -87
- package/shared/definition47.cjs +140 -23
- package/shared/definition47.js +139 -22
- package/shared/definition48.cjs +132 -57
- package/shared/definition48.js +131 -56
- package/shared/definition49.cjs +18 -524
- package/shared/definition49.js +17 -523
- package/shared/definition5.cjs +20 -17
- package/shared/definition5.js +20 -17
- package/shared/definition50.cjs +73 -25
- package/shared/definition50.js +72 -24
- package/shared/definition51.cjs +506 -99
- package/shared/definition51.js +505 -99
- package/shared/definition52.cjs +29 -277
- package/shared/definition52.js +28 -276
- package/shared/definition53.cjs +97 -256
- package/shared/definition53.js +97 -255
- package/shared/definition54.cjs +287 -769
- package/shared/definition54.js +287 -769
- package/shared/definition55.cjs +305 -105
- package/shared/definition55.js +304 -104
- package/shared/definition56.cjs +841 -81
- package/shared/definition56.js +840 -80
- package/shared/definition57.cjs +153 -69
- package/shared/definition57.js +152 -68
- package/shared/definition58.cjs +138 -299
- package/shared/definition58.js +137 -298
- package/shared/definition59.cjs +72 -27
- package/shared/definition59.js +71 -26
- package/shared/definition6.cjs +4 -5
- package/shared/definition6.js +4 -5
- package/shared/definition60.cjs +279 -1780
- package/shared/definition60.js +278 -1779
- package/shared/definition61.cjs +65870 -11
- package/shared/definition61.js +65869 -11
- package/shared/definition62.cjs +50 -0
- package/shared/definition62.js +46 -0
- package/shared/definition63.cjs +1828 -0
- package/shared/definition63.js +1824 -0
- package/shared/definition7.cjs +8 -6
- package/shared/definition7.js +8 -6
- package/shared/definition8.cjs +27 -20
- package/shared/definition8.js +27 -20
- package/shared/definition9.cjs +7 -10
- package/shared/definition9.js +7 -10
- package/shared/enums.cjs +8 -0
- package/shared/enums.js +8 -1
- package/shared/icon.cjs +7 -2
- package/shared/icon.js +7 -2
- package/shared/index2.cjs +67 -38
- package/shared/index2.js +67 -38
- package/shared/key-codes2.cjs +8 -0
- package/shared/key-codes2.js +5 -1
- package/shared/listbox.cjs +1 -1
- package/shared/listbox.js +1 -1
- package/shared/localization/Locale.d.ts +6 -0
- package/shared/patterns/form-elements/form-elements.d.ts +2 -3
- package/shared/patterns/index.d.ts +0 -1
- package/shared/presentationDate.cjs +140 -81
- package/shared/presentationDate.js +140 -81
- package/shared/slider.template.cjs +71 -0
- package/shared/slider.template.js +67 -0
- package/shared/text-anchor.cjs +6 -0
- package/shared/text-anchor.js +6 -0
- package/shared/text-anchor.template.cjs +33 -33
- package/shared/text-anchor.template.js +33 -33
- package/shared/text-field.cjs +1 -1
- package/shared/text-field.js +1 -1
- package/shared/utils/applyMixinsWithObservables.d.ts +1 -0
- package/side-drawer/index.cjs +1 -1
- package/side-drawer/index.js +1 -1
- package/slider/index.cjs +2 -1
- package/slider/index.js +2 -1
- package/split-button/index.cjs +2 -2
- package/split-button/index.js +2 -2
- package/style.css +1 -0
- package/styles/core/all.css +1 -1
- package/styles/core/theme.css +1 -1
- package/styles/core/typography.css +1 -1
- package/styles/fonts/spezia-variable.css +39 -13
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +4 -2
- package/switch/index.cjs +2 -2
- package/switch/index.js +2 -2
- package/tab/index.cjs +2 -2
- package/tab/index.js +2 -2
- package/tab-panel/index.cjs +1 -1
- package/tab-panel/index.js +1 -1
- package/tabs/index.cjs +4 -4
- package/tabs/index.js +4 -4
- package/tag/index.cjs +2 -2
- package/tag/index.js +2 -2
- package/tag-group/index.cjs +1 -1
- package/tag-group/index.js +1 -1
- package/text-area/index.cjs +4 -3
- package/text-area/index.js +4 -3
- package/text-field/index.cjs +4 -6
- package/text-field/index.js +4 -6
- package/time-picker/index.cjs +8 -10
- package/time-picker/index.js +8 -10
- package/toggletip/index.cjs +5 -5
- package/toggletip/index.js +5 -5
- package/tooltip/index.cjs +5 -5
- package/tooltip/index.js +5 -5
- package/tree-item/index.cjs +2 -2
- package/tree-item/index.js +2 -2
- package/tree-view/index.cjs +1 -1
- package/tree-view/index.js +1 -1
- package/video-player/index.cjs +17 -0
- package/video-player/index.js +15 -0
- package/vivid.api.json +428 -1
- package/focus/index.cjs +0 -7
- package/focus/index.js +0 -5
- package/lib/focus/definition.d.ts +0 -3
- package/lib/focus/focus.d.ts +0 -3
- package/lib/focus/focus.template.d.ts +0 -4
- package/lib/popup/popup.d.ts +0 -21
- package/shared/focus.cjs +0 -8
- package/shared/focus.js +0 -6
- package/shared/focus2.cjs +0 -11
- package/shared/focus2.js +0 -9
- package/shared/patterns/focus.d.ts +0 -3
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { B as Button } from './definition11.js';
|
|
2
|
-
import { P as Popup } from './
|
|
3
|
-
import { T as TextField } from './
|
|
4
|
-
import { D as Divider } from './
|
|
2
|
+
import { P as Popup } from './definition63.js';
|
|
3
|
+
import { T as TextField } from './definition55.js';
|
|
4
|
+
import { D as Divider } from './definition22.js';
|
|
5
5
|
import { h as html, F as FoundationElement, a as attr, o as observable, v as volatile, D as DOM } from './index.js';
|
|
6
6
|
import { r as ref } from './ref.js';
|
|
7
|
+
import { s as slotted } from './slotted.js';
|
|
7
8
|
import { r as repeat } from './repeat.js';
|
|
8
9
|
import { w as when } from './when.js';
|
|
9
10
|
import { c as classNames } from './class-names.js';
|
|
@@ -11,10 +12,10 @@ import './affix.js';
|
|
|
11
12
|
import { a as FormElementHelperText } from './index2.js';
|
|
12
13
|
import { L as Localized } from './localized.js';
|
|
13
14
|
import { T as TrappedFocus } from './trapped-focus.js';
|
|
15
|
+
import { a as applyMixinsWithObservables } from './applyMixinsWithObservables.js';
|
|
14
16
|
import { F as FormAssociated } from './form-associated.js';
|
|
15
|
-
import { a as applyMixins } from './apply-mixins.js';
|
|
16
17
|
|
|
17
|
-
const styles = ":host{display:inline-block}.base{display:inline-block;inline-size:100%}.control{inline-size:100%}.dialog{display:inline-flex;flex-direction:column;padding:12px;gap:12px}.dialog .footer{display:flex;align-items:center;justify-content:flex-end;padding:8px;gap:8px}.segments{display:flex;gap:24px}.segment{display:flex;flex-direction:column;gap:12px}.segment .header{display:flex;align-items:center;padding-block:8px}.segment .title{display:flex;flex-grow:1;justify-content:center}.segment .title-action{block-size:24px;
|
|
18
|
+
const styles = ":host{display:inline-block}.base{display:inline-block;inline-size:100%}.control{inline-size:100%}.dialog{display:inline-flex;flex-direction:column;padding:12px;gap:12px}.dialog .footer{display:flex;align-items:center;justify-content:flex-end;padding:8px;gap:8px}.segments{display:flex;gap:24px}.segment{display:flex;flex-direction:column;gap:12px}.segment .header{display:flex;align-items:center;padding-block:8px}.segment .title{display:flex;flex-grow:1;justify-content:center}.segment .title-action{border-radius:8px;block-size:24px;font:var(--vvd-typography-base-extended);padding-inline:6px}.calendar{display:flex;flex-direction:column;margin-top:8px;gap:4px}.calendar .calendar-separator{margin-inline:10px}.calendar .calendar-weekdays{display:flex;justify-content:center}.calendar .calendar-weekday{display:inline-flex;align-items:center;justify-content:center;block-size:16px;font:var(--vvd-typography-base-condensed);inline-size:40px}.calendar .calendar-week{display:flex;justify-content:center}.calendar .calendar-day{display:inline-flex;align-items:center;justify-content:center;border-radius:50%;aspect-ratio:1/1;block-size:28px;font:var(--vvd-typography-base);margin-inline:6px;--focus-inset: -2px}.calendar .calendar-day.start,.calendar .calendar-day.end{border:2px solid var(--vvd-color-cta-50);background-color:var(--vvd-color-cta-200)}.calendar .calendar-day:before,.calendar .calendar-day:after{position:absolute;z-index:-1;display:block;width:20px;height:28px}.calendar .calendar-day:before{right:50%}.calendar .calendar-day:after{left:50%}.calendar .calendar-day.range:before,.calendar .calendar-day.range:after{background-color:var(--vvd-color-cta-50)}.calendar .calendar-day.range:not(.start):before,.calendar .calendar-day.range:not(.end):after{content:\"\"}.calendar .calendar-day.outside-month,.calendar .calendar-day:disabled{color:var(--vvd-color-neutral-400)}.months-separator{margin-inline:-12px}.month-grid{display:flex;flex-direction:column;gap:34px}.month-grid .months-row{display:flex;justify-content:center;gap:29px}.month-grid .month{display:inline-flex;align-items:center;justify-content:center;border-radius:50%;aspect-ratio:1/1;block-size:48px;font:var(--vvd-typography-base-extended);text-transform:uppercase}.month-grid .month:disabled{color:var(--vvd-color-neutral-400)}.button{position:relative;padding:0;border:none;background-color:var(--_appearance-color-fill);color:var(--_appearance-color-text);cursor:pointer}.button{--_connotation-color-primary: var(--vvd-date-picker-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-firm: var(--vvd-date-picker-accent-firm, var(--vvd-color-canvas-text));--_connotation-color-faint: var(--vvd-date-picker-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-soft: var(--vvd-date-picker-accent-soft, var(--vvd-color-neutral-100));--_connotation-color-dim: var(--vvd-date-picker-accent-dim, var(--vvd-color-neutral-200));--_connotation-color-pale: var(--vvd-date-picker-accent-pale, var(--vvd-color-neutral-300))}.button{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.button:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}.button:where(.active,:active):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.button:where(.selected):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.button:where(.selected):where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-dim);--_appearance-color-outline: transparent}.button:where(.selected):where(.disabled,:disabled){--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-200);--_appearance-color-outline: transparent}.button:focus-visible{--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));color:var(--vvd-color-canvas-text)}.button.current{border:1px solid var(--vvd-color-neutral-200)}.button:disabled{cursor:not-allowed}\n";
|
|
18
19
|
|
|
19
20
|
function _typeof(obj) {
|
|
20
21
|
"@babel/helpers - typeof";
|
|
@@ -5277,26 +5278,32 @@ function renderDialogHeader(context) {
|
|
|
5277
5278
|
`
|
|
5278
5279
|
)}
|
|
5279
5280
|
<div class="title">
|
|
5280
|
-
${when(
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
|
|
5293
|
-
|
|
5294
|
-
|
|
5295
|
-
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
|
|
5299
|
-
|
|
5281
|
+
${when(
|
|
5282
|
+
(x) => x.titleClickable,
|
|
5283
|
+
html`
|
|
5284
|
+
<button
|
|
5285
|
+
tabindex="1"
|
|
5286
|
+
id="${(x) => `grid-label-${x.id}`}"
|
|
5287
|
+
class="title-action button"
|
|
5288
|
+
aria-live="polite"
|
|
5289
|
+
@click="${(_, c) => c.parent._onTitleActionClick()}"
|
|
5290
|
+
>
|
|
5291
|
+
${(x) => x.title}
|
|
5292
|
+
</button>
|
|
5293
|
+
`
|
|
5294
|
+
)}
|
|
5295
|
+
${when(
|
|
5296
|
+
(x) => !x.titleClickable,
|
|
5297
|
+
html`
|
|
5298
|
+
<div
|
|
5299
|
+
id="${(x) => `grid-label-${x.id}`}"
|
|
5300
|
+
class="title-action"
|
|
5301
|
+
aria-live="polite"
|
|
5302
|
+
>
|
|
5303
|
+
${(x) => x.title}
|
|
5304
|
+
</div>
|
|
5305
|
+
`
|
|
5306
|
+
)}
|
|
5300
5307
|
</div>
|
|
5301
5308
|
|
|
5302
5309
|
${when(
|
|
@@ -5353,9 +5360,8 @@ function renderCalendarGrid(context) {
|
|
|
5353
5360
|
<${dividerTag} class="calendar-separator" role="presentation"></${dividerTag}>
|
|
5354
5361
|
${repeat(
|
|
5355
5362
|
(x) => x.calendar.grid,
|
|
5356
|
-
html`
|
|
5357
|
-
|
|
5358
|
-
${repeat(
|
|
5363
|
+
html` <div class="calendar-week" role="row">
|
|
5364
|
+
${repeat(
|
|
5359
5365
|
(x) => x,
|
|
5360
5366
|
html`
|
|
5361
5367
|
${when(
|
|
@@ -5364,40 +5370,60 @@ function renderCalendarGrid(context) {
|
|
|
5364
5370
|
)}
|
|
5365
5371
|
${when(
|
|
5366
5372
|
(x, c) => !c.parentContext.parentContext.parent._hideDatesOutsideMonth || !x.isOutsideMonth,
|
|
5367
|
-
html`
|
|
5368
|
-
|
|
5369
|
-
|
|
5370
|
-
class="${(x, c) => classNames(
|
|
5373
|
+
html` <span role="gridcell">
|
|
5374
|
+
<button
|
|
5375
|
+
class="${(x, c) => classNames(
|
|
5371
5376
|
"calendar-day",
|
|
5372
5377
|
"button",
|
|
5373
|
-
[
|
|
5374
|
-
|
|
5375
|
-
|
|
5376
|
-
|
|
5377
|
-
[
|
|
5378
|
+
[
|
|
5379
|
+
"current",
|
|
5380
|
+
x.date === c.parentContext.parentContext.parent._currentDate
|
|
5381
|
+
],
|
|
5382
|
+
[
|
|
5383
|
+
"selected",
|
|
5384
|
+
c.parentContext.parentContext.parent._isDateSelected(x.date)
|
|
5385
|
+
],
|
|
5386
|
+
[
|
|
5387
|
+
"range",
|
|
5388
|
+
c.parentContext.parentContext.parent._isDateInSelectedRange(
|
|
5389
|
+
x.date
|
|
5390
|
+
)
|
|
5391
|
+
],
|
|
5392
|
+
[
|
|
5393
|
+
"start",
|
|
5394
|
+
c.parentContext.parentContext.parent._isDateRangeStart(
|
|
5395
|
+
x.date
|
|
5396
|
+
)
|
|
5397
|
+
],
|
|
5398
|
+
[
|
|
5399
|
+
"end",
|
|
5400
|
+
c.parentContext.parentContext.parent._isDateRangeEnd(x.date)
|
|
5401
|
+
],
|
|
5378
5402
|
["outside-month", x.isOutsideMonth]
|
|
5379
5403
|
)}"
|
|
5380
|
-
|
|
5381
|
-
|
|
5382
|
-
|
|
5383
|
-
|
|
5384
|
-
|
|
5385
|
-
|
|
5386
|
-
|
|
5387
|
-
|
|
5388
|
-
|
|
5404
|
+
?disabled="${(x, c) => !c.parentContext.parentContext.parent._isDateInValidRange(
|
|
5405
|
+
x.date
|
|
5406
|
+
)}"
|
|
5407
|
+
tabindex="${(x, c) => x.date === c.parentContext.parentContext.parent._tabbableDate ? 2 : -1}"
|
|
5408
|
+
aria-selected="${(x, c) => c.parentContext.parentContext.parent._isDateAriaSelected(x.date)}"
|
|
5409
|
+
data-date="${(x) => x.date}"
|
|
5410
|
+
@click="${(x, c) => c.parentContext.parentContext.parent._onDateClick(x.date)}"
|
|
5411
|
+
@focus="${(x, c) => c.parentContext.parentContext.parent._onDateFocus(x.date)}"
|
|
5412
|
+
@mouseenter="${(x, c) => c.parentContext.parentContext.parent._onDateMouseEnter(x.date)}"
|
|
5413
|
+
@mouseleave="${(x, c) => c.parentContext.parentContext.parent._onDateMouseLeave(x.date)}"
|
|
5414
|
+
@keydown="${(x, c) => c.parentContext.parentContext.parent._onDateKeydown(
|
|
5389
5415
|
x.date,
|
|
5390
5416
|
c.event
|
|
5391
5417
|
)}"
|
|
5392
|
-
|
|
5393
|
-
|
|
5394
|
-
|
|
5395
|
-
|
|
5418
|
+
>
|
|
5419
|
+
${(x) => x.label}
|
|
5420
|
+
</button>
|
|
5421
|
+
</span>`
|
|
5396
5422
|
)}
|
|
5397
5423
|
</div>
|
|
5398
5424
|
`
|
|
5399
5425
|
)}
|
|
5400
|
-
|
|
5426
|
+
</div>`
|
|
5401
5427
|
)}`;
|
|
5402
5428
|
}
|
|
5403
5429
|
function renderMonthPickerGrid(context) {
|
|
@@ -5419,9 +5445,9 @@ function renderMonthPickerGrid(context) {
|
|
|
5419
5445
|
${repeat(
|
|
5420
5446
|
(x) => x,
|
|
5421
5447
|
html`
|
|
5422
|
-
|
|
5423
|
-
|
|
5424
|
-
|
|
5448
|
+
<span role="gridcell">
|
|
5449
|
+
<button
|
|
5450
|
+
class="${(x, c) => classNames(
|
|
5425
5451
|
"month",
|
|
5426
5452
|
"button",
|
|
5427
5453
|
[
|
|
@@ -5439,24 +5465,33 @@ function renderMonthPickerGrid(context) {
|
|
|
5439
5465
|
)
|
|
5440
5466
|
]
|
|
5441
5467
|
)}"
|
|
5442
|
-
|
|
5443
|
-
|
|
5444
|
-
|
|
5468
|
+
tabindex="${(x, c) => c.parentContext.parentContext.parent._tabbableMonth && areMonthsEqual(
|
|
5469
|
+
x.month,
|
|
5470
|
+
c.parentContext.parentContext.parent._tabbableMonth
|
|
5471
|
+
) ? 2 : -1}"
|
|
5472
|
+
aria-label="${(x) => x.monthName}"
|
|
5473
|
+
aria-selected="${(x, c) => areMonthsEqual(
|
|
5445
5474
|
x.month,
|
|
5446
5475
|
c.parentContext.parentContext.parent._selectedMonth
|
|
5447
5476
|
)}"
|
|
5448
|
-
|
|
5449
|
-
|
|
5450
|
-
|
|
5451
|
-
|
|
5452
|
-
|
|
5477
|
+
data-month="${(x) => monthToStr(x.month)}"
|
|
5478
|
+
?disabled="${(x, c) => !c.parentContext.parentContext.parent._isMonthInValidRange(
|
|
5479
|
+
x.month
|
|
5480
|
+
)}"
|
|
5481
|
+
@click="${(x, c) => c.parentContext.parentContext.parent._onMonthClick(
|
|
5482
|
+
x.month
|
|
5483
|
+
)}"
|
|
5484
|
+
@focus="${(x, c) => c.parentContext.parentContext.parent._onMonthFocus(
|
|
5485
|
+
x.month
|
|
5486
|
+
)}"
|
|
5487
|
+
@keydown="${(x, c) => c.parentContext.parentContext.parent._onMonthKeydown(
|
|
5453
5488
|
x.month,
|
|
5454
5489
|
c.event
|
|
5455
5490
|
)}"
|
|
5456
|
-
|
|
5457
|
-
|
|
5458
|
-
|
|
5459
|
-
|
|
5491
|
+
>
|
|
5492
|
+
${(x) => x.label}
|
|
5493
|
+
</button>
|
|
5494
|
+
</span>
|
|
5460
5495
|
`
|
|
5461
5496
|
)}
|
|
5462
5497
|
</div>
|
|
@@ -5483,6 +5518,11 @@ const DatePickerBaseTemplate = (context, _) => {
|
|
|
5483
5518
|
@input="${(x, c) => x._onTextFieldInput(c.event)}"
|
|
5484
5519
|
@change="${(x) => x._onTextFieldChange()}"
|
|
5485
5520
|
>
|
|
5521
|
+
<slot
|
|
5522
|
+
slot="${(x) => x._helperTextSlottedContent?.length ? "helper-text" : void 0}"
|
|
5523
|
+
name="helper-text"
|
|
5524
|
+
${slotted("_helperTextSlottedContent")}
|
|
5525
|
+
></slot>
|
|
5486
5526
|
<${buttonTag}
|
|
5487
5527
|
id="calendar-button"
|
|
5488
5528
|
${ref("_calendarButtonEl")}
|
|
@@ -5506,18 +5546,17 @@ const DatePickerBaseTemplate = (context, _) => {
|
|
|
5506
5546
|
<div class="segments">
|
|
5507
5547
|
${repeat(
|
|
5508
5548
|
(x) => x._segments,
|
|
5509
|
-
html`
|
|
5510
|
-
|
|
5511
|
-
|
|
5512
|
-
${when(
|
|
5549
|
+
html` <div class="segment">
|
|
5550
|
+
${renderDialogHeader(context)}
|
|
5551
|
+
${when(
|
|
5513
5552
|
(x) => x.type === "month-picker",
|
|
5514
5553
|
html`${renderMonthPickerGrid(context)}`
|
|
5515
5554
|
)}
|
|
5516
|
-
|
|
5555
|
+
${when(
|
|
5517
5556
|
(x) => x.type === "calendar",
|
|
5518
5557
|
html`${renderCalendarGrid(context)}`
|
|
5519
5558
|
)}
|
|
5520
|
-
|
|
5559
|
+
</div>`
|
|
5521
5560
|
)}
|
|
5522
5561
|
</div>
|
|
5523
5562
|
<div class="footer">
|
|
@@ -5574,7 +5613,12 @@ const buildDateGrid = ({ month, year }, getDay) => {
|
|
|
5574
5613
|
let week = [];
|
|
5575
5614
|
for (let i = 0; i < totalDaysInCalendar; i++) {
|
|
5576
5615
|
const dayIndexInMonth = i - firstDayInWeek;
|
|
5577
|
-
week.push(
|
|
5616
|
+
week.push(
|
|
5617
|
+
gridDate(
|
|
5618
|
+
addDays$1(firstDay, dayIndexInMonth),
|
|
5619
|
+
isOutsideMonth(dayIndexInMonth, daysInMonth)
|
|
5620
|
+
)
|
|
5621
|
+
);
|
|
5578
5622
|
if (week.length === 7) {
|
|
5579
5623
|
grid.push(week);
|
|
5580
5624
|
week = [];
|
|
@@ -5617,7 +5661,9 @@ const yearOfDate = (dateStr) => {
|
|
|
5617
5661
|
|
|
5618
5662
|
class _DatePickerBase extends FoundationElement {
|
|
5619
5663
|
}
|
|
5620
|
-
class FormAssociatedDatePickerBase extends FormAssociated(
|
|
5664
|
+
class FormAssociatedDatePickerBase extends FormAssociated(
|
|
5665
|
+
_DatePickerBase
|
|
5666
|
+
) {
|
|
5621
5667
|
constructor() {
|
|
5622
5668
|
super(...arguments);
|
|
5623
5669
|
this.proxy = document.createElement("input");
|
|
@@ -5722,7 +5768,10 @@ class DatePickerBase extends FormAssociatedDatePickerBase {
|
|
|
5722
5768
|
_adjustSelectedMonthToEnsureVisibilityOf(date) {
|
|
5723
5769
|
const month = monthOfDate(date);
|
|
5724
5770
|
const firstDisplayedMonth = this._selectedMonth;
|
|
5725
|
-
const lastDisplayedMonth = addMonths(
|
|
5771
|
+
const lastDisplayedMonth = addMonths(
|
|
5772
|
+
this._selectedMonth,
|
|
5773
|
+
this._numCalendars - 1
|
|
5774
|
+
);
|
|
5726
5775
|
if (compareMonths(month, firstDisplayedMonth) < 0) {
|
|
5727
5776
|
this._selectedMonth = month;
|
|
5728
5777
|
return true;
|
|
@@ -5832,7 +5881,9 @@ class DatePickerBase extends FormAssociatedDatePickerBase {
|
|
|
5832
5881
|
} else {
|
|
5833
5882
|
this.#openPopupIfPossible();
|
|
5834
5883
|
DOM.processUpdates();
|
|
5835
|
-
const tabbableDate = this.shadowRoot.querySelector(
|
|
5884
|
+
const tabbableDate = this.shadowRoot.querySelector(
|
|
5885
|
+
`[data-date="${this._tabbableDate}"]`
|
|
5886
|
+
);
|
|
5836
5887
|
tabbableDate.focus();
|
|
5837
5888
|
}
|
|
5838
5889
|
}
|
|
@@ -6013,9 +6064,9 @@ class DatePickerBase extends FormAssociatedDatePickerBase {
|
|
|
6013
6064
|
this._lastFocussedDate = date;
|
|
6014
6065
|
}
|
|
6015
6066
|
get _tabbableDate() {
|
|
6016
|
-
const datesInSegments = this._segments.filter(
|
|
6017
|
-
(segment) => segment.
|
|
6018
|
-
);
|
|
6067
|
+
const datesInSegments = this._segments.filter(
|
|
6068
|
+
(segment) => segment.type === "calendar"
|
|
6069
|
+
).flatMap((segment) => segment.calendar.grid.flat().map((d) => d.date));
|
|
6019
6070
|
const candidates = [
|
|
6020
6071
|
this._lastFocussedDate,
|
|
6021
6072
|
...this._getSelectedDates(),
|
|
@@ -6023,7 +6074,10 @@ class DatePickerBase extends FormAssociatedDatePickerBase {
|
|
|
6023
6074
|
...datesInSegments
|
|
6024
6075
|
];
|
|
6025
6076
|
const firstVisibleMonth = this._selectedMonth;
|
|
6026
|
-
const lastVisibleMonth = addMonths(
|
|
6077
|
+
const lastVisibleMonth = addMonths(
|
|
6078
|
+
this._selectedMonth,
|
|
6079
|
+
this._numCalendars - 1
|
|
6080
|
+
);
|
|
6027
6081
|
return candidates.find(
|
|
6028
6082
|
(date) => date && compareMonths(monthOfDate(date), firstVisibleMonth) >= 0 && compareMonths(monthOfDate(date), lastVisibleMonth) <= 0 && this._isDateInValidRange(date)
|
|
6029
6083
|
) ?? null;
|
|
@@ -6151,7 +6205,12 @@ __decorateClass([
|
|
|
6151
6205
|
__decorateClass([
|
|
6152
6206
|
volatile
|
|
6153
6207
|
], DatePickerBase.prototype, "_tabbableMonth", 1);
|
|
6154
|
-
|
|
6208
|
+
applyMixinsWithObservables(
|
|
6209
|
+
DatePickerBase,
|
|
6210
|
+
Localized,
|
|
6211
|
+
FormElementHelperText,
|
|
6212
|
+
TrappedFocus
|
|
6213
|
+
);
|
|
6155
6214
|
|
|
6156
6215
|
const formatPresentationDate = (dateStr, locale) => {
|
|
6157
6216
|
const date = parseDateStr(dateStr);
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const aria = require('./aria2.cjs');
|
|
4
|
+
const index = require('./index.cjs');
|
|
5
|
+
const ref = require('./ref.cjs');
|
|
6
|
+
const classNames = require('./class-names.cjs');
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* This method keeps a given value within the bounds of a min and max value. If the value
|
|
10
|
+
* is larger than the max, the minimum value will be returned. If the value is smaller than the minimum,
|
|
11
|
+
* the maximum will be returned. Otherwise, the value is returned un-changed.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Ensures that a value is between a min and max value. If value is lower than min, min will be returned.
|
|
15
|
+
* If value is greater than max, max will be returned.
|
|
16
|
+
*/
|
|
17
|
+
function limit(min, max, value) {
|
|
18
|
+
return Math.min(Math.max(value, min), max);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const getClasses = ({ disabled, connotation }) => classNames.classNames(
|
|
22
|
+
"control",
|
|
23
|
+
["disabled", Boolean(disabled)],
|
|
24
|
+
[`connotation-${connotation}`, Boolean(connotation)]
|
|
25
|
+
);
|
|
26
|
+
const getMarkersTemplate = (isHorizontal, numMarkers) => {
|
|
27
|
+
const placeholder = isHorizontal ? ["right", "center", "", "100% repeat-x"] : ["bottom", "top", "100%", "repeat-y"];
|
|
28
|
+
return index.html` <div
|
|
29
|
+
class="mark"
|
|
30
|
+
style="
|
|
31
|
+
background: linear-gradient(to ${placeholder[0]}, currentcolor 3px, transparent 0px)
|
|
32
|
+
0px ${placeholder[1]} / ${placeholder[2]} calc((100% - 3px) / ${numMarkers}) ${placeholder[3]}
|
|
33
|
+
"
|
|
34
|
+
></div>`;
|
|
35
|
+
};
|
|
36
|
+
const SliderTemplate = () => {
|
|
37
|
+
return index.html`<template
|
|
38
|
+
role="${(x) => x.ariaLabel ? "presentation" : null}"
|
|
39
|
+
>
|
|
40
|
+
<div
|
|
41
|
+
role="slider"
|
|
42
|
+
tabindex="${(x) => x.disabled ? null : 0}"
|
|
43
|
+
aria-label="${(x) => x.ariaLabel}"
|
|
44
|
+
aria-valuetext="${(x) => x.ariaValuetext || x.valueTextFormatter(x.value)}"
|
|
45
|
+
aria-valuenow="${(x) => x.value}"
|
|
46
|
+
aria-valuemin="${(x) => x.min}"
|
|
47
|
+
aria-valuemax="${(x) => x.max}"
|
|
48
|
+
aria-disabled="${(x) => x.disabled ? true : void 0}"
|
|
49
|
+
aria-orientation="${(x) => x.orientation}"
|
|
50
|
+
class="${getClasses} ${(x) => x.orientation}"
|
|
51
|
+
>
|
|
52
|
+
<div class="positioning-region">
|
|
53
|
+
<div ${ref.ref("track")} class="track">
|
|
54
|
+
<div class="track-start" style="${(x) => x.position}"></div>
|
|
55
|
+
${(x) => x.markers ? getMarkersTemplate(
|
|
56
|
+
x.orientation === aria.Orientation.horizontal,
|
|
57
|
+
Math.floor((x.max - x.min) / x.step)
|
|
58
|
+
) : void 0}
|
|
59
|
+
</div>
|
|
60
|
+
<div
|
|
61
|
+
${ref.ref("thumb")}
|
|
62
|
+
class="thumb-container"
|
|
63
|
+
style="${(x) => x.position}"
|
|
64
|
+
></div>
|
|
65
|
+
</div></div
|
|
66
|
+
></template>`;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
exports.SliderTemplate = SliderTemplate;
|
|
70
|
+
exports.getMarkersTemplate = getMarkersTemplate;
|
|
71
|
+
exports.limit = limit;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { O as Orientation } from './aria2.js';
|
|
2
|
+
import { h as html } from './index.js';
|
|
3
|
+
import { r as ref } from './ref.js';
|
|
4
|
+
import { c as classNames } from './class-names.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* This method keeps a given value within the bounds of a min and max value. If the value
|
|
8
|
+
* is larger than the max, the minimum value will be returned. If the value is smaller than the minimum,
|
|
9
|
+
* the maximum will be returned. Otherwise, the value is returned un-changed.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Ensures that a value is between a min and max value. If value is lower than min, min will be returned.
|
|
13
|
+
* If value is greater than max, max will be returned.
|
|
14
|
+
*/
|
|
15
|
+
function limit(min, max, value) {
|
|
16
|
+
return Math.min(Math.max(value, min), max);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const getClasses = ({ disabled, connotation }) => classNames(
|
|
20
|
+
"control",
|
|
21
|
+
["disabled", Boolean(disabled)],
|
|
22
|
+
[`connotation-${connotation}`, Boolean(connotation)]
|
|
23
|
+
);
|
|
24
|
+
const getMarkersTemplate = (isHorizontal, numMarkers) => {
|
|
25
|
+
const placeholder = isHorizontal ? ["right", "center", "", "100% repeat-x"] : ["bottom", "top", "100%", "repeat-y"];
|
|
26
|
+
return html` <div
|
|
27
|
+
class="mark"
|
|
28
|
+
style="
|
|
29
|
+
background: linear-gradient(to ${placeholder[0]}, currentcolor 3px, transparent 0px)
|
|
30
|
+
0px ${placeholder[1]} / ${placeholder[2]} calc((100% - 3px) / ${numMarkers}) ${placeholder[3]}
|
|
31
|
+
"
|
|
32
|
+
></div>`;
|
|
33
|
+
};
|
|
34
|
+
const SliderTemplate = () => {
|
|
35
|
+
return html`<template
|
|
36
|
+
role="${(x) => x.ariaLabel ? "presentation" : null}"
|
|
37
|
+
>
|
|
38
|
+
<div
|
|
39
|
+
role="slider"
|
|
40
|
+
tabindex="${(x) => x.disabled ? null : 0}"
|
|
41
|
+
aria-label="${(x) => x.ariaLabel}"
|
|
42
|
+
aria-valuetext="${(x) => x.ariaValuetext || x.valueTextFormatter(x.value)}"
|
|
43
|
+
aria-valuenow="${(x) => x.value}"
|
|
44
|
+
aria-valuemin="${(x) => x.min}"
|
|
45
|
+
aria-valuemax="${(x) => x.max}"
|
|
46
|
+
aria-disabled="${(x) => x.disabled ? true : void 0}"
|
|
47
|
+
aria-orientation="${(x) => x.orientation}"
|
|
48
|
+
class="${getClasses} ${(x) => x.orientation}"
|
|
49
|
+
>
|
|
50
|
+
<div class="positioning-region">
|
|
51
|
+
<div ${ref("track")} class="track">
|
|
52
|
+
<div class="track-start" style="${(x) => x.position}"></div>
|
|
53
|
+
${(x) => x.markers ? getMarkersTemplate(
|
|
54
|
+
x.orientation === Orientation.horizontal,
|
|
55
|
+
Math.floor((x.max - x.min) / x.step)
|
|
56
|
+
) : void 0}
|
|
57
|
+
</div>
|
|
58
|
+
<div
|
|
59
|
+
${ref("thumb")}
|
|
60
|
+
class="thumb-container"
|
|
61
|
+
style="${(x) => x.position}"
|
|
62
|
+
></div>
|
|
63
|
+
</div></div
|
|
64
|
+
></template>`;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export { SliderTemplate as S, getMarkersTemplate as g, limit as l };
|
package/shared/text-anchor.cjs
CHANGED
|
@@ -28,6 +28,12 @@ class TextAnchor extends anchor.Anchor {
|
|
|
28
28
|
__decorateClass([
|
|
29
29
|
index.attr
|
|
30
30
|
], TextAnchor.prototype, "text", 2);
|
|
31
|
+
__decorateClass([
|
|
32
|
+
index.attr
|
|
33
|
+
], TextAnchor.prototype, "connotation", 2);
|
|
34
|
+
__decorateClass([
|
|
35
|
+
index.attr
|
|
36
|
+
], TextAnchor.prototype, "appearance", 2);
|
|
31
37
|
applyMixins.applyMixins(TextAnchor, affix.AffixIcon);
|
|
32
38
|
|
|
33
39
|
exports.TextAnchor = TextAnchor;
|
package/shared/text-anchor.js
CHANGED
|
@@ -26,6 +26,12 @@ class TextAnchor extends Anchor {
|
|
|
26
26
|
__decorateClass([
|
|
27
27
|
attr
|
|
28
28
|
], TextAnchor.prototype, "text", 2);
|
|
29
|
+
__decorateClass([
|
|
30
|
+
attr
|
|
31
|
+
], TextAnchor.prototype, "connotation", 2);
|
|
32
|
+
__decorateClass([
|
|
33
|
+
attr
|
|
34
|
+
], TextAnchor.prototype, "appearance", 2);
|
|
29
35
|
applyMixins(TextAnchor, AffixIcon);
|
|
30
36
|
|
|
31
37
|
export { TextAnchor as T };
|
|
@@ -5,44 +5,44 @@ const index = require('./index.cjs');
|
|
|
5
5
|
const ref = require('./ref.cjs');
|
|
6
6
|
const classNames = require('./class-names.cjs');
|
|
7
7
|
|
|
8
|
-
const getClasses = ({ text }) => classNames.classNames(
|
|
8
|
+
const getClasses = ({ text, connotation, appearance }) => classNames.classNames(
|
|
9
9
|
"control",
|
|
10
|
-
["icon-only", !text]
|
|
10
|
+
["icon-only", !text],
|
|
11
|
+
[`connotation-${connotation}`, Boolean(connotation)],
|
|
12
|
+
[`appearance-${appearance}`, Boolean(appearance)]
|
|
11
13
|
);
|
|
12
14
|
const textAnchorTemplate = (context) => {
|
|
13
15
|
const affixIconTemplate = affix.affixIconTemplateFactory(context);
|
|
14
16
|
return index.html`<a
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
</a>
|
|
45
|
-
`;
|
|
17
|
+
class="${getClasses}"
|
|
18
|
+
download="${(x) => x.download}"
|
|
19
|
+
href="${(x) => x.href}"
|
|
20
|
+
hreflang="${(x) => x.hreflang}"
|
|
21
|
+
ping="${(x) => x.ping}"
|
|
22
|
+
referrerpolicy="${(x) => x.referrerpolicy}"
|
|
23
|
+
rel="${(x) => x.rel}"
|
|
24
|
+
target="${(x) => x.target}"
|
|
25
|
+
type="${(x) => x.type}"
|
|
26
|
+
aria-atomic="${(x) => x.ariaAtomic}"
|
|
27
|
+
aria-busy="${(x) => x.ariaBusy}"
|
|
28
|
+
aria-current="${(x) => x.ariaCurrent}"
|
|
29
|
+
aria-details="${(x) => x.ariaDetails}"
|
|
30
|
+
aria-disabled="${(x) => x.ariaDisabled}"
|
|
31
|
+
aria-errormessage="${(x) => x.ariaErrormessage}"
|
|
32
|
+
aria-expanded="${(x) => x.ariaExpanded}"
|
|
33
|
+
aria-haspopup="${(x) => x.ariaHaspopup}"
|
|
34
|
+
aria-hidden="${(x) => x.ariaHidden}"
|
|
35
|
+
aria-invalid="${(x) => x.ariaInvalid}"
|
|
36
|
+
aria-keyshortcuts="${(x) => x.ariaKeyshortcuts}"
|
|
37
|
+
aria-label="${(x) => x.ariaLabel}"
|
|
38
|
+
aria-live="${(x) => x.ariaLive}"
|
|
39
|
+
aria-relevant="${(x) => x.ariaRelevant}"
|
|
40
|
+
aria-roledescription="${(x) => x.ariaRoledescription}"
|
|
41
|
+
${ref.ref("control")}
|
|
42
|
+
>
|
|
43
|
+
${(x) => affixIconTemplate(x.icon, affix.IconWrapper.Slot)} ${(x) => x.text}
|
|
44
|
+
${(x) => x.getBodyTemplate?.() ?? ""}
|
|
45
|
+
</a> `;
|
|
46
46
|
};
|
|
47
47
|
|
|
48
48
|
exports.textAnchorTemplate = textAnchorTemplate;
|