@vonage/vivid 3.51.0 → 3.52.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/alert/index.cjs +1 -1
- package/alert/index.js +1 -1
- package/appearance-ui/index.cjs +19 -11
- package/appearance-ui/index.js +19 -11
- package/audio-player/index.cjs +2 -1
- package/audio-player/index.js +2 -1
- package/card/index.cjs +1 -1
- package/card/index.js +1 -1
- package/combobox/index.cjs +2 -5
- package/combobox/index.js +2 -5
- package/custom-elements.json +1357 -529
- package/date-picker/index.cjs +3 -6
- package/date-picker/index.js +3 -6
- package/date-range-picker/index.cjs +2 -5
- package/date-range-picker/index.js +2 -5
- package/dialog/index.cjs +1 -1
- package/dialog/index.js +1 -1
- package/elevation/index.cjs +1 -1
- package/elevation/index.js +1 -1
- package/file-picker/index.cjs +0 -2
- package/file-picker/index.js +0 -2
- package/header/index.cjs +1 -1
- package/header/index.js +1 -1
- package/index.cjs +60 -58
- package/index.js +22 -23
- package/lib/avatar/definition.d.ts +1 -1
- package/lib/button/button.d.ts +1 -0
- package/lib/button/definition.d.ts +1 -1
- package/lib/calendar-event/definition.d.ts +1 -1
- package/lib/components.d.ts +1 -0
- package/lib/layout/definition.d.ts +1 -1
- package/lib/menu-item/menu-item.d.ts +3 -0
- package/lib/range-slider/definition.d.ts +3 -0
- package/lib/range-slider/locale.d.ts +4 -0
- package/lib/range-slider/range-slider.d.ts +32 -0
- package/lib/range-slider/range-slider.form-associated.d.ts +10 -0
- package/lib/range-slider/range-slider.template.d.ts +4 -0
- package/lib/range-slider/utils/lerp.d.ts +2 -0
- package/lib/range-slider/utils/roundToStepValue.d.ts +1 -0
- package/lib/slider/slider.template.d.ts +1 -0
- package/lib/split-button/definition.d.ts +1 -1
- package/listbox/index.cjs +23 -22
- package/listbox/index.js +23 -22
- package/locales/en-GB.cjs +4 -0
- package/locales/en-GB.js +4 -0
- package/locales/en-US.cjs +4 -0
- package/locales/en-US.js +4 -0
- package/locales/ja-JP.cjs +5 -1
- package/locales/ja-JP.js +5 -1
- package/locales/zh-CN.cjs +4 -0
- package/locales/zh-CN.js +4 -0
- package/menu/index.cjs +3 -3
- package/menu/index.js +3 -3
- package/menu-item/index.cjs +2 -2
- package/menu-item/index.js +2 -2
- package/number-field/index.cjs +0 -2
- package/number-field/index.js +0 -2
- package/package.json +34 -34
- package/popup/index.cjs +2 -2
- package/popup/index.js +2 -2
- package/range-slider/index.cjs +22 -0
- package/range-slider/index.js +20 -0
- package/select/index.cjs +3 -3
- package/select/index.js +3 -3
- package/selectable-box/index.cjs +1 -1
- package/selectable-box/index.js +1 -1
- package/shared/Reflector.cjs +5 -1
- package/shared/Reflector.js +5 -1
- package/shared/affix.cjs +11 -4
- package/shared/affix.js +12 -4
- package/shared/anchored.cjs +8 -2
- package/shared/anchored.js +8 -2
- package/shared/definition.cjs +8 -3
- package/shared/definition.js +8 -3
- package/shared/definition10.cjs +5 -5
- package/shared/definition10.js +5 -5
- package/shared/definition11.cjs +75 -47
- package/shared/definition11.js +76 -48
- package/shared/definition12.cjs +12 -14
- package/shared/definition12.js +12 -14
- package/shared/definition13.cjs +118 -75
- package/shared/definition13.js +118 -75
- package/shared/definition14.cjs +33 -32
- package/shared/definition14.js +33 -32
- package/shared/definition15.cjs +20 -7
- package/shared/definition15.js +20 -7
- package/shared/definition16.cjs +37 -42
- package/shared/definition16.js +36 -41
- package/shared/definition17.cjs +125 -65
- package/shared/definition17.js +126 -66
- package/shared/definition18.cjs +30 -14
- package/shared/definition18.js +30 -14
- package/shared/definition19.cjs +116 -80
- package/shared/definition19.js +116 -80
- package/shared/definition2.cjs +10 -5
- package/shared/definition2.js +10 -5
- package/shared/definition20.cjs +16 -15
- package/shared/definition20.js +16 -15
- package/shared/definition21.cjs +6 -10
- package/shared/definition21.js +6 -10
- package/shared/definition22.cjs +14 -18
- package/shared/definition22.js +14 -18
- package/shared/definition23.cjs +34 -35
- package/shared/definition23.js +34 -35
- package/shared/definition24.cjs +116 -69
- package/shared/definition24.js +116 -69
- package/shared/definition25.cjs +2 -4
- package/shared/definition25.js +2 -4
- package/shared/definition26.cjs +9 -8
- package/shared/definition26.js +9 -8
- package/shared/definition27.cjs +7 -5
- package/shared/definition27.js +7 -5
- package/shared/definition28.cjs +209 -143
- package/shared/definition28.js +209 -143
- package/shared/definition29.cjs +10 -4
- package/shared/definition29.js +10 -4
- package/shared/definition3.cjs +7 -10
- package/shared/definition3.js +7 -10
- package/shared/definition30.cjs +7 -5
- package/shared/definition30.js +7 -5
- package/shared/definition31.cjs +2 -4
- package/shared/definition31.js +2 -4
- package/shared/definition32.cjs +1 -3
- package/shared/definition32.js +1 -3
- package/shared/definition33.cjs +7 -10
- package/shared/definition33.js +7 -10
- package/shared/definition34.cjs +76 -59
- package/shared/definition34.js +76 -59
- package/shared/definition35.cjs +19 -20
- package/shared/definition35.js +19 -20
- package/shared/definition36.cjs +30 -14
- package/shared/definition36.js +30 -14
- package/shared/definition37.cjs +33 -46
- package/shared/definition37.js +33 -46
- package/shared/definition38.cjs +31 -33
- package/shared/definition38.js +31 -33
- package/shared/definition39.cjs +13 -4
- package/shared/definition39.js +13 -4
- package/shared/definition4.cjs +23 -11
- package/shared/definition4.js +23 -11
- package/shared/definition40.cjs +19 -14
- package/shared/definition40.js +19 -14
- package/shared/definition41.cjs +534 -635
- package/shared/definition41.js +534 -635
- package/shared/definition42.cjs +674 -106
- package/shared/definition42.js +673 -105
- package/shared/definition43.cjs +122 -79
- package/shared/definition43.js +120 -77
- package/shared/definition44.cjs +72 -567
- package/shared/definition44.js +71 -565
- package/shared/definition45.cjs +520 -118
- package/shared/definition45.js +518 -117
- package/shared/definition46.cjs +117 -130
- package/shared/definition46.js +116 -129
- package/shared/definition47.cjs +152 -18
- package/shared/definition47.js +151 -17
- package/shared/definition48.cjs +20 -77
- package/shared/definition48.js +19 -76
- package/shared/definition49.cjs +52 -495
- package/shared/definition49.js +51 -494
- package/shared/definition5.cjs +20 -17
- package/shared/definition5.js +20 -17
- package/shared/definition50.cjs +525 -24
- package/shared/definition50.js +524 -23
- package/shared/definition51.cjs +28 -119
- package/shared/definition51.js +26 -118
- package/shared/definition52.cjs +113 -266
- package/shared/definition52.js +113 -265
- package/shared/definition53.cjs +285 -245
- package/shared/definition53.js +285 -245
- package/shared/definition54.cjs +285 -751
- package/shared/definition54.js +284 -750
- package/shared/definition55.cjs +828 -99
- package/shared/definition55.js +827 -98
- package/shared/definition56.cjs +126 -77
- package/shared/definition56.js +125 -76
- package/shared/definition57.cjs +125 -71
- package/shared/definition57.js +124 -70
- package/shared/definition58.cjs +73 -287
- package/shared/definition58.js +74 -288
- package/shared/definition59.cjs +298 -40
- package/shared/definition59.js +297 -39
- package/shared/definition6.cjs +3 -4
- package/shared/definition6.js +3 -4
- package/shared/definition60.cjs +24 -1784
- package/shared/definition60.js +23 -1783
- package/shared/definition61.cjs +1819 -11
- package/shared/definition61.js +1818 -11
- package/shared/definition7.cjs +6 -4
- package/shared/definition7.js +6 -4
- package/shared/definition8.cjs +25 -18
- package/shared/definition8.js +25 -18
- package/shared/definition9.cjs +6 -9
- package/shared/definition9.js +6 -9
- package/shared/icon.cjs +7 -2
- package/shared/icon.js +7 -2
- package/shared/index2.cjs +1 -1
- package/shared/index2.js +1 -1
- package/shared/key-codes2.cjs +8 -0
- package/shared/key-codes2.js +5 -1
- package/shared/localization/Locale.d.ts +2 -0
- package/shared/patterns/index.d.ts +0 -1
- package/shared/presentationDate.cjs +126 -78
- package/shared/presentationDate.js +126 -78
- package/shared/slider.template.cjs +71 -0
- package/shared/slider.template.js +67 -0
- package/shared/text-anchor.template.cjs +30 -35
- package/shared/text-anchor.template.js +30 -35
- package/shared/text-field.cjs +1 -1
- package/shared/text-field.js +1 -1
- package/side-drawer/index.cjs +1 -1
- package/side-drawer/index.js +1 -1
- package/slider/index.cjs +2 -1
- package/slider/index.js +2 -1
- package/split-button/index.cjs +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/fonts/spezia-variable.css +39 -13
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +4 -2
- package/switch/index.cjs +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 +3 -3
- package/tabs/index.js +3 -3
- 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 -4
- package/text-field/index.js +1 -4
- package/time-picker/index.cjs +4 -7
- package/time-picker/index.js +4 -7
- package/toggletip/index.cjs +3 -3
- package/toggletip/index.js +3 -3
- package/tooltip/index.cjs +3 -3
- package/tooltip/index.js +3 -3
- 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/vivid.api.json +117 -1
- package/focus/index.cjs +0 -7
- package/focus/index.js +0 -5
- package/lib/focus/definition.d.ts +0 -3
- package/lib/focus/focus.d.ts +0 -3
- package/lib/focus/focus.template.d.ts +0 -4
- package/lib/popup/popup.d.ts +0 -21
- package/shared/focus.cjs +0 -8
- package/shared/focus.js +0 -6
- package/shared/focus2.cjs +0 -11
- package/shared/focus2.js +0 -9
- package/shared/patterns/focus.d.ts +0 -3
package/shared/definition24.cjs
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
const index = require('./index.cjs');
|
|
4
4
|
const definition$1 = require('./definition26.cjs');
|
|
5
|
-
const definition$2 = require('./definition61.cjs');
|
|
6
5
|
const definition = require('./definition11.cjs');
|
|
7
6
|
const enums = require('./enums.cjs');
|
|
8
7
|
require('./affix.cjs');
|
|
@@ -14,7 +13,7 @@ const when = require('./when.cjs');
|
|
|
14
13
|
const ref = require('./ref.cjs');
|
|
15
14
|
const classNames = require('./class-names.cjs');
|
|
16
15
|
|
|
17
|
-
const styles = ":host{display:block;max-inline-size:400px}.base{display:flex;flex-direction:column}.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);background-color:var(--vvd-color-cta-50);
|
|
16
|
+
const styles = ":host{display:block;max-inline-size:400px}.base{display:flex;flex-direction:column}.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}.control:not(.size-expanded){min-block-size:52px}.control.size-expanded{min-block-size:120px}.control:focus-visible{--focus-stroke-gap-color: transparent;--focus-inset: 1px;box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px))}.main{pointer-events:none}.dz-preview{display:grid;box-sizing:border-box;padding:6px 12px;border-radius:8px;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{color:var(--vvd-color-alert-500);font:var(--vvd-typography-base-condensed);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)}.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}.message{margin-block-start:4px;--_low-ink-color: var(--vvd-color-neutral-600)}.preview-list{display:flex;flex-direction:column;gap:12px;margin-block-start:12px;overflow-y:auto}.preview-list:empty{display:none}\n";
|
|
18
17
|
|
|
19
18
|
var objectExtend = extend;
|
|
20
19
|
|
|
@@ -2162,10 +2161,39 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
2162
2161
|
__defProp(target, key, result);
|
|
2163
2162
|
return result;
|
|
2164
2163
|
};
|
|
2164
|
+
var __accessCheck = (obj, member, msg) => {
|
|
2165
|
+
if (!member.has(obj))
|
|
2166
|
+
throw TypeError("Cannot " + msg);
|
|
2167
|
+
};
|
|
2168
|
+
var __privateGet = (obj, member, getter) => {
|
|
2169
|
+
__accessCheck(obj, member, "read from private field");
|
|
2170
|
+
return getter ? getter.call(obj) : member.get(obj);
|
|
2171
|
+
};
|
|
2172
|
+
var __privateAdd = (obj, member, value) => {
|
|
2173
|
+
if (member.has(obj))
|
|
2174
|
+
throw TypeError("Cannot add the same private member more than once");
|
|
2175
|
+
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
2176
|
+
};
|
|
2177
|
+
var __privateSet = (obj, member, value, setter) => {
|
|
2178
|
+
__accessCheck(obj, member, "write to private field");
|
|
2179
|
+
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
2180
|
+
return value;
|
|
2181
|
+
};
|
|
2182
|
+
var __privateMethod = (obj, member, method) => {
|
|
2183
|
+
__accessCheck(obj, member, "access private method");
|
|
2184
|
+
return method;
|
|
2185
|
+
};
|
|
2186
|
+
var _dropzone, _chooseFile, chooseFile_fn, _updateHiddenFileInput, updateHiddenFileInput_fn, _handleFilesChanged, handleFilesChanged_fn, _updateFormValue, updateFormValue_fn, _setValueToAFakePathLikeNativeInput, setValueToAFakePathLikeNativeInput_fn;
|
|
2165
2187
|
const isFormAssociatedTryingToSetFormValueToFakePath = (value) => typeof value === "string";
|
|
2166
2188
|
let FilePicker = class extends FormAssociatedFilePicker {
|
|
2167
2189
|
constructor() {
|
|
2168
2190
|
super();
|
|
2191
|
+
__privateAdd(this, _chooseFile);
|
|
2192
|
+
__privateAdd(this, _updateHiddenFileInput);
|
|
2193
|
+
__privateAdd(this, _handleFilesChanged);
|
|
2194
|
+
__privateAdd(this, _updateFormValue);
|
|
2195
|
+
__privateAdd(this, _setValueToAFakePathLikeNativeInput);
|
|
2196
|
+
__privateAdd(this, _dropzone, void 0);
|
|
2169
2197
|
this.maxFileSize = 256;
|
|
2170
2198
|
/**
|
|
2171
2199
|
* Used internally to hold the tag that button is registered at.
|
|
@@ -2179,37 +2207,36 @@ let FilePicker = class extends FormAssociatedFilePicker {
|
|
|
2179
2207
|
};
|
|
2180
2208
|
$3ed269f2f0fb224b$export$2e2bcd8739ae039.autoDiscover = false;
|
|
2181
2209
|
}
|
|
2182
|
-
#dropzone;
|
|
2183
2210
|
/**
|
|
2184
2211
|
* Files that have been added to the file picker and passed validation.
|
|
2185
2212
|
*
|
|
2186
2213
|
* @public
|
|
2187
2214
|
*/
|
|
2188
2215
|
get files() {
|
|
2189
|
-
return this
|
|
2216
|
+
return __privateGet(this, _dropzone)?.getAcceptedFiles() ?? [];
|
|
2190
2217
|
}
|
|
2191
2218
|
maxFilesChanged(_oldValue, newValue) {
|
|
2192
|
-
if (!this
|
|
2219
|
+
if (!__privateGet(this, _dropzone)) {
|
|
2193
2220
|
return;
|
|
2194
2221
|
}
|
|
2195
|
-
this
|
|
2196
|
-
this
|
|
2222
|
+
__privateGet(this, _dropzone).options.maxFiles = newValue;
|
|
2223
|
+
__privateMethod(this, _updateHiddenFileInput, updateHiddenFileInput_fn).call(this);
|
|
2197
2224
|
}
|
|
2198
2225
|
maxFileSizeChanged(_oldValue, newValue) {
|
|
2199
|
-
if (!this
|
|
2226
|
+
if (!__privateGet(this, _dropzone)) {
|
|
2200
2227
|
return;
|
|
2201
2228
|
}
|
|
2202
|
-
this
|
|
2229
|
+
__privateGet(this, _dropzone).options.maxFilesize = newValue;
|
|
2203
2230
|
}
|
|
2204
2231
|
acceptChanged(_oldValue, newValue) {
|
|
2205
|
-
if (!this
|
|
2232
|
+
if (!__privateGet(this, _dropzone)) {
|
|
2206
2233
|
return;
|
|
2207
2234
|
}
|
|
2208
|
-
this
|
|
2235
|
+
__privateGet(this, _dropzone).options.acceptedFiles = newValue;
|
|
2209
2236
|
}
|
|
2210
2237
|
nameChanged(previous, next) {
|
|
2211
2238
|
super.nameChanged(previous, next);
|
|
2212
|
-
this
|
|
2239
|
+
__privateMethod(this, _updateFormValue, updateFormValue_fn).call(this);
|
|
2213
2240
|
}
|
|
2214
2241
|
connectedCallback() {
|
|
2215
2242
|
super.connectedCallback();
|
|
@@ -2219,7 +2246,7 @@ let FilePicker = class extends FormAssociatedFilePicker {
|
|
|
2219
2246
|
const previewList = this.shadowRoot.querySelector(
|
|
2220
2247
|
".preview-list"
|
|
2221
2248
|
);
|
|
2222
|
-
this
|
|
2249
|
+
__privateSet(this, _dropzone, new $3ed269f2f0fb224b$export$2e2bcd8739ae039(control, {
|
|
2223
2250
|
url: "/",
|
|
2224
2251
|
// dummy url, we do not use dropzone's upload functionality
|
|
2225
2252
|
maxFiles: this.maxFiles ?? null,
|
|
@@ -2241,8 +2268,8 @@ let FilePicker = class extends FormAssociatedFilePicker {
|
|
|
2241
2268
|
dictInvalidFileType: this.locale.filePicker.invalidFileTypeError,
|
|
2242
2269
|
dictMaxFilesExceeded: this.locale.filePicker.maxFilesExceededError,
|
|
2243
2270
|
dictFileTooBig: this.locale.filePicker.fileTooBigError
|
|
2244
|
-
});
|
|
2245
|
-
this
|
|
2271
|
+
}));
|
|
2272
|
+
__privateGet(this, _dropzone).on("addedfiles", (files) => {
|
|
2246
2273
|
for (const file of files) {
|
|
2247
2274
|
if (file.previewElement) {
|
|
2248
2275
|
const removeButton = file.previewElement.querySelector(
|
|
@@ -2251,16 +2278,16 @@ let FilePicker = class extends FormAssociatedFilePicker {
|
|
|
2251
2278
|
removeButton.addEventListener("click", (e) => {
|
|
2252
2279
|
e.preventDefault();
|
|
2253
2280
|
e.stopPropagation();
|
|
2254
|
-
this
|
|
2281
|
+
__privateGet(this, _dropzone).removeFile(file);
|
|
2255
2282
|
});
|
|
2256
2283
|
}
|
|
2257
2284
|
}
|
|
2258
|
-
this
|
|
2285
|
+
__privateMethod(this, _handleFilesChanged, handleFilesChanged_fn).call(this);
|
|
2259
2286
|
});
|
|
2260
|
-
this
|
|
2261
|
-
this
|
|
2287
|
+
__privateGet(this, _dropzone).on("removedfile", () => {
|
|
2288
|
+
__privateMethod(this, _handleFilesChanged, handleFilesChanged_fn).call(this);
|
|
2262
2289
|
});
|
|
2263
|
-
this
|
|
2290
|
+
__privateGet(this, _dropzone).on("error", (file) => {
|
|
2264
2291
|
if (file.previewElement) {
|
|
2265
2292
|
const removeButton = file.previewElement.querySelector(
|
|
2266
2293
|
".remove-btn"
|
|
@@ -2271,7 +2298,7 @@ let FilePicker = class extends FormAssociatedFilePicker {
|
|
|
2271
2298
|
}
|
|
2272
2299
|
disconnectedCallback() {
|
|
2273
2300
|
super.disconnectedCallback();
|
|
2274
|
-
this
|
|
2301
|
+
__privateGet(this, _dropzone).destroy();
|
|
2275
2302
|
}
|
|
2276
2303
|
/**
|
|
2277
2304
|
* Used internally to set the button tag.
|
|
@@ -2285,50 +2312,56 @@ let FilePicker = class extends FormAssociatedFilePicker {
|
|
|
2285
2312
|
*/
|
|
2286
2313
|
handleKeydown(e) {
|
|
2287
2314
|
if (e.key === "Enter" || e.key === " ") {
|
|
2288
|
-
this
|
|
2315
|
+
__privateMethod(this, _chooseFile, chooseFile_fn).call(this);
|
|
2289
2316
|
}
|
|
2290
2317
|
return true;
|
|
2291
2318
|
}
|
|
2292
|
-
#chooseFile() {
|
|
2293
|
-
if (this.#dropzone.hiddenFileInput) {
|
|
2294
|
-
this.#dropzone.hiddenFileInput.click();
|
|
2295
|
-
}
|
|
2296
|
-
}
|
|
2297
|
-
#updateHiddenFileInput() {
|
|
2298
|
-
if (this.#dropzone.hiddenFileInput) {
|
|
2299
|
-
this.#dropzone.hiddenFileInput.dispatchEvent(
|
|
2300
|
-
new Event("change", { bubbles: false })
|
|
2301
|
-
);
|
|
2302
|
-
}
|
|
2303
|
-
}
|
|
2304
|
-
#handleFilesChanged() {
|
|
2305
|
-
this.$emit("change");
|
|
2306
|
-
this.#updateFormValue();
|
|
2307
|
-
}
|
|
2308
|
-
#updateFormValue() {
|
|
2309
|
-
const files = this.files;
|
|
2310
|
-
if (!this.name) {
|
|
2311
|
-
this.setFormValue(null);
|
|
2312
|
-
} else {
|
|
2313
|
-
const formData = new FormData();
|
|
2314
|
-
for (const file of files) {
|
|
2315
|
-
formData.append(this.name, file);
|
|
2316
|
-
}
|
|
2317
|
-
this.setFormValue(formData);
|
|
2318
|
-
}
|
|
2319
|
-
this.#setValueToAFakePathLikeNativeInput();
|
|
2320
|
-
}
|
|
2321
|
-
#setValueToAFakePathLikeNativeInput() {
|
|
2322
|
-
this.value = this.files.length > 0 ? `C:\\fakepath\\${this.files[0].name}` : "";
|
|
2323
|
-
}
|
|
2324
2319
|
validate() {
|
|
2325
2320
|
super.validate(this.control);
|
|
2326
2321
|
}
|
|
2327
2322
|
formResetCallback() {
|
|
2328
2323
|
super.formResetCallback();
|
|
2329
|
-
this
|
|
2324
|
+
__privateGet(this, _dropzone).removeAllFiles();
|
|
2330
2325
|
}
|
|
2331
2326
|
};
|
|
2327
|
+
_dropzone = new WeakMap();
|
|
2328
|
+
_chooseFile = new WeakSet();
|
|
2329
|
+
chooseFile_fn = function() {
|
|
2330
|
+
if (__privateGet(this, _dropzone).hiddenFileInput) {
|
|
2331
|
+
__privateGet(this, _dropzone).hiddenFileInput.click();
|
|
2332
|
+
}
|
|
2333
|
+
};
|
|
2334
|
+
_updateHiddenFileInput = new WeakSet();
|
|
2335
|
+
updateHiddenFileInput_fn = function() {
|
|
2336
|
+
if (__privateGet(this, _dropzone).hiddenFileInput) {
|
|
2337
|
+
__privateGet(this, _dropzone).hiddenFileInput.dispatchEvent(
|
|
2338
|
+
new Event("change", { bubbles: false })
|
|
2339
|
+
);
|
|
2340
|
+
}
|
|
2341
|
+
};
|
|
2342
|
+
_handleFilesChanged = new WeakSet();
|
|
2343
|
+
handleFilesChanged_fn = function() {
|
|
2344
|
+
this.$emit("change");
|
|
2345
|
+
__privateMethod(this, _updateFormValue, updateFormValue_fn).call(this);
|
|
2346
|
+
};
|
|
2347
|
+
_updateFormValue = new WeakSet();
|
|
2348
|
+
updateFormValue_fn = function() {
|
|
2349
|
+
const files = this.files;
|
|
2350
|
+
if (!this.name) {
|
|
2351
|
+
this.setFormValue(null);
|
|
2352
|
+
} else {
|
|
2353
|
+
const formData = new FormData();
|
|
2354
|
+
for (const file of files) {
|
|
2355
|
+
formData.append(this.name, file);
|
|
2356
|
+
}
|
|
2357
|
+
this.setFormValue(formData);
|
|
2358
|
+
}
|
|
2359
|
+
__privateMethod(this, _setValueToAFakePathLikeNativeInput, setValueToAFakePathLikeNativeInput_fn).call(this);
|
|
2360
|
+
};
|
|
2361
|
+
_setValueToAFakePathLikeNativeInput = new WeakSet();
|
|
2362
|
+
setValueToAFakePathLikeNativeInput_fn = function() {
|
|
2363
|
+
this.value = this.files.length > 0 ? `C:\\fakepath\\${this.files[0].name}` : "";
|
|
2364
|
+
};
|
|
2332
2365
|
__decorateClass([
|
|
2333
2366
|
index.attr({ attribute: "max-files" })
|
|
2334
2367
|
], FilePicker.prototype, "maxFiles", 2);
|
|
@@ -2347,27 +2380,37 @@ FilePicker = __decorateClass([
|
|
|
2347
2380
|
], FilePicker);
|
|
2348
2381
|
applyMixins.applyMixins(FilePicker, index$1.FormElementHelperText, localized.Localized);
|
|
2349
2382
|
|
|
2350
|
-
const getClasses = ({
|
|
2351
|
-
size
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
"dz-default",
|
|
2355
|
-
"dz-message",
|
|
2356
|
-
[`size-${size}`, Boolean(size)]
|
|
2357
|
-
);
|
|
2383
|
+
const getClasses = ({ size }) => classNames.classNames("control", "dz-default", "dz-message", [
|
|
2384
|
+
`size-${size}`,
|
|
2385
|
+
Boolean(size)
|
|
2386
|
+
]);
|
|
2358
2387
|
const FilePickerTemplate = (context) => {
|
|
2359
2388
|
return index.html`
|
|
2360
2389
|
${(x) => {
|
|
2361
2390
|
x.setButtonTag(context.tagFor(definition.Button));
|
|
2362
2391
|
}}
|
|
2363
2392
|
<div class="base" aria-label="${(x) => x.label}">
|
|
2364
|
-
${when.when(
|
|
2365
|
-
|
|
2366
|
-
|
|
2393
|
+
${when.when(
|
|
2394
|
+
(x) => x.label,
|
|
2395
|
+
index.html`<label>${(x) => x.label}</label>`
|
|
2396
|
+
)}
|
|
2397
|
+
<div
|
|
2398
|
+
${ref.ref("control")}
|
|
2399
|
+
class="${getClasses}"
|
|
2400
|
+
tabindex="0"
|
|
2401
|
+
role="button"
|
|
2402
|
+
@keydown="${(x, c) => x.handleKeydown(c.event)}"
|
|
2403
|
+
>
|
|
2367
2404
|
<slot class="main"></slot>
|
|
2368
2405
|
</div>
|
|
2369
|
-
${when.when(
|
|
2370
|
-
|
|
2406
|
+
${when.when(
|
|
2407
|
+
(x) => !x.errorValidationMessage && x.helperText?.length,
|
|
2408
|
+
index$1.getFeedbackTemplate("helper", context)
|
|
2409
|
+
)}
|
|
2410
|
+
${when.when(
|
|
2411
|
+
(x) => x.errorValidationMessage,
|
|
2412
|
+
index$1.getFeedbackTemplate("error", context)
|
|
2413
|
+
)}
|
|
2371
2414
|
<div class="preview-list"></div>
|
|
2372
2415
|
</div>
|
|
2373
2416
|
`;
|
|
@@ -2381,7 +2424,11 @@ const filePickerDefinition = FilePicker.compose({
|
|
|
2381
2424
|
delegatesFocus: true
|
|
2382
2425
|
}
|
|
2383
2426
|
});
|
|
2384
|
-
const filePickerRegistries = [
|
|
2427
|
+
const filePickerRegistries = [
|
|
2428
|
+
filePickerDefinition(),
|
|
2429
|
+
...definition$1.iconRegistries,
|
|
2430
|
+
...definition.buttonRegistries
|
|
2431
|
+
];
|
|
2385
2432
|
const registerFilePicker = index.registerFactory(filePickerRegistries);
|
|
2386
2433
|
|
|
2387
2434
|
exports.filePickerDefinition = filePickerDefinition;
|
package/shared/definition24.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { F as FoundationElement, a as attr, h as html, r as registerFactory } from './index.js';
|
|
2
2
|
import { a as iconRegistries } from './definition26.js';
|
|
3
|
-
import { f as focusRegistries } from './definition61.js';
|
|
4
3
|
import { B as Button, a as buttonRegistries } from './definition11.js';
|
|
5
4
|
import { C as Connotation } from './enums.js';
|
|
6
5
|
import './affix.js';
|
|
@@ -12,7 +11,7 @@ import { w as when } from './when.js';
|
|
|
12
11
|
import { r as ref } from './ref.js';
|
|
13
12
|
import { c as classNames } from './class-names.js';
|
|
14
13
|
|
|
15
|
-
const styles = ":host{display:block;max-inline-size:400px}.base{display:flex;flex-direction:column}.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);background-color:var(--vvd-color-cta-50);
|
|
14
|
+
const styles = ":host{display:block;max-inline-size:400px}.base{display:flex;flex-direction:column}.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}.control:not(.size-expanded){min-block-size:52px}.control.size-expanded{min-block-size:120px}.control:focus-visible{--focus-stroke-gap-color: transparent;--focus-inset: 1px;box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px))}.main{pointer-events:none}.dz-preview{display:grid;box-sizing:border-box;padding:6px 12px;border-radius:8px;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{color:var(--vvd-color-alert-500);font:var(--vvd-typography-base-condensed);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)}.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}.message{margin-block-start:4px;--_low-ink-color: var(--vvd-color-neutral-600)}.preview-list{display:flex;flex-direction:column;gap:12px;margin-block-start:12px;overflow-y:auto}.preview-list:empty{display:none}\n";
|
|
16
15
|
|
|
17
16
|
var objectExtend = extend;
|
|
18
17
|
|
|
@@ -2160,10 +2159,39 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
2160
2159
|
__defProp(target, key, result);
|
|
2161
2160
|
return result;
|
|
2162
2161
|
};
|
|
2162
|
+
var __accessCheck = (obj, member, msg) => {
|
|
2163
|
+
if (!member.has(obj))
|
|
2164
|
+
throw TypeError("Cannot " + msg);
|
|
2165
|
+
};
|
|
2166
|
+
var __privateGet = (obj, member, getter) => {
|
|
2167
|
+
__accessCheck(obj, member, "read from private field");
|
|
2168
|
+
return getter ? getter.call(obj) : member.get(obj);
|
|
2169
|
+
};
|
|
2170
|
+
var __privateAdd = (obj, member, value) => {
|
|
2171
|
+
if (member.has(obj))
|
|
2172
|
+
throw TypeError("Cannot add the same private member more than once");
|
|
2173
|
+
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
2174
|
+
};
|
|
2175
|
+
var __privateSet = (obj, member, value, setter) => {
|
|
2176
|
+
__accessCheck(obj, member, "write to private field");
|
|
2177
|
+
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
2178
|
+
return value;
|
|
2179
|
+
};
|
|
2180
|
+
var __privateMethod = (obj, member, method) => {
|
|
2181
|
+
__accessCheck(obj, member, "access private method");
|
|
2182
|
+
return method;
|
|
2183
|
+
};
|
|
2184
|
+
var _dropzone, _chooseFile, chooseFile_fn, _updateHiddenFileInput, updateHiddenFileInput_fn, _handleFilesChanged, handleFilesChanged_fn, _updateFormValue, updateFormValue_fn, _setValueToAFakePathLikeNativeInput, setValueToAFakePathLikeNativeInput_fn;
|
|
2163
2185
|
const isFormAssociatedTryingToSetFormValueToFakePath = (value) => typeof value === "string";
|
|
2164
2186
|
let FilePicker = class extends FormAssociatedFilePicker {
|
|
2165
2187
|
constructor() {
|
|
2166
2188
|
super();
|
|
2189
|
+
__privateAdd(this, _chooseFile);
|
|
2190
|
+
__privateAdd(this, _updateHiddenFileInput);
|
|
2191
|
+
__privateAdd(this, _handleFilesChanged);
|
|
2192
|
+
__privateAdd(this, _updateFormValue);
|
|
2193
|
+
__privateAdd(this, _setValueToAFakePathLikeNativeInput);
|
|
2194
|
+
__privateAdd(this, _dropzone, void 0);
|
|
2167
2195
|
this.maxFileSize = 256;
|
|
2168
2196
|
/**
|
|
2169
2197
|
* Used internally to hold the tag that button is registered at.
|
|
@@ -2177,37 +2205,36 @@ let FilePicker = class extends FormAssociatedFilePicker {
|
|
|
2177
2205
|
};
|
|
2178
2206
|
$3ed269f2f0fb224b$export$2e2bcd8739ae039.autoDiscover = false;
|
|
2179
2207
|
}
|
|
2180
|
-
#dropzone;
|
|
2181
2208
|
/**
|
|
2182
2209
|
* Files that have been added to the file picker and passed validation.
|
|
2183
2210
|
*
|
|
2184
2211
|
* @public
|
|
2185
2212
|
*/
|
|
2186
2213
|
get files() {
|
|
2187
|
-
return this
|
|
2214
|
+
return __privateGet(this, _dropzone)?.getAcceptedFiles() ?? [];
|
|
2188
2215
|
}
|
|
2189
2216
|
maxFilesChanged(_oldValue, newValue) {
|
|
2190
|
-
if (!this
|
|
2217
|
+
if (!__privateGet(this, _dropzone)) {
|
|
2191
2218
|
return;
|
|
2192
2219
|
}
|
|
2193
|
-
this
|
|
2194
|
-
this
|
|
2220
|
+
__privateGet(this, _dropzone).options.maxFiles = newValue;
|
|
2221
|
+
__privateMethod(this, _updateHiddenFileInput, updateHiddenFileInput_fn).call(this);
|
|
2195
2222
|
}
|
|
2196
2223
|
maxFileSizeChanged(_oldValue, newValue) {
|
|
2197
|
-
if (!this
|
|
2224
|
+
if (!__privateGet(this, _dropzone)) {
|
|
2198
2225
|
return;
|
|
2199
2226
|
}
|
|
2200
|
-
this
|
|
2227
|
+
__privateGet(this, _dropzone).options.maxFilesize = newValue;
|
|
2201
2228
|
}
|
|
2202
2229
|
acceptChanged(_oldValue, newValue) {
|
|
2203
|
-
if (!this
|
|
2230
|
+
if (!__privateGet(this, _dropzone)) {
|
|
2204
2231
|
return;
|
|
2205
2232
|
}
|
|
2206
|
-
this
|
|
2233
|
+
__privateGet(this, _dropzone).options.acceptedFiles = newValue;
|
|
2207
2234
|
}
|
|
2208
2235
|
nameChanged(previous, next) {
|
|
2209
2236
|
super.nameChanged(previous, next);
|
|
2210
|
-
this
|
|
2237
|
+
__privateMethod(this, _updateFormValue, updateFormValue_fn).call(this);
|
|
2211
2238
|
}
|
|
2212
2239
|
connectedCallback() {
|
|
2213
2240
|
super.connectedCallback();
|
|
@@ -2217,7 +2244,7 @@ let FilePicker = class extends FormAssociatedFilePicker {
|
|
|
2217
2244
|
const previewList = this.shadowRoot.querySelector(
|
|
2218
2245
|
".preview-list"
|
|
2219
2246
|
);
|
|
2220
|
-
this
|
|
2247
|
+
__privateSet(this, _dropzone, new $3ed269f2f0fb224b$export$2e2bcd8739ae039(control, {
|
|
2221
2248
|
url: "/",
|
|
2222
2249
|
// dummy url, we do not use dropzone's upload functionality
|
|
2223
2250
|
maxFiles: this.maxFiles ?? null,
|
|
@@ -2239,8 +2266,8 @@ let FilePicker = class extends FormAssociatedFilePicker {
|
|
|
2239
2266
|
dictInvalidFileType: this.locale.filePicker.invalidFileTypeError,
|
|
2240
2267
|
dictMaxFilesExceeded: this.locale.filePicker.maxFilesExceededError,
|
|
2241
2268
|
dictFileTooBig: this.locale.filePicker.fileTooBigError
|
|
2242
|
-
});
|
|
2243
|
-
this
|
|
2269
|
+
}));
|
|
2270
|
+
__privateGet(this, _dropzone).on("addedfiles", (files) => {
|
|
2244
2271
|
for (const file of files) {
|
|
2245
2272
|
if (file.previewElement) {
|
|
2246
2273
|
const removeButton = file.previewElement.querySelector(
|
|
@@ -2249,16 +2276,16 @@ let FilePicker = class extends FormAssociatedFilePicker {
|
|
|
2249
2276
|
removeButton.addEventListener("click", (e) => {
|
|
2250
2277
|
e.preventDefault();
|
|
2251
2278
|
e.stopPropagation();
|
|
2252
|
-
this
|
|
2279
|
+
__privateGet(this, _dropzone).removeFile(file);
|
|
2253
2280
|
});
|
|
2254
2281
|
}
|
|
2255
2282
|
}
|
|
2256
|
-
this
|
|
2283
|
+
__privateMethod(this, _handleFilesChanged, handleFilesChanged_fn).call(this);
|
|
2257
2284
|
});
|
|
2258
|
-
this
|
|
2259
|
-
this
|
|
2285
|
+
__privateGet(this, _dropzone).on("removedfile", () => {
|
|
2286
|
+
__privateMethod(this, _handleFilesChanged, handleFilesChanged_fn).call(this);
|
|
2260
2287
|
});
|
|
2261
|
-
this
|
|
2288
|
+
__privateGet(this, _dropzone).on("error", (file) => {
|
|
2262
2289
|
if (file.previewElement) {
|
|
2263
2290
|
const removeButton = file.previewElement.querySelector(
|
|
2264
2291
|
".remove-btn"
|
|
@@ -2269,7 +2296,7 @@ let FilePicker = class extends FormAssociatedFilePicker {
|
|
|
2269
2296
|
}
|
|
2270
2297
|
disconnectedCallback() {
|
|
2271
2298
|
super.disconnectedCallback();
|
|
2272
|
-
this
|
|
2299
|
+
__privateGet(this, _dropzone).destroy();
|
|
2273
2300
|
}
|
|
2274
2301
|
/**
|
|
2275
2302
|
* Used internally to set the button tag.
|
|
@@ -2283,50 +2310,56 @@ let FilePicker = class extends FormAssociatedFilePicker {
|
|
|
2283
2310
|
*/
|
|
2284
2311
|
handleKeydown(e) {
|
|
2285
2312
|
if (e.key === "Enter" || e.key === " ") {
|
|
2286
|
-
this
|
|
2313
|
+
__privateMethod(this, _chooseFile, chooseFile_fn).call(this);
|
|
2287
2314
|
}
|
|
2288
2315
|
return true;
|
|
2289
2316
|
}
|
|
2290
|
-
#chooseFile() {
|
|
2291
|
-
if (this.#dropzone.hiddenFileInput) {
|
|
2292
|
-
this.#dropzone.hiddenFileInput.click();
|
|
2293
|
-
}
|
|
2294
|
-
}
|
|
2295
|
-
#updateHiddenFileInput() {
|
|
2296
|
-
if (this.#dropzone.hiddenFileInput) {
|
|
2297
|
-
this.#dropzone.hiddenFileInput.dispatchEvent(
|
|
2298
|
-
new Event("change", { bubbles: false })
|
|
2299
|
-
);
|
|
2300
|
-
}
|
|
2301
|
-
}
|
|
2302
|
-
#handleFilesChanged() {
|
|
2303
|
-
this.$emit("change");
|
|
2304
|
-
this.#updateFormValue();
|
|
2305
|
-
}
|
|
2306
|
-
#updateFormValue() {
|
|
2307
|
-
const files = this.files;
|
|
2308
|
-
if (!this.name) {
|
|
2309
|
-
this.setFormValue(null);
|
|
2310
|
-
} else {
|
|
2311
|
-
const formData = new FormData();
|
|
2312
|
-
for (const file of files) {
|
|
2313
|
-
formData.append(this.name, file);
|
|
2314
|
-
}
|
|
2315
|
-
this.setFormValue(formData);
|
|
2316
|
-
}
|
|
2317
|
-
this.#setValueToAFakePathLikeNativeInput();
|
|
2318
|
-
}
|
|
2319
|
-
#setValueToAFakePathLikeNativeInput() {
|
|
2320
|
-
this.value = this.files.length > 0 ? `C:\\fakepath\\${this.files[0].name}` : "";
|
|
2321
|
-
}
|
|
2322
2317
|
validate() {
|
|
2323
2318
|
super.validate(this.control);
|
|
2324
2319
|
}
|
|
2325
2320
|
formResetCallback() {
|
|
2326
2321
|
super.formResetCallback();
|
|
2327
|
-
this
|
|
2322
|
+
__privateGet(this, _dropzone).removeAllFiles();
|
|
2328
2323
|
}
|
|
2329
2324
|
};
|
|
2325
|
+
_dropzone = new WeakMap();
|
|
2326
|
+
_chooseFile = new WeakSet();
|
|
2327
|
+
chooseFile_fn = function() {
|
|
2328
|
+
if (__privateGet(this, _dropzone).hiddenFileInput) {
|
|
2329
|
+
__privateGet(this, _dropzone).hiddenFileInput.click();
|
|
2330
|
+
}
|
|
2331
|
+
};
|
|
2332
|
+
_updateHiddenFileInput = new WeakSet();
|
|
2333
|
+
updateHiddenFileInput_fn = function() {
|
|
2334
|
+
if (__privateGet(this, _dropzone).hiddenFileInput) {
|
|
2335
|
+
__privateGet(this, _dropzone).hiddenFileInput.dispatchEvent(
|
|
2336
|
+
new Event("change", { bubbles: false })
|
|
2337
|
+
);
|
|
2338
|
+
}
|
|
2339
|
+
};
|
|
2340
|
+
_handleFilesChanged = new WeakSet();
|
|
2341
|
+
handleFilesChanged_fn = function() {
|
|
2342
|
+
this.$emit("change");
|
|
2343
|
+
__privateMethod(this, _updateFormValue, updateFormValue_fn).call(this);
|
|
2344
|
+
};
|
|
2345
|
+
_updateFormValue = new WeakSet();
|
|
2346
|
+
updateFormValue_fn = function() {
|
|
2347
|
+
const files = this.files;
|
|
2348
|
+
if (!this.name) {
|
|
2349
|
+
this.setFormValue(null);
|
|
2350
|
+
} else {
|
|
2351
|
+
const formData = new FormData();
|
|
2352
|
+
for (const file of files) {
|
|
2353
|
+
formData.append(this.name, file);
|
|
2354
|
+
}
|
|
2355
|
+
this.setFormValue(formData);
|
|
2356
|
+
}
|
|
2357
|
+
__privateMethod(this, _setValueToAFakePathLikeNativeInput, setValueToAFakePathLikeNativeInput_fn).call(this);
|
|
2358
|
+
};
|
|
2359
|
+
_setValueToAFakePathLikeNativeInput = new WeakSet();
|
|
2360
|
+
setValueToAFakePathLikeNativeInput_fn = function() {
|
|
2361
|
+
this.value = this.files.length > 0 ? `C:\\fakepath\\${this.files[0].name}` : "";
|
|
2362
|
+
};
|
|
2330
2363
|
__decorateClass([
|
|
2331
2364
|
attr({ attribute: "max-files" })
|
|
2332
2365
|
], FilePicker.prototype, "maxFiles", 2);
|
|
@@ -2345,27 +2378,37 @@ FilePicker = __decorateClass([
|
|
|
2345
2378
|
], FilePicker);
|
|
2346
2379
|
applyMixins(FilePicker, FormElementHelperText, Localized);
|
|
2347
2380
|
|
|
2348
|
-
const getClasses = ({
|
|
2349
|
-
size
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
"dz-default",
|
|
2353
|
-
"dz-message",
|
|
2354
|
-
[`size-${size}`, Boolean(size)]
|
|
2355
|
-
);
|
|
2381
|
+
const getClasses = ({ size }) => classNames("control", "dz-default", "dz-message", [
|
|
2382
|
+
`size-${size}`,
|
|
2383
|
+
Boolean(size)
|
|
2384
|
+
]);
|
|
2356
2385
|
const FilePickerTemplate = (context) => {
|
|
2357
2386
|
return html`
|
|
2358
2387
|
${(x) => {
|
|
2359
2388
|
x.setButtonTag(context.tagFor(Button));
|
|
2360
2389
|
}}
|
|
2361
2390
|
<div class="base" aria-label="${(x) => x.label}">
|
|
2362
|
-
${when(
|
|
2363
|
-
|
|
2364
|
-
|
|
2391
|
+
${when(
|
|
2392
|
+
(x) => x.label,
|
|
2393
|
+
html`<label>${(x) => x.label}</label>`
|
|
2394
|
+
)}
|
|
2395
|
+
<div
|
|
2396
|
+
${ref("control")}
|
|
2397
|
+
class="${getClasses}"
|
|
2398
|
+
tabindex="0"
|
|
2399
|
+
role="button"
|
|
2400
|
+
@keydown="${(x, c) => x.handleKeydown(c.event)}"
|
|
2401
|
+
>
|
|
2365
2402
|
<slot class="main"></slot>
|
|
2366
2403
|
</div>
|
|
2367
|
-
${when(
|
|
2368
|
-
|
|
2404
|
+
${when(
|
|
2405
|
+
(x) => !x.errorValidationMessage && x.helperText?.length,
|
|
2406
|
+
getFeedbackTemplate("helper", context)
|
|
2407
|
+
)}
|
|
2408
|
+
${when(
|
|
2409
|
+
(x) => x.errorValidationMessage,
|
|
2410
|
+
getFeedbackTemplate("error", context)
|
|
2411
|
+
)}
|
|
2369
2412
|
<div class="preview-list"></div>
|
|
2370
2413
|
</div>
|
|
2371
2414
|
`;
|
|
@@ -2379,7 +2422,11 @@ const filePickerDefinition = FilePicker.compose({
|
|
|
2379
2422
|
delegatesFocus: true
|
|
2380
2423
|
}
|
|
2381
2424
|
});
|
|
2382
|
-
const filePickerRegistries = [
|
|
2425
|
+
const filePickerRegistries = [
|
|
2426
|
+
filePickerDefinition(),
|
|
2427
|
+
...iconRegistries,
|
|
2428
|
+
...buttonRegistries
|
|
2429
|
+
];
|
|
2383
2430
|
const registerFilePicker = registerFactory(filePickerRegistries);
|
|
2384
2431
|
|
|
2385
2432
|
export { filePickerRegistries as a, filePickerDefinition as f, registerFilePicker as r };
|
package/shared/definition25.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const index = require('./index.cjs');
|
|
4
|
-
const definition = require('./
|
|
4
|
+
const definition = require('./definition60.cjs');
|
|
5
5
|
const classNames = require('./class-names.cjs');
|
|
6
6
|
|
|
7
7
|
const styles = ".base{z-index:1;block-size:calc(1px*(40 + 4*clamp(-1,var(--vvd-size-density, 0),2)) + 1px*(24 + 4*clamp(-1,var(--vvd-size-density, 0),2)));font:var(--vvd-typography-heading-4);inline-size:100%}.base .header-content{display:inline-flex;align-items:center;column-gap:4px}.container{display:flex;box-sizing:border-box;justify-content:space-between;background-color:var(--header-bg-color, var(--vvd-color-canvas));block-size:inherit;color:var(--vvd-color-canvas-text);column-gap:12px;padding-block:8px;padding-inline:16px}.container[part~=vvd-theme-alternate]{color-scheme:var(--vvd-color-scheme)}.app-content{--vvd-header-block-size:calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2)) + 1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2)))}\n";
|
|
@@ -36,9 +36,7 @@ __decorateClass([
|
|
|
36
36
|
})
|
|
37
37
|
], Header.prototype, "alternate", 2);
|
|
38
38
|
|
|
39
|
-
const getPartAlternate = ({ alternate }) => classNames.classNames(
|
|
40
|
-
["vvd-theme-alternate", Boolean(alternate)]
|
|
41
|
-
);
|
|
39
|
+
const getPartAlternate = ({ alternate }) => classNames.classNames(["vvd-theme-alternate", Boolean(alternate)]);
|
|
42
40
|
const headerTemplate = (context) => {
|
|
43
41
|
const elevationTag = context.tagFor(definition.Elevation);
|
|
44
42
|
return index.html`
|
package/shared/definition25.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as attr, F as FoundationElement, h as html, r as registerFactory } from './index.js';
|
|
2
|
-
import { E as Elevation, e as elevationRegistries } from './
|
|
2
|
+
import { E as Elevation, e as elevationRegistries } from './definition60.js';
|
|
3
3
|
import { c as classNames } from './class-names.js';
|
|
4
4
|
|
|
5
5
|
const styles = ".base{z-index:1;block-size:calc(1px*(40 + 4*clamp(-1,var(--vvd-size-density, 0),2)) + 1px*(24 + 4*clamp(-1,var(--vvd-size-density, 0),2)));font:var(--vvd-typography-heading-4);inline-size:100%}.base .header-content{display:inline-flex;align-items:center;column-gap:4px}.container{display:flex;box-sizing:border-box;justify-content:space-between;background-color:var(--header-bg-color, var(--vvd-color-canvas));block-size:inherit;color:var(--vvd-color-canvas-text);column-gap:12px;padding-block:8px;padding-inline:16px}.container[part~=vvd-theme-alternate]{color-scheme:var(--vvd-color-scheme)}.app-content{--vvd-header-block-size:calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2)) + 1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2)))}\n";
|
|
@@ -34,9 +34,7 @@ __decorateClass([
|
|
|
34
34
|
})
|
|
35
35
|
], Header.prototype, "alternate", 2);
|
|
36
36
|
|
|
37
|
-
const getPartAlternate = ({ alternate }) => classNames(
|
|
38
|
-
["vvd-theme-alternate", Boolean(alternate)]
|
|
39
|
-
);
|
|
37
|
+
const getPartAlternate = ({ alternate }) => classNames(["vvd-theme-alternate", Boolean(alternate)]);
|
|
40
38
|
const headerTemplate = (context) => {
|
|
41
39
|
const elevationTag = context.tagFor(Elevation);
|
|
42
40
|
return html`
|