@vonage/vivid 5.1.0 → 5.3.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-item/definition.cjs +2 -1
- package/accordion-item/definition.js +2 -1
- package/alert/index.cjs +1 -1
- package/alert/index.js +1 -1
- package/audio-player/definition.cjs +41 -6
- package/audio-player/definition.js +41 -6
- package/audio-player/index.cjs +27 -25
- package/audio-player/index.js +88 -62
- package/badge/index.cjs +2 -2
- package/badge/index.js +4 -4
- package/banner/index.cjs +3 -3
- package/banner/index.js +6 -6
- package/breadcrumb-item/index.cjs +1 -1
- package/breadcrumb-item/index.js +1 -1
- package/bundled/affix.cjs +7 -7
- package/bundled/affix.js +5 -5
- package/bundled/anchored.cjs +1 -1
- package/bundled/anchored.js +6 -6
- package/bundled/attribute-binding-behaviour.cjs +1 -1
- package/bundled/attribute-binding-behaviour.js +15 -13
- package/bundled/base-color-picker.cjs +13 -0
- package/bundled/base-color-picker.js +194 -0
- package/bundled/button.cjs +1 -1
- package/bundled/button.js +2 -2
- package/bundled/calendar-picker.template.cjs +1 -1
- package/bundled/calendar-picker.template.js +21 -21
- package/bundled/char-count.cjs +1 -1
- package/bundled/char-count.js +1 -1
- package/bundled/children.cjs +1 -1
- package/bundled/children.js +28 -20
- package/bundled/definition.cjs +3 -3
- package/bundled/definition.js +38 -38
- package/bundled/definition10.cjs +72 -18
- package/bundled/definition10.js +351 -65
- package/bundled/definition11.cjs +19 -10
- package/bundled/definition11.js +66 -37
- package/bundled/definition12.cjs +10 -1
- package/bundled/definition12.js +38 -14
- package/bundled/definition13.cjs +1 -73
- package/bundled/definition13.js +15 -354
- package/bundled/definition15.cjs +1 -1
- package/bundled/definition15.js +1 -1
- package/bundled/definition16.cjs +2 -2
- package/bundled/definition16.js +8 -8
- package/bundled/definition17.cjs +7 -7
- package/bundled/definition17.js +17 -17
- package/bundled/definition19.cjs +17 -14
- package/bundled/definition19.js +85 -77
- package/bundled/definition2.cjs +9 -5
- package/bundled/definition2.js +21 -17
- package/bundled/definition22.cjs +9 -9
- package/bundled/definition22.js +31 -31
- package/bundled/definition3.cjs +1 -1
- package/bundled/definition3.js +1 -1
- package/bundled/definition6.cjs +6 -6
- package/bundled/definition6.js +34 -31
- package/bundled/definition7.cjs +1 -1
- package/bundled/definition7.js +6 -6
- package/bundled/definition8.cjs +2 -2
- package/bundled/definition8.js +4 -4
- package/bundled/definition9.cjs +1 -1
- package/bundled/definition9.js +1 -1
- package/bundled/delegates-aria.cjs +1 -1
- package/bundled/delegates-aria.js +59 -46
- package/bundled/form-associated.cjs +1 -1
- package/bundled/form-associated.js +3 -3
- package/bundled/host-semantics.cjs +1 -1
- package/bundled/host-semantics.js +48 -34
- package/bundled/localized.cjs +1 -1
- package/bundled/localized.js +43 -31
- package/bundled/mixins.cjs +18 -18
- package/bundled/mixins.js +99 -93
- package/bundled/normalize.cjs +1 -0
- package/bundled/normalize.js +7 -0
- package/bundled/picker-field.template.cjs +18 -13
- package/bundled/picker-field.template.js +45 -37
- package/bundled/ref.cjs +1 -1
- package/bundled/ref.js +8 -25
- package/bundled/repeat.cjs +1 -1
- package/bundled/repeat.js +459 -233
- package/bundled/slider.template.cjs +1 -1
- package/bundled/slider.template.js +2 -2
- package/bundled/slotted.cjs +1 -1
- package/bundled/slotted.js +62 -45
- package/bundled/text-field.cjs +1 -1
- package/bundled/text-field.js +1 -1
- package/bundled/time-selection-picker.template.cjs +1 -1
- package/bundled/time-selection-picker.template.js +5 -5
- package/bundled/vivid-element.cjs +1 -1
- package/bundled/vivid-element.js +2126 -1172
- package/bundled/when.cjs +1 -1
- package/bundled/when.js +8 -7
- package/bundled/with-contextual-help.cjs +1 -1
- package/bundled/with-contextual-help.js +17 -7
- package/calendar/definition.cjs +1 -1
- package/calendar/definition.js +2 -2
- package/calendar/index.cjs +1 -1
- package/calendar/index.js +6 -6
- package/calendar-event/index.cjs +1 -1
- package/calendar-event/index.js +1 -1
- package/card/definition.cjs +10 -2
- package/card/definition.js +10 -2
- package/card/index.cjs +19 -11
- package/card/index.js +35 -27
- package/color-picker/definition.cjs +1079 -0
- package/color-picker/definition.js +1073 -0
- package/color-picker/index.cjs +127 -0
- package/color-picker/index.js +726 -0
- package/combobox/definition.cjs +13 -6
- package/combobox/definition.js +14 -7
- package/combobox/index.cjs +15 -11
- package/combobox/index.js +82 -75
- package/contextual-help/index.cjs +1 -1
- package/contextual-help/index.js +1 -1
- package/custom-elements.json +1621 -325
- package/data-grid/definition.cjs +862 -27
- package/data-grid/definition.js +863 -28
- package/data-grid/index.cjs +25 -25
- package/data-grid/index.js +175 -168
- package/date-picker/index.cjs +1 -1
- package/date-picker/index.js +2 -2
- package/date-range-picker/index.cjs +1 -1
- package/date-range-picker/index.js +2 -2
- package/date-time-picker/index.cjs +1 -1
- package/date-time-picker/index.js +2 -2
- package/dial-pad/definition.cjs +55 -1
- package/dial-pad/definition.js +56 -2
- package/dial-pad/index.cjs +21 -18
- package/dial-pad/index.js +138 -104
- package/dialog/definition.cjs +4 -1
- package/dialog/definition.js +4 -1
- package/dialog/index.cjs +21 -18
- package/dialog/index.js +43 -40
- package/empty-state/definition.cjs +7 -2
- package/empty-state/definition.js +7 -2
- package/empty-state/index.cjs +10 -5
- package/empty-state/index.js +18 -13
- package/fab/index.cjs +2 -2
- package/fab/index.js +4 -4
- package/file-picker/definition.cjs +16 -7
- package/file-picker/definition.js +17 -8
- package/file-picker/index.cjs +12 -9
- package/file-picker/index.js +103 -93
- package/icon/definition.cjs +10 -6
- package/icon/definition.js +10 -6
- package/index.cjs +4 -0
- package/index.js +1 -0
- package/lib/accordion-item/accordion-item.d.ts +2 -2
- package/lib/action-group/action-group.d.ts +2 -2
- package/lib/alert/alert.d.ts +4 -4
- package/lib/audio-player/audio-player.d.ts +6 -2
- package/lib/avatar/avatar.d.ts +2 -2
- package/lib/badge/badge.d.ts +2 -2
- package/lib/banner/banner.d.ts +6 -6
- package/lib/breadcrumb/breadcrumb.d.ts +2 -2
- package/lib/breadcrumb-item/breadcrumb-item.d.ts +2 -2
- package/lib/button/button.d.ts +6 -6
- package/lib/button/button.template.d.ts +2 -1
- package/lib/calendar/calendar.d.ts +1 -1
- package/lib/calendar-event/calendar-event.d.ts +2 -2
- package/lib/card/card.d.ts +2 -2
- package/lib/checkbox/checkbox.d.ts +12 -12
- package/lib/color-picker/color-picker.d.ts +2420 -0
- package/lib/color-picker/color-picker.template.d.ts +3 -0
- package/lib/color-picker/definition.d.ts +4 -0
- package/lib/color-picker/locale.d.ts +9 -0
- package/lib/combobox/combobox.d.ts +495 -78
- package/lib/components.d.ts +1 -0
- package/lib/data-grid/data-grid-cell.d.ts +4 -4
- package/lib/data-grid/data-grid-row.d.ts +3 -4
- package/lib/data-grid/data-grid.d.ts +1 -2
- package/lib/date-picker/date-picker.d.ts +906 -894
- package/lib/date-range-picker/date-range-picker.d.ts +596 -590
- package/lib/date-time-picker/date-time-picker.d.ts +907 -895
- package/lib/dial-pad/dial-pad.d.ts +3 -2
- package/lib/dial-pad/dial-pad.template.d.ts +1 -1
- package/lib/dial-pad/locale.d.ts +1 -0
- package/lib/dialog/dialog.d.ts +4 -4
- package/lib/divider/divider.d.ts +2 -2
- package/lib/fab/fab.d.ts +2 -2
- package/lib/file-picker/file-picker.d.ts +495 -78
- package/lib/header/header.d.ts +2 -2
- package/lib/menu/menu.d.ts +5 -4
- package/lib/menu-item/menu-item.d.ts +4 -4
- package/lib/nav/nav.d.ts +2 -2
- package/lib/nav-disclosure/nav-disclosure.d.ts +4 -4
- package/lib/nav-item/nav-item.d.ts +4 -4
- package/lib/note/note.d.ts +2 -2
- package/lib/number-field/number-field.d.ts +19 -18
- package/lib/option/option.d.ts +4 -4
- package/lib/pagination/pagination.d.ts +2 -2
- package/lib/progress/progress.d.ts +2 -2
- package/lib/progress-ring/progress-ring.d.ts +2 -2
- package/lib/radio/radio.d.ts +6 -6
- package/lib/radio-group/radio-group.d.ts +2 -2
- package/lib/range-slider/range-slider.d.ts +6 -6
- package/lib/rich-text-editor/menubar/menubar.d.ts +2 -2
- package/lib/rich-text-editor/rich-text-editor.d.ts +2 -2
- package/lib/searchable-select/option-tag.d.ts +2 -2
- package/lib/searchable-select/searchable-select.d.ts +521 -104
- package/lib/select/select.d.ts +484 -67
- package/lib/selectable-box/selectable-box.d.ts +2 -2
- package/lib/simple-color-picker/locale.d.ts +0 -1
- package/lib/simple-color-picker/simple-color-picker.d.ts +47 -821
- package/lib/slider/slider.d.ts +6 -6
- package/lib/split-button/split-button.d.ts +6 -6
- package/lib/switch/switch.d.ts +4 -4
- package/lib/tab/tab.d.ts +6 -6
- package/lib/tab-panel/tab-panel.d.ts +2 -2
- package/lib/tag/tag.d.ts +6 -6
- package/lib/tag-group/tag-group.d.ts +2 -2
- package/lib/tag-name-map.d.ts +2 -1
- package/lib/text-area/text-area.d.ts +17 -16
- package/lib/text-field/text-field.d.ts +19 -18
- package/lib/time-picker/time-picker.d.ts +579 -573
- package/lib/toggletip/toggletip.d.ts +4 -4
- package/lib/tooltip/tooltip.d.ts +2 -2
- package/lib/tree-item/tree-item.d.ts +4 -4
- package/lib/tree-view/tree-view.d.ts +2 -2
- package/lib/video-player/video-player.d.ts +2 -2
- package/locales/de-DE.cjs +15 -3
- package/locales/de-DE.js +15 -3
- package/locales/en-GB.cjs +15 -3
- package/locales/en-GB.js +15 -3
- package/locales/en-US.cjs +15 -3
- package/locales/en-US.js +15 -3
- package/locales/ja-JP.cjs +15 -3
- package/locales/ja-JP.js +15 -3
- package/locales/zh-CN.cjs +15 -3
- package/locales/zh-CN.js +15 -3
- package/menu/definition.cjs +8 -4
- package/menu/definition.js +9 -5
- package/note/index.cjs +2 -2
- package/note/index.js +4 -4
- package/number-field/definition.cjs +3 -3
- package/number-field/definition.js +4 -4
- package/number-field/index.cjs +8 -8
- package/number-field/index.js +41 -40
- package/option/index.cjs +1 -1
- package/option/index.js +1 -1
- package/package.json +5 -5
- package/pagination/definition.cjs +2 -1
- package/pagination/definition.js +2 -1
- package/pagination/index.cjs +12 -12
- package/pagination/index.js +59 -59
- package/progress/index.cjs +1 -1
- package/progress/index.js +1 -1
- package/radio/definition.cjs +9 -9
- package/radio/definition.js +10 -10
- package/radio-group/definition.cjs +2 -1
- package/radio-group/definition.js +2 -1
- package/radio-group/index.cjs +5 -5
- package/radio-group/index.js +80 -77
- package/range-slider/index.cjs +1 -1
- package/range-slider/index.js +1 -1
- package/rich-text-editor/definition.cjs +1 -1
- package/rich-text-editor/definition.js +2 -2
- package/rich-text-editor/index.cjs +2 -2
- package/rich-text-editor/index.js +3 -3
- package/searchable-select/definition.cjs +30 -21
- package/searchable-select/definition.js +31 -22
- package/searchable-select/index.cjs +28 -25
- package/searchable-select/index.js +149 -140
- package/select/definition.cjs +15 -7
- package/select/definition.js +16 -8
- package/selectable-box/definition.cjs +1 -1
- package/selectable-box/definition.js +1 -1
- package/selectable-box/index.cjs +3 -3
- package/selectable-box/index.js +20 -20
- package/shared/aria/aria-change-subscription.d.ts +0 -1
- package/shared/aria/aria-mixin.d.ts +2 -2
- package/shared/aria/delegate-aria-behavior.d.ts +5 -10
- package/shared/aria/delegates-aria.d.ts +3 -3
- package/shared/aria/host-semantics-behavior.d.ts +5 -8
- package/shared/aria/host-semantics.d.ts +3 -3
- package/shared/color-picker/base-color-picker.d.ts +436 -0
- package/shared/color-picker/index.d.ts +1 -0
- package/shared/color-picker/locale.d.ts +3 -0
- package/shared/color-picker/utils.d.ts +1 -0
- package/shared/deprecation/replaced-props.d.ts +317 -2
- package/shared/design-system/defineVividComponent.d.ts +2 -2
- package/shared/feedback/feedback-message.d.ts +2 -2
- package/shared/feedback/mixins.d.ts +4 -4
- package/shared/foundation/button/button.d.ts +4 -4
- package/shared/foundation/form-associated/form-associated.d.ts +4 -4
- package/shared/foundation/vivid-element/vivid-element.d.ts +335 -8
- package/shared/localization/Locale.d.ts +4 -0
- package/shared/patterns/affix.d.ts +4 -4
- package/shared/patterns/anchored.d.ts +4 -4
- package/shared/patterns/char-count/char-count.d.ts +2 -2
- package/shared/patterns/form-elements/form-element.d.ts +4 -4
- package/shared/patterns/form-elements/index.d.ts +1 -0
- package/shared/patterns/form-elements/with-contextual-help.d.ts +7 -6
- package/shared/patterns/form-elements/with-error-text.d.ts +6 -6
- package/shared/patterns/form-elements/with-success-text.d.ts +2 -2
- package/shared/patterns/linkable.d.ts +2 -2
- package/shared/patterns/localized.d.ts +2 -2
- package/shared/patterns/trapped-focus.d.ts +2 -2
- package/shared/picker-field/mixins/calendar-picker.d.ts +454 -451
- package/shared/picker-field/mixins/calendar-picker.template.d.ts +454 -451
- package/shared/picker-field/mixins/inline-time-picker/inline-time-picker.d.ts +2 -2
- package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +600 -594
- package/shared/picker-field/mixins/single-date-picker.d.ts +746 -737
- package/shared/picker-field/mixins/single-value-picker.d.ts +451 -448
- package/shared/picker-field/mixins/time-selection-picker.d.ts +580 -574
- package/shared/picker-field/mixins/time-selection-picker.template.d.ts +579 -573
- package/shared/picker-field/picker-field.d.ts +495 -78
- package/shared/templating/attribute-binding-behaviour.d.ts +3 -4
- package/shared/templating/render-in-light-dom.d.ts +13 -12
- package/side-drawer/index.cjs +1 -1
- package/side-drawer/index.js +1 -1
- package/simple-color-picker/definition.cjs +28 -215
- package/simple-color-picker/definition.js +29 -216
- package/simple-color-picker/index.cjs +9 -21
- package/simple-color-picker/index.js +71 -185
- 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/switch/index.cjs +2 -2
- package/switch/index.js +4 -4
- package/tabs/definition.cjs +1 -1
- package/tabs/definition.js +2 -2
- package/tabs/index.cjs +2 -2
- package/tabs/index.js +16 -16
- package/tag/index.cjs +1 -1
- package/tag/index.js +1 -1
- package/text-area/definition.cjs +1 -1
- package/text-area/definition.js +1 -1
- package/text-area/index.cjs +3 -3
- package/text-area/index.js +9 -9
- package/text-field/definition.cjs +3 -3
- package/text-field/definition.js +4 -4
- 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 +2 -2
- package/toggletip/definition.cjs +1 -1
- package/toggletip/definition.js +2 -2
- package/tree-view/definition.cjs +1 -1
- package/tree-view/definition.js +2 -2
- package/tree-view/index.cjs +2 -2
- package/tree-view/index.js +6 -6
- package/unbundled/_commonjsHelpers.cjs +36 -0
- package/unbundled/_commonjsHelpers.js +32 -0
- package/unbundled/affix.cjs +1 -1
- package/unbundled/affix.js +1 -1
- package/unbundled/attribute-binding-behaviour.cjs +11 -10
- package/unbundled/attribute-binding-behaviour.js +11 -10
- package/unbundled/base-color-picker.cjs +278 -0
- package/unbundled/base-color-picker.js +275 -0
- package/unbundled/button.cjs +1 -1
- package/unbundled/button.js +2 -2
- package/unbundled/calendar-picker.template.cjs +3 -3
- package/unbundled/calendar-picker.template.js +4 -4
- package/unbundled/definition2.cjs +1 -1
- package/unbundled/definition2.js +2 -2
- package/unbundled/definition3.cjs +2 -1
- package/unbundled/definition3.js +2 -1
- package/unbundled/delegates-aria.cjs +67 -33
- package/unbundled/delegates-aria.js +69 -35
- package/unbundled/form-associated.cjs +2 -2
- package/unbundled/form-associated.js +3 -3
- package/unbundled/host-semantics.cjs +47 -22
- package/unbundled/host-semantics.js +48 -23
- package/unbundled/mixins.cjs +34 -27
- package/unbundled/mixins.js +35 -28
- package/unbundled/picker-field.template.cjs +13 -5
- package/unbundled/picker-field.template.js +14 -6
- package/unbundled/text-field.cjs +1 -1
- package/unbundled/text-field.js +1 -1
- package/unbundled/time-selection-picker.template.cjs +4 -4
- package/unbundled/time-selection-picker.template.js +5 -5
- package/unbundled/vivid-element.cjs +22 -15
- package/unbundled/vivid-element.js +23 -15
- package/unbundled/with-contextual-help.cjs +11 -0
- package/unbundled/with-contextual-help.js +11 -0
- package/video-player/definition.cjs +69007 -1
- package/video-player/definition.js +69007 -1
- package/video-player/index.cjs +35 -35
- package/video-player/index.js +1358 -1384
- package/visually-hidden/index.cjs +1 -1
- package/visually-hidden/index.js +1 -1
- package/vivid.api.json +347 -69
package/pagination/index.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const h=require("../bundled/definition3.cjs"),s=require("../bundled/vivid-element.cjs"),m=require("../bundled/localized.cjs"),l=require("../bundled/enums.cjs"),g=require("../bundled/ref.cjs"),I=require("../bundled/children.cjs"),z=require("../bundled/repeat.cjs"),y=require("../bundled/slotted.cjs"),b=require("../bundled/when.cjs"),w=require("../bundled/class-names.cjs"),S=".control{display:inline-flex;justify-content:space-between}.control:not(.shape-pill){border-radius:4px}.control.shape-pill{border-radius:16px}.buttons-wrapper{display:flex;column-gap:4px}.vwc-pagination-button[size=super-condensed]{--base-size: calc(1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.vwc-pagination-button[size=condensed]{--base-size: calc(1px*(32 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.vwc-pagination-button[size=normal]{--base-size: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.vwc-pagination-button::part(button){padding-inline:0}.dots{align-self:center;text-align:center}.dots:not(.size-super-condensed){font:var(--vvd-typography-base-bold)}.dots.size-super-condensed{font:var(--vvd-typography-base-condensed-bold);inline-size:calc(1px*(24 + 4*clamp(-1,var(--vvd-size-density, 0),2)))}.dots.size-condensed{inline-size:calc(1px*(32 + 4*clamp(-1,var(--vvd-size-density, 0),2)))}.dots.size-normal{inline-size:calc(1px*(40 + 4*clamp(-1,var(--vvd-size-density, 0),2)))}";var B=Object.defineProperty,_=Object.getOwnPropertyDescriptor,r=(i,e,t,o)=>{for(var n=o>1?void 0:o?_(e,t):e,c=i.length-1,d;c>=0;c--)(d=i[c])&&(n=(o?d(e,t,n):d(n))||n);return o&&n&&B(e,t,n),n};const p=7,f={fromView:i=>parseInt(i,10),toView:i=>i.toString()};class a extends m.Localized(s.VividElement){constructor(){super(),this.navIcons=!1,this.total=0,this.selectedIndex=0,this.addEventListener("tabpressed",e=>{const{value:t,shiftKey:o}=e.detail,n=this.paginationButtons.findIndex($=>Number($.label)===t),c=o?-1:1,d=n+c;if(d<0)return this.prevButton.focus();if(d>this.paginationButtons.length-1)return this.nextButton.focus();this.paginationButtons&&this.paginationButtons[n+c].focus()})}get pagesList(){return new Array(this.total<p?this.total:p).fill(0).map((e,t,o)=>{if(t===0)return 1;if(t===o.length-1)return this.total;if(this.selectedIndex!==void 0&&this.total>p){if(this.selectedIndex<4&&t===p-2)return"...";if(this.selectedIndex>=4&&this.selectedIndex<=this.total-5){if(t>1&&t<p-2)return this.selectedIndex+(t-2);if(t===1||t===p-2)return"..."}if(this.selectedIndex>this.total-5){if(t>1)return this.total-(6-t);if(t===1)return"..."}}return t+1})}totalChanged(e,t){if(t<0){this.total=0;return}this.#t()}selectedIndexChanged(e,t){e!==void 0&&(this.$emit("pagination-change",{selectedIndex:t,total:this.total,oldIndex:e}),this.#t())}paginationButtonsChanged(e,t){t.forEach(o=>{o.shadowRoot.querySelector("button").setAttribute("part","button")})}get#e(){return Math.max(0,Math.min(this.selectedIndex??0,this.total-1))}#t(){this.selectedIndex!==this.#e&&window.queueMicrotask(()=>{this.selectedIndex!==this.#e&&(this.selectedIndex=this.#e)})}}r([s.attr],a.prototype,"size",2);r([s.attr],a.prototype,"shape",2);r([s.observable],a.prototype,"paginationButtons",2);r([s.observable],a.prototype,"prevButton",2);r([s.observable],a.prototype,"nextButton",2);r([s.attr({attribute:"nav-icons",mode:"boolean"})],a.prototype,"navIcons",2);r([s.volatile],a.prototype,"pagesList",1);r([s.attr({mode:"reflect",converter:f})],a.prototype,"total",2);r([s.attr({mode:"reflect",converter:f,attribute:"selected-index"})],a.prototype,"selectedIndex",2);const P=[l.Size.SuperCondensed,l.Size.Condensed,l.Size.Normal],L=[l.Shape.Rounded,l.Shape.Pill],x=(i,{parent:e})=>e.selectedIndex=Number(i)-1,E=(i,{event:e,parent:t})=>{(e.key===" "||e.key==="Enter")&&x(i,{parent:t}),e.key==="Tab"&&e.target.dispatchEvent(new CustomEvent("tabpressed",{detail:{value:i,shiftKey:e.shiftKey},bubbles:!0,composed:!0}))},q=i=>w.classNames("control");function C(i,{parent:e}){return e.selectedIndex===Number(i)-1?"filled":"ghost"}const D=i=>s.html` ${b.when(e=>e!=="...",s.html`
|
|
2
2
|
<${i} class="vwc-pagination-button"
|
|
3
3
|
label="${e=>e}"
|
|
4
4
|
appearance="${C}"
|
|
5
5
|
size="${(e,{parent:t})=>u(t)}"
|
|
6
|
-
shape="${(e,{parent:t})=>
|
|
7
|
-
style="inline-size: ${e=>
|
|
6
|
+
shape="${(e,{parent:t})=>v(t)}"
|
|
7
|
+
style="inline-size: ${e=>N(e)};"
|
|
8
8
|
tabindex="0"
|
|
9
9
|
aria-label="${(e,{parent:t})=>t.locale.pagination.goToPageLabel(e)}"
|
|
10
10
|
aria-current="${(e,{parent:t})=>t.selectedIndex===Number(e)-1}"
|
|
@@ -12,32 +12,32 @@
|
|
|
12
12
|
@keydown="${E}">
|
|
13
13
|
</${i}>
|
|
14
14
|
`)}
|
|
15
|
-
${
|
|
15
|
+
${b.when(e=>e==="...",s.html` <div
|
|
16
16
|
class="dots size-${(e,{parent:t})=>u(t)}"
|
|
17
17
|
aria-hidden="true"
|
|
18
18
|
>
|
|
19
19
|
...
|
|
20
|
-
</div>`)}`,u=i=>!i.size||!P.includes(i.size)?l.Size.SuperCondensed:i.size,
|
|
20
|
+
</div>`)}`,u=i=>!i.size||!P.includes(i.size)?l.Size.SuperCondensed:i.size,v=i=>!i.shape||!L.includes(i.shape)?l.Shape.Rounded:i.shape,N=i=>`calc(var(--base-size) + ${String(i).length-1}ch)`,A=i=>{const e=i.tagFor(h.Button),t=i.tagFor(h.Button,!0),o=D(e);return s.html`
|
|
21
21
|
<div class="${q}">
|
|
22
|
-
<${e} class="prev-button" ${
|
|
22
|
+
<${e} class="prev-button" ${g.ref("prevButton")}
|
|
23
23
|
label="${n=>n.navIcons?null:"Previous"}"
|
|
24
24
|
icon="${n=>n.navIcons?"chevron-left-line":null}"
|
|
25
25
|
size="${u}"
|
|
26
|
-
shape="${
|
|
26
|
+
shape="${v}"
|
|
27
27
|
?disabled="${n=>n.total===0||n.selectedIndex===0}"
|
|
28
28
|
@click="${n=>n.selectedIndex!==void 0&&n.selectedIndex--}"
|
|
29
29
|
aria-label="${n=>n.locale.pagination.previousPageLabel}"
|
|
30
30
|
></${e}>
|
|
31
|
-
<div id="buttons-wrapper" class="buttons-wrapper" ${
|
|
32
|
-
${
|
|
31
|
+
<div id="buttons-wrapper" class="buttons-wrapper" ${I.children({property:"paginationButtons",filter:y.elements(t)})}>
|
|
32
|
+
${z.repeat(n=>n.pagesList,o,{positioning:!0})}
|
|
33
33
|
</div>
|
|
34
|
-
<${e} class="next-button" ${
|
|
34
|
+
<${e} class="next-button" ${g.ref("nextButton")}
|
|
35
35
|
label="${n=>n.navIcons?null:"Next"}"
|
|
36
36
|
icon="${n=>n.navIcons?"chevron-right-line":null}"
|
|
37
37
|
size="${u}"
|
|
38
|
-
shape="${
|
|
38
|
+
shape="${v}"
|
|
39
39
|
?disabled="${n=>n.total===0||n.selectedIndex===n.total-1}"
|
|
40
40
|
@click="${n=>n.selectedIndex!==void 0&&n.selectedIndex++}"
|
|
41
41
|
aria-label="${n=>n.locale.pagination.nextPageLabel}"
|
|
42
42
|
></${e}>
|
|
43
|
-
</div>`},O=s.defineVividComponent("pagination",a,
|
|
43
|
+
</div>`},O=s.defineVividComponent("pagination",a,A,[h.buttonDefinition],{styles:S}),R=s.createRegisterFunction(O);R();
|
package/pagination/index.js
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { B as
|
|
1
|
+
import { B as b, b as z } from "../bundled/definition3.js";
|
|
2
2
|
import { V as w, a as c, o as g, v as B, h as p, c as S, d as _ } from "../bundled/vivid-element.js";
|
|
3
3
|
import { L as P } from "../bundled/localized.js";
|
|
4
4
|
import { a as u, b as v } from "../bundled/enums.js";
|
|
5
|
-
import {
|
|
6
|
-
import { c as
|
|
7
|
-
import { r as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
5
|
+
import { r as m } from "../bundled/ref.js";
|
|
6
|
+
import { c as L } from "../bundled/children.js";
|
|
7
|
+
import { r as C } from "../bundled/repeat.js";
|
|
8
|
+
import { e as E } from "../bundled/slotted.js";
|
|
9
|
+
import { w as x } from "../bundled/when.js";
|
|
10
|
+
import { c as D } from "../bundled/class-names.js";
|
|
11
11
|
const A = ".control{display:inline-flex;justify-content:space-between}.control:not(.shape-pill){border-radius:4px}.control.shape-pill{border-radius:16px}.buttons-wrapper{display:flex;column-gap:4px}.vwc-pagination-button[size=super-condensed]{--base-size: calc(1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.vwc-pagination-button[size=condensed]{--base-size: calc(1px*(32 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.vwc-pagination-button[size=normal]{--base-size: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) }.vwc-pagination-button::part(button){padding-inline:0}.dots{align-self:center;text-align:center}.dots:not(.size-super-condensed){font:var(--vvd-typography-base-bold)}.dots.size-super-condensed{font:var(--vvd-typography-base-condensed-bold);inline-size:calc(1px*(24 + 4*clamp(-1,var(--vvd-size-density, 0),2)))}.dots.size-condensed{inline-size:calc(1px*(32 + 4*clamp(-1,var(--vvd-size-density, 0),2)))}.dots.size-normal{inline-size:calc(1px*(40 + 4*clamp(-1,var(--vvd-size-density, 0),2)))}";
|
|
12
|
-
var N = Object.defineProperty, O = Object.getOwnPropertyDescriptor,
|
|
13
|
-
for (var
|
|
14
|
-
(l = s[r]) && (
|
|
15
|
-
return
|
|
12
|
+
var N = Object.defineProperty, O = Object.getOwnPropertyDescriptor, o = (s, e, t, i) => {
|
|
13
|
+
for (var n = i > 1 ? void 0 : i ? O(e, t) : e, r = s.length - 1, l; r >= 0; r--)
|
|
14
|
+
(l = s[r]) && (n = (i ? l(e, t, n) : l(n)) || n);
|
|
15
|
+
return i && n && N(e, t, n), n;
|
|
16
16
|
};
|
|
17
|
-
const d = 7,
|
|
17
|
+
const d = 7, $ = {
|
|
18
18
|
fromView: (s) => parseInt(s, 10),
|
|
19
19
|
toView: (s) => s.toString()
|
|
20
20
|
};
|
|
21
|
-
class
|
|
21
|
+
class a extends P(w) {
|
|
22
22
|
constructor() {
|
|
23
23
|
super(), this.navIcons = !1, this.total = 0, this.selectedIndex = 0, this.addEventListener("tabpressed", (e) => {
|
|
24
|
-
const { value: t, shiftKey:
|
|
25
|
-
(
|
|
26
|
-
), r =
|
|
24
|
+
const { value: t, shiftKey: i } = e.detail, n = this.paginationButtons.findIndex(
|
|
25
|
+
(y) => Number(y.label) === t
|
|
26
|
+
), r = i ? -1 : 1, l = n + r;
|
|
27
27
|
if (l < 0)
|
|
28
28
|
return this.prevButton.focus();
|
|
29
29
|
if (l > this.paginationButtons.length - 1)
|
|
30
30
|
return this.nextButton.focus();
|
|
31
|
-
this.paginationButtons && this.paginationButtons[
|
|
31
|
+
this.paginationButtons && this.paginationButtons[n + r].focus();
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
34
|
get pagesList() {
|
|
35
35
|
return new Array(
|
|
36
36
|
this.total < d ? this.total : d
|
|
37
|
-
).fill(0).map((e, t,
|
|
37
|
+
).fill(0).map((e, t, i) => {
|
|
38
38
|
if (t === 0) return 1;
|
|
39
|
-
if (t ===
|
|
39
|
+
if (t === i.length - 1) return this.total;
|
|
40
40
|
if (this.selectedIndex !== void 0 && this.total > d) {
|
|
41
41
|
if (this.selectedIndex < 4 && t === d - 2)
|
|
42
42
|
return "...";
|
|
@@ -68,8 +68,8 @@ class o extends P(w) {
|
|
|
68
68
|
}), this.#t());
|
|
69
69
|
}
|
|
70
70
|
paginationButtonsChanged(e, t) {
|
|
71
|
-
t.forEach((
|
|
72
|
-
|
|
71
|
+
t.forEach((i) => {
|
|
72
|
+
i.shadowRoot.querySelector("button").setAttribute("part", "button");
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
75
|
get #e() {
|
|
@@ -81,54 +81,54 @@ class o extends P(w) {
|
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
-
|
|
84
|
+
o([
|
|
85
85
|
c
|
|
86
|
-
],
|
|
87
|
-
|
|
86
|
+
], a.prototype, "size", 2);
|
|
87
|
+
o([
|
|
88
88
|
c
|
|
89
|
-
],
|
|
90
|
-
|
|
89
|
+
], a.prototype, "shape", 2);
|
|
90
|
+
o([
|
|
91
91
|
g
|
|
92
|
-
],
|
|
93
|
-
|
|
92
|
+
], a.prototype, "paginationButtons", 2);
|
|
93
|
+
o([
|
|
94
94
|
g
|
|
95
|
-
],
|
|
96
|
-
|
|
95
|
+
], a.prototype, "prevButton", 2);
|
|
96
|
+
o([
|
|
97
97
|
g
|
|
98
|
-
],
|
|
99
|
-
|
|
98
|
+
], a.prototype, "nextButton", 2);
|
|
99
|
+
o([
|
|
100
100
|
c({ attribute: "nav-icons", mode: "boolean" })
|
|
101
|
-
],
|
|
102
|
-
|
|
101
|
+
], a.prototype, "navIcons", 2);
|
|
102
|
+
o([
|
|
103
103
|
B
|
|
104
|
-
],
|
|
105
|
-
|
|
106
|
-
c({ mode: "reflect", converter:
|
|
107
|
-
],
|
|
108
|
-
|
|
104
|
+
], a.prototype, "pagesList", 1);
|
|
105
|
+
o([
|
|
106
|
+
c({ mode: "reflect", converter: $ })
|
|
107
|
+
], a.prototype, "total", 2);
|
|
108
|
+
o([
|
|
109
109
|
c({
|
|
110
110
|
mode: "reflect",
|
|
111
|
-
converter:
|
|
111
|
+
converter: $,
|
|
112
112
|
attribute: "selected-index"
|
|
113
113
|
})
|
|
114
|
-
],
|
|
114
|
+
], a.prototype, "selectedIndex", 2);
|
|
115
115
|
const R = [
|
|
116
116
|
u.SuperCondensed,
|
|
117
117
|
u.Condensed,
|
|
118
118
|
u.Normal
|
|
119
|
-
], T = [v.Rounded, v.Pill],
|
|
120
|
-
(e.key === " " || e.key === "Enter") &&
|
|
119
|
+
], T = [v.Rounded, v.Pill], I = (s, { parent: e }) => e.selectedIndex = Number(s) - 1, K = (s, { event: e, parent: t }) => {
|
|
120
|
+
(e.key === " " || e.key === "Enter") && I(s, { parent: t }), e.key === "Tab" && e.target.dispatchEvent(
|
|
121
121
|
new CustomEvent("tabpressed", {
|
|
122
122
|
detail: { value: s, shiftKey: e.shiftKey },
|
|
123
123
|
bubbles: !0,
|
|
124
124
|
composed: !0
|
|
125
125
|
})
|
|
126
126
|
);
|
|
127
|
-
}, M = (s) =>
|
|
127
|
+
}, M = (s) => D("control");
|
|
128
128
|
function V(s, { parent: e }) {
|
|
129
129
|
return e.selectedIndex === Number(s) - 1 ? "filled" : "ghost";
|
|
130
130
|
}
|
|
131
|
-
const j = (s) => p` ${
|
|
131
|
+
const j = (s) => p` ${x(
|
|
132
132
|
(e) => e !== "...",
|
|
133
133
|
p`
|
|
134
134
|
<${s} class="vwc-pagination-button"
|
|
@@ -140,12 +140,12 @@ const j = (s) => p` ${m(
|
|
|
140
140
|
tabindex="0"
|
|
141
141
|
aria-label="${(e, { parent: t }) => t.locale.pagination.goToPageLabel(e)}"
|
|
142
142
|
aria-current="${(e, { parent: t }) => t.selectedIndex === Number(e) - 1}"
|
|
143
|
-
@click="${
|
|
143
|
+
@click="${I}"
|
|
144
144
|
@keydown="${K}">
|
|
145
145
|
</${s}>
|
|
146
146
|
`
|
|
147
147
|
)}
|
|
148
|
-
${
|
|
148
|
+
${x(
|
|
149
149
|
(e) => e === "...",
|
|
150
150
|
p` <div
|
|
151
151
|
class="dots size-${(e, { parent: t }) => h(t)}"
|
|
@@ -153,11 +153,11 @@ ${m(
|
|
|
153
153
|
>
|
|
154
154
|
...
|
|
155
155
|
</div>`
|
|
156
|
-
)}`, h = (s) => !s.size || !R.includes(s.size) ? u.SuperCondensed : s.size, f = (s) => !s.shape || !T.includes(s.shape) ? v.Rounded : s.shape, k = (s) => `calc(var(--base-size) + ${String(s).length - 1}ch)`,
|
|
157
|
-
const e = s.tagFor(
|
|
156
|
+
)}`, h = (s) => !s.size || !R.includes(s.size) ? u.SuperCondensed : s.size, f = (s) => !s.shape || !T.includes(s.shape) ? v.Rounded : s.shape, k = (s) => `calc(var(--base-size) + ${String(s).length - 1}ch)`, F = (s) => {
|
|
157
|
+
const e = s.tagFor(b), t = s.tagFor(b, !0), i = j(e);
|
|
158
158
|
return p`
|
|
159
159
|
<div class="${M}">
|
|
160
|
-
<${e} class="prev-button" ${
|
|
160
|
+
<${e} class="prev-button" ${m("prevButton")}
|
|
161
161
|
label="${(n) => n.navIcons ? null : "Previous"}"
|
|
162
162
|
icon="${(n) => n.navIcons ? "chevron-left-line" : null}"
|
|
163
163
|
size="${h}"
|
|
@@ -166,13 +166,13 @@ ${m(
|
|
|
166
166
|
@click="${(n) => n.selectedIndex !== void 0 && n.selectedIndex--}"
|
|
167
167
|
aria-label="${(n) => n.locale.pagination.previousPageLabel}"
|
|
168
168
|
></${e}>
|
|
169
|
-
<div id="buttons-wrapper" class="buttons-wrapper" ${
|
|
169
|
+
<div id="buttons-wrapper" class="buttons-wrapper" ${L({
|
|
170
170
|
property: "paginationButtons",
|
|
171
|
-
filter:
|
|
171
|
+
filter: E(t)
|
|
172
172
|
})}>
|
|
173
|
-
${
|
|
173
|
+
${C((n) => n.pagesList, i, { positioning: !0 })}
|
|
174
174
|
</div>
|
|
175
|
-
<${e} class="next-button" ${
|
|
175
|
+
<${e} class="next-button" ${m("nextButton")}
|
|
176
176
|
label="${(n) => n.navIcons ? null : "Next"}"
|
|
177
177
|
icon="${(n) => n.navIcons ? "chevron-right-line" : null}"
|
|
178
178
|
size="${h}"
|
|
@@ -182,13 +182,13 @@ ${m(
|
|
|
182
182
|
aria-label="${(n) => n.locale.pagination.nextPageLabel}"
|
|
183
183
|
></${e}>
|
|
184
184
|
</div>`;
|
|
185
|
-
},
|
|
185
|
+
}, W = _(
|
|
186
186
|
"pagination",
|
|
187
|
-
|
|
188
|
-
|
|
187
|
+
a,
|
|
188
|
+
F,
|
|
189
189
|
[z],
|
|
190
190
|
{
|
|
191
191
|
styles: A
|
|
192
192
|
}
|
|
193
|
-
),
|
|
194
|
-
|
|
193
|
+
), q = S(W);
|
|
194
|
+
q();
|
package/progress/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const a=require("../bundled/vivid-element.cjs"),d=require("../bundled/base-progress.cjs"),v=require("../bundled/delegates-aria.cjs"),
|
|
1
|
+
"use strict";const a=require("../bundled/vivid-element.cjs"),d=require("../bundled/base-progress.cjs"),v=require("../bundled/delegates-aria.cjs"),p=require("../bundled/when.cjs"),m=require("../bundled/class-names.cjs"),u=".base{height:6px;align-items:center;margin:0;outline:none}.base:not(.connotation-pacific).connotation-cta{--_connotation-color-primary: var(--vvd-progress-cta-primary, var(--vvd-color-cta-500));--_connotation-color-soft: var(--vvd-progress-cta-soft, var(--vvd-color-cta-100))}.base:not(.connotation-pacific).connotation-alert{--_connotation-color-primary: var(--vvd-progress-alert-primary, var(--vvd-color-alert-500));--_connotation-color-soft: var(--vvd-progress-alert-soft, var(--vvd-color-alert-100))}.base:not(.connotation-pacific).connotation-success{--_connotation-color-primary: var(--vvd-progress-success-primary, var(--vvd-color-success-500));--_connotation-color-soft: var(--vvd-progress-success-soft, var(--vvd-color-success-100))}.base:not(.connotation-pacific):not(.connotation-cta,.connotation-alert,.connotation-success){--_connotation-color-primary: var(--vvd-progress-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-soft: var(--vvd-progress-accent-soft, var(--vvd-color-neutral-100))}.base:not(.connotation-pacific){--_appearance-color-text: var(--_connotation-color-contrast);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.base.connotation-pacific{--_connotation-color-primary: linear-gradient(to right, var(--vvd-color-information-200), var(--vvd-color-cta-600))}.progress{position:relative;display:flex;overflow:hidden;align-items:center;block-size:100%;inline-size:100%}.base:not(.connotation-pacific) .progress{background-color:var(--_appearance-color-fill)}.base.connotation-pacific .progress{background-color:var(--vvd-color-neutral-100)}.base:not(.shape-sharp) .progress{border-radius:4px}.indeterminate{display:flex;border-radius:inherit;background-color:var(--_connotation-color-primary);block-size:100%;inline-size:100%}.determinate{border-radius:inherit;background-color:var(--_connotation-color-primary);block-size:100%;transition:all .2s ease-in-out}.connotation-pacific .determinate{background-image:var(--_connotation-color-primary)}.reverse .determinate{position:absolute;right:0}.paused .determinate{background:var(--vvd-color-neutral-300)}.indicator-1{animation:indeterminate-1 2s infinite;inline-size:30%}.indicator-2{animation:indeterminate-2 2s infinite;inline-size:60%}.indicator-1,.indicator-2{position:absolute;animation-timing-function:cubic-bezier(.4,0,.6,1);background-color:var(--vvd-color-neutral-100);block-size:100%;opacity:0}.connotation-pacific .indicator-1,.connotation-pacific .indicator-2{background-image:var(--_connotation-color-primary)}.paused .indicator-1,.paused .indicator-2{animation-play-state:paused;background-color:var(--_connotation-color-primary)}.reverse .indicator-1,.reverse .indicator-2{animation-direction:reverse}@keyframes indeterminate-1{0%{opacity:1;transform:translate(-100%)}70%{opacity:1;transform:translate(300%)}70.01%{opacity:0}to{opacity:0;transform:translate(300%)}}@keyframes indeterminate-2{0%{opacity:0;transform:translate(-150%)}29.99%{opacity:0}30%{opacity:1;transform:translate(-150%)}to{opacity:1;transform:translate(166.66%)}}";var f=Object.defineProperty,s=(o,n,t,c)=>{for(var r=void 0,i=o.length-1,l;i>=0;i--)(l=o[i])&&(r=l(n,t,r)||r);return r&&f(n,t,r),r};class e extends v.DelegatesAria(d.BaseProgress){constructor(){super(...arguments),this.reverse=!1}}s([a.attr()],e.prototype,"shape");s([a.attr()],e.prototype,"connotation");s([a.attr({mode:"boolean"})],e.prototype,"reverse");const g=({connotation:o,shape:n,reverse:t,paused:c})=>m.classNames("base",[`connotation-${o}`,!!o],[`shape-${n}`,!!n],["reverse",!!t],["paused",!!c]);function b(){return a.html` <span
|
|
2
2
|
class="determinate"
|
|
3
3
|
style="width: ${o=>o.percentComplete}%"
|
|
4
4
|
></span>`}function y(){return a.html` <span class="indeterminate" name="indeterminate">
|
package/progress/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a as i, h as s, c as d, d as m } from "../bundled/vivid-element.js";
|
|
2
2
|
import { B as f } from "../bundled/base-progress.js";
|
|
3
3
|
import { D as u, d as g } from "../bundled/delegates-aria.js";
|
|
4
|
-
import { c as b } from "../bundled/class-names.js";
|
|
5
4
|
import { w as v } from "../bundled/when.js";
|
|
5
|
+
import { c as b } from "../bundled/class-names.js";
|
|
6
6
|
const y = ".base{height:6px;align-items:center;margin:0;outline:none}.base:not(.connotation-pacific).connotation-cta{--_connotation-color-primary: var(--vvd-progress-cta-primary, var(--vvd-color-cta-500));--_connotation-color-soft: var(--vvd-progress-cta-soft, var(--vvd-color-cta-100))}.base:not(.connotation-pacific).connotation-alert{--_connotation-color-primary: var(--vvd-progress-alert-primary, var(--vvd-color-alert-500));--_connotation-color-soft: var(--vvd-progress-alert-soft, var(--vvd-color-alert-100))}.base:not(.connotation-pacific).connotation-success{--_connotation-color-primary: var(--vvd-progress-success-primary, var(--vvd-color-success-500));--_connotation-color-soft: var(--vvd-progress-success-soft, var(--vvd-color-success-100))}.base:not(.connotation-pacific):not(.connotation-cta,.connotation-alert,.connotation-success){--_connotation-color-primary: var(--vvd-progress-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-soft: var(--vvd-progress-accent-soft, var(--vvd-color-neutral-100))}.base:not(.connotation-pacific){--_appearance-color-text: var(--_connotation-color-contrast);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.base.connotation-pacific{--_connotation-color-primary: linear-gradient(to right, var(--vvd-color-information-200), var(--vvd-color-cta-600))}.progress{position:relative;display:flex;overflow:hidden;align-items:center;block-size:100%;inline-size:100%}.base:not(.connotation-pacific) .progress{background-color:var(--_appearance-color-fill)}.base.connotation-pacific .progress{background-color:var(--vvd-color-neutral-100)}.base:not(.shape-sharp) .progress{border-radius:4px}.indeterminate{display:flex;border-radius:inherit;background-color:var(--_connotation-color-primary);block-size:100%;inline-size:100%}.determinate{border-radius:inherit;background-color:var(--_connotation-color-primary);block-size:100%;transition:all .2s ease-in-out}.connotation-pacific .determinate{background-image:var(--_connotation-color-primary)}.reverse .determinate{position:absolute;right:0}.paused .determinate{background:var(--vvd-color-neutral-300)}.indicator-1{animation:indeterminate-1 2s infinite;inline-size:30%}.indicator-2{animation:indeterminate-2 2s infinite;inline-size:60%}.indicator-1,.indicator-2{position:absolute;animation-timing-function:cubic-bezier(.4,0,.6,1);background-color:var(--vvd-color-neutral-100);block-size:100%;opacity:0}.connotation-pacific .indicator-1,.connotation-pacific .indicator-2{background-image:var(--_connotation-color-primary)}.paused .indicator-1,.paused .indicator-2{animation-play-state:paused;background-color:var(--_connotation-color-primary)}.reverse .indicator-1,.reverse .indicator-2{animation-direction:reverse}@keyframes indeterminate-1{0%{opacity:1;transform:translate(-100%)}70%{opacity:1;transform:translate(300%)}70.01%{opacity:0}to{opacity:0;transform:translate(300%)}}@keyframes indeterminate-2{0%{opacity:0;transform:translate(-150%)}29.99%{opacity:0}30%{opacity:1;transform:translate(-150%)}to{opacity:1;transform:translate(166.66%)}}";
|
|
7
7
|
var _ = Object.defineProperty, c = (o, r, n, l) => {
|
|
8
8
|
for (var a = void 0, e = o.length - 1, p; e >= 0; e--)
|
package/radio/definition.cjs
CHANGED
|
@@ -106,14 +106,14 @@ class Radio extends withErrorText.WithErrorText(
|
|
|
106
106
|
nameChanged(previous, next) {
|
|
107
107
|
super.nameChanged(previous, next);
|
|
108
108
|
next !== null ? this.proxy.setAttribute("name", this.name) : this.proxy.removeAttribute("name");
|
|
109
|
-
fastElement.
|
|
109
|
+
fastElement.Updates.enqueue(this.validate);
|
|
110
110
|
}
|
|
111
111
|
/**
|
|
112
112
|
* @internal
|
|
113
113
|
*/
|
|
114
114
|
connectedCallback() {
|
|
115
115
|
super.connectedCallback();
|
|
116
|
-
fastElement.
|
|
116
|
+
fastElement.Updates.enqueue(this.validate);
|
|
117
117
|
if (this.parentElement.getAttribute("data-vvd-component") !== "radio-group" && this.getAttribute("tabindex") === null) {
|
|
118
118
|
if (!this.disabled) {
|
|
119
119
|
this.setAttribute("tabindex", "0");
|
|
@@ -195,18 +195,18 @@ const getClasses = ({ connotation, checked, readOnly, disabled }) => fastWebUtil
|
|
|
195
195
|
["disabled", Boolean(disabled)]
|
|
196
196
|
);
|
|
197
197
|
const RadioTemplate = fastElement.html`<template
|
|
198
|
-
aria-checked="${(x) => x
|
|
199
|
-
aria-disabled="${(x) => x
|
|
200
|
-
aria-required="${(x) => x
|
|
201
|
-
@keypress="${(x, c) => x
|
|
202
|
-
@click="${(x, c) => x
|
|
198
|
+
aria-checked="${(x) => x?.checked}"
|
|
199
|
+
aria-disabled="${(x) => x?.disabled}"
|
|
200
|
+
aria-required="${(x) => x?.required}"
|
|
201
|
+
@keypress="${(x, c) => x?.keypressHandler(c.event)}"
|
|
202
|
+
@click="${(x, c) => x?.clickHandler(c.event)}"
|
|
203
203
|
role="radio"
|
|
204
204
|
>
|
|
205
205
|
<div class="${getClasses}">
|
|
206
206
|
<div class="control"></div>
|
|
207
207
|
${fastElement.when(
|
|
208
|
-
(x) => x
|
|
209
|
-
fastElement.html`<label class="label">${(x) => x
|
|
208
|
+
(x) => x?.label,
|
|
209
|
+
fastElement.html`<label class="label">${(x) => x?.label}</label>`
|
|
210
210
|
)}
|
|
211
211
|
</div>
|
|
212
212
|
</template>`;
|
package/radio/definition.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { V as VividElement, d as defineVividComponent, c as createRegisterFunction } from '../unbundled/vivid-element.js';
|
|
2
|
-
import {
|
|
2
|
+
import { Updates, attr, observable, when, html } from '@microsoft/fast-element';
|
|
3
3
|
import { keySpace, classNames } from '@microsoft/fast-web-utilities';
|
|
4
4
|
import { C as CheckableFormAssociated } from '../unbundled/form-associated.js';
|
|
5
5
|
import { W as WithErrorText } from '../unbundled/with-error-text.js';
|
|
@@ -102,14 +102,14 @@ class Radio extends WithErrorText(
|
|
|
102
102
|
nameChanged(previous, next) {
|
|
103
103
|
super.nameChanged(previous, next);
|
|
104
104
|
next !== null ? this.proxy.setAttribute("name", this.name) : this.proxy.removeAttribute("name");
|
|
105
|
-
|
|
105
|
+
Updates.enqueue(this.validate);
|
|
106
106
|
}
|
|
107
107
|
/**
|
|
108
108
|
* @internal
|
|
109
109
|
*/
|
|
110
110
|
connectedCallback() {
|
|
111
111
|
super.connectedCallback();
|
|
112
|
-
|
|
112
|
+
Updates.enqueue(this.validate);
|
|
113
113
|
if (this.parentElement.getAttribute("data-vvd-component") !== "radio-group" && this.getAttribute("tabindex") === null) {
|
|
114
114
|
if (!this.disabled) {
|
|
115
115
|
this.setAttribute("tabindex", "0");
|
|
@@ -191,18 +191,18 @@ const getClasses = ({ connotation, checked, readOnly, disabled }) => classNames(
|
|
|
191
191
|
["disabled", Boolean(disabled)]
|
|
192
192
|
);
|
|
193
193
|
const RadioTemplate = html`<template
|
|
194
|
-
aria-checked="${(x) => x
|
|
195
|
-
aria-disabled="${(x) => x
|
|
196
|
-
aria-required="${(x) => x
|
|
197
|
-
@keypress="${(x, c) => x
|
|
198
|
-
@click="${(x, c) => x
|
|
194
|
+
aria-checked="${(x) => x?.checked}"
|
|
195
|
+
aria-disabled="${(x) => x?.disabled}"
|
|
196
|
+
aria-required="${(x) => x?.required}"
|
|
197
|
+
@keypress="${(x, c) => x?.keypressHandler(c.event)}"
|
|
198
|
+
@click="${(x, c) => x?.clickHandler(c.event)}"
|
|
199
199
|
role="radio"
|
|
200
200
|
>
|
|
201
201
|
<div class="${getClasses}">
|
|
202
202
|
<div class="control"></div>
|
|
203
203
|
${when(
|
|
204
|
-
(x) => x
|
|
205
|
-
html`<label class="label">${(x) => x
|
|
204
|
+
(x) => x?.label,
|
|
205
|
+
html`<label class="label">${(x) => x?.label}</label>`
|
|
206
206
|
)}
|
|
207
207
|
</div>
|
|
208
208
|
</template>`;
|
|
@@ -308,6 +308,7 @@ __decorateClass([
|
|
|
308
308
|
], RadioGroup.prototype, "slottedRadioButtons");
|
|
309
309
|
|
|
310
310
|
const RadioGroupTemplate = (context) => {
|
|
311
|
+
const radioTagName = context.tagFor(radio_definition.VwcRadioElement, true);
|
|
311
312
|
return fastElement.html`
|
|
312
313
|
<template
|
|
313
314
|
@keydown="${(x, c) => x.keydownHandler(c.event)}"
|
|
@@ -333,7 +334,7 @@ const RadioGroupTemplate = (context) => {
|
|
|
333
334
|
<slot
|
|
334
335
|
${fastElement.slotted({
|
|
335
336
|
property: "slottedRadioButtons",
|
|
336
|
-
filter: fastElement.elements(
|
|
337
|
+
filter: fastElement.elements(radioTagName)
|
|
337
338
|
})}
|
|
338
339
|
@slotchange="${(x) => x.handleSlotChange()}"
|
|
339
340
|
></slot>
|
|
@@ -304,6 +304,7 @@ __decorateClass([
|
|
|
304
304
|
], RadioGroup.prototype, "slottedRadioButtons");
|
|
305
305
|
|
|
306
306
|
const RadioGroupTemplate = (context) => {
|
|
307
|
+
const radioTagName = context.tagFor(Radio, true);
|
|
307
308
|
return html`
|
|
308
309
|
<template
|
|
309
310
|
@keydown="${(x, c) => x.keydownHandler(c.event)}"
|
|
@@ -329,7 +330,7 @@ const RadioGroupTemplate = (context) => {
|
|
|
329
330
|
<slot
|
|
330
331
|
${slotted({
|
|
331
332
|
property: "slottedRadioButtons",
|
|
332
|
-
filter: elements(
|
|
333
|
+
filter: elements(radioTagName)
|
|
333
334
|
})}
|
|
334
335
|
@slotchange="${(x) => x.handleSlotChange()}"
|
|
335
336
|
></slot>
|
package/radio-group/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";const r=require("../bundled/vivid-element.cjs"),c=require("../bundled/definition17.cjs"),f=require("../bundled/mixins.cjs"),n=require("../bundled/key-codes.cjs"),g=require("../bundled/aria.cjs"),p=require("../bundled/delegates-aria.cjs"),
|
|
1
|
+
"use strict";const r=require("../bundled/vivid-element.cjs"),c=require("../bundled/definition17.cjs"),f=require("../bundled/mixins.cjs"),n=require("../bundled/key-codes.cjs"),g=require("../bundled/aria.cjs"),p=require("../bundled/delegates-aria.cjs"),b=require("../bundled/when.cjs"),u=require("../bundled/slotted.cjs"),v=".base{display:flex;flex-direction:column;gap:8px;--_low-ink-color: var(--vvd-color-neutral-600)}.positioning-region{display:flex;flex-wrap:wrap;gap:8px}.positioning-region.vertical{flex-direction:column}fieldset{display:block;padding:0;border:none;margin:0}legend{padding:0;color:var(--vvd-color-canvas-text);font:var(--vvd-typography-base);margin-block-end:8px}";var y=Object.defineProperty,s=(d,t,e,i)=>{for(var o=void 0,l=d.length-1,h;l>=0;l--)(h=d[l])&&(o=h(t,e,o)||o);return o&&y(t,e,o),o};class a extends f.WithFeedback(r.VividElement){constructor(){super(...arguments),this.errorValidationMessage="",this.orientation=g.Orientation.horizontal,this.slottedRadioButtons=[],this.radioErrorHandler=t=>{const e=t.target;this.errorValidationMessage=e.errorValidationMessage||""},this.radioChangeHandler=t=>{const e=t.target;e.checked&&(this.slottedRadioButtons?.forEach(i=>{i!==e&&(i.checked=!1)}),this.value=e.value,this.#e(e)),t.stopPropagation()},this.moveToRadioByIndex=(t,e)=>{const i=t[e];!this.isInsideToolbar&&!i.readOnly&&(i.checked=!0),i.focus()},this.moveRightOffGroup=()=>{this.nextElementSibling?.focus()},this.moveLeftOffGroup=()=>{this.previousElementSibling?.focus()},this.moveRight=t=>{const e=t.target,i=this.#t;let o=0;if(o=i.indexOf(e)+1,o===i.length&&this.isInsideToolbar&&t.key===n.keyArrowRight){this.moveRightOffGroup();return}o===i.length&&(o=0),this.moveToRadioByIndex(i,o)},this.moveLeft=t=>{const e=t.target,i=this.#t;let o=i.indexOf(e)-1;if(this.isInsideToolbar&&t.key===n.keyArrowLeft&&o<0){this.moveLeftOffGroup();return}o=o<0?i.length-1:o,this.moveToRadioByIndex(i,o)},this.keydownHandler=t=>{switch(t.key){case n.keyEnter:this.checkFocusedRadio(t.target);break;case n.keyArrowRight:case n.keyArrowDown:this.moveRight(t);break;case n.keyArrowLeft:case n.keyArrowUp:this.moveLeft(t);break;default:return!0}}}requiredChanged(){this.slottedRadioButtons?.forEach(t=>{this.required?t.required=!0:t.required=!1})}readOnlyChanged(){this.slottedRadioButtons?.forEach(t=>{this.readOnly?t.readOnly=!0:t.readOnly=!1})}disabledChanged(){this.slottedRadioButtons?.forEach(t=>{this.disabled?t.disabled=!0:t.disabled=!1})}nameChanged(){this.slottedRadioButtons?.forEach(t=>{t.setAttribute("name",this.name)})}valueChanged(){this.slottedRadioButtons?.forEach(t=>{t.value===this.value&&(t.checked=!0)}),this.$emit("change")}handleSlotChange(){this.errorText&&this.slottedRadioButtons?.forEach(t=>{t.errorText=this.errorText})}errorTextChanged(t,e){e?this.errorValidationMessage=e:this.errorValidationMessage=""}get#t(){return this.slottedRadioButtons?.filter(t=>!t.disabled)}slottedRadioButtonsChanged(){this.slottedRadioButtons&&this.slottedRadioButtons.length>0&&this.setupRadioButtons()}get isInsideToolbar(){return!!this.closest('[role="toolbar"]')}connectedCallback(){super.connectedCallback(),this.setupRadioButtons()}disconnectedCallback(){this.slottedRadioButtons?.forEach(t=>{t.removeEventListener("change",this.radioChangeHandler),t.removeEventListener("invalid",this.radioErrorHandler)})}setupRadioButtons(){let t=!1;for(const e of this.slottedRadioButtons)this.name!==void 0&&e.setAttribute("name",this.name),this.disabled&&(e.disabled=!0),this.readOnly&&(e.readOnly=!0),this.required&&(e.required=!0),this.value&&this.value===e.value?(e.checked=!0,this.#e(e),t=!0):e.checked=!1,e.addEventListener("change",this.radioChangeHandler),e.addEventListener("invalid",this.radioErrorHandler);if(this.value===void 0&&this.slottedRadioButtons?.length>0){const e=this.slottedRadioButtons?.filter(i=>i.hasAttribute("checked"));if(e.length>0&&!t){const i=e[e.length-1];i.checked=!0,this.#e(i)}else this.#e(this.slottedRadioButtons[0])}}focusInHandler(t){this.#e(t.target)}#e(t){t.setAttribute("tabindex","0");for(const e of this.slottedRadioButtons)e!==t&&e.setAttribute("tabindex","-1")}checkFocusedRadio(t){t.readOnly||(t.checked=!0)}}s([r.attr],a.prototype,"label");s([r.attr({attribute:"required",mode:"boolean"})],a.prototype,"required");s([r.attr({attribute:"readonly",mode:"boolean"})],a.prototype,"readOnly");s([r.attr({attribute:"disabled",mode:"boolean"})],a.prototype,"disabled");s([r.attr],a.prototype,"name");s([r.attr],a.prototype,"value");s([r.observable],a.prototype,"errorValidationMessage");s([r.attr({attribute:"error-text"})],a.prototype,"errorText");s([r.attr],a.prototype,"orientation");s([r.observable],a.prototype,"slottedRadioButtons");const R=d=>{const t=d.tagFor(c.Radio,!0);return r.html`
|
|
2
2
|
<template
|
|
3
|
-
@keydown="${(e,
|
|
4
|
-
@focusin="${(e,
|
|
3
|
+
@keydown="${(e,i)=>e.keydownHandler(i.event)}"
|
|
4
|
+
@focusin="${(e,i)=>e.focusInHandler(i.event)}"
|
|
5
5
|
>
|
|
6
6
|
<div class="base">
|
|
7
7
|
<fieldset
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
>
|
|
14
14
|
${b.when(e=>e.label,r.html`<legend id="label">${e=>e.label}</legend>`)}
|
|
15
15
|
<slot
|
|
16
|
-
${u.slotted({property:"slottedRadioButtons",filter:u.elements(
|
|
16
|
+
${u.slotted({property:"slottedRadioButtons",filter:u.elements(t)})}
|
|
17
17
|
@slotchange="${e=>e.handleSlotChange()}"
|
|
18
18
|
></slot>
|
|
19
19
|
</fieldset>
|
|
20
20
|
${e=>e._getFeedbackTemplate(d)}
|
|
21
21
|
</div>
|
|
22
22
|
</template>
|
|
23
|
-
|
|
23
|
+
`},m=r.defineVividComponent("radio-group",a,R,[c.radioDefinition,f.feedbackMessageDefinition],{styles:v}),k=r.createRegisterFunction(m);k();
|