@onereach/ui-components 17.1.0 → 17.1.2
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/OrDataGridV3/OrDataGrid.js +1 -1
- package/dist/bundled/v2/components/OrDataGridV3/index.js +1 -1
- 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/OrSelectV3/OrSelect.js +12 -18
- package/dist/bundled/v2/components/index.js +1 -1
- package/dist/bundled/v2/index.js +1 -1
- package/dist/bundled/v3/components/OrDataGridV3/OrDataGrid.js +1 -1
- package/dist/bundled/v3/components/OrDataGridV3/index.js +1 -1
- package/dist/bundled/v3/components/OrDataGridV3/styles.js +1 -1
- package/dist/bundled/v3/components/{OrDataGridV3-054c0ff2.js → OrDataGridV3-61becb11.js} +1 -1
- 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/OrSelectV3/OrSelect.js +1 -1
- package/dist/bundled/v3/components/OrSelectV3/index.js +1 -1
- package/dist/bundled/v3/components/OrSelectV3/styles.js +1 -1
- package/dist/bundled/v3/components/{OrSelectV3-bb7f767d.js → OrSelectV3-b7448701.js} +12 -17
- package/dist/bundled/v3/components/index.js +3 -3
- package/dist/bundled/v3/index.js +3 -3
- package/dist/esm/v2/{OrDataGrid-7dc6f16f.js → OrDataGrid-74589615.js} +1 -1
- package/dist/esm/v2/{OrDataGridToolbar-c414c8f2.js → OrDataGridToolbar-303a4c3d.js} +1 -1
- package/dist/esm/v2/{OrDropArea-7cf24c23.js → OrDropArea-78f52187.js} +28 -2
- package/dist/esm/v2/{OrSelect-cf1f8c43.js → OrSelect-5e6734f2.js} +1 -1
- package/dist/esm/v2/{OrSelectSingleControl-ba3f3975.js → OrSelectSingleControl-450f2642.js} +12 -18
- package/dist/esm/v2/components/index.js +5 -5
- package/dist/esm/v2/components/or-data-grid-v3/index.js +4 -4
- package/dist/esm/v2/components/or-data-grid-v3/partials/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-select-v3/index.js +2 -2
- package/dist/esm/v2/components/or-select-v3/partials/index.js +1 -1
- package/dist/esm/v2/components/or-select-v3/partials/or-select-single-control/OrSelectSingleControl.vue.d.ts +1 -1
- package/dist/esm/v2/components/or-select-v3/partials/or-select-single-control/index.js +1 -1
- package/dist/esm/v2/index.js +5 -5
- package/dist/esm/v3/{OrDataGrid-a91f8a87.js → OrDataGrid-f56e2527.js} +1 -1
- package/dist/esm/v3/{OrDataGridToolbar-8bebd1fd.js → OrDataGridToolbar-8fedec74.js} +1 -1
- package/dist/esm/v3/{OrDropArea-24fe94e7.js → OrDropArea-8b3fc35c.js} +28 -2
- package/dist/esm/v3/{OrSelect-27c013b2.js → OrSelect-1274c0d1.js} +1 -1
- package/dist/esm/v3/{OrSelectSingleControl-722043c2.js → OrSelectSingleControl-93cdab5b.js} +13 -18
- package/dist/esm/v3/components/index.js +5 -5
- package/dist/esm/v3/components/or-data-grid-v3/index.js +4 -4
- package/dist/esm/v3/components/or-data-grid-v3/partials/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-select-v3/index.js +2 -2
- package/dist/esm/v3/components/or-select-v3/partials/index.js +1 -1
- package/dist/esm/v3/components/or-select-v3/partials/or-select-single-control/OrSelectSingleControl.vue.d.ts +1 -1
- package/dist/esm/v3/components/or-select-v3/partials/or-select-single-control/index.js +1 -1
- package/dist/esm/v3/index.js +5 -5
- package/package.json +3 -3
- package/src/components/or-drop-area-v3/OrDropArea.vue +33 -2
- package/src/components/or-select-v3/partials/or-select-single-control/OrSelectSingleControl.vue +11 -15
- /package/dist/bundled/v2/{OrDataGrid-e08ff27a.js → OrDataGrid-16e613a1.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { _ as default } from '../../OrDataGrid-
|
|
1
|
+
export { _ as default } from '../../OrDataGrid-16e613a1.js';
|
|
2
2
|
import '../../normalize-component-6e8e3d80.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { D as DataGridVariant, _ as OrDataGridV3 } from '../../OrDataGrid-
|
|
1
|
+
export { D as DataGridVariant, _ as OrDataGridV3 } from '../../OrDataGrid-16e613a1.js';
|
|
@@ -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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, ref, toRefs, computed, watch,
|
|
1
|
+
import { defineComponent, ref, toRefs, computed, watch, getCurrentInstance } from 'vue-demi';
|
|
2
2
|
import { l as useFocus } from '../../index-82dee23f.js';
|
|
3
3
|
import { useProxyModelValue } from '../../hooks/useProxyModelValue.js';
|
|
4
4
|
import { n as normalizeComponent } from '../../normalize-component-6e8e3d80.js';
|
|
@@ -494,7 +494,6 @@ var script$1 = defineComponent({
|
|
|
494
494
|
const searchControl = ref();
|
|
495
495
|
const selectionLabelRef = ref();
|
|
496
496
|
const tooltipRef = ref();
|
|
497
|
-
const isContentTruncated = ref(false);
|
|
498
497
|
// Props
|
|
499
498
|
const {
|
|
500
499
|
modelValue,
|
|
@@ -513,14 +512,6 @@ var script$1 = defineComponent({
|
|
|
513
512
|
var _a;
|
|
514
513
|
return (_a = selection.value) === null || _a === void 0 ? void 0 : _a.label;
|
|
515
514
|
});
|
|
516
|
-
/* NOTE: using watch here due to async action.
|
|
517
|
-
Computed don't work since we need not just to track the data but to analyze UI after the re-render */
|
|
518
|
-
watch(model, async () => {
|
|
519
|
-
await nextTick();
|
|
520
|
-
if (selectionLabelRef.value) {
|
|
521
|
-
isContentTruncated.value = selectionLabelRef.value.scrollWidth > selectionLabelRef.value.clientWidth;
|
|
522
|
-
}
|
|
523
|
-
});
|
|
524
515
|
watch(() => props.isOpen, () => {
|
|
525
516
|
var _a;
|
|
526
517
|
(_a = tooltipRef.value) === null || _a === void 0 ? void 0 : _a.close();
|
|
@@ -543,6 +534,11 @@ var script$1 = defineComponent({
|
|
|
543
534
|
searchControl.value.focus();
|
|
544
535
|
}
|
|
545
536
|
}
|
|
537
|
+
function checkTooltip() {
|
|
538
|
+
if (!selectionLabelRef.value) return; // to prevent fro TS error; normally ref will always be available here since the method is a mouse event callback
|
|
539
|
+
const isContentTruncated = selectionLabelRef.value.scrollWidth > selectionLabelRef.value.clientWidth;
|
|
540
|
+
if (isContentTruncated) openTooltip();
|
|
541
|
+
}
|
|
546
542
|
return {
|
|
547
543
|
root,
|
|
548
544
|
rootStyles,
|
|
@@ -553,11 +549,11 @@ var script$1 = defineComponent({
|
|
|
553
549
|
selectionLabel,
|
|
554
550
|
focus,
|
|
555
551
|
focused,
|
|
556
|
-
isContentTruncated,
|
|
557
552
|
selectionLabelRef,
|
|
558
553
|
tooltipRef,
|
|
559
554
|
openTooltip,
|
|
560
|
-
closeTooltip
|
|
555
|
+
closeTooltip,
|
|
556
|
+
checkTooltip
|
|
561
557
|
};
|
|
562
558
|
}
|
|
563
559
|
});
|
|
@@ -595,18 +591,16 @@ var __vue_render__$1 = function () {
|
|
|
595
591
|
ref: "selectionLabelRef",
|
|
596
592
|
staticClass: "truncate w-full",
|
|
597
593
|
on: {
|
|
598
|
-
"mouseenter": _vm.
|
|
599
|
-
"mouseleave":
|
|
600
|
-
_vm.tooltipRef && _vm.tooltipRef.close();
|
|
601
|
-
}
|
|
594
|
+
"mouseenter": _vm.checkTooltip,
|
|
595
|
+
"mouseleave": _vm.closeTooltip
|
|
602
596
|
}
|
|
603
|
-
}, [_vm._v("\n " + _vm._s(_vm.selectionLabel) + "\n ")]), _vm._v(" "),
|
|
597
|
+
}, [_vm._v("\n " + _vm._s(_vm.selectionLabel) + "\n ")]), _vm._v(" "), _c('OrTooltip', {
|
|
604
598
|
ref: "tooltipRef",
|
|
605
599
|
attrs: {
|
|
606
600
|
"content": _vm.selectionLabel,
|
|
607
601
|
"trigger": _vm.selectionLabelRef
|
|
608
602
|
}
|
|
609
|
-
})
|
|
603
|
+
})], 1)]]], 2);
|
|
610
604
|
};
|
|
611
605
|
var __vue_staticRenderFns__$1 = [];
|
|
612
606
|
|
|
@@ -44,7 +44,7 @@ export { default as OrConfirm } from './OrConfirm/OrConfirm.js';
|
|
|
44
44
|
export { default as OrConfirmV3 } from './OrConfirmV3/OrConfirm.js';
|
|
45
45
|
export { ConfirmType } from './OrConfirmV3/props.js';
|
|
46
46
|
export { default as OrContextMenuV3 } from './OrContextMenuV3/OrContextMenu.js';
|
|
47
|
-
export { D as DataGridVariant, _ as OrDataGridV3 } from '../OrDataGrid-
|
|
47
|
+
export { D as DataGridVariant, _ as OrDataGridV3 } from '../OrDataGrid-16e613a1.js';
|
|
48
48
|
export { default as OrDateFormatV3 } from './OrDateFormatV3/OrDateFormat.js';
|
|
49
49
|
export { default as OrDatePickerV3 } from './OrDatePickerV3/OrDatePicker.js';
|
|
50
50
|
export { default as OrDateRangePickerV3 } from './OrDateRangePickerV3/OrDateRangePicker.js';
|
package/dist/bundled/v2/index.js
CHANGED
|
@@ -18,7 +18,7 @@ export { default as OrCombinedInputV3 } from './components/OrCombinedInputV3/OrC
|
|
|
18
18
|
export { default as OrConfirm } from './components/OrConfirm/OrConfirm.js';
|
|
19
19
|
export { default as OrConfirmV3 } from './components/OrConfirmV3/OrConfirm.js';
|
|
20
20
|
export { default as OrContextMenuV3 } from './components/OrContextMenuV3/OrContextMenu.js';
|
|
21
|
-
export { D as DataGridVariant, _ as OrDataGridV3 } from './OrDataGrid-
|
|
21
|
+
export { D as DataGridVariant, _ as OrDataGridV3 } from './OrDataGrid-16e613a1.js';
|
|
22
22
|
export { default as OrDateFormatV3 } from './components/OrDateFormatV3/OrDateFormat.js';
|
|
23
23
|
export { default as OrDatePickerV3 } from './components/OrDatePickerV3/OrDatePicker.js';
|
|
24
24
|
export { default as OrDateRangePickerV3 } from './components/OrDateRangePickerV3/OrDateRangePicker.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { s as default } from '../OrDataGridV3-
|
|
1
|
+
export { s as default } from '../OrDataGridV3-61becb11.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { D as DataGridVariant, s as OrDataGridV3 } from '../OrDataGridV3-
|
|
1
|
+
export { D as DataGridVariant, s as OrDataGridV3 } from '../OrDataGridV3-61becb11.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { a as DataGrid } from '../OrDataGridV3-
|
|
1
|
+
export { a as DataGrid } from '../OrDataGridV3-61becb11.js';
|
|
@@ -5,7 +5,7 @@ import { s as script$g } from './OrDatePickerV3-b7df1103.js';
|
|
|
5
5
|
import { s as script$h } from './OrDateTimePickerV3-a996d0ed.js';
|
|
6
6
|
import { s as script$i } from './OrInputV3-335ca448.js';
|
|
7
7
|
import { s as script$j } from './OrRatingV3-e3260da7.js';
|
|
8
|
-
import { s as script$k } from './OrSelectV3-
|
|
8
|
+
import { s as script$k } from './OrSelectV3-b7448701.js';
|
|
9
9
|
import { s as script$l } from './OrSwitchV3-d504bd59.js';
|
|
10
10
|
import { s as script$m } from './OrTagInputV3-2209a961.js';
|
|
11
11
|
import { s as script$n } from './OrTimePickerV3-6dac2d43.js';
|
|
@@ -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 '../OrSelectV3-
|
|
1
|
+
export { s as default } from '../OrSelectV3-b7448701.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { s as OrSelectV3 } from '../OrSelectV3-
|
|
1
|
+
export { s as OrSelectV3 } from '../OrSelectV3-b7448701.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { S as Select, a as SelectControl, c as SelectDropdown, d as SelectDropdownDefault, e as SelectDropdownFlipped, f as SelectDropdownItem, h as SelectLoader, g as SelectNoSearchResults, b as SelectSearchControl } from '../OrSelectV3-
|
|
1
|
+
export { S as Select, a as SelectControl, c as SelectDropdown, d as SelectDropdownDefault, e as SelectDropdownFlipped, f as SelectDropdownItem, h as SelectLoader, g as SelectNoSearchResults, b as SelectSearchControl } from '../OrSelectV3-b7448701.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { withDirectives, openBlock, createElementBlock, normalizeStyle, normalizeClass, vModelDynamic, renderSlot, resolveComponent, createVNode, createSlots, withCtx, createTextVNode, toDisplayString, createElementVNode, vShow, createBlock, createCommentVNode, Fragment, resolveDirective, withModifiers, renderList } from 'vue';
|
|
2
|
-
import { defineComponent, ref, toRefs, computed, watch,
|
|
2
|
+
import { defineComponent, ref, toRefs, computed, watch, getCurrentInstance } from 'vue-demi';
|
|
3
3
|
import { x as useFocus } from './OrAutocompleteV3-50cc3b22.js';
|
|
4
4
|
import { useProxyModelValue } from '../hooks/useProxyModelValue.js';
|
|
5
5
|
import { s as script$5, T as TagsOverflow } from './OrTagsV3-61415f93.js';
|
|
@@ -379,7 +379,6 @@ var script$1 = defineComponent({
|
|
|
379
379
|
const searchControl = ref();
|
|
380
380
|
const selectionLabelRef = ref();
|
|
381
381
|
const tooltipRef = ref();
|
|
382
|
-
const isContentTruncated = ref(false);
|
|
383
382
|
// Props
|
|
384
383
|
const {
|
|
385
384
|
modelValue,
|
|
@@ -398,14 +397,6 @@ var script$1 = defineComponent({
|
|
|
398
397
|
var _a;
|
|
399
398
|
return (_a = selection.value) === null || _a === void 0 ? void 0 : _a.label;
|
|
400
399
|
});
|
|
401
|
-
/* NOTE: using watch here due to async action.
|
|
402
|
-
Computed don't work since we need not just to track the data but to analyze UI after the re-render */
|
|
403
|
-
watch(model, async () => {
|
|
404
|
-
await nextTick();
|
|
405
|
-
if (selectionLabelRef.value) {
|
|
406
|
-
isContentTruncated.value = selectionLabelRef.value.scrollWidth > selectionLabelRef.value.clientWidth;
|
|
407
|
-
}
|
|
408
|
-
});
|
|
409
400
|
watch(() => props.isOpen, () => {
|
|
410
401
|
var _a;
|
|
411
402
|
(_a = tooltipRef.value) === null || _a === void 0 ? void 0 : _a.close();
|
|
@@ -428,6 +419,11 @@ var script$1 = defineComponent({
|
|
|
428
419
|
searchControl.value.focus();
|
|
429
420
|
}
|
|
430
421
|
}
|
|
422
|
+
function checkTooltip() {
|
|
423
|
+
if (!selectionLabelRef.value) return; // to prevent fro TS error; normally ref will always be available here since the method is a mouse event callback
|
|
424
|
+
const isContentTruncated = selectionLabelRef.value.scrollWidth > selectionLabelRef.value.clientWidth;
|
|
425
|
+
if (isContentTruncated) openTooltip();
|
|
426
|
+
}
|
|
431
427
|
return {
|
|
432
428
|
root,
|
|
433
429
|
rootStyles,
|
|
@@ -438,11 +434,11 @@ var script$1 = defineComponent({
|
|
|
438
434
|
selectionLabel,
|
|
439
435
|
focus,
|
|
440
436
|
focused,
|
|
441
|
-
isContentTruncated,
|
|
442
437
|
selectionLabelRef,
|
|
443
438
|
tooltipRef,
|
|
444
439
|
openTooltip,
|
|
445
|
-
closeTooltip
|
|
440
|
+
closeTooltip,
|
|
441
|
+
checkTooltip
|
|
446
442
|
};
|
|
447
443
|
}
|
|
448
444
|
});
|
|
@@ -475,14 +471,13 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
475
471
|
}, 8 /* PROPS */, ["disabled"])) : (openBlock(), createElementBlock("div", _hoisted_1$1, [createElementVNode("div", {
|
|
476
472
|
ref: "selectionLabelRef",
|
|
477
473
|
class: "truncate w-full",
|
|
478
|
-
onMouseenter: _cache[1] || (_cache[1] = (...args) => _ctx.
|
|
479
|
-
onMouseleave: _cache[2] || (_cache[2] =
|
|
480
|
-
}, toDisplayString(_ctx.selectionLabel), 545 /* TEXT, NEED_HYDRATION, NEED_PATCH */),
|
|
481
|
-
key: 0,
|
|
474
|
+
onMouseenter: _cache[1] || (_cache[1] = (...args) => _ctx.checkTooltip && _ctx.checkTooltip(...args)),
|
|
475
|
+
onMouseleave: _cache[2] || (_cache[2] = (...args) => _ctx.closeTooltip && _ctx.closeTooltip(...args))
|
|
476
|
+
}, toDisplayString(_ctx.selectionLabel), 545 /* TEXT, NEED_HYDRATION, NEED_PATCH */), createVNode(_component_OrTooltip, {
|
|
482
477
|
ref: "tooltipRef",
|
|
483
478
|
content: _ctx.selectionLabel,
|
|
484
479
|
trigger: _ctx.selectionLabelRef
|
|
485
|
-
}, null, 8 /* PROPS */, ["content", "trigger"])
|
|
480
|
+
}, null, 8 /* PROPS */, ["content", "trigger"])]))], 64 /* STABLE_FRAGMENT */))], 2 /* CLASS */);
|
|
486
481
|
}
|
|
487
482
|
|
|
488
483
|
script$1.render = render$1;
|
|
@@ -24,7 +24,7 @@ export { s as OrCombinedInputV3 } from './OrCombinedInputV3-ceff5a22.js';
|
|
|
24
24
|
export { s as OrConfirm } from './OrConfirm-004d318a.js';
|
|
25
25
|
export { C as ConfirmType, s as OrConfirmV3 } from './OrConfirmV3-7ed78857.js';
|
|
26
26
|
export { default as OrContextMenuV3 } from './OrContextMenuV3/OrContextMenu.js';
|
|
27
|
-
export { D as DataGridVariant, s as OrDataGridV3 } from './OrDataGridV3-
|
|
27
|
+
export { D as DataGridVariant, s as OrDataGridV3 } from './OrDataGridV3-61becb11.js';
|
|
28
28
|
export { s as OrDateFormatV3 } from './OrDateFormatV3-10e372f9.js';
|
|
29
29
|
export { s as OrDatePickerV3 } from './OrDatePickerV3-b7df1103.js';
|
|
30
30
|
export { s as OrDateRangePickerV3 } from './OrDateRangePickerV3-90be16a0.js';
|
|
@@ -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';
|
|
@@ -93,7 +93,7 @@ export { default as OrSearch } from './OrSearch/OrSearch.js';
|
|
|
93
93
|
export { default as OrSearchV3 } from './OrSearchV3/OrSearch.js';
|
|
94
94
|
export { s as OrSegmentedControlV3, S as SegmentedControlSize } from './OrSegmentedControlV3-99c7f6ed.js';
|
|
95
95
|
export { s as OrSelect } from './OrSelect-eebd1857.js';
|
|
96
|
-
export { s as OrSelectV3 } from './OrSelectV3-
|
|
96
|
+
export { s as OrSelectV3 } from './OrSelectV3-b7448701.js';
|
|
97
97
|
export { OrSidebar, OrSidebarSide } from './OrSidebar/index.js';
|
|
98
98
|
export { s as OrSidebarV3, S as SidebarPlacement } from './OrSidebarV3-f0ed4bc9.js';
|
|
99
99
|
export { s as OrSkeletonCircle, a as OrSkeletonRect, b as OrSkeletonText, O as OrSkeletonTextSizes } from './OrSkeleton-21203227.js';
|
package/dist/bundled/v3/index.js
CHANGED
|
@@ -16,13 +16,13 @@ export { s as OrCombinedInputV3 } from './components/OrCombinedInputV3-ceff5a22.
|
|
|
16
16
|
export { s as OrConfirm } from './components/OrConfirm-004d318a.js';
|
|
17
17
|
export { C as ConfirmType, s as OrConfirmV3 } from './components/OrConfirmV3-7ed78857.js';
|
|
18
18
|
export { default as OrContextMenuV3 } from './components/OrContextMenuV3/OrContextMenu.js';
|
|
19
|
-
export { D as DataGridVariant, s as OrDataGridV3 } from './components/OrDataGridV3-
|
|
19
|
+
export { D as DataGridVariant, s as OrDataGridV3 } from './components/OrDataGridV3-61becb11.js';
|
|
20
20
|
export { s as OrDateFormatV3 } from './components/OrDateFormatV3-10e372f9.js';
|
|
21
21
|
export { s as OrDateRangePickerV3 } from './components/OrDateRangePickerV3-90be16a0.js';
|
|
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';
|
|
@@ -116,7 +116,7 @@ export { s as OrRatingV3, R as RatingVariant } from './components/OrRatingV3-e32
|
|
|
116
116
|
export { s as OrResizeablePanelV3, R as ResizeablePanelPadding, a as ResizeablePanelPlacement } from './components/OrResizeablePanelV3-c512dde5.js';
|
|
117
117
|
export { default as OrSearch } from './components/OrSearch/OrSearch.js';
|
|
118
118
|
export { default as OrSearchV3 } from './components/OrSearchV3/OrSearch.js';
|
|
119
|
-
export { s as OrSelectV3 } from './components/OrSelectV3-
|
|
119
|
+
export { s as OrSelectV3 } from './components/OrSelectV3-b7448701.js';
|
|
120
120
|
export { s as OrSortingV3 } from './components/OrSortingV3-c7afa99b.js';
|
|
121
121
|
export { s as OrSwitchV3 } from './components/OrSwitchV3-d504bd59.js';
|
|
122
122
|
export { default as OrTabHeaderItem } from './components/OrTabHeaderItem/OrTabHeaderItem.js';
|
|
@@ -5,7 +5,7 @@ import { _ as __vue_component__$h } from './OrSearch-3731baa5.js';
|
|
|
5
5
|
import './OrSkeletonCircle.vue_rollup-plugin-vue_script-f572f02f.js';
|
|
6
6
|
import './OrSkeletonRect.vue_rollup-plugin-vue_script-d2b78065.js';
|
|
7
7
|
import { _ as __vue_component__$i } from './OrSkeletonText-b6e51e70.js';
|
|
8
|
-
import { _ as __vue_component__$2, a as __vue_component__$3, b as __vue_component__$4, c as __vue_component__$5, d as __vue_component__$6, e as __vue_component__$7, f as __vue_component__$8, g as __vue_component__$9, h as __vue_component__$a, i as __vue_component__$b, j as __vue_component__$c, k as __vue_component__$d, l as __vue_component__$e, m as __vue_component__$f, D as DataGridVariant } from './OrDataGridToolbar-
|
|
8
|
+
import { _ as __vue_component__$2, a as __vue_component__$3, b as __vue_component__$4, c as __vue_component__$5, d as __vue_component__$6, e as __vue_component__$7, f as __vue_component__$8, g as __vue_component__$9, h as __vue_component__$a, i as __vue_component__$b, j as __vue_component__$c, k as __vue_component__$d, l as __vue_component__$e, m as __vue_component__$f, D as DataGridVariant } from './OrDataGridToolbar-303a4c3d.js';
|
|
9
9
|
import { n as normalizeComponent } from './normalize-component-6e8e3d80.js';
|
|
10
10
|
|
|
11
11
|
const DataGrid = [
|
|
@@ -12,7 +12,7 @@ import { _ as __vue_component__$g } from './OrDateTimePicker-4fba136b.js';
|
|
|
12
12
|
import './OrDateTimePickerTimeSelect-0ecb4686.js';
|
|
13
13
|
import { _ as __vue_component__$h } from './OrInput-52c9e48e.js';
|
|
14
14
|
import { _ as __vue_component__$i } from './OrRating-7c968949.js';
|
|
15
|
-
import { _ as __vue_component__$j } from './OrSelect-
|
|
15
|
+
import { _ as __vue_component__$j } from './OrSelect-5e6734f2.js';
|
|
16
16
|
import { _ as __vue_component__$k } from './OrSwitch-783547da.js';
|
|
17
17
|
import { _ as __vue_component__$l } from './OrTagInput-2dd90e11.js';
|
|
18
18
|
import { _ as __vue_component__$m } from './OrTimePicker-db4774fb.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
|
},
|
|
@@ -25,7 +25,7 @@ import { _ as __vue_component__$b } from './OrPopover-45e2dbce.js';
|
|
|
25
25
|
import { T as TagsOverflow } from './OrTags-4b35fccf.js';
|
|
26
26
|
import { _ as __vue_component__$e } from './OrLoader-25e123a1.js';
|
|
27
27
|
import { _ as __vue_component__$c } from './OrSelectMultipleControl-aa5891fd.js';
|
|
28
|
-
import { _ as __vue_component__$d } from './OrSelectSingleControl-
|
|
28
|
+
import { _ as __vue_component__$d } from './OrSelectSingleControl-450f2642.js';
|
|
29
29
|
import './OrSelectPlaceholder-a6caa9e0.js';
|
|
30
30
|
import { n as normalizeComponent } from './normalize-component-6e8e3d80.js';
|
|
31
31
|
|