@vonage/vivid 4.23.0 → 4.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +21830 -14295
- package/elevation/index.cjs +1 -1
- package/elevation/index.js +1 -1
- package/index.cjs +112 -150
- package/index.js +37 -35
- package/lib/accordion-item/accordion-item.d.ts +6 -0
- package/lib/action-group/action-group.d.ts +6 -0
- package/lib/alert/alert.d.ts +20 -0
- package/lib/audio-player/audio-player.d.ts +6 -0
- package/lib/badge/badge.d.ts +9 -1
- package/lib/banner/banner.d.ts +25 -0
- package/lib/breadcrumb/breadcrumb.d.ts +6 -0
- package/lib/breadcrumb-item/breadcrumb-item.d.ts +63 -7
- package/lib/button/button.d.ts +732 -7
- package/lib/button/locale.d.ts +3 -0
- package/lib/calendar-event/calendar-event.d.ts +6 -0
- package/lib/card/card.d.ts +394 -2
- package/lib/card/card.template.d.ts +2 -1
- package/lib/checkbox/checkbox.d.ts +1822 -5
- package/lib/combobox/combobox.d.ts +1827 -20
- package/lib/data-grid/data-grid-cell.d.ts +339 -1
- package/lib/data-grid/locale.d.ts +5 -0
- package/lib/date-picker/date-picker.d.ts +1676 -207
- package/lib/date-range-picker/date-range-picker.d.ts +840 -107
- package/lib/date-time-picker/date-time-picker.d.ts +1678 -209
- package/lib/dial-pad/dial-pad.d.ts +8 -0
- package/lib/dialog/dialog.d.ts +12 -0
- package/lib/divider/divider.d.ts +6 -0
- package/lib/fab/fab.d.ts +6 -0
- package/lib/file-picker/file-picker.d.ts +1510 -32
- package/lib/file-picker/locale.d.ts +1 -0
- package/lib/header/header.d.ts +6 -0
- package/lib/icon/icon.d.ts +1 -0
- package/lib/icon/icon.template.d.ts +2 -1
- package/lib/menu/menu.d.ts +16 -7
- package/lib/menu/name.d.ts +1 -0
- package/lib/menu-item/menu-item.d.ts +14 -2
- package/lib/nav/nav.d.ts +6 -0
- package/lib/nav-disclosure/nav-disclosure.d.ts +13 -0
- package/lib/nav-item/nav-item.d.ts +405 -3
- package/lib/note/note.d.ts +6 -0
- package/lib/number-field/number-field.d.ts +1857 -36
- package/lib/option/option.d.ts +12 -0
- package/lib/progress/progress.d.ts +6 -0
- package/lib/progress-ring/progress-ring.d.ts +6 -0
- package/lib/radio/radio.d.ts +1137 -4
- package/lib/radio-group/radio-group.d.ts +20 -2
- package/lib/range-slider/range-slider.d.ts +752 -5
- package/lib/rich-text-editor/definition.d.ts +2 -2
- package/lib/rich-text-editor/facades/vivid-prose-mirror.facade.d.ts +3 -1
- package/lib/rich-text-editor/locale.d.ts +10 -0
- package/lib/rich-text-editor/menubar/menubar.d.ts +340 -1
- package/lib/rich-text-editor/rich-text-editor.d.ts +352 -2
- package/lib/searchable-select/locale.d.ts +1 -0
- package/lib/searchable-select/option-tag.d.ts +6 -0
- package/lib/searchable-select/searchable-select.d.ts +1857 -35
- package/lib/select/select.d.ts +1843 -28
- package/lib/selectable-box/selectable-box.d.ts +6 -0
- package/lib/slider/slider.d.ts +384 -2
- package/lib/split-button/split-button.d.ts +18 -0
- package/lib/switch/switch.d.ts +386 -3
- package/lib/tab/tab.d.ts +18 -1
- package/lib/tab-panel/tab-panel.d.ts +6 -0
- package/lib/tabs/tabs.d.ts +5 -21
- package/lib/tag/tag.d.ts +12 -0
- package/lib/tag-group/tag-group.d.ts +6 -0
- package/lib/text-area/text-area.d.ts +2174 -19
- package/lib/text-field/text-field.d.ts +2195 -31
- package/lib/time-picker/time-picker.d.ts +839 -106
- package/lib/toggletip/toggletip.d.ts +10 -4
- package/lib/tooltip/tooltip.d.ts +10 -4
- package/lib/tree-item/tree-item.d.ts +12 -0
- package/lib/tree-view/tree-view.d.ts +6 -0
- package/lib/video-player/video-player.d.ts +6 -0
- package/lib/visually-hidden/definition.d.ts +4 -0
- package/lib/visually-hidden/visually-hidden.d.ts +3 -0
- package/lib/visually-hidden/visually-hidden.template.d.ts +3 -0
- package/locales/de-DE.cjs +47 -1
- package/locales/de-DE.js +47 -1
- package/locales/en-GB.cjs +47 -1
- package/locales/en-GB.js +47 -1
- package/locales/en-US.cjs +47 -1
- package/locales/en-US.js +47 -1
- package/locales/ja-JP.cjs +47 -1
- package/locales/ja-JP.js +47 -1
- package/locales/zh-CN.cjs +47 -1
- package/locales/zh-CN.js +47 -1
- package/menu/index.cjs +1 -1
- package/menu/index.js +1 -1
- package/nav/index.cjs +1 -1
- package/nav/index.js +1 -1
- package/nav-disclosure/index.cjs +1 -1
- package/nav-disclosure/index.js +1 -1
- package/nav-item/index.cjs +1 -1
- package/nav-item/index.js +1 -1
- package/note/index.cjs +1 -1
- package/note/index.js +1 -1
- package/number-field/index.cjs +1 -1
- package/number-field/index.js +1 -1
- package/option/index.cjs +1 -1
- package/option/index.js +1 -1
- package/package.json +1 -1
- package/pagination/index.cjs +1 -1
- package/pagination/index.js +1 -1
- package/popup/index.cjs +1 -1
- package/popup/index.js +1 -1
- 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 +1 -1
- package/range-slider/index.js +1 -1
- package/rich-text-editor/index.cjs +1 -1
- package/rich-text-editor/index.js +1 -1
- package/searchable-select/index.cjs +1 -1
- package/searchable-select/index.js +1 -1
- package/select/index.cjs +1 -1
- package/select/index.js +1 -1
- package/selectable-box/index.cjs +1 -1
- package/selectable-box/index.js +1 -1
- package/shared/affix.cjs +13 -7
- package/shared/affix.js +13 -8
- package/shared/aria/delegates-aria.d.ts +6 -0
- package/shared/aria/host-semantics.d.ts +6 -0
- package/shared/breadcrumb-item.cjs +2 -5
- package/shared/breadcrumb-item.js +2 -5
- package/shared/button.cjs +19 -14
- package/shared/button.js +19 -14
- package/shared/calendar-picker.template.cjs +3 -3
- package/shared/calendar-picker.template.js +1 -1
- package/shared/char-count.cjs +92 -0
- package/shared/char-count.js +90 -0
- package/shared/definition.js +1 -1
- package/shared/definition10.js +1 -1
- package/shared/definition11.cjs +27 -44
- package/shared/definition11.js +28 -45
- package/shared/definition12.cjs +1 -1
- package/shared/definition12.js +2 -2
- package/shared/definition13.js +1 -1
- package/shared/definition14.cjs +53 -22
- package/shared/definition14.js +54 -23
- package/shared/definition15.cjs +31 -36
- package/shared/definition15.js +30 -36
- package/shared/definition16.cjs +43 -63
- package/shared/definition16.js +42 -63
- package/shared/definition17.cjs +12 -5
- package/shared/definition17.js +12 -5
- package/shared/definition18.cjs +10 -14
- package/shared/definition18.js +9 -14
- package/shared/definition19.cjs +85 -100
- package/shared/definition19.js +75 -91
- package/shared/definition2.js +1 -1
- package/shared/definition20.cjs +15 -20
- package/shared/definition20.js +14 -20
- package/shared/definition21.cjs +22 -3
- package/shared/definition21.js +23 -4
- package/shared/definition22.cjs +12 -6
- package/shared/definition22.js +13 -7
- package/shared/definition23.cjs +5 -38
- package/shared/definition23.js +5 -37
- package/shared/definition24.cjs +2 -7
- package/shared/definition24.js +3 -8
- package/shared/definition25.js +1 -1
- package/shared/definition26.cjs +160 -163
- package/shared/definition26.js +159 -163
- package/shared/definition27.cjs +1 -1
- package/shared/definition27.js +2 -2
- package/shared/definition28.cjs +32 -17
- package/shared/definition28.js +33 -18
- package/shared/definition29.js +1 -1
- package/shared/definition3.js +1 -1
- package/shared/definition30.cjs +96 -482
- package/shared/definition30.js +99 -482
- package/shared/definition31.cjs +334 -57
- package/shared/definition31.js +333 -56
- package/shared/definition32.cjs +104 -19
- package/shared/definition32.js +105 -20
- package/shared/definition33.cjs +67 -15
- package/shared/definition33.js +66 -14
- package/shared/definition34.cjs +15 -50
- package/shared/definition34.js +14 -49
- package/shared/definition35.cjs +28 -397
- package/shared/definition35.js +27 -397
- package/shared/definition36.cjs +404 -54
- package/shared/definition36.js +404 -55
- package/shared/definition37.cjs +57 -234
- package/shared/definition37.js +57 -233
- package/shared/definition38.cjs +221 -66
- package/shared/definition38.js +220 -65
- package/shared/definition39.cjs +52 -44
- package/shared/definition39.js +51 -43
- package/shared/definition4.cjs +31 -24
- package/shared/definition4.js +33 -26
- package/shared/definition40.cjs +56 -266
- package/shared/definition40.js +55 -265
- package/shared/definition41.cjs +285 -142
- package/shared/definition41.js +285 -142
- package/shared/definition42.cjs +156 -564
- package/shared/definition42.js +156 -565
- package/shared/definition43.cjs +557 -14317
- package/shared/definition43.js +556 -14316
- package/shared/definition44.cjs +14418 -1085
- package/shared/definition44.js +14416 -1085
- package/shared/definition45.cjs +1049 -671
- package/shared/definition45.js +1050 -672
- package/shared/definition46.cjs +848 -113
- package/shared/definition46.js +847 -112
- package/shared/definition47.cjs +125 -90
- package/shared/definition47.js +124 -89
- package/shared/definition48.cjs +88 -455
- package/shared/definition48.js +87 -454
- package/shared/definition49.cjs +466 -109
- package/shared/definition49.js +466 -109
- package/shared/definition5.cjs +8 -7
- package/shared/definition5.js +6 -5
- package/shared/definition50.cjs +106 -106
- package/shared/definition50.js +105 -105
- package/shared/definition51.cjs +136 -15
- package/shared/definition51.js +135 -14
- package/shared/definition52.cjs +16 -115
- package/shared/definition52.js +15 -114
- package/shared/definition53.cjs +78 -490
- package/shared/definition53.js +77 -488
- package/shared/definition54.cjs +445 -23
- package/shared/definition54.js +443 -22
- package/shared/definition55.cjs +22 -136
- package/shared/definition55.js +21 -135
- package/shared/definition56.cjs +95 -291
- package/shared/definition56.js +95 -292
- package/shared/definition57.cjs +192 -480
- package/shared/definition57.js +190 -479
- package/shared/definition58.cjs +411 -24
- package/shared/definition58.js +410 -24
- package/shared/definition59.cjs +27 -144
- package/shared/definition59.js +27 -143
- package/shared/definition6.js +1 -1
- package/shared/definition60.cjs +83 -54
- package/shared/definition60.js +82 -53
- package/shared/definition61.cjs +78 -166
- package/shared/definition61.js +77 -164
- package/shared/definition62.cjs +143 -232
- package/shared/definition62.js +141 -231
- package/shared/definition63.cjs +234 -69417
- package/shared/definition63.js +233 -69416
- package/shared/definition64.cjs +69454 -28
- package/shared/definition64.js +69453 -27
- package/shared/definition65.cjs +28 -2168
- package/shared/definition65.js +27 -2166
- package/shared/definition66.cjs +27 -0
- package/shared/definition66.js +23 -0
- package/shared/definition67.cjs +2195 -0
- package/shared/definition67.js +2190 -0
- package/shared/definition7.cjs +11 -2
- package/shared/definition7.js +12 -3
- package/shared/definition8.cjs +24 -11
- package/shared/definition8.js +26 -13
- package/shared/definition9.cjs +1 -2
- package/shared/definition9.js +2 -3
- package/shared/delegates-aria.js +1 -1
- package/shared/deprecation/replaced-props.d.ts +20 -0
- package/shared/divider.cjs +41 -0
- package/shared/divider.js +38 -0
- package/shared/feedback/feedback-message.d.ts +345 -0
- package/shared/feedback/locale.d.ts +4 -0
- package/{lib/text-anchor/text-anchor.d.ts → shared/feedback/mixins.d.ts} +62 -39
- package/shared/form-associated.cjs +124 -100
- package/shared/form-associated.js +125 -101
- package/shared/form-element.cjs +84 -0
- package/shared/form-element.js +82 -0
- package/shared/foundation/button/button.d.ts +378 -2
- package/shared/foundation/form-associated/form-associated.d.ts +753 -49
- package/shared/foundation/listbox/listbox.d.ts +1 -1
- package/shared/foundation/vivid-element/vivid-element.d.ts +14 -0
- package/shared/host-semantics.js +1 -1
- package/shared/key-codes.js +1 -1
- package/shared/linkable.cjs +70 -0
- package/shared/linkable.js +68 -0
- package/shared/localization/Locale.d.ts +16 -0
- package/shared/mixins.cjs +306 -0
- package/shared/mixins.js +300 -0
- package/shared/patterns/affix.d.ts +16 -1
- package/shared/patterns/anchored.d.ts +20 -8
- package/shared/patterns/char-count/char-count.d.ts +351 -0
- package/shared/patterns/char-count/index.d.ts +1 -0
- package/shared/patterns/char-count/locale.d.ts +4 -0
- package/shared/patterns/form-elements/form-element.d.ts +744 -0
- package/shared/patterns/form-elements/index.d.ts +3 -1
- package/shared/patterns/form-elements/with-error-text.d.ts +1122 -0
- package/shared/patterns/form-elements/with-success-text.d.ts +341 -0
- package/shared/patterns/index.d.ts +2 -0
- package/shared/patterns/linkable.d.ts +394 -0
- package/shared/patterns/localized.d.ts +6 -0
- package/shared/patterns/trapped-focus.d.ts +6 -0
- package/shared/picker-field/mixins/calendar-picker.d.ts +420 -52
- package/shared/picker-field/mixins/calendar-picker.template.d.ts +420 -52
- package/shared/picker-field/mixins/inline-time-picker/inline-time-picker.d.ts +6 -0
- package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +843 -107
- package/shared/picker-field/mixins/single-date-picker.d.ts +1259 -155
- package/shared/picker-field/mixins/single-value-picker.d.ts +417 -49
- package/shared/picker-field/mixins/time-selection-picker.d.ts +842 -106
- package/shared/picker-field/mixins/time-selection-picker.template.d.ts +839 -103
- package/shared/picker-field/picker-field.d.ts +1491 -15
- package/shared/picker-field.template.cjs +13 -22
- package/shared/picker-field.template.js +14 -23
- package/shared/repeat.js +1 -1
- package/shared/slider.template.cjs +1 -1
- package/shared/slider.template.js +1 -1
- package/shared/time-selection-picker.template.cjs +10 -15
- package/shared/time-selection-picker.template.js +10 -16
- package/shared/vivid-element.cjs +53 -4
- package/shared/vivid-element.js +53 -3
- package/shared/with-error-text.cjs +56 -0
- package/shared/with-error-text.js +54 -0
- package/shared/with-success-text.cjs +23 -0
- package/shared/with-success-text.js +21 -0
- package/side-drawer/index.cjs +1 -1
- package/side-drawer/index.js +1 -1
- package/slider/index.cjs +1 -1
- package/slider/index.js +1 -1
- package/split-button/index.cjs +1 -1
- package/split-button/index.js +1 -1
- 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 +1 -1
- package/switch/index.js +1 -1
- package/tab/index.cjs +1 -1
- package/tab/index.js +1 -1
- package/tab-panel/index.cjs +1 -1
- package/tab-panel/index.js +1 -1
- package/tabs/index.cjs +1 -1
- package/tabs/index.js +1 -1
- package/tag/index.cjs +1 -1
- package/tag/index.js +1 -1
- package/tag-group/index.cjs +1 -1
- package/tag-group/index.js +1 -1
- package/text-area/index.cjs +1 -1
- package/text-area/index.js +1 -1
- package/text-field/index.cjs +1 -1
- package/text-field/index.js +1 -1
- package/time-picker/index.cjs +1 -1
- package/time-picker/index.js +1 -1
- package/toggletip/index.cjs +1 -1
- package/toggletip/index.js +1 -1
- package/tooltip/index.cjs +1 -1
- package/tooltip/index.js +1 -1
- package/tree-item/index.cjs +1 -1
- package/tree-item/index.js +1 -1
- package/tree-view/index.cjs +1 -1
- package/tree-view/index.js +1 -1
- package/video-player/index.cjs +1 -1
- package/video-player/index.js +1 -1
- package/visually-hidden/index.cjs +5 -0
- package/visually-hidden/index.js +3 -0
- package/vivid.api.json +762 -1478
- package/lib/checkbox/checkbox.form-associated.d.ts +0 -11
- package/lib/file-picker/file-picker.form-associated.d.ts +0 -11
- package/lib/number-field/number-field.form-associated.d.ts +0 -11
- package/lib/radio/radio.form-associated.d.ts +0 -13
- package/lib/range-slider/range-slider.form-associated.d.ts +0 -11
- package/lib/searchable-select/searchable-select.form-associated.d.ts +0 -11
- package/lib/select/select.form-associated.d.ts +0 -11
- package/lib/slider/slider.form-associated.d.ts +0 -11
- package/lib/switch/switch.form-associated.d.ts +0 -11
- package/lib/text-anchor/definition.d.ts +0 -2
- package/lib/text-anchor/text-anchor.template.d.ts +0 -3
- package/lib/text-area/text-area.form-associated.d.ts +0 -11
- package/lib/text-field/text-field.form-associated.d.ts +0 -11
- package/shared/anchor.cjs +0 -49
- package/shared/anchor.js +0 -47
- package/shared/apply-mixins.cjs +0 -23
- package/shared/apply-mixins.js +0 -21
- package/shared/applyMixinsWithObservables.cjs +0 -15
- package/shared/applyMixinsWithObservables.js +0 -13
- package/shared/direction.cjs +0 -17
- package/shared/direction.js +0 -15
- package/shared/form-elements.cjs +0 -209
- package/shared/form-elements.js +0 -202
- package/shared/foundation/anchor/anchor.d.ts +0 -11
- package/shared/foundation/utilities/apply-mixins.d.ts +0 -1
- package/shared/patterns/form-elements/form-elements.d.ts +0 -58
- package/shared/picker-field/picker-field.form-associated.d.ts +0 -11
- package/shared/text-anchor.cjs +0 -38
- package/shared/text-anchor.js +0 -36
- package/shared/text-anchor.template.cjs +0 -35
- package/shared/text-anchor.template.js +0 -33
- package/shared/utils/applyMixinsWithObservables.d.ts +0 -1
- package/text-anchor/index.cjs +0 -17
- package/text-anchor/index.js +0 -15
package/shared/definition26.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { I as Icon, i as iconDefinition } from './definition28.js';
|
|
2
2
|
import { B as Button, b as buttonDefinition } from './definition11.js';
|
|
3
|
-
import { V as VividElement, a as attr, h as html,
|
|
4
|
-
import { a as
|
|
3
|
+
import { V as VividElement, a as attr, h as html, d as createRegisterFunction, f as defineVividComponent } from './vivid-element.js';
|
|
4
|
+
import { a as WithFeedback, f as feedbackMessageDefinition } from './mixins.js';
|
|
5
5
|
import { D as DelegatesAria, d as delegateAria } from './delegates-aria.js';
|
|
6
6
|
import { F as FormAssociated } from './form-associated.js';
|
|
7
|
+
import { W as WithErrorText } from './with-error-text.js';
|
|
8
|
+
import { F as FormElement } from './form-element.js';
|
|
7
9
|
import { L as Localized } from './localized.js';
|
|
8
|
-
import { a as FormElementHelperText, e as errorText, f as formElements, g as getFeedbackTemplate } from './form-elements.js';
|
|
9
10
|
import { w as when } from './when.js';
|
|
10
11
|
import { r as ref } from './ref.js';
|
|
11
12
|
import { c as classNames } from './class-names.js';
|
|
12
13
|
|
|
13
|
-
const styles = ":host{display:block;max-inline-size:400px}.base{display:flex;flex-direction:column;block-size:inherit;max-block-size:inherit}.control{display:flex;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:center;padding:16px;border:1px dashed var(--vvd-color-neutral-400);border-radius:8px;background-color:var(--vvd-color-cta-50);color:var(--vvd-color-neutral-600);cursor:pointer;font:var(--vvd-typography-base);gap:8px;inline-size:100%;min-block-size:52px;outline:none;transition:all .3s ease}.control:not(.size-expanded){min-block-size:52px}.control.size-expanded{min-block-size:120px}.control:focus-visible{--focus-stroke-gap-color: transparent;box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px))}.control:hover,.control:active,.control:focus-visible{background-color:var(--vvd-color-cta-100)}.main{pointer-events:none}.dz-preview{display:grid;box-sizing:border-box;padding:8px;border:1px solid var(--vvd-color-neutral-300);border-radius:8px;background-color:var(--file-picker-list-item-background-color, var(--vvd-color-canvas));grid-template-columns:1fr auto;grid-template-rows:auto auto;inline-size:100%}.dz-preview .dz-details{display:flex;min-width:0;flex-direction:column;max-inline-size:100%}.dz-preview .dz-details .dz-filename{overflow:hidden;color:var(--vvd-color-canvas-text);font:var(--vvd-typography-base);text-overflow:ellipsis;white-space:nowrap}.dz-preview .dz-details .dz-size{color:var(--vvd-color-neutral-600);font:var(--vvd-typography-base-condensed)}.dz-preview .dz-error-message{display:flex;align-items:center;color:var(--vvd-color-alert-600);font:var(--vvd-typography-base-condensed-bold);gap:4px;margin-block-start:4px}.dz-preview:not(.dz-error) .dz-error-message{display:none}.dz-preview.dz-error{border:1px solid var(--vvd-color-alert-500);background-color:var(--vvd-color-alert-50)}.dz-preview.dz-error .dz-details .dz-size,.dz-preview.dz-error .dz-progress{display:none}.dz-preview .remove-btn{display:inline;align-self:center;grid-column:2/-1;grid-row:1/-1}.
|
|
14
|
+
const styles = ":host{display:block;max-inline-size:400px}.base{display:flex;flex-direction:column;block-size:inherit;max-block-size:inherit;--_low-ink-color: var(--vvd-color-neutral-600)}.control-wrapper{display:flex;flex-direction:column;block-size:inherit;gap:4px;max-block-size:inherit}.control{display:flex;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:center;padding:16px;border:1px dashed var(--vvd-color-neutral-400);border-radius:8px;background-color:var(--vvd-color-cta-50);color:var(--vvd-color-neutral-600);cursor:pointer;font:var(--vvd-typography-base);gap:8px;inline-size:100%;min-block-size:52px;outline:none;transition:all .3s ease}.control:not(.size-expanded){min-block-size:52px}.control.size-expanded{min-block-size:120px}.control:focus-visible{--focus-stroke-gap-color: transparent;box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px))}.control:hover,.control:active,.control:focus-visible{background-color:var(--vvd-color-cta-100)}.main{pointer-events:none}.dz-preview{display:grid;box-sizing:border-box;padding:8px;border:1px solid var(--vvd-color-neutral-300);border-radius:8px;background-color:var(--file-picker-list-item-background-color, var(--vvd-color-canvas));grid-template-columns:1fr auto;grid-template-rows:auto auto;inline-size:100%}.dz-preview .dz-details{display:flex;min-width:0;flex-direction:column;max-inline-size:100%}.dz-preview .dz-details .dz-filename{overflow:hidden;color:var(--vvd-color-canvas-text);font:var(--vvd-typography-base);text-overflow:ellipsis;white-space:nowrap}.dz-preview .dz-details .dz-size{color:var(--vvd-color-neutral-600);font:var(--vvd-typography-base-condensed)}.dz-preview .dz-error-message{display:flex;align-items:center;color:var(--vvd-color-alert-600);font:var(--vvd-typography-base-condensed-bold);gap:4px;margin-block-start:4px}.dz-preview:not(.dz-error) .dz-error-message{display:none}.dz-preview.dz-error{border:1px solid var(--vvd-color-alert-500);background-color:var(--vvd-color-alert-50)}.dz-preview.dz-error .dz-details .dz-size,.dz-preview.dz-error .dz-progress{display:none}.dz-preview .remove-btn{display:inline;align-self:center;grid-column:2/-1;grid-row:1/-1}.preview-list{--scrollbar-track-color: transparent;--scrollbar-thumb-color: color-mix(in srgb, var(--vvd-color-neutral-950), transparent 70%)}.preview-list{scrollbar-color:var(--scrollbar-thumb-color) var(--scrollbar-track-color);scrollbar-width:thin}.preview-list ::-webkit-scrollbar{width:4px}.preview-list ::-webkit-scrollbar-track{background:var(--scrollbar-track-color)}.preview-list ::-webkit-scrollbar-thumb{border:0;border-radius:4px;background-color:var(--scrollbar-fallback-track-color, var(--scrollbar-thumb-color))}.preview-list{display:flex;flex-direction:column;gap:12px;margin-block-start:12px;overflow-y:auto}.preview-list:empty{display:none}";
|
|
14
15
|
|
|
15
16
|
var objectExtend = extend;
|
|
16
17
|
|
|
@@ -2138,34 +2139,15 @@ function $3ed269f2f0fb224b$var$__guardMethod__(obj, methodName, transform) {
|
|
|
2138
2139
|
else return undefined;
|
|
2139
2140
|
}
|
|
2140
2141
|
|
|
2141
|
-
class _FilePicker extends VividElement {
|
|
2142
|
-
}
|
|
2143
|
-
class FormAssociatedFilePicker extends FormAssociated(_FilePicker) {
|
|
2144
|
-
constructor() {
|
|
2145
|
-
super(...arguments);
|
|
2146
|
-
this.proxy = document.createElement("input");
|
|
2147
|
-
}
|
|
2148
|
-
}
|
|
2149
|
-
|
|
2150
2142
|
var __defProp = Object.defineProperty;
|
|
2151
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
2152
|
-
var __typeError = (msg) => {
|
|
2153
|
-
throw TypeError(msg);
|
|
2154
|
-
};
|
|
2155
2143
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
2156
|
-
var result =
|
|
2144
|
+
var result = void 0 ;
|
|
2157
2145
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
2158
2146
|
if (decorator = decorators[i])
|
|
2159
|
-
result = (
|
|
2160
|
-
if (
|
|
2147
|
+
result = (decorator(target, key, result) ) || result;
|
|
2148
|
+
if (result) __defProp(target, key, result);
|
|
2161
2149
|
return result;
|
|
2162
2150
|
};
|
|
2163
|
-
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
2164
|
-
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
2165
|
-
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
2166
|
-
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
|
|
2167
|
-
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
2168
|
-
var _dropzone, _FilePicker_instances, syncSingleFileState_fn, _localizeErrorMessage, _localizeFileSizeNumberAndUnits, addRemoveButtonToFilesPreview_fn, chooseFile_fn, updateHiddenFileInput_fn, keepOnlyNewestFile_fn, handleFilesChanged_fn, updateFormValue_fn, setValueToAFakePathLikeNativeInput_fn, formatNumbersInMessage_fn;
|
|
2169
2151
|
const isFormAssociatedTryingToSetFormValueToFakePath = (value) => typeof value === "string";
|
|
2170
2152
|
const generateFilePreviewTemplate = (buttonTag, iconTag, locale) => {
|
|
2171
2153
|
return `<div class="dz-preview dz-file-preview">
|
|
@@ -2180,13 +2162,13 @@ const generateFilePreviewTemplate = (buttonTag, iconTag, locale) => {
|
|
|
2180
2162
|
<${buttonTag} class="remove-btn" icon="delete-line" appearance="ghost-light" size="condensed" aria-label="${locale.filePicker.removeFileLabel}"></${buttonTag}>
|
|
2181
2163
|
</div>`;
|
|
2182
2164
|
};
|
|
2183
|
-
|
|
2184
|
-
|
|
2165
|
+
class FilePicker extends WithFeedback(
|
|
2166
|
+
WithErrorText(
|
|
2167
|
+
FormElement(DelegatesAria(Localized(FormAssociated(VividElement))))
|
|
2168
|
+
)
|
|
2185
2169
|
) {
|
|
2186
2170
|
constructor() {
|
|
2187
2171
|
super();
|
|
2188
|
-
__privateAdd(this, _FilePicker_instances);
|
|
2189
|
-
__privateAdd(this, _dropzone);
|
|
2190
2172
|
this.singleFile = false;
|
|
2191
2173
|
this.maxFileSize = 256;
|
|
2192
2174
|
/**
|
|
@@ -2206,7 +2188,7 @@ let FilePicker = class extends DelegatesAria(
|
|
|
2206
2188
|
* Used internally to hold the tag that icon is registered at.
|
|
2207
2189
|
*/
|
|
2208
2190
|
this.iconTag = "vwc-icon";
|
|
2209
|
-
|
|
2191
|
+
this.#localizeErrorMessage = (file, message) => {
|
|
2210
2192
|
if (file.previewElement) {
|
|
2211
2193
|
file.previewElement.classList.add("dz-error");
|
|
2212
2194
|
if (typeof message !== "string" && message.error) {
|
|
@@ -2215,15 +2197,21 @@ let FilePicker = class extends DelegatesAria(
|
|
|
2215
2197
|
for (const node of file.previewElement.querySelectorAll(
|
|
2216
2198
|
"[data-dz-errormessage]"
|
|
2217
2199
|
)) {
|
|
2218
|
-
node.textContent =
|
|
2200
|
+
node.textContent = this.#formatNumbersInMessage(message);
|
|
2219
2201
|
}
|
|
2220
2202
|
}
|
|
2221
|
-
}
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
return
|
|
2203
|
+
};
|
|
2204
|
+
this.#localizeFileSizeNumberAndUnits = () => {
|
|
2205
|
+
this.#dropzone.filesize = (size) => {
|
|
2206
|
+
return this.#formatNumbersInMessage(
|
|
2207
|
+
$3ed269f2f0fb224b$export$2e2bcd8739ae039.prototype.filesize.call(this.#dropzone, size)
|
|
2208
|
+
);
|
|
2225
2209
|
};
|
|
2226
|
-
}
|
|
2210
|
+
};
|
|
2211
|
+
/**
|
|
2212
|
+
* @internal
|
|
2213
|
+
*/
|
|
2214
|
+
this.proxy = document.createElement("input");
|
|
2227
2215
|
this.setFormValue = (value, state) => {
|
|
2228
2216
|
if (isFormAssociatedTryingToSetFormValueToFakePath(value)) {
|
|
2229
2217
|
return;
|
|
@@ -2232,13 +2220,14 @@ let FilePicker = class extends DelegatesAria(
|
|
|
2232
2220
|
};
|
|
2233
2221
|
$3ed269f2f0fb224b$export$2e2bcd8739ae039.autoDiscover = false;
|
|
2234
2222
|
}
|
|
2223
|
+
#dropzone;
|
|
2235
2224
|
/**
|
|
2236
2225
|
* Files that have been added to the file picker and passed validation.
|
|
2237
2226
|
*
|
|
2238
2227
|
* @public
|
|
2239
2228
|
*/
|
|
2240
2229
|
get files() {
|
|
2241
|
-
return
|
|
2230
|
+
return this.#dropzone?.getAcceptedFiles() ?? [];
|
|
2242
2231
|
}
|
|
2243
2232
|
/**
|
|
2244
2233
|
* Files that have been rejected by the file picker for failing validation.
|
|
@@ -2246,45 +2235,71 @@ let FilePicker = class extends DelegatesAria(
|
|
|
2246
2235
|
* @public
|
|
2247
2236
|
*/
|
|
2248
2237
|
get rejectedFiles() {
|
|
2249
|
-
return
|
|
2238
|
+
return this.#dropzone?.getRejectedFiles() ?? [];
|
|
2239
|
+
}
|
|
2240
|
+
#syncSingleFileState() {
|
|
2241
|
+
if (this.singleFile) {
|
|
2242
|
+
this.#dropzone?.hiddenFileInput?.removeAttribute("multiple");
|
|
2243
|
+
} else {
|
|
2244
|
+
this.#dropzone?.hiddenFileInput?.setAttribute("multiple", "multiple");
|
|
2245
|
+
}
|
|
2250
2246
|
}
|
|
2251
2247
|
singleFileChanged() {
|
|
2252
|
-
|
|
2248
|
+
this.#syncSingleFileState();
|
|
2253
2249
|
}
|
|
2254
2250
|
maxFilesChanged(_oldValue, newValue) {
|
|
2255
|
-
if (!
|
|
2251
|
+
if (!this.#dropzone) {
|
|
2256
2252
|
return;
|
|
2257
2253
|
}
|
|
2258
|
-
|
|
2259
|
-
|
|
2254
|
+
this.#dropzone.options.maxFiles = newValue;
|
|
2255
|
+
this.#updateHiddenFileInput();
|
|
2260
2256
|
}
|
|
2261
2257
|
maxFileSizeChanged(_oldValue, newValue) {
|
|
2262
|
-
if (!
|
|
2258
|
+
if (!this.#dropzone) {
|
|
2263
2259
|
return;
|
|
2264
2260
|
}
|
|
2265
|
-
|
|
2261
|
+
this.#dropzone.options.maxFilesize = newValue;
|
|
2266
2262
|
}
|
|
2267
2263
|
acceptChanged(_oldValue, newValue) {
|
|
2268
|
-
if (!
|
|
2264
|
+
if (!this.#dropzone) {
|
|
2269
2265
|
return;
|
|
2270
2266
|
}
|
|
2271
|
-
|
|
2267
|
+
this.#dropzone.options.acceptedFiles = newValue;
|
|
2272
2268
|
}
|
|
2273
2269
|
invalidFileTypeErrorChanged(_oldValue, newValue) {
|
|
2274
|
-
if (
|
|
2275
|
-
|
|
2270
|
+
if (this.#dropzone)
|
|
2271
|
+
this.#dropzone.options.dictInvalidFileType = newValue || this.locale.filePicker.invalidFileTypeError;
|
|
2276
2272
|
}
|
|
2277
2273
|
maxFilesExceededErrorChanged(_oldValue, newValue) {
|
|
2278
|
-
if (
|
|
2279
|
-
|
|
2274
|
+
if (this.#dropzone)
|
|
2275
|
+
this.#dropzone.options.dictMaxFilesExceeded = newValue || this.locale.filePicker.maxFilesExceededError;
|
|
2280
2276
|
}
|
|
2281
2277
|
fileTooBigErrorChanged(_oldValue, newValue) {
|
|
2282
|
-
if (
|
|
2283
|
-
|
|
2278
|
+
if (this.#dropzone)
|
|
2279
|
+
this.#dropzone.options.dictFileTooBig = newValue || this.locale.filePicker.fileTooBigError;
|
|
2284
2280
|
}
|
|
2285
2281
|
nameChanged(previous, next) {
|
|
2286
2282
|
super.nameChanged(previous, next);
|
|
2287
|
-
|
|
2283
|
+
this.#updateFormValue();
|
|
2284
|
+
}
|
|
2285
|
+
#localizeErrorMessage;
|
|
2286
|
+
#localizeFileSizeNumberAndUnits;
|
|
2287
|
+
#addRemoveButtonToFilesPreview() {
|
|
2288
|
+
this.#dropzone.on("addedfiles", (files) => {
|
|
2289
|
+
for (const file of files) {
|
|
2290
|
+
if (file.previewElement) {
|
|
2291
|
+
const removeButton = file.previewElement.querySelector(
|
|
2292
|
+
".remove-btn"
|
|
2293
|
+
);
|
|
2294
|
+
removeButton.addEventListener("click", (e) => {
|
|
2295
|
+
e.preventDefault();
|
|
2296
|
+
e.stopPropagation();
|
|
2297
|
+
this.#dropzone.removeFile(file);
|
|
2298
|
+
});
|
|
2299
|
+
}
|
|
2300
|
+
}
|
|
2301
|
+
this.#handleFilesChanged();
|
|
2302
|
+
});
|
|
2288
2303
|
}
|
|
2289
2304
|
connectedCallback() {
|
|
2290
2305
|
super.connectedCallback();
|
|
@@ -2294,7 +2309,7 @@ let FilePicker = class extends DelegatesAria(
|
|
|
2294
2309
|
const previewList = this.shadowRoot.querySelector(
|
|
2295
2310
|
".preview-list"
|
|
2296
2311
|
);
|
|
2297
|
-
|
|
2312
|
+
this.#dropzone = new $3ed269f2f0fb224b$export$2e2bcd8739ae039(control, {
|
|
2298
2313
|
url: "/",
|
|
2299
2314
|
// dummy url, we do not use dropzone's upload functionality
|
|
2300
2315
|
maxFiles: this.maxFiles ?? null,
|
|
@@ -2312,18 +2327,18 @@ let FilePicker = class extends DelegatesAria(
|
|
|
2312
2327
|
dictInvalidFileType: this.invalidFileTypeError || this.locale.filePicker.invalidFileTypeError,
|
|
2313
2328
|
dictMaxFilesExceeded: this.maxFilesExceededError || this.locale.filePicker.maxFilesExceededError,
|
|
2314
2329
|
dictFileTooBig: this.fileTooBigError || this.locale.filePicker.fileTooBigError,
|
|
2315
|
-
error:
|
|
2316
|
-
})
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2330
|
+
error: this.#localizeErrorMessage
|
|
2331
|
+
});
|
|
2332
|
+
this.#localizeFileSizeNumberAndUnits();
|
|
2333
|
+
this.#addRemoveButtonToFilesPreview();
|
|
2334
|
+
this.#dropzone.on("removedfile", () => {
|
|
2335
|
+
this.#handleFilesChanged();
|
|
2321
2336
|
});
|
|
2322
|
-
|
|
2337
|
+
this.#syncSingleFileState();
|
|
2323
2338
|
}
|
|
2324
2339
|
disconnectedCallback() {
|
|
2325
2340
|
super.disconnectedCallback();
|
|
2326
|
-
|
|
2341
|
+
this.#dropzone.destroy();
|
|
2327
2342
|
}
|
|
2328
2343
|
/**
|
|
2329
2344
|
* Used internally to set the button tag.
|
|
@@ -2344,126 +2359,104 @@ let FilePicker = class extends DelegatesAria(
|
|
|
2344
2359
|
*/
|
|
2345
2360
|
handleKeydown(e) {
|
|
2346
2361
|
if (e.key === "Enter" || e.key === " ") {
|
|
2347
|
-
|
|
2362
|
+
this.#chooseFile();
|
|
2348
2363
|
}
|
|
2349
2364
|
return true;
|
|
2350
2365
|
}
|
|
2351
|
-
|
|
2352
|
-
|
|
2366
|
+
#chooseFile() {
|
|
2367
|
+
if (this.#dropzone.hiddenFileInput) {
|
|
2368
|
+
this.#dropzone.hiddenFileInput.click();
|
|
2369
|
+
}
|
|
2353
2370
|
}
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2371
|
+
#updateHiddenFileInput() {
|
|
2372
|
+
this.#dropzone.hiddenFileInput.dispatchEvent(
|
|
2373
|
+
new Event("change", { bubbles: false })
|
|
2374
|
+
);
|
|
2357
2375
|
}
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
__privateGet(this, _dropzone)?.removeAllFiles();
|
|
2376
|
+
#keepOnlyNewestFile() {
|
|
2377
|
+
for (let i = 0; i < this.files.length - 1; i++) {
|
|
2378
|
+
this.#dropzone.removeFile(this.files[i]);
|
|
2379
|
+
}
|
|
2363
2380
|
}
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2381
|
+
#handleFilesChanged() {
|
|
2382
|
+
if (this.singleFile && this.files.length >= 1) {
|
|
2383
|
+
this.#keepOnlyNewestFile();
|
|
2384
|
+
}
|
|
2385
|
+
this.$emit("change");
|
|
2386
|
+
this.#updateFormValue();
|
|
2387
|
+
this.validate();
|
|
2388
|
+
requestAnimationFrame(() => this.#syncSingleFileState());
|
|
2372
2389
|
}
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
".remove-btn"
|
|
2382
|
-
);
|
|
2383
|
-
removeButton.addEventListener("click", (e) => {
|
|
2384
|
-
e.preventDefault();
|
|
2385
|
-
e.stopPropagation();
|
|
2386
|
-
__privateGet(this, _dropzone).removeFile(file);
|
|
2387
|
-
});
|
|
2390
|
+
#updateFormValue() {
|
|
2391
|
+
const files = this.files;
|
|
2392
|
+
if (!this.name) {
|
|
2393
|
+
this.setFormValue(null);
|
|
2394
|
+
} else {
|
|
2395
|
+
const formData = new FormData();
|
|
2396
|
+
for (const file of files) {
|
|
2397
|
+
formData.append(this.name, file);
|
|
2388
2398
|
}
|
|
2399
|
+
this.setFormValue(formData);
|
|
2389
2400
|
}
|
|
2390
|
-
|
|
2391
|
-
});
|
|
2392
|
-
};
|
|
2393
|
-
chooseFile_fn = function() {
|
|
2394
|
-
if (__privateGet(this, _dropzone).hiddenFileInput) {
|
|
2395
|
-
__privateGet(this, _dropzone).hiddenFileInput.click();
|
|
2401
|
+
this.#setValueToAFakePathLikeNativeInput();
|
|
2396
2402
|
}
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
__privateGet(this, _dropzone).hiddenFileInput.dispatchEvent(
|
|
2400
|
-
new Event("change", { bubbles: false })
|
|
2401
|
-
);
|
|
2402
|
-
};
|
|
2403
|
-
keepOnlyNewestFile_fn = function() {
|
|
2404
|
-
for (let i = 0; i < this.files.length - 1; i++) {
|
|
2405
|
-
__privateGet(this, _dropzone).removeFile(this.files[i]);
|
|
2403
|
+
#setValueToAFakePathLikeNativeInput() {
|
|
2404
|
+
this.value = this.files.length > 0 ? `C:\\fakepath\\${this.files[0].name}` : "";
|
|
2406
2405
|
}
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2406
|
+
#getCustomValidationError() {
|
|
2407
|
+
if (this.rejectedFiles.length > 0) {
|
|
2408
|
+
return this.locale.filePicker.invalidFilesError;
|
|
2409
|
+
}
|
|
2410
|
+
return null;
|
|
2411
2411
|
}
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
if (!this.name) {
|
|
2419
|
-
this.setFormValue(null);
|
|
2420
|
-
} else {
|
|
2421
|
-
const formData = new FormData();
|
|
2422
|
-
for (const file of files) {
|
|
2423
|
-
formData.append(this.name, file);
|
|
2424
|
-
}
|
|
2425
|
-
this.setFormValue(formData);
|
|
2412
|
+
/** {@inheritDoc (FormAssociated:interface).validate} */
|
|
2413
|
+
validate() {
|
|
2414
|
+
if (this.proxy) {
|
|
2415
|
+
this.proxy.setCustomValidity(this.#getCustomValidationError() ?? "");
|
|
2416
|
+
}
|
|
2417
|
+
super.validate(this.control);
|
|
2426
2418
|
}
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
this.value = this.files.length > 0 ? `C:\\fakepath\\${this.files[0].name}` : "";
|
|
2431
|
-
};
|
|
2432
|
-
formatNumbersInMessage_fn = function(message) {
|
|
2433
|
-
if (this.locale.common.useCommaAsDecimalSeparator) {
|
|
2434
|
-
return message.replace(/(\d+)\.(\d+)/g, "$1,$2");
|
|
2419
|
+
formResetCallback() {
|
|
2420
|
+
super.formResetCallback();
|
|
2421
|
+
this.#dropzone.removeAllFiles();
|
|
2435
2422
|
}
|
|
2436
|
-
|
|
2437
|
-
|
|
2423
|
+
#formatNumbersInMessage(message) {
|
|
2424
|
+
if (this.locale.common.useCommaAsDecimalSeparator) {
|
|
2425
|
+
return message.replace(/(\d+)\.(\d+)/g, "$1,$2");
|
|
2426
|
+
}
|
|
2427
|
+
return message;
|
|
2428
|
+
}
|
|
2429
|
+
/**
|
|
2430
|
+
* Removes all files from the File Picker.
|
|
2431
|
+
*/
|
|
2432
|
+
removeAllFiles() {
|
|
2433
|
+
this.#dropzone?.removeAllFiles();
|
|
2434
|
+
}
|
|
2435
|
+
}
|
|
2438
2436
|
__decorateClass([
|
|
2439
2437
|
attr({ attribute: "single-file", mode: "boolean" })
|
|
2440
|
-
], FilePicker.prototype, "singleFile"
|
|
2438
|
+
], FilePicker.prototype, "singleFile");
|
|
2441
2439
|
__decorateClass([
|
|
2442
2440
|
attr({ attribute: "max-files" })
|
|
2443
|
-
], FilePicker.prototype, "maxFiles"
|
|
2441
|
+
], FilePicker.prototype, "maxFiles");
|
|
2444
2442
|
__decorateClass([
|
|
2445
2443
|
attr({ mode: "fromView", attribute: "max-file-size" })
|
|
2446
|
-
], FilePicker.prototype, "maxFileSize"
|
|
2444
|
+
], FilePicker.prototype, "maxFileSize");
|
|
2447
2445
|
__decorateClass([
|
|
2448
2446
|
attr
|
|
2449
|
-
], FilePicker.prototype, "accept"
|
|
2447
|
+
], FilePicker.prototype, "accept");
|
|
2450
2448
|
__decorateClass([
|
|
2451
2449
|
attr
|
|
2452
|
-
], FilePicker.prototype, "size"
|
|
2450
|
+
], FilePicker.prototype, "size");
|
|
2453
2451
|
__decorateClass([
|
|
2454
2452
|
attr({ attribute: "invalid-file-type-error" })
|
|
2455
|
-
], FilePicker.prototype, "invalidFileTypeError"
|
|
2453
|
+
], FilePicker.prototype, "invalidFileTypeError");
|
|
2456
2454
|
__decorateClass([
|
|
2457
2455
|
attr({ attribute: "max-files-exceeded-error" })
|
|
2458
|
-
], FilePicker.prototype, "maxFilesExceededError"
|
|
2456
|
+
], FilePicker.prototype, "maxFilesExceededError");
|
|
2459
2457
|
__decorateClass([
|
|
2460
2458
|
attr({ attribute: "file-too-big-error" })
|
|
2461
|
-
], FilePicker.prototype, "fileTooBigError"
|
|
2462
|
-
FilePicker = __decorateClass([
|
|
2463
|
-
errorText,
|
|
2464
|
-
formElements
|
|
2465
|
-
], FilePicker);
|
|
2466
|
-
applyMixinsWithObservables(FilePicker, FormElementHelperText);
|
|
2459
|
+
], FilePicker.prototype, "fileTooBigError");
|
|
2467
2460
|
|
|
2468
2461
|
const getClasses = ({ size }) => classNames("control", "dz-default", "dz-message", [
|
|
2469
2462
|
`size-${size}`,
|
|
@@ -2480,18 +2473,21 @@ const FilePickerTemplate = (context) => {
|
|
|
2480
2473
|
(x) => x.label,
|
|
2481
2474
|
html`<label>${(x) => x.label}</label>`
|
|
2482
2475
|
)}
|
|
2483
|
-
<div
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2476
|
+
<div class="control-wrapper">
|
|
2477
|
+
<div
|
|
2478
|
+
${ref("control")}
|
|
2479
|
+
class="${getClasses}"
|
|
2480
|
+
tabindex="0"
|
|
2481
|
+
@keydown="${(x, c) => x.handleKeydown(c.event)}"
|
|
2482
|
+
aria-describedby="${(x) => x._feedbackDescribedBy}"
|
|
2483
|
+
${delegateAria({
|
|
2489
2484
|
role: "button"
|
|
2490
2485
|
})}
|
|
2491
|
-
|
|
2492
|
-
|
|
2486
|
+
>
|
|
2487
|
+
<slot class="main"></slot>
|
|
2488
|
+
</div>
|
|
2489
|
+
${(x) => x._getFeedbackTemplate(context)}
|
|
2493
2490
|
</div>
|
|
2494
|
-
${getFeedbackTemplate(context)}
|
|
2495
2491
|
<div class="preview-list"></div>
|
|
2496
2492
|
</div>
|
|
2497
2493
|
`;
|
|
@@ -2501,7 +2497,7 @@ const filePickerDefinition = defineVividComponent(
|
|
|
2501
2497
|
"file-picker",
|
|
2502
2498
|
FilePicker,
|
|
2503
2499
|
FilePickerTemplate,
|
|
2504
|
-
[iconDefinition, buttonDefinition],
|
|
2500
|
+
[iconDefinition, buttonDefinition, feedbackMessageDefinition],
|
|
2505
2501
|
{
|
|
2506
2502
|
styles,
|
|
2507
2503
|
shadowOptions: {
|
package/shared/definition27.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const definition = require('./
|
|
3
|
+
const definition = require('./definition65.cjs');
|
|
4
4
|
const vividElement = require('./vivid-element.cjs');
|
|
5
5
|
const delegatesAria = require('./delegates-aria.cjs');
|
|
6
6
|
const classNames = require('./class-names.cjs');
|
package/shared/definition27.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as Elevation, e as elevationDefinition } from './
|
|
2
|
-
import { V as VividElement, a as attr, h as html,
|
|
1
|
+
import { E as Elevation, e as elevationDefinition } from './definition65.js';
|
|
2
|
+
import { V as VividElement, a as attr, h as html, d as createRegisterFunction, f as defineVividComponent } from './vivid-element.js';
|
|
3
3
|
import { D as DelegatesAria, d as delegateAria } from './delegates-aria.js';
|
|
4
4
|
import { c as classNames } from './class-names.js';
|
|
5
5
|
|
package/shared/definition28.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const vividElement = require('./vivid-element.cjs');
|
|
4
|
+
const definition = require('./definition66.cjs');
|
|
4
5
|
const _has = require('./_has.cjs');
|
|
5
6
|
const classNames = require('./class-names.cjs');
|
|
6
7
|
const when = require('./when.cjs');
|
|
@@ -243,6 +244,9 @@ __decorateClass([
|
|
|
243
244
|
__decorateClass([
|
|
244
245
|
vividElement.observable
|
|
245
246
|
], Icon.prototype, "iconLoaded", 2);
|
|
247
|
+
__decorateClass([
|
|
248
|
+
vividElement.attr
|
|
249
|
+
], Icon.prototype, "label", 2);
|
|
246
250
|
__decorateClass([
|
|
247
251
|
vividElement.attr
|
|
248
252
|
], Icon.prototype, "name", 2);
|
|
@@ -255,24 +259,35 @@ const getClasses = ({ connotation, size }) => classNames.classNames(
|
|
|
255
259
|
[`connotation-${connotation}`, Boolean(connotation)],
|
|
256
260
|
[`size-${size}`, typeof size === "number"]
|
|
257
261
|
);
|
|
258
|
-
const iconTemplate =
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
262
|
+
const iconTemplate = (context) => {
|
|
263
|
+
const visuallyHiddenTag = context.tagFor(definition.VisuallyHidden);
|
|
264
|
+
const isDecorative = (x) => !x.label || x.label.trim().length === 0;
|
|
265
|
+
return vividElement.html`
|
|
266
|
+
<figure class="${getClasses}" ?aria-hidden="${(x) => isDecorative(x)}" ?aria-busy="${(x) => !x.iconLoaded}">
|
|
267
|
+
<slot>
|
|
268
|
+
${when.when(
|
|
269
|
+
(x) => !x.iconLoaded,
|
|
270
|
+
vividElement.html`<img alt="${(x) => x.name}" src="${(x) => x.iconUrl}" />`
|
|
271
|
+
)}
|
|
272
|
+
${when.when(
|
|
273
|
+
(x) => x.iconLoaded && x._svg,
|
|
274
|
+
(x) => vividElement.html`${x._svg}`
|
|
275
|
+
)}
|
|
276
|
+
</slot>
|
|
277
|
+
<${visuallyHiddenTag} class="label">${(x) => x.label}</${visuallyHiddenTag}>
|
|
278
|
+
</figure>
|
|
279
|
+
`;
|
|
280
|
+
};
|
|
272
281
|
|
|
273
|
-
const iconDefinition = vividElement.defineVividComponent(
|
|
274
|
-
|
|
275
|
-
|
|
282
|
+
const iconDefinition = vividElement.defineVividComponent(
|
|
283
|
+
"icon",
|
|
284
|
+
Icon,
|
|
285
|
+
iconTemplate,
|
|
286
|
+
[definition.visuallyHiddenDefinition],
|
|
287
|
+
{
|
|
288
|
+
styles
|
|
289
|
+
}
|
|
290
|
+
);
|
|
276
291
|
const registerIcon = vividElement.createRegisterFunction(iconDefinition);
|
|
277
292
|
|
|
278
293
|
exports.Icon = Icon;
|
package/shared/definition28.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { V as VividElement, a as attr, o as observable, v as volatile, h as html,
|
|
1
|
+
import { V as VividElement, a as attr, o as observable, v as volatile, h as html, d as createRegisterFunction, f as defineVividComponent } from './vivid-element.js';
|
|
2
|
+
import { V as VisuallyHidden, v as visuallyHiddenDefinition } from './definition66.js';
|
|
2
3
|
import { _ as _curry1, a as _curry2, b as _has } from './_has.js';
|
|
3
4
|
import { c as classNames } from './class-names.js';
|
|
4
5
|
import { w as when } from './when.js';
|
|
@@ -241,6 +242,9 @@ __decorateClass([
|
|
|
241
242
|
__decorateClass([
|
|
242
243
|
observable
|
|
243
244
|
], Icon.prototype, "iconLoaded", 2);
|
|
245
|
+
__decorateClass([
|
|
246
|
+
attr
|
|
247
|
+
], Icon.prototype, "label", 2);
|
|
244
248
|
__decorateClass([
|
|
245
249
|
attr
|
|
246
250
|
], Icon.prototype, "name", 2);
|
|
@@ -253,24 +257,35 @@ const getClasses = ({ connotation, size }) => classNames(
|
|
|
253
257
|
[`connotation-${connotation}`, Boolean(connotation)],
|
|
254
258
|
[`size-${size}`, typeof size === "number"]
|
|
255
259
|
);
|
|
256
|
-
const iconTemplate =
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
260
|
+
const iconTemplate = (context) => {
|
|
261
|
+
const visuallyHiddenTag = context.tagFor(VisuallyHidden);
|
|
262
|
+
const isDecorative = (x) => !x.label || x.label.trim().length === 0;
|
|
263
|
+
return html`
|
|
264
|
+
<figure class="${getClasses}" ?aria-hidden="${(x) => isDecorative(x)}" ?aria-busy="${(x) => !x.iconLoaded}">
|
|
265
|
+
<slot>
|
|
266
|
+
${when(
|
|
267
|
+
(x) => !x.iconLoaded,
|
|
268
|
+
html`<img alt="${(x) => x.name}" src="${(x) => x.iconUrl}" />`
|
|
269
|
+
)}
|
|
270
|
+
${when(
|
|
271
|
+
(x) => x.iconLoaded && x._svg,
|
|
272
|
+
(x) => html`${x._svg}`
|
|
273
|
+
)}
|
|
274
|
+
</slot>
|
|
275
|
+
<${visuallyHiddenTag} class="label">${(x) => x.label}</${visuallyHiddenTag}>
|
|
276
|
+
</figure>
|
|
277
|
+
`;
|
|
278
|
+
};
|
|
270
279
|
|
|
271
|
-
const iconDefinition = defineVividComponent(
|
|
272
|
-
|
|
273
|
-
|
|
280
|
+
const iconDefinition = defineVividComponent(
|
|
281
|
+
"icon",
|
|
282
|
+
Icon,
|
|
283
|
+
iconTemplate,
|
|
284
|
+
[visuallyHiddenDefinition],
|
|
285
|
+
{
|
|
286
|
+
styles
|
|
287
|
+
}
|
|
288
|
+
);
|
|
274
289
|
const registerIcon = createRegisterFunction(iconDefinition);
|
|
275
290
|
|
|
276
291
|
export { Icon as I, iconDefinition as i, memoizeWith as m, registerIcon as r };
|