@onereach/ui-components 17.2.0-beta.4881.0 → 17.2.0-beta.4882.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/dist/bundled/v2/components/OrDropAreaV3/OrDropArea.js +28 -2
- package/dist/bundled/v2/components/OrDropAreaV3/OrDropArea.vue.d.ts +10 -0
- package/dist/bundled/v2/components/OrFilterPopoverV3/OrFilterPopover.js +1 -29
- package/dist/bundled/v2/components/OrFilterPopoverV3/OrFilterPopover.vue.d.ts +0 -9
- package/dist/bundled/v3/components/OrDropAreaV3/OrDropArea.js +1 -1
- package/dist/bundled/v3/components/OrDropAreaV3/OrDropArea.vue.d.ts +10 -0
- package/dist/bundled/v3/components/OrDropAreaV3/index.js +1 -1
- package/dist/bundled/v3/components/OrDropAreaV3/props.js +1 -1
- package/dist/bundled/v3/components/OrDropAreaV3/styles.js +1 -1
- package/dist/bundled/v3/components/OrDropAreaV3/utils/approximateFileSize.js +1 -1
- package/dist/bundled/v3/components/OrDropAreaV3/utils/index.js +1 -1
- package/dist/bundled/v3/components/{OrDropAreaV3-cf5ef7d5.js → OrDropAreaV3-a9883f18.js} +28 -2
- package/dist/bundled/v3/components/OrFilterPopoverV3/OrFilterPopover.js +1 -1
- package/dist/bundled/v3/components/OrFilterPopoverV3/OrFilterPopover.vue.d.ts +0 -9
- package/dist/bundled/v3/components/OrFilterPopoverV3/index.js +1 -1
- package/dist/bundled/v3/components/OrFilterPopoverV3/styles.js +1 -1
- package/dist/bundled/v3/components/{OrFilterPopoverV3-6899e1b2.js → OrFilterPopoverV3-7b645a22.js} +5 -26
- package/dist/bundled/v3/components/OrFilterV3/OrFilter.js +1 -1
- package/dist/bundled/v3/components/OrFilterV3/index.js +1 -1
- package/dist/bundled/v3/components/OrFilterV3/styles.js +1 -1
- package/dist/bundled/v3/components/{OrFilterV3-a48ae51c.js → OrFilterV3-e4db0097.js} +1 -1
- package/dist/bundled/v3/components/index.js +3 -3
- package/dist/bundled/v3/index.js +3 -3
- package/dist/esm/v2/{OrDropArea-7cf24c23.js → OrDropArea-78f52187.js} +28 -2
- package/dist/esm/v2/{OrFilter-140e4850.js → OrFilter-3ed01d2f.js} +1 -1
- package/dist/esm/v2/{OrFilterPopover-a3bb9348.js → OrFilterPopover-36bc0e6d.js} +1 -29
- package/dist/esm/v2/components/index.js +3 -3
- package/dist/esm/v2/components/or-drop-area-v3/OrDropArea.vue.d.ts +10 -0
- package/dist/esm/v2/components/or-drop-area-v3/index.js +1 -1
- package/dist/esm/v2/components/or-filter-popover-v3/OrFilterPopover.vue.d.ts +0 -9
- package/dist/esm/v2/components/or-filter-popover-v3/index.js +1 -1
- package/dist/esm/v2/components/or-filter-v3/index.js +2 -2
- package/dist/esm/v2/index.js +3 -3
- package/dist/esm/v3/{OrDropArea-24fe94e7.js → OrDropArea-8b3fc35c.js} +28 -2
- package/dist/esm/v3/{OrFilter-d3b39b0d.js → OrFilter-b38dcd0e.js} +1 -1
- package/dist/esm/v3/{OrFilterPopover-28255b45.js → OrFilterPopover-624150ff.js} +5 -26
- package/dist/esm/v3/components/index.js +3 -3
- package/dist/esm/v3/components/or-drop-area-v3/OrDropArea.vue.d.ts +10 -0
- package/dist/esm/v3/components/or-drop-area-v3/index.js +1 -1
- package/dist/esm/v3/components/or-filter-popover-v3/OrFilterPopover.vue.d.ts +0 -9
- package/dist/esm/v3/components/or-filter-popover-v3/index.js +1 -1
- package/dist/esm/v3/components/or-filter-v3/index.js +2 -2
- package/dist/esm/v3/index.js +3 -3
- package/package.json +1 -1
- package/src/components/or-drop-area-v3/OrDropArea.vue +33 -2
- package/src/components/or-filter-popover-v3/OrFilterPopover.vue +1 -27
|
@@ -40,6 +40,10 @@ var script = defineComponent({
|
|
|
40
40
|
disabled: {
|
|
41
41
|
type: Boolean,
|
|
42
42
|
default: false
|
|
43
|
+
},
|
|
44
|
+
error: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: false
|
|
43
47
|
}
|
|
44
48
|
},
|
|
45
49
|
emits: ['update:modelValue'],
|
|
@@ -56,13 +60,34 @@ var script = defineComponent({
|
|
|
56
60
|
const constraintsStyles = computed(() => [...DropAreaConstraints]);
|
|
57
61
|
// State
|
|
58
62
|
const proxyModelValue = useProxyModelValue(toRef(props, 'modelValue'), context.emit);
|
|
63
|
+
const accept = computed(() => {
|
|
64
|
+
if (!props.fileTypes || !Array.isArray(props.fileTypes)) return '';
|
|
65
|
+
return props.fileTypes.join(',');
|
|
66
|
+
});
|
|
59
67
|
const invalid = computed(() => {
|
|
60
|
-
|
|
68
|
+
/* External error */
|
|
69
|
+
if (props.error) return true;
|
|
70
|
+
/* No validation provided */
|
|
71
|
+
if (!props.fileTypes) return false;
|
|
72
|
+
/* File type match: strict and non-strict MIME-type comparison */
|
|
73
|
+
if (props.fileTypes.length > 0 && proxyModelValue.value.some(file => {
|
|
74
|
+
let match = props.fileTypes.some(fileType => {
|
|
75
|
+
if (fileType.match(/\/\*$/)) {
|
|
76
|
+
const baseType = fileType.replace('/*', '');
|
|
77
|
+
return file.type.indexOf(baseType) !== -1;
|
|
78
|
+
} else {
|
|
79
|
+
return file.type === fileType;
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
return !match;
|
|
83
|
+
})) {
|
|
61
84
|
return true;
|
|
62
85
|
}
|
|
86
|
+
/* Files count */
|
|
63
87
|
if (proxyModelValue.value.length > props.maxFiles) {
|
|
64
88
|
return true;
|
|
65
89
|
}
|
|
90
|
+
/* File size */
|
|
66
91
|
if (proxyModelValue.value.some(file => file.size > props.maxFileSize)) {
|
|
67
92
|
return true;
|
|
68
93
|
}
|
|
@@ -86,6 +111,7 @@ var script = defineComponent({
|
|
|
86
111
|
textEmphasisStyles,
|
|
87
112
|
constraintsStyles,
|
|
88
113
|
proxyModelValue,
|
|
114
|
+
accept,
|
|
89
115
|
invalid,
|
|
90
116
|
onChange,
|
|
91
117
|
isDesktop,
|
|
@@ -114,7 +140,7 @@ var __vue_render__ = function () {
|
|
|
114
140
|
class: _vm.controlStyles,
|
|
115
141
|
attrs: {
|
|
116
142
|
"type": 'file',
|
|
117
|
-
"accept": _vm.
|
|
143
|
+
"accept": _vm.accept,
|
|
118
144
|
"multiple": _vm.maxFiles > 1,
|
|
119
145
|
"disabled": _vm.disabled
|
|
120
146
|
},
|
|
@@ -26,6 +26,10 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
26
26
|
type: BooleanConstructor;
|
|
27
27
|
default: boolean;
|
|
28
28
|
};
|
|
29
|
+
error: {
|
|
30
|
+
type: BooleanConstructor;
|
|
31
|
+
default: boolean;
|
|
32
|
+
};
|
|
29
33
|
}, {
|
|
30
34
|
root: import("vue-demi").Ref<HTMLElement | undefined>;
|
|
31
35
|
rootStyles: import("vue-demi").ComputedRef<string[]>;
|
|
@@ -35,6 +39,7 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
35
39
|
textEmphasisStyles: import("vue-demi").ComputedRef<string[]>;
|
|
36
40
|
constraintsStyles: import("vue-demi").ComputedRef<string[]>;
|
|
37
41
|
proxyModelValue: import("../../hooks").UseProxyModelValueReturn<File[]>;
|
|
42
|
+
accept: import("vue-demi").ComputedRef<string>;
|
|
38
43
|
invalid: import("vue-demi").ComputedRef<boolean>;
|
|
39
44
|
onChange: (event: Event) => void;
|
|
40
45
|
isDesktop: import("vue-demi").ComputedRef<boolean>;
|
|
@@ -65,6 +70,10 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
65
70
|
type: BooleanConstructor;
|
|
66
71
|
default: boolean;
|
|
67
72
|
};
|
|
73
|
+
error: {
|
|
74
|
+
type: BooleanConstructor;
|
|
75
|
+
default: boolean;
|
|
76
|
+
};
|
|
68
77
|
}>> & {
|
|
69
78
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
70
79
|
}, {
|
|
@@ -74,5 +83,6 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
74
83
|
maxFileSize: number;
|
|
75
84
|
size: "m" | "s";
|
|
76
85
|
disabled: boolean;
|
|
86
|
+
error: boolean;
|
|
77
87
|
}>;
|
|
78
88
|
export default _default;
|
|
@@ -45,10 +45,6 @@ var script = defineComponent({
|
|
|
45
45
|
type: String,
|
|
46
46
|
default: undefined
|
|
47
47
|
},
|
|
48
|
-
enableDesktopControls: {
|
|
49
|
-
type: Boolean,
|
|
50
|
-
default: false
|
|
51
|
-
},
|
|
52
48
|
offset: {
|
|
53
49
|
type: [Number, Object, Function],
|
|
54
50
|
default: 8
|
|
@@ -138,31 +134,7 @@ var __vue_render__ = function () {
|
|
|
138
134
|
return _vm.reset();
|
|
139
135
|
}
|
|
140
136
|
}
|
|
141
|
-
}, [_vm._v("\n " + _vm._s(_vm.resetLabel) + "\n ")])], 1), _vm._v(" "), _vm._t("default"), _vm._v(" "), _vm._t('actions',
|
|
142
|
-
return [_vm.enableDesktopControls ? _c('div', {
|
|
143
|
-
class: _vm.footerStyles
|
|
144
|
-
}, [_c('OrButton', {
|
|
145
|
-
class: ['grow'],
|
|
146
|
-
attrs: {
|
|
147
|
-
"variant": 'contained'
|
|
148
|
-
},
|
|
149
|
-
on: {
|
|
150
|
-
"click": function ($event) {
|
|
151
|
-
return _vm.apply();
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}, [_vm._v("\n " + _vm._s(_vm.applyLabel) + "\n ")]), _vm._v(" "), _c('OrButton', {
|
|
155
|
-
class: ['grow'],
|
|
156
|
-
attrs: {
|
|
157
|
-
"variant": 'outlined'
|
|
158
|
-
},
|
|
159
|
-
on: {
|
|
160
|
-
"click": function ($event) {
|
|
161
|
-
return _vm.reset();
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
}, [_vm._v("\n " + _vm._s(_vm.resetLabel) + "\n ")])], 1) : _vm._e()];
|
|
165
|
-
}, null, {
|
|
137
|
+
}, [_vm._v("\n " + _vm._s(_vm.resetLabel) + "\n ")])], 1), _vm._v(" "), _vm._t("default"), _vm._v(" "), _vm._t('actions', null, null, {
|
|
166
138
|
apply: _vm.apply,
|
|
167
139
|
reset: _vm.reset,
|
|
168
140
|
isDesktop: _vm.isDesktop,
|
|
@@ -30,10 +30,6 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
30
30
|
type: PropType<"none" | "start" | "end" | undefined>;
|
|
31
31
|
default: undefined;
|
|
32
32
|
};
|
|
33
|
-
enableDesktopControls: {
|
|
34
|
-
type: BooleanConstructor;
|
|
35
|
-
default: boolean;
|
|
36
|
-
};
|
|
37
33
|
offset: {
|
|
38
34
|
type: PropType<PopoverOffset>;
|
|
39
35
|
default: number;
|
|
@@ -80,10 +76,6 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
80
76
|
type: PropType<"none" | "start" | "end" | undefined>;
|
|
81
77
|
default: undefined;
|
|
82
78
|
};
|
|
83
|
-
enableDesktopControls: {
|
|
84
|
-
type: BooleanConstructor;
|
|
85
|
-
default: boolean;
|
|
86
|
-
};
|
|
87
79
|
offset: {
|
|
88
80
|
type: PropType<PopoverOffset>;
|
|
89
81
|
default: number;
|
|
@@ -102,7 +94,6 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
102
94
|
trigger: ReferenceElement;
|
|
103
95
|
placement: "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end" | "right" | "right-start" | "right-end";
|
|
104
96
|
fallbackPlacement: "none" | "start" | "end" | undefined;
|
|
105
|
-
enableDesktopControls: boolean;
|
|
106
97
|
offset: PopoverOffset;
|
|
107
98
|
}>;
|
|
108
99
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { s as default } from '../OrDropAreaV3-
|
|
1
|
+
export { s as default } from '../OrDropAreaV3-a9883f18.js';
|
|
@@ -26,6 +26,10 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
26
26
|
type: BooleanConstructor;
|
|
27
27
|
default: boolean;
|
|
28
28
|
};
|
|
29
|
+
error: {
|
|
30
|
+
type: BooleanConstructor;
|
|
31
|
+
default: boolean;
|
|
32
|
+
};
|
|
29
33
|
}, {
|
|
30
34
|
root: import("vue-demi").Ref<HTMLElement | undefined>;
|
|
31
35
|
rootStyles: import("vue-demi").ComputedRef<string[]>;
|
|
@@ -35,6 +39,7 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
35
39
|
textEmphasisStyles: import("vue-demi").ComputedRef<string[]>;
|
|
36
40
|
constraintsStyles: import("vue-demi").ComputedRef<string[]>;
|
|
37
41
|
proxyModelValue: import("../../hooks").UseProxyModelValueReturn<File[]>;
|
|
42
|
+
accept: import("vue-demi").ComputedRef<string>;
|
|
38
43
|
invalid: import("vue-demi").ComputedRef<boolean>;
|
|
39
44
|
onChange: (event: Event) => void;
|
|
40
45
|
isDesktop: import("vue-demi").ComputedRef<boolean>;
|
|
@@ -65,6 +70,10 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
65
70
|
type: BooleanConstructor;
|
|
66
71
|
default: boolean;
|
|
67
72
|
};
|
|
73
|
+
error: {
|
|
74
|
+
type: BooleanConstructor;
|
|
75
|
+
default: boolean;
|
|
76
|
+
};
|
|
68
77
|
}>> & {
|
|
69
78
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
70
79
|
}, {
|
|
@@ -74,5 +83,6 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
74
83
|
maxFileSize: number;
|
|
75
84
|
size: "m" | "s";
|
|
76
85
|
disabled: boolean;
|
|
86
|
+
error: boolean;
|
|
77
87
|
}>;
|
|
78
88
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { D as DropAreaSize, s as OrDropAreaV3, a as approximateFileSize } from '../OrDropAreaV3-
|
|
1
|
+
export { D as DropAreaSize, s as OrDropAreaV3, a as approximateFileSize } from '../OrDropAreaV3-a9883f18.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { D as DropAreaSize } from '../OrDropAreaV3-
|
|
1
|
+
export { D as DropAreaSize } from '../OrDropAreaV3-a9883f18.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { b as DropArea, i as DropAreaConstraints, d as DropAreaControl, e as DropAreaIcon, f as DropAreaIconSizes, c as DropAreaSizes, g as DropAreaText, h as DropAreaTextEmphasis } from '../OrDropAreaV3-
|
|
1
|
+
export { b as DropArea, i as DropAreaConstraints, d as DropAreaControl, e as DropAreaIcon, f as DropAreaIconSizes, c as DropAreaSizes, g as DropAreaText, h as DropAreaTextEmphasis } from '../OrDropAreaV3-a9883f18.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { a as approximateFileSize } from '../../OrDropAreaV3-
|
|
1
|
+
export { a as approximateFileSize } from '../../OrDropAreaV3-a9883f18.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { a as approximateFileSize } from '../../OrDropAreaV3-
|
|
1
|
+
export { a as approximateFileSize } from '../../OrDropAreaV3-a9883f18.js';
|
|
@@ -120,6 +120,10 @@ var script = defineComponent({
|
|
|
120
120
|
disabled: {
|
|
121
121
|
type: Boolean,
|
|
122
122
|
default: false
|
|
123
|
+
},
|
|
124
|
+
error: {
|
|
125
|
+
type: Boolean,
|
|
126
|
+
default: false
|
|
123
127
|
}
|
|
124
128
|
},
|
|
125
129
|
emits: ['update:modelValue'],
|
|
@@ -136,13 +140,34 @@ var script = defineComponent({
|
|
|
136
140
|
const constraintsStyles = computed(() => [...DropAreaConstraints]);
|
|
137
141
|
// State
|
|
138
142
|
const proxyModelValue = useProxyModelValue(toRef(props, 'modelValue'), context.emit);
|
|
143
|
+
const accept = computed(() => {
|
|
144
|
+
if (!props.fileTypes || !Array.isArray(props.fileTypes)) return '';
|
|
145
|
+
return props.fileTypes.join(',');
|
|
146
|
+
});
|
|
139
147
|
const invalid = computed(() => {
|
|
140
|
-
|
|
148
|
+
/* External error */
|
|
149
|
+
if (props.error) return true;
|
|
150
|
+
/* No validation provided */
|
|
151
|
+
if (!props.fileTypes) return false;
|
|
152
|
+
/* File type match: strict and non-strict MIME-type comparison */
|
|
153
|
+
if (props.fileTypes.length > 0 && proxyModelValue.value.some(file => {
|
|
154
|
+
let match = props.fileTypes.some(fileType => {
|
|
155
|
+
if (fileType.match(/\/\*$/)) {
|
|
156
|
+
const baseType = fileType.replace('/*', '');
|
|
157
|
+
return file.type.indexOf(baseType) !== -1;
|
|
158
|
+
} else {
|
|
159
|
+
return file.type === fileType;
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
return !match;
|
|
163
|
+
})) {
|
|
141
164
|
return true;
|
|
142
165
|
}
|
|
166
|
+
/* Files count */
|
|
143
167
|
if (proxyModelValue.value.length > props.maxFiles) {
|
|
144
168
|
return true;
|
|
145
169
|
}
|
|
170
|
+
/* File size */
|
|
146
171
|
if (proxyModelValue.value.some(file => file.size > props.maxFileSize)) {
|
|
147
172
|
return true;
|
|
148
173
|
}
|
|
@@ -166,6 +191,7 @@ var script = defineComponent({
|
|
|
166
191
|
textEmphasisStyles,
|
|
167
192
|
constraintsStyles,
|
|
168
193
|
proxyModelValue,
|
|
194
|
+
accept,
|
|
169
195
|
invalid,
|
|
170
196
|
onChange,
|
|
171
197
|
isDesktop,
|
|
@@ -193,7 +219,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
193
219
|
}, [createElementVNode("input", {
|
|
194
220
|
class: normalizeClass(_ctx.controlStyles),
|
|
195
221
|
type: 'file',
|
|
196
|
-
accept: _ctx.
|
|
222
|
+
accept: _ctx.accept,
|
|
197
223
|
multiple: _ctx.maxFiles > 1,
|
|
198
224
|
disabled: _ctx.disabled,
|
|
199
225
|
onChange: _cache[0] || (_cache[0] = $event => _ctx.onChange($event))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { s as default } from '../OrFilterPopoverV3-
|
|
1
|
+
export { s as default } from '../OrFilterPopoverV3-7b645a22.js';
|
|
@@ -30,10 +30,6 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
30
30
|
type: PropType<"none" | "start" | "end" | undefined>;
|
|
31
31
|
default: undefined;
|
|
32
32
|
};
|
|
33
|
-
enableDesktopControls: {
|
|
34
|
-
type: BooleanConstructor;
|
|
35
|
-
default: boolean;
|
|
36
|
-
};
|
|
37
33
|
offset: {
|
|
38
34
|
type: PropType<PopoverOffset>;
|
|
39
35
|
default: number;
|
|
@@ -80,10 +76,6 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
80
76
|
type: PropType<"none" | "start" | "end" | undefined>;
|
|
81
77
|
default: undefined;
|
|
82
78
|
};
|
|
83
|
-
enableDesktopControls: {
|
|
84
|
-
type: BooleanConstructor;
|
|
85
|
-
default: boolean;
|
|
86
|
-
};
|
|
87
79
|
offset: {
|
|
88
80
|
type: PropType<PopoverOffset>;
|
|
89
81
|
default: number;
|
|
@@ -102,7 +94,6 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
102
94
|
trigger: ReferenceElement;
|
|
103
95
|
placement: "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end" | "right" | "right-start" | "right-end";
|
|
104
96
|
fallbackPlacement: "none" | "start" | "end" | undefined;
|
|
105
|
-
enableDesktopControls: boolean;
|
|
106
97
|
offset: PopoverOffset;
|
|
107
98
|
}>;
|
|
108
99
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { s as OrFilterPopoverV3 } from '../OrFilterPopoverV3-
|
|
1
|
+
export { s as OrFilterPopoverV3 } from '../OrFilterPopoverV3-7b645a22.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { F as FilterPopover, b as FilterPopoverFooter, a as FilterPopoverHeader } from '../OrFilterPopoverV3-
|
|
1
|
+
export { F as FilterPopover, b as FilterPopoverFooter, a as FilterPopoverHeader } from '../OrFilterPopoverV3-7b645a22.js';
|
package/dist/bundled/v3/components/{OrFilterPopoverV3-6899e1b2.js → OrFilterPopoverV3-7b645a22.js}
RENAMED
|
@@ -63,10 +63,6 @@ var script = defineComponent({
|
|
|
63
63
|
type: String,
|
|
64
64
|
default: undefined
|
|
65
65
|
},
|
|
66
|
-
enableDesktopControls: {
|
|
67
|
-
type: Boolean,
|
|
68
|
-
default: false
|
|
69
|
-
},
|
|
70
66
|
offset: {
|
|
71
67
|
type: [Number, Object, Function],
|
|
72
68
|
default: 8
|
|
@@ -134,7 +130,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
134
130
|
placement: _ctx.placement,
|
|
135
131
|
"fallback-placement": _ctx.fallbackPlacement,
|
|
136
132
|
offset: _ctx.offset,
|
|
137
|
-
"onUpdate:state": _cache[
|
|
133
|
+
"onUpdate:state": _cache[1] || (_cache[1] = $event => $event === 'open' ? _ctx.open() : _ctx.close())
|
|
138
134
|
}, {
|
|
139
135
|
default: withCtx(() => [createElementVNode("div", mergeProps(_ctx.$attrs, {
|
|
140
136
|
ref: 'root',
|
|
@@ -152,29 +148,12 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
152
148
|
reset: _ctx.reset,
|
|
153
149
|
isDesktop: _ctx.isDesktop,
|
|
154
150
|
isMobile: _ctx.isMobile
|
|
155
|
-
})),
|
|
156
|
-
key: 0,
|
|
157
|
-
class: normalizeClass(_ctx.footerStyles)
|
|
158
|
-
}, [createVNode(_component_OrButton, {
|
|
159
|
-
class: normalizeClass(['grow']),
|
|
160
|
-
variant: 'contained',
|
|
161
|
-
onClick: _cache[1] || (_cache[1] = $event => _ctx.apply())
|
|
162
|
-
}, {
|
|
163
|
-
default: withCtx(() => [createTextVNode(toDisplayString(_ctx.applyLabel), 1 /* TEXT */)]),
|
|
164
|
-
_: 1 /* STABLE */
|
|
165
|
-
}), createVNode(_component_OrButton, {
|
|
166
|
-
class: normalizeClass(['grow']),
|
|
167
|
-
variant: 'outlined',
|
|
168
|
-
onClick: _cache[2] || (_cache[2] = $event => _ctx.reset())
|
|
169
|
-
}, {
|
|
170
|
-
default: withCtx(() => [createTextVNode(toDisplayString(_ctx.resetLabel), 1 /* TEXT */)]),
|
|
171
|
-
_: 1 /* STABLE */
|
|
172
|
-
})], 2 /* CLASS */)) : createCommentVNode("v-if", true)])], 16 /* FULL_PROPS */)]),
|
|
151
|
+
})))], 16 /* FULL_PROPS */)]),
|
|
173
152
|
_: 3 /* FORWARDED */
|
|
174
153
|
}, 8 /* PROPS */, ["is-open", "trigger", "placement", "fallback-placement", "offset"])) : createCommentVNode("v-if", true), _ctx.isMobile ? (openBlock(), createBlock(_component_OrModal, {
|
|
175
154
|
key: 1,
|
|
176
155
|
"is-open": _ctx.state === 'open',
|
|
177
|
-
"onUpdate:state": _cache[
|
|
156
|
+
"onUpdate:state": _cache[4] || (_cache[4] = $event => $event === 'open' ? _ctx.open() : _ctx.close())
|
|
178
157
|
}, {
|
|
179
158
|
header: withCtx(() => [createTextVNode(toDisplayString(_ctx.title), 1 /* TEXT */)]),
|
|
180
159
|
footer: withCtx(() => [renderSlot(_ctx.$slots, 'actions', normalizeProps(guardReactiveProps({
|
|
@@ -187,14 +166,14 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
187
166
|
}, [createVNode(_component_OrButton, {
|
|
188
167
|
class: normalizeClass(['grow']),
|
|
189
168
|
variant: 'contained',
|
|
190
|
-
onClick: _cache[
|
|
169
|
+
onClick: _cache[2] || (_cache[2] = $event => _ctx.apply())
|
|
191
170
|
}, {
|
|
192
171
|
default: withCtx(() => [createTextVNode(toDisplayString(_ctx.applyLabel), 1 /* TEXT */)]),
|
|
193
172
|
_: 1 /* STABLE */
|
|
194
173
|
}), createVNode(_component_OrButton, {
|
|
195
174
|
class: normalizeClass(['grow']),
|
|
196
175
|
variant: 'outlined',
|
|
197
|
-
onClick: _cache[
|
|
176
|
+
onClick: _cache[3] || (_cache[3] = $event => _ctx.reset())
|
|
198
177
|
}, {
|
|
199
178
|
default: withCtx(() => [createTextVNode(toDisplayString(_ctx.resetLabel), 1 /* TEXT */)]),
|
|
200
179
|
_: 1 /* STABLE */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { s as default } from '../OrFilterV3-
|
|
1
|
+
export { s as default } from '../OrFilterV3-e4db0097.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { s as OrFilterV3 } from '../OrFilterV3-
|
|
1
|
+
export { s as OrFilterV3 } from '../OrFilterV3-e4db0097.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { F as Filter } from '../OrFilterV3-
|
|
1
|
+
export { F as Filter } from '../OrFilterV3-e4db0097.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { resolveComponent, openBlock, createElementBlock, normalizeClass, createVNode, mergeProps, withCtx, renderSlot, normalizeProps, guardReactiveProps } from 'vue';
|
|
2
2
|
import { defineComponent, ref, computed, toRef } from 'vue-demi';
|
|
3
|
-
import { s as script$1 } from './OrFilterPopoverV3-
|
|
3
|
+
import { s as script$1 } from './OrFilterPopoverV3-7b645a22.js';
|
|
4
4
|
import { s as script$2 } from './OrFilterTriggerV3-72ea800e.js';
|
|
5
5
|
import { usePopoverState } from '../hooks/usePopoverState.js';
|
|
6
6
|
|
|
@@ -32,7 +32,7 @@ export { s as OrDateTimeFormatV3 } from './OrDateTimeFormatV3-295547f5.js';
|
|
|
32
32
|
export { D as DEFAULT_TEXT, s as OrDateTimePicker, n as OrDateTimePickerItemTypes, O as OrDateTimePickerTypes } from './OrDateTimePicker-30ec840a.js';
|
|
33
33
|
export { a as OrDateTimePickerDateControl, b as OrDateTimePickerDateSelect, c as OrDateTimePickerMobileControl, d as OrDateTimePickerMonthSelect, e as OrDateTimePickerPopoverFooter, g as OrDateTimePickerPopoverHeader, l as OrDateTimePickerTimeControl, m as OrDateTimePickerTimeSelect, s as OrDateTimePickerV3, f as formatDate, i as formatMobileDate, n as formatMobileTime, k as formatTime, h as getCurrentDate, j as getNextMonthDate } from './OrDateTimePickerV3-a996d0ed.js';
|
|
34
34
|
export { D as DrawerPlacement, s as OrDrawerV3 } from './OrDrawerV3-28a3fff2.js';
|
|
35
|
-
export { D as DropAreaSize, s as OrDropAreaV3, a as approximateFileSize } from './OrDropAreaV3-
|
|
35
|
+
export { D as DropAreaSize, s as OrDropAreaV3, a as approximateFileSize } from './OrDropAreaV3-a9883f18.js';
|
|
36
36
|
export { E as EditorTabsOverflow, s as OrEditorTabsV3 } from './OrEditorTabsV3-dd261195.js';
|
|
37
37
|
export { E as EmptyStateSize, s as OrEmptyStateV3 } from './OrEmptyStateV3-af47ab45.js';
|
|
38
38
|
export { default as OrError } from './OrError/OrError.js';
|
|
@@ -40,9 +40,9 @@ export { s as OrErrorTagV3 } from './OrErrorTagV3-1b00b9d5.js';
|
|
|
40
40
|
export { s as OrErrorV3 } from './OrErrorV3-b04d76aa.js';
|
|
41
41
|
export { b as ExpansionPanelBackgroundColor, a as ExpansionPanelColor, E as ExpansionPanelVariant, s as OrExpansionPanelV3 } from './OrExpansionPanelV3-484e7326.js';
|
|
42
42
|
export { F as FabColor, s as OrFabV3 } from './OrFabV3-86cf1da1.js';
|
|
43
|
-
export { s as OrFilterPopoverV3 } from './OrFilterPopoverV3-
|
|
43
|
+
export { s as OrFilterPopoverV3 } from './OrFilterPopoverV3-7b645a22.js';
|
|
44
44
|
export { s as OrFilterTriggerV3 } from './OrFilterTriggerV3-72ea800e.js';
|
|
45
|
-
export { s as OrFilterV3 } from './OrFilterV3-
|
|
45
|
+
export { s as OrFilterV3 } from './OrFilterV3-e4db0097.js';
|
|
46
46
|
export { s as OrFloating, e as OrFloatingHideStrategy, O as OrFloatingPlacements } from './OrFloating-b1742993.js';
|
|
47
47
|
export { F as FormGroupDirection, s as OrFormGroupV3 } from './OrFormGroupV3-c0c2a946.js';
|
|
48
48
|
export { default as OrHint } from './OrHint/OrHint.js';
|
package/dist/bundled/v3/index.js
CHANGED
|
@@ -22,12 +22,12 @@ export { s as OrDateRangePickerV3 } from './components/OrDateRangePickerV3-90be1
|
|
|
22
22
|
export { s as OrDateTimeFormatV3 } from './components/OrDateTimeFormatV3-295547f5.js';
|
|
23
23
|
export { D as DEFAULT_TEXT, s as OrDateTimePicker, n as OrDateTimePickerItemTypes, O as OrDateTimePickerTypes } from './components/OrDateTimePicker-30ec840a.js';
|
|
24
24
|
export { D as DrawerPlacement, s as OrDrawerV3 } from './components/OrDrawerV3-28a3fff2.js';
|
|
25
|
-
export { D as DropAreaSize, s as OrDropAreaV3, a as approximateFileSize } from './components/OrDropAreaV3-
|
|
25
|
+
export { D as DropAreaSize, s as OrDropAreaV3, a as approximateFileSize } from './components/OrDropAreaV3-a9883f18.js';
|
|
26
26
|
export { E as EditorTabsOverflow, s as OrEditorTabsV3 } from './components/OrEditorTabsV3-dd261195.js';
|
|
27
27
|
export { E as EmptyStateSize, s as OrEmptyStateV3 } from './components/OrEmptyStateV3-af47ab45.js';
|
|
28
28
|
export { s as OrErrorTagV3 } from './components/OrErrorTagV3-1b00b9d5.js';
|
|
29
29
|
export { F as FabColor, s as OrFabV3 } from './components/OrFabV3-86cf1da1.js';
|
|
30
|
-
export { s as OrFilterV3 } from './components/OrFilterV3-
|
|
30
|
+
export { s as OrFilterV3 } from './components/OrFilterV3-e4db0097.js';
|
|
31
31
|
export { I as InlineInputType, s as OrInlineInputV3 } from './components/OrInlineInputV3-35ae654c.js';
|
|
32
32
|
export { InlineTextEditTrimmingTypes, InlineTextEditTypes, OrInlineTextEdit } from './components/OrInlineTextEdit/index.js';
|
|
33
33
|
export { s as OrInlineTextareaV3 } from './components/OrInlineTextareaV3-c03fab60.js';
|
|
@@ -84,7 +84,7 @@ export { a as OrDateTimePickerDateControl, b as OrDateTimePickerDateSelect, c as
|
|
|
84
84
|
export { default as OrError } from './components/OrError/OrError.js';
|
|
85
85
|
export { s as OrErrorV3 } from './components/OrErrorV3-b04d76aa.js';
|
|
86
86
|
export { b as ExpansionPanelBackgroundColor, a as ExpansionPanelColor, E as ExpansionPanelVariant, s as OrExpansionPanelV3 } from './components/OrExpansionPanelV3-484e7326.js';
|
|
87
|
-
export { s as OrFilterPopoverV3 } from './components/OrFilterPopoverV3-
|
|
87
|
+
export { s as OrFilterPopoverV3 } from './components/OrFilterPopoverV3-7b645a22.js';
|
|
88
88
|
export { s as OrFilterTriggerV3 } from './components/OrFilterTriggerV3-72ea800e.js';
|
|
89
89
|
export { s as OrFloating, e as OrFloatingHideStrategy, O as OrFloatingPlacements } from './components/OrFloating-b1742993.js';
|
|
90
90
|
export { F as FormGroupDirection, s as OrFormGroupV3 } from './components/OrFormGroupV3-c0c2a946.js';
|
|
@@ -119,6 +119,10 @@ var script = defineComponent({
|
|
|
119
119
|
disabled: {
|
|
120
120
|
type: Boolean,
|
|
121
121
|
default: false
|
|
122
|
+
},
|
|
123
|
+
error: {
|
|
124
|
+
type: Boolean,
|
|
125
|
+
default: false
|
|
122
126
|
}
|
|
123
127
|
},
|
|
124
128
|
emits: ['update:modelValue'],
|
|
@@ -135,13 +139,34 @@ var script = defineComponent({
|
|
|
135
139
|
const constraintsStyles = computed(() => [...DropAreaConstraints]);
|
|
136
140
|
// State
|
|
137
141
|
const proxyModelValue = useProxyModelValue(toRef(props, 'modelValue'), context.emit);
|
|
142
|
+
const accept = computed(() => {
|
|
143
|
+
if (!props.fileTypes || !Array.isArray(props.fileTypes)) return '';
|
|
144
|
+
return props.fileTypes.join(',');
|
|
145
|
+
});
|
|
138
146
|
const invalid = computed(() => {
|
|
139
|
-
|
|
147
|
+
/* External error */
|
|
148
|
+
if (props.error) return true;
|
|
149
|
+
/* No validation provided */
|
|
150
|
+
if (!props.fileTypes) return false;
|
|
151
|
+
/* File type match: strict and non-strict MIME-type comparison */
|
|
152
|
+
if (props.fileTypes.length > 0 && proxyModelValue.value.some(file => {
|
|
153
|
+
let match = props.fileTypes.some(fileType => {
|
|
154
|
+
if (fileType.match(/\/\*$/)) {
|
|
155
|
+
const baseType = fileType.replace('/*', '');
|
|
156
|
+
return file.type.indexOf(baseType) !== -1;
|
|
157
|
+
} else {
|
|
158
|
+
return file.type === fileType;
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
return !match;
|
|
162
|
+
})) {
|
|
140
163
|
return true;
|
|
141
164
|
}
|
|
165
|
+
/* Files count */
|
|
142
166
|
if (proxyModelValue.value.length > props.maxFiles) {
|
|
143
167
|
return true;
|
|
144
168
|
}
|
|
169
|
+
/* File size */
|
|
145
170
|
if (proxyModelValue.value.some(file => file.size > props.maxFileSize)) {
|
|
146
171
|
return true;
|
|
147
172
|
}
|
|
@@ -165,6 +190,7 @@ var script = defineComponent({
|
|
|
165
190
|
textEmphasisStyles,
|
|
166
191
|
constraintsStyles,
|
|
167
192
|
proxyModelValue,
|
|
193
|
+
accept,
|
|
168
194
|
invalid,
|
|
169
195
|
onChange,
|
|
170
196
|
isDesktop,
|
|
@@ -193,7 +219,7 @@ var __vue_render__ = function () {
|
|
|
193
219
|
class: _vm.controlStyles,
|
|
194
220
|
attrs: {
|
|
195
221
|
"type": 'file',
|
|
196
|
-
"accept": _vm.
|
|
222
|
+
"accept": _vm.accept,
|
|
197
223
|
"multiple": _vm.maxFiles > 1,
|
|
198
224
|
"disabled": _vm.disabled
|
|
199
225
|
},
|
|
@@ -5,7 +5,7 @@ import '@vueuse/core';
|
|
|
5
5
|
import { u as usePopoverState } from './usePopoverState-7267fa91.js';
|
|
6
6
|
import '@onereach/styles/screens.json';
|
|
7
7
|
import '@onereach/styles/tailwind.config.json';
|
|
8
|
-
import { _ as __vue_component__$1 } from './OrFilterPopover-
|
|
8
|
+
import { _ as __vue_component__$1 } from './OrFilterPopover-36bc0e6d.js';
|
|
9
9
|
import { _ as __vue_component__$2 } from './OrFilterTrigger-1e4aa34c.js';
|
|
10
10
|
import { n as normalizeComponent } from './normalize-component-6e8e3d80.js';
|
|
11
11
|
|
|
@@ -68,10 +68,6 @@ var script = defineComponent({
|
|
|
68
68
|
type: String,
|
|
69
69
|
default: undefined
|
|
70
70
|
},
|
|
71
|
-
enableDesktopControls: {
|
|
72
|
-
type: Boolean,
|
|
73
|
-
default: false
|
|
74
|
-
},
|
|
75
71
|
offset: {
|
|
76
72
|
type: [Number, Object, Function],
|
|
77
73
|
default: 8
|
|
@@ -161,31 +157,7 @@ var __vue_render__ = function () {
|
|
|
161
157
|
return _vm.reset();
|
|
162
158
|
}
|
|
163
159
|
}
|
|
164
|
-
}, [_vm._v("\n " + _vm._s(_vm.resetLabel) + "\n ")])], 1), _vm._v(" "), _vm._t("default"), _vm._v(" "), _vm._t('actions',
|
|
165
|
-
return [_vm.enableDesktopControls ? _c('div', {
|
|
166
|
-
class: _vm.footerStyles
|
|
167
|
-
}, [_c('OrButton', {
|
|
168
|
-
class: ['grow'],
|
|
169
|
-
attrs: {
|
|
170
|
-
"variant": 'contained'
|
|
171
|
-
},
|
|
172
|
-
on: {
|
|
173
|
-
"click": function ($event) {
|
|
174
|
-
return _vm.apply();
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
}, [_vm._v("\n " + _vm._s(_vm.applyLabel) + "\n ")]), _vm._v(" "), _c('OrButton', {
|
|
178
|
-
class: ['grow'],
|
|
179
|
-
attrs: {
|
|
180
|
-
"variant": 'outlined'
|
|
181
|
-
},
|
|
182
|
-
on: {
|
|
183
|
-
"click": function ($event) {
|
|
184
|
-
return _vm.reset();
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
}, [_vm._v("\n " + _vm._s(_vm.resetLabel) + "\n ")])], 1) : _vm._e()];
|
|
188
|
-
}, null, {
|
|
160
|
+
}, [_vm._v("\n " + _vm._s(_vm.resetLabel) + "\n ")])], 1), _vm._v(" "), _vm._t("default"), _vm._v(" "), _vm._t('actions', null, null, {
|
|
189
161
|
apply: _vm.apply,
|
|
190
162
|
reset: _vm.reset,
|
|
191
163
|
isDesktop: _vm.isDesktop,
|
|
@@ -47,7 +47,7 @@ export { f as formatDate, a as formatTime } from '../formatTime-3f37a00f.js';
|
|
|
47
47
|
export { f as formatMobileDate, a as formatMobileTime, g as getCurrentDate } from '../getCurrentDate-e5a478c3.js';
|
|
48
48
|
export { g as getNextMonthDate } from '../getNextMonthDate-8ec29631.js';
|
|
49
49
|
export { D as DrawerPlacement, _ as OrDrawerV3 } from '../OrDrawer-ac6cdc09.js';
|
|
50
|
-
export { D as DropAreaSize, _ as OrDropAreaV3 } from '../OrDropArea-
|
|
50
|
+
export { D as DropAreaSize, _ as OrDropAreaV3 } from '../OrDropArea-78f52187.js';
|
|
51
51
|
export { a as approximateFileSize } from '../approximateFileSize-a48b356b.js';
|
|
52
52
|
export { E as EditorTabsOverflow, _ as OrEditorTabsV3 } from '../OrEditorTabs-17d79ae1.js';
|
|
53
53
|
export { E as EmptyStateSize, _ as OrEmptyStateV3 } from '../OrEmptyState-186f7abc.js';
|
|
@@ -56,9 +56,9 @@ export { _ as OrErrorTagV3 } from '../OrErrorTag-fb59988e.js';
|
|
|
56
56
|
export { _ as OrErrorV3 } from '../OrError-b25d782d.js';
|
|
57
57
|
export { b as ExpansionPanelBackgroundColor, a as ExpansionPanelColor, E as ExpansionPanelVariant, _ as OrExpansionPanelV3 } from '../OrExpansionPanel-c10defa5.js';
|
|
58
58
|
export { F as FabColor, _ as OrFabV3 } from '../OrFab-26e22be7.js';
|
|
59
|
-
export { _ as OrFilterPopoverV3 } from '../OrFilterPopover-
|
|
59
|
+
export { _ as OrFilterPopoverV3 } from '../OrFilterPopover-36bc0e6d.js';
|
|
60
60
|
export { _ as OrFilterTriggerV3 } from '../OrFilterTrigger-1e4aa34c.js';
|
|
61
|
-
export { _ as OrFilterV3 } from '../OrFilter-
|
|
61
|
+
export { _ as OrFilterV3 } from '../OrFilter-3ed01d2f.js';
|
|
62
62
|
export { _ as OrFloating, a as OrFloatingHideStrategy, O as OrFloatingPlacements } from '../OrFloating-517737ad.js';
|
|
63
63
|
export { F as FormGroupDirection, _ as OrFormGroupV3 } from '../OrFormGroup-a814b820.js';
|
|
64
64
|
export { _ as OrHint } from '../OrHint-7eadc91e.js';
|
|
@@ -26,6 +26,10 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
26
26
|
type: BooleanConstructor;
|
|
27
27
|
default: boolean;
|
|
28
28
|
};
|
|
29
|
+
error: {
|
|
30
|
+
type: BooleanConstructor;
|
|
31
|
+
default: boolean;
|
|
32
|
+
};
|
|
29
33
|
}, {
|
|
30
34
|
root: import("vue-demi").Ref<HTMLElement | undefined>;
|
|
31
35
|
rootStyles: import("vue-demi").ComputedRef<string[]>;
|
|
@@ -35,6 +39,7 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
35
39
|
textEmphasisStyles: import("vue-demi").ComputedRef<string[]>;
|
|
36
40
|
constraintsStyles: import("vue-demi").ComputedRef<string[]>;
|
|
37
41
|
proxyModelValue: import("../../hooks").UseProxyModelValueReturn<File[]>;
|
|
42
|
+
accept: import("vue-demi").ComputedRef<string>;
|
|
38
43
|
invalid: import("vue-demi").ComputedRef<boolean>;
|
|
39
44
|
onChange: (event: Event) => void;
|
|
40
45
|
isDesktop: import("vue-demi").ComputedRef<boolean>;
|
|
@@ -65,6 +70,10 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
65
70
|
type: BooleanConstructor;
|
|
66
71
|
default: boolean;
|
|
67
72
|
};
|
|
73
|
+
error: {
|
|
74
|
+
type: BooleanConstructor;
|
|
75
|
+
default: boolean;
|
|
76
|
+
};
|
|
68
77
|
}>> & {
|
|
69
78
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
70
79
|
}, {
|
|
@@ -74,5 +83,6 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
74
83
|
maxFileSize: number;
|
|
75
84
|
size: "m" | "s";
|
|
76
85
|
disabled: boolean;
|
|
86
|
+
error: boolean;
|
|
77
87
|
}>;
|
|
78
88
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { D as DropAreaSize, _ as OrDropAreaV3 } from '../../OrDropArea-
|
|
1
|
+
export { D as DropAreaSize, _ as OrDropAreaV3 } from '../../OrDropArea-78f52187.js';
|
|
2
2
|
export { a as approximateFileSize } from '../../approximateFileSize-a48b356b.js';
|
|
3
3
|
import 'vue-demi';
|
|
4
4
|
import '../../TimeFormat-a7f5565b.js';
|
|
@@ -30,10 +30,6 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
30
30
|
type: PropType<"none" | "start" | "end" | undefined>;
|
|
31
31
|
default: undefined;
|
|
32
32
|
};
|
|
33
|
-
enableDesktopControls: {
|
|
34
|
-
type: BooleanConstructor;
|
|
35
|
-
default: boolean;
|
|
36
|
-
};
|
|
37
33
|
offset: {
|
|
38
34
|
type: PropType<PopoverOffset>;
|
|
39
35
|
default: number;
|
|
@@ -80,10 +76,6 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
80
76
|
type: PropType<"none" | "start" | "end" | undefined>;
|
|
81
77
|
default: undefined;
|
|
82
78
|
};
|
|
83
|
-
enableDesktopControls: {
|
|
84
|
-
type: BooleanConstructor;
|
|
85
|
-
default: boolean;
|
|
86
|
-
};
|
|
87
79
|
offset: {
|
|
88
80
|
type: PropType<PopoverOffset>;
|
|
89
81
|
default: number;
|
|
@@ -102,7 +94,6 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
102
94
|
trigger: ReferenceElement;
|
|
103
95
|
placement: "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end" | "right" | "right-start" | "right-end";
|
|
104
96
|
fallbackPlacement: "none" | "start" | "end" | undefined;
|
|
105
|
-
enableDesktopControls: boolean;
|
|
106
97
|
offset: PopoverOffset;
|
|
107
98
|
}>;
|
|
108
99
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { _ as OrFilterV3 } from '../../OrFilter-
|
|
1
|
+
export { _ as OrFilterV3 } from '../../OrFilter-3ed01d2f.js';
|
|
2
2
|
import 'vue-demi';
|
|
3
3
|
import '../../TimeFormat-a7f5565b.js';
|
|
4
4
|
import '../../dom-53c9635b.js';
|
|
@@ -8,7 +8,7 @@ import '@vueuse/core';
|
|
|
8
8
|
import '../../usePopoverState-7267fa91.js';
|
|
9
9
|
import '@onereach/styles/screens.json';
|
|
10
10
|
import '@onereach/styles/tailwind.config.json';
|
|
11
|
-
import '../../OrFilterPopover-
|
|
11
|
+
import '../../OrFilterPopover-36bc0e6d.js';
|
|
12
12
|
import '../../useResponsive-491da8c6.js';
|
|
13
13
|
import '../../OrButton-01ca6705.js';
|
|
14
14
|
import '../../OrButton.vue_rollup-plugin-vue_script-0b37151a.js';
|
package/dist/esm/v2/index.js
CHANGED
|
@@ -47,7 +47,7 @@ export { f as formatDate, a as formatTime } from './formatTime-3f37a00f.js';
|
|
|
47
47
|
export { f as formatMobileDate, a as formatMobileTime, g as getCurrentDate } from './getCurrentDate-e5a478c3.js';
|
|
48
48
|
export { g as getNextMonthDate } from './getNextMonthDate-8ec29631.js';
|
|
49
49
|
export { D as DrawerPlacement, _ as OrDrawerV3 } from './OrDrawer-ac6cdc09.js';
|
|
50
|
-
export { D as DropAreaSize, _ as OrDropAreaV3 } from './OrDropArea-
|
|
50
|
+
export { D as DropAreaSize, _ as OrDropAreaV3 } from './OrDropArea-78f52187.js';
|
|
51
51
|
export { a as approximateFileSize } from './approximateFileSize-a48b356b.js';
|
|
52
52
|
export { E as EditorTabsOverflow, _ as OrEditorTabsV3 } from './OrEditorTabs-17d79ae1.js';
|
|
53
53
|
export { E as EmptyStateSize, _ as OrEmptyStateV3 } from './OrEmptyState-186f7abc.js';
|
|
@@ -56,9 +56,9 @@ export { _ as OrErrorTagV3 } from './OrErrorTag-fb59988e.js';
|
|
|
56
56
|
export { _ as OrErrorV3 } from './OrError-b25d782d.js';
|
|
57
57
|
export { b as ExpansionPanelBackgroundColor, a as ExpansionPanelColor, E as ExpansionPanelVariant, _ as OrExpansionPanelV3 } from './OrExpansionPanel-c10defa5.js';
|
|
58
58
|
export { F as FabColor, _ as OrFabV3 } from './OrFab-26e22be7.js';
|
|
59
|
-
export { _ as OrFilterPopoverV3 } from './OrFilterPopover-
|
|
59
|
+
export { _ as OrFilterPopoverV3 } from './OrFilterPopover-36bc0e6d.js';
|
|
60
60
|
export { _ as OrFilterTriggerV3 } from './OrFilterTrigger-1e4aa34c.js';
|
|
61
|
-
export { _ as OrFilterV3 } from './OrFilter-
|
|
61
|
+
export { _ as OrFilterV3 } from './OrFilter-3ed01d2f.js';
|
|
62
62
|
export { _ as OrFloating, a as OrFloatingHideStrategy, O as OrFloatingPlacements } from './OrFloating-517737ad.js';
|
|
63
63
|
export { F as FormGroupDirection, _ as OrFormGroupV3 } from './OrFormGroup-a814b820.js';
|
|
64
64
|
export { _ as OrHint } from './OrHint-7eadc91e.js';
|
|
@@ -119,6 +119,10 @@ var script = defineComponent({
|
|
|
119
119
|
disabled: {
|
|
120
120
|
type: Boolean,
|
|
121
121
|
default: false
|
|
122
|
+
},
|
|
123
|
+
error: {
|
|
124
|
+
type: Boolean,
|
|
125
|
+
default: false
|
|
122
126
|
}
|
|
123
127
|
},
|
|
124
128
|
emits: ['update:modelValue'],
|
|
@@ -135,13 +139,34 @@ var script = defineComponent({
|
|
|
135
139
|
const constraintsStyles = computed(() => [...DropAreaConstraints]);
|
|
136
140
|
// State
|
|
137
141
|
const proxyModelValue = useProxyModelValue(toRef(props, 'modelValue'), context.emit);
|
|
142
|
+
const accept = computed(() => {
|
|
143
|
+
if (!props.fileTypes || !Array.isArray(props.fileTypes)) return '';
|
|
144
|
+
return props.fileTypes.join(',');
|
|
145
|
+
});
|
|
138
146
|
const invalid = computed(() => {
|
|
139
|
-
|
|
147
|
+
/* External error */
|
|
148
|
+
if (props.error) return true;
|
|
149
|
+
/* No validation provided */
|
|
150
|
+
if (!props.fileTypes) return false;
|
|
151
|
+
/* File type match: strict and non-strict MIME-type comparison */
|
|
152
|
+
if (props.fileTypes.length > 0 && proxyModelValue.value.some(file => {
|
|
153
|
+
let match = props.fileTypes.some(fileType => {
|
|
154
|
+
if (fileType.match(/\/\*$/)) {
|
|
155
|
+
const baseType = fileType.replace('/*', '');
|
|
156
|
+
return file.type.indexOf(baseType) !== -1;
|
|
157
|
+
} else {
|
|
158
|
+
return file.type === fileType;
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
return !match;
|
|
162
|
+
})) {
|
|
140
163
|
return true;
|
|
141
164
|
}
|
|
165
|
+
/* Files count */
|
|
142
166
|
if (proxyModelValue.value.length > props.maxFiles) {
|
|
143
167
|
return true;
|
|
144
168
|
}
|
|
169
|
+
/* File size */
|
|
145
170
|
if (proxyModelValue.value.some(file => file.size > props.maxFileSize)) {
|
|
146
171
|
return true;
|
|
147
172
|
}
|
|
@@ -165,6 +190,7 @@ var script = defineComponent({
|
|
|
165
190
|
textEmphasisStyles,
|
|
166
191
|
constraintsStyles,
|
|
167
192
|
proxyModelValue,
|
|
193
|
+
accept,
|
|
168
194
|
invalid,
|
|
169
195
|
onChange,
|
|
170
196
|
isDesktop,
|
|
@@ -192,7 +218,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
192
218
|
}, [createElementVNode("input", {
|
|
193
219
|
class: normalizeClass(_ctx.controlStyles),
|
|
194
220
|
type: 'file',
|
|
195
|
-
accept: _ctx.
|
|
221
|
+
accept: _ctx.accept,
|
|
196
222
|
multiple: _ctx.maxFiles > 1,
|
|
197
223
|
disabled: _ctx.disabled,
|
|
198
224
|
onChange: _cache[0] || (_cache[0] = $event => _ctx.onChange($event))
|
|
@@ -5,7 +5,7 @@ import '@vueuse/core';
|
|
|
5
5
|
import { u as usePopoverState } from './usePopoverState-7267fa91.js';
|
|
6
6
|
import '@onereach/styles/screens.json';
|
|
7
7
|
import '@onereach/styles/tailwind.config.json';
|
|
8
|
-
import { s as script$1 } from './OrFilterPopover-
|
|
8
|
+
import { s as script$1 } from './OrFilterPopover-624150ff.js';
|
|
9
9
|
import { s as script$2 } from './OrFilterTrigger-7fe3a2dc.js';
|
|
10
10
|
import { resolveComponent, openBlock, createElementBlock, normalizeClass, createVNode, mergeProps, withCtx, renderSlot, normalizeProps, guardReactiveProps } from 'vue';
|
|
11
11
|
|
|
@@ -67,10 +67,6 @@ var script = defineComponent({
|
|
|
67
67
|
type: String,
|
|
68
68
|
default: undefined
|
|
69
69
|
},
|
|
70
|
-
enableDesktopControls: {
|
|
71
|
-
type: Boolean,
|
|
72
|
-
default: false
|
|
73
|
-
},
|
|
74
70
|
offset: {
|
|
75
71
|
type: [Number, Object, Function],
|
|
76
72
|
default: 8
|
|
@@ -138,7 +134,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
138
134
|
placement: _ctx.placement,
|
|
139
135
|
"fallback-placement": _ctx.fallbackPlacement,
|
|
140
136
|
offset: _ctx.offset,
|
|
141
|
-
"onUpdate:state": _cache[
|
|
137
|
+
"onUpdate:state": _cache[1] || (_cache[1] = $event => $event === 'open' ? _ctx.open() : _ctx.close())
|
|
142
138
|
}, {
|
|
143
139
|
default: withCtx(() => [createElementVNode("div", mergeProps(_ctx.$attrs, {
|
|
144
140
|
ref: 'root',
|
|
@@ -156,29 +152,12 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
156
152
|
reset: _ctx.reset,
|
|
157
153
|
isDesktop: _ctx.isDesktop,
|
|
158
154
|
isMobile: _ctx.isMobile
|
|
159
|
-
})),
|
|
160
|
-
key: 0,
|
|
161
|
-
class: normalizeClass(_ctx.footerStyles)
|
|
162
|
-
}, [createVNode(_component_OrButton, {
|
|
163
|
-
class: normalizeClass(['grow']),
|
|
164
|
-
variant: 'contained',
|
|
165
|
-
onClick: _cache[1] || (_cache[1] = $event => _ctx.apply())
|
|
166
|
-
}, {
|
|
167
|
-
default: withCtx(() => [createTextVNode(toDisplayString(_ctx.applyLabel), 1 /* TEXT */)]),
|
|
168
|
-
_: 1 /* STABLE */
|
|
169
|
-
}), createVNode(_component_OrButton, {
|
|
170
|
-
class: normalizeClass(['grow']),
|
|
171
|
-
variant: 'outlined',
|
|
172
|
-
onClick: _cache[2] || (_cache[2] = $event => _ctx.reset())
|
|
173
|
-
}, {
|
|
174
|
-
default: withCtx(() => [createTextVNode(toDisplayString(_ctx.resetLabel), 1 /* TEXT */)]),
|
|
175
|
-
_: 1 /* STABLE */
|
|
176
|
-
})], 2 /* CLASS */)) : createCommentVNode("v-if", true)])], 16 /* FULL_PROPS */)]),
|
|
155
|
+
})))], 16 /* FULL_PROPS */)]),
|
|
177
156
|
_: 3 /* FORWARDED */
|
|
178
157
|
}, 8 /* PROPS */, ["is-open", "trigger", "placement", "fallback-placement", "offset"])) : createCommentVNode("v-if", true), _ctx.isMobile ? (openBlock(), createBlock(_component_OrModal, {
|
|
179
158
|
key: 1,
|
|
180
159
|
"is-open": _ctx.state === 'open',
|
|
181
|
-
"onUpdate:state": _cache[
|
|
160
|
+
"onUpdate:state": _cache[4] || (_cache[4] = $event => $event === 'open' ? _ctx.open() : _ctx.close())
|
|
182
161
|
}, {
|
|
183
162
|
header: withCtx(() => [createTextVNode(toDisplayString(_ctx.title), 1 /* TEXT */)]),
|
|
184
163
|
footer: withCtx(() => [renderSlot(_ctx.$slots, 'actions', normalizeProps(guardReactiveProps({
|
|
@@ -191,14 +170,14 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
191
170
|
}, [createVNode(_component_OrButton, {
|
|
192
171
|
class: normalizeClass(['grow']),
|
|
193
172
|
variant: 'contained',
|
|
194
|
-
onClick: _cache[
|
|
173
|
+
onClick: _cache[2] || (_cache[2] = $event => _ctx.apply())
|
|
195
174
|
}, {
|
|
196
175
|
default: withCtx(() => [createTextVNode(toDisplayString(_ctx.applyLabel), 1 /* TEXT */)]),
|
|
197
176
|
_: 1 /* STABLE */
|
|
198
177
|
}), createVNode(_component_OrButton, {
|
|
199
178
|
class: normalizeClass(['grow']),
|
|
200
179
|
variant: 'outlined',
|
|
201
|
-
onClick: _cache[
|
|
180
|
+
onClick: _cache[3] || (_cache[3] = $event => _ctx.reset())
|
|
202
181
|
}, {
|
|
203
182
|
default: withCtx(() => [createTextVNode(toDisplayString(_ctx.resetLabel), 1 /* TEXT */)]),
|
|
204
183
|
_: 1 /* STABLE */
|
|
@@ -45,7 +45,7 @@ export { f as formatDate, a as formatTime } from '../formatTime-3f37a00f.js';
|
|
|
45
45
|
export { f as formatMobileDate, a as formatMobileTime, g as getCurrentDate } from '../getCurrentDate-e5a478c3.js';
|
|
46
46
|
export { g as getNextMonthDate } from '../getNextMonthDate-8ec29631.js';
|
|
47
47
|
export { D as DrawerPlacement, s as OrDrawerV3 } from '../OrDrawer-f12faf1a.js';
|
|
48
|
-
export { D as DropAreaSize, s as OrDropAreaV3 } from '../OrDropArea-
|
|
48
|
+
export { D as DropAreaSize, s as OrDropAreaV3 } from '../OrDropArea-8b3fc35c.js';
|
|
49
49
|
export { a as approximateFileSize } from '../approximateFileSize-a48b356b.js';
|
|
50
50
|
export { E as EditorTabsOverflow, s as OrEditorTabsV3 } from '../OrEditorTabs-d5779ee7.js';
|
|
51
51
|
export { E as EmptyStateSize, s as OrEmptyStateV3 } from '../OrEmptyState-47f9d910.js';
|
|
@@ -54,9 +54,9 @@ export { s as OrErrorTagV3 } from '../OrErrorTag-94f074a2.js';
|
|
|
54
54
|
export { s as OrErrorV3 } from '../OrError-331220bc.js';
|
|
55
55
|
export { b as ExpansionPanelBackgroundColor, a as ExpansionPanelColor, E as ExpansionPanelVariant, s as OrExpansionPanelV3 } from '../OrExpansionPanel-99c697c1.js';
|
|
56
56
|
export { F as FabColor, s as OrFabV3 } from '../OrFab-f949bf4f.js';
|
|
57
|
-
export { s as OrFilterPopoverV3 } from '../OrFilterPopover-
|
|
57
|
+
export { s as OrFilterPopoverV3 } from '../OrFilterPopover-624150ff.js';
|
|
58
58
|
export { s as OrFilterTriggerV3 } from '../OrFilterTrigger-7fe3a2dc.js';
|
|
59
|
-
export { s as OrFilterV3 } from '../OrFilter-
|
|
59
|
+
export { s as OrFilterV3 } from '../OrFilter-b38dcd0e.js';
|
|
60
60
|
export { s as OrFloating, a as OrFloatingHideStrategy, O as OrFloatingPlacements } from '../OrFloating-00617713.js';
|
|
61
61
|
export { F as FormGroupDirection, s as OrFormGroupV3 } from '../OrFormGroup-893719a1.js';
|
|
62
62
|
export { s as OrHint } from '../OrHint-8822005b.js';
|
|
@@ -26,6 +26,10 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
26
26
|
type: BooleanConstructor;
|
|
27
27
|
default: boolean;
|
|
28
28
|
};
|
|
29
|
+
error: {
|
|
30
|
+
type: BooleanConstructor;
|
|
31
|
+
default: boolean;
|
|
32
|
+
};
|
|
29
33
|
}, {
|
|
30
34
|
root: import("vue-demi").Ref<HTMLElement | undefined>;
|
|
31
35
|
rootStyles: import("vue-demi").ComputedRef<string[]>;
|
|
@@ -35,6 +39,7 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
35
39
|
textEmphasisStyles: import("vue-demi").ComputedRef<string[]>;
|
|
36
40
|
constraintsStyles: import("vue-demi").ComputedRef<string[]>;
|
|
37
41
|
proxyModelValue: import("../../hooks").UseProxyModelValueReturn<File[]>;
|
|
42
|
+
accept: import("vue-demi").ComputedRef<string>;
|
|
38
43
|
invalid: import("vue-demi").ComputedRef<boolean>;
|
|
39
44
|
onChange: (event: Event) => void;
|
|
40
45
|
isDesktop: import("vue-demi").ComputedRef<boolean>;
|
|
@@ -65,6 +70,10 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
65
70
|
type: BooleanConstructor;
|
|
66
71
|
default: boolean;
|
|
67
72
|
};
|
|
73
|
+
error: {
|
|
74
|
+
type: BooleanConstructor;
|
|
75
|
+
default: boolean;
|
|
76
|
+
};
|
|
68
77
|
}>> & {
|
|
69
78
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
70
79
|
}, {
|
|
@@ -74,5 +83,6 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
74
83
|
maxFileSize: number;
|
|
75
84
|
size: "m" | "s";
|
|
76
85
|
disabled: boolean;
|
|
86
|
+
error: boolean;
|
|
77
87
|
}>;
|
|
78
88
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { D as DropAreaSize, s as OrDropAreaV3 } from '../../OrDropArea-
|
|
1
|
+
export { D as DropAreaSize, s as OrDropAreaV3 } from '../../OrDropArea-8b3fc35c.js';
|
|
2
2
|
export { a as approximateFileSize } from '../../approximateFileSize-a48b356b.js';
|
|
3
3
|
import 'vue-demi';
|
|
4
4
|
import '../../TimeFormat-a7f5565b.js';
|
|
@@ -30,10 +30,6 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
30
30
|
type: PropType<"none" | "start" | "end" | undefined>;
|
|
31
31
|
default: undefined;
|
|
32
32
|
};
|
|
33
|
-
enableDesktopControls: {
|
|
34
|
-
type: BooleanConstructor;
|
|
35
|
-
default: boolean;
|
|
36
|
-
};
|
|
37
33
|
offset: {
|
|
38
34
|
type: PropType<PopoverOffset>;
|
|
39
35
|
default: number;
|
|
@@ -80,10 +76,6 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
80
76
|
type: PropType<"none" | "start" | "end" | undefined>;
|
|
81
77
|
default: undefined;
|
|
82
78
|
};
|
|
83
|
-
enableDesktopControls: {
|
|
84
|
-
type: BooleanConstructor;
|
|
85
|
-
default: boolean;
|
|
86
|
-
};
|
|
87
79
|
offset: {
|
|
88
80
|
type: PropType<PopoverOffset>;
|
|
89
81
|
default: number;
|
|
@@ -102,7 +94,6 @@ declare const _default: import("vue-demi").DefineComponent<{
|
|
|
102
94
|
trigger: ReferenceElement;
|
|
103
95
|
placement: "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end" | "right" | "right-start" | "right-end";
|
|
104
96
|
fallbackPlacement: "none" | "start" | "end" | undefined;
|
|
105
|
-
enableDesktopControls: boolean;
|
|
106
97
|
offset: PopoverOffset;
|
|
107
98
|
}>;
|
|
108
99
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { s as OrFilterV3 } from '../../OrFilter-
|
|
1
|
+
export { s as OrFilterV3 } from '../../OrFilter-b38dcd0e.js';
|
|
2
2
|
import 'vue-demi';
|
|
3
3
|
import '../../TimeFormat-a7f5565b.js';
|
|
4
4
|
import '../../dom-53c9635b.js';
|
|
@@ -8,7 +8,7 @@ import '@vueuse/core';
|
|
|
8
8
|
import '../../usePopoverState-7267fa91.js';
|
|
9
9
|
import '@onereach/styles/screens.json';
|
|
10
10
|
import '@onereach/styles/tailwind.config.json';
|
|
11
|
-
import '../../OrFilterPopover-
|
|
11
|
+
import '../../OrFilterPopover-624150ff.js';
|
|
12
12
|
import '../../useResponsive-491da8c6.js';
|
|
13
13
|
import '../../OrButton-9154d1be.js';
|
|
14
14
|
import '../../OrLoader-472e965e.js';
|
package/dist/esm/v3/index.js
CHANGED
|
@@ -45,7 +45,7 @@ export { f as formatDate, a as formatTime } from './formatTime-3f37a00f.js';
|
|
|
45
45
|
export { f as formatMobileDate, a as formatMobileTime, g as getCurrentDate } from './getCurrentDate-e5a478c3.js';
|
|
46
46
|
export { g as getNextMonthDate } from './getNextMonthDate-8ec29631.js';
|
|
47
47
|
export { D as DrawerPlacement, s as OrDrawerV3 } from './OrDrawer-f12faf1a.js';
|
|
48
|
-
export { D as DropAreaSize, s as OrDropAreaV3 } from './OrDropArea-
|
|
48
|
+
export { D as DropAreaSize, s as OrDropAreaV3 } from './OrDropArea-8b3fc35c.js';
|
|
49
49
|
export { a as approximateFileSize } from './approximateFileSize-a48b356b.js';
|
|
50
50
|
export { E as EditorTabsOverflow, s as OrEditorTabsV3 } from './OrEditorTabs-d5779ee7.js';
|
|
51
51
|
export { E as EmptyStateSize, s as OrEmptyStateV3 } from './OrEmptyState-47f9d910.js';
|
|
@@ -54,9 +54,9 @@ export { s as OrErrorTagV3 } from './OrErrorTag-94f074a2.js';
|
|
|
54
54
|
export { s as OrErrorV3 } from './OrError-331220bc.js';
|
|
55
55
|
export { b as ExpansionPanelBackgroundColor, a as ExpansionPanelColor, E as ExpansionPanelVariant, s as OrExpansionPanelV3 } from './OrExpansionPanel-99c697c1.js';
|
|
56
56
|
export { F as FabColor, s as OrFabV3 } from './OrFab-f949bf4f.js';
|
|
57
|
-
export { s as OrFilterPopoverV3 } from './OrFilterPopover-
|
|
57
|
+
export { s as OrFilterPopoverV3 } from './OrFilterPopover-624150ff.js';
|
|
58
58
|
export { s as OrFilterTriggerV3 } from './OrFilterTrigger-7fe3a2dc.js';
|
|
59
|
-
export { s as OrFilterV3 } from './OrFilter-
|
|
59
|
+
export { s as OrFilterV3 } from './OrFilter-b38dcd0e.js';
|
|
60
60
|
export { s as OrFloating, a as OrFloatingHideStrategy, O as OrFloatingPlacements } from './OrFloating-00617713.js';
|
|
61
61
|
export { F as FormGroupDirection, s as OrFormGroupV3 } from './OrFormGroup-893719a1.js';
|
|
62
62
|
export { s as OrHint } from './OrHint-8822005b.js';
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<input
|
|
9
9
|
:class="controlStyles"
|
|
10
10
|
:type="'file'"
|
|
11
|
-
:accept="
|
|
11
|
+
:accept="accept"
|
|
12
12
|
:multiple="maxFiles > 1"
|
|
13
13
|
:disabled="disabled"
|
|
14
14
|
@change="onChange($event)"
|
|
@@ -126,6 +126,11 @@ export default defineComponent({
|
|
|
126
126
|
type: Boolean,
|
|
127
127
|
default: false,
|
|
128
128
|
},
|
|
129
|
+
|
|
130
|
+
error: {
|
|
131
|
+
type: Boolean,
|
|
132
|
+
default: false,
|
|
133
|
+
},
|
|
129
134
|
},
|
|
130
135
|
|
|
131
136
|
emits: [
|
|
@@ -173,15 +178,40 @@ export default defineComponent({
|
|
|
173
178
|
// State
|
|
174
179
|
const proxyModelValue = useProxyModelValue(toRef(props, 'modelValue'), context.emit);
|
|
175
180
|
|
|
181
|
+
const accept = computed(() => {
|
|
182
|
+
if (!props.fileTypes || !Array.isArray(props.fileTypes)) return '';
|
|
183
|
+
|
|
184
|
+
return props.fileTypes.join(',');
|
|
185
|
+
});
|
|
186
|
+
|
|
176
187
|
const invalid = computed(() => {
|
|
177
|
-
|
|
188
|
+
/* External error */
|
|
189
|
+
if (props.error) return true;
|
|
190
|
+
|
|
191
|
+
/* No validation provided */
|
|
192
|
+
if (!props.fileTypes) return false;
|
|
193
|
+
|
|
194
|
+
/* File type match: strict and non-strict MIME-type comparison */
|
|
195
|
+
if (props.fileTypes.length > 0 && proxyModelValue.value.some((file) => {
|
|
196
|
+
let match = props.fileTypes.some(fileType => {
|
|
197
|
+
if (fileType.match(/\/\*$/)) {
|
|
198
|
+
const baseType = fileType.replace('/*', '');
|
|
199
|
+
return file.type.indexOf(baseType) !== -1;
|
|
200
|
+
} else {
|
|
201
|
+
return file.type === fileType;
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
return !match;
|
|
205
|
+
})) {
|
|
178
206
|
return true;
|
|
179
207
|
}
|
|
180
208
|
|
|
209
|
+
/* Files count */
|
|
181
210
|
if (proxyModelValue.value.length > props.maxFiles) {
|
|
182
211
|
return true;
|
|
183
212
|
}
|
|
184
213
|
|
|
214
|
+
/* File size */
|
|
185
215
|
if (proxyModelValue.value.some((file) => file.size > props.maxFileSize)) {
|
|
186
216
|
return true;
|
|
187
217
|
}
|
|
@@ -208,6 +238,7 @@ export default defineComponent({
|
|
|
208
238
|
constraintsStyles,
|
|
209
239
|
|
|
210
240
|
proxyModelValue,
|
|
241
|
+
accept,
|
|
211
242
|
invalid,
|
|
212
243
|
|
|
213
244
|
onChange,
|
|
@@ -33,28 +33,7 @@
|
|
|
33
33
|
<slot
|
|
34
34
|
v-bind="{ apply, reset, isDesktop, isMobile }"
|
|
35
35
|
:name="'actions'"
|
|
36
|
-
|
|
37
|
-
<div
|
|
38
|
-
v-if="enableDesktopControls"
|
|
39
|
-
:class="footerStyles"
|
|
40
|
-
>
|
|
41
|
-
<OrButton
|
|
42
|
-
:class="['grow']"
|
|
43
|
-
:variant="'contained'"
|
|
44
|
-
@click="apply()"
|
|
45
|
-
>
|
|
46
|
-
{{ applyLabel }}
|
|
47
|
-
</OrButton>
|
|
48
|
-
|
|
49
|
-
<OrButton
|
|
50
|
-
:class="['grow']"
|
|
51
|
-
:variant="'outlined'"
|
|
52
|
-
@click="reset()"
|
|
53
|
-
>
|
|
54
|
-
{{ resetLabel }}
|
|
55
|
-
</OrButton>
|
|
56
|
-
</div>
|
|
57
|
-
</slot>
|
|
36
|
+
/>
|
|
58
37
|
</div>
|
|
59
38
|
</OrPopover>
|
|
60
39
|
</template>
|
|
@@ -161,11 +140,6 @@ export default defineComponent({
|
|
|
161
140
|
default: undefined,
|
|
162
141
|
},
|
|
163
142
|
|
|
164
|
-
enableDesktopControls: {
|
|
165
|
-
type: Boolean,
|
|
166
|
-
default: false,
|
|
167
|
-
},
|
|
168
|
-
|
|
169
143
|
offset: {
|
|
170
144
|
type: [Number, Object, Function] as PropType<PopoverOffset>,
|
|
171
145
|
default: 8,
|