vue-devui 1.6.36-alpha.0 → 1.6.36-alpha.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/auto-complete/index.es.js +17 -0
- package/auto-complete/index.umd.js +17 -17
- package/breadcrumb/index.es.js +17 -0
- package/breadcrumb/index.umd.js +2 -2
- package/category-search/index.es.js +103 -16
- package/category-search/index.umd.js +23 -23
- package/checkbox/index.es.js +17 -0
- package/checkbox/index.umd.js +13 -13
- package/code-review/index.es.js +17 -0
- package/code-review/index.umd.js +16 -16
- package/data-grid/index.es.js +17 -0
- package/data-grid/index.umd.js +17 -17
- package/date-picker-pro/index.es.js +17 -0
- package/date-picker-pro/index.umd.js +18 -18
- package/dropdown/index.es.js +17 -0
- package/dropdown/index.umd.js +2 -2
- package/editable-select/index.es.js +17 -0
- package/editable-select/index.umd.js +12 -12
- package/editor-md/index.es.js +17 -0
- package/editor-md/index.umd.js +19 -19
- package/form/index.es.js +17 -0
- package/form/index.umd.js +20 -20
- package/input/index.es.js +17 -0
- package/input/index.umd.js +15 -15
- package/input-number/index.es.js +17 -0
- package/input-number/index.umd.js +20 -20
- package/mention/index.es.js +17 -0
- package/mention/index.umd.js +21 -21
- package/modal/index.es.js +17 -0
- package/modal/index.umd.js +2 -2
- package/overlay/index.es.js +17 -0
- package/overlay/index.umd.js +1 -1
- package/package.json +1 -1
- package/pagination/index.es.js +18 -2
- package/pagination/index.umd.js +16 -16
- package/popover/index.es.js +17 -0
- package/popover/index.umd.js +16 -16
- package/radio/index.es.js +17 -0
- package/radio/index.umd.js +20 -20
- package/search/index.es.js +17 -0
- package/search/index.umd.js +14 -14
- package/select/index.es.js +18 -2
- package/select/index.umd.js +15 -15
- package/splitter/index.es.js +17 -0
- package/splitter/index.umd.js +9 -9
- package/switch/index.es.js +17 -0
- package/switch/index.umd.js +20 -20
- package/table/index.es.js +17 -0
- package/table/index.umd.js +9 -9
- package/tag/index.es.js +1 -2
- package/tag/index.umd.js +1 -1
- package/textarea/index.es.js +17 -0
- package/textarea/index.umd.js +21 -21
- package/time-picker/index.es.js +17 -0
- package/time-picker/index.umd.js +18 -18
- package/time-select/index.es.js +18 -2
- package/time-select/index.umd.js +17 -17
- package/tooltip/index.es.js +17 -0
- package/tooltip/index.umd.js +12 -12
- package/tree/index.es.js +17 -0
- package/tree/index.umd.js +13 -13
- package/types/category-search/src/category-search-types.d.ts +11 -0
- package/types/category-search/src/composables/use-category-selected-tags.d.ts +15 -0
- package/types/overlay/src/flexible-overlay/flexible-overlay-types.d.ts +4 -0
- package/types/overlay/src/flexible-overlay/index.d.ts +3 -0
- package/vue-devui.es.js +103 -16
- package/vue-devui.umd.js +71 -71
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ExtractPropTypes, PropType, InjectionKey, SetupContext, Ref } from 'vue';
|
|
2
|
+
import type { PopoverProps } from '../../popover';
|
|
2
3
|
export type CategorySearchTagType = 'radio' | 'checkbox' | 'label' | 'textInput' | 'numberRange' | 'keyword';
|
|
3
4
|
export type StyleType = 'default' | 'gray';
|
|
4
5
|
export interface ITagOption {
|
|
@@ -133,6 +134,9 @@ export interface ExtendConfig {
|
|
|
133
134
|
export interface ITagContext {
|
|
134
135
|
toggle: (status?: boolean) => void;
|
|
135
136
|
}
|
|
137
|
+
export interface SelectedCategoryEvent {
|
|
138
|
+
tag: ICategorySearchTagItem;
|
|
139
|
+
}
|
|
136
140
|
export declare const categorySearchProps: {
|
|
137
141
|
category: {
|
|
138
142
|
type: PropType<ICategorySearchTagItem[]>;
|
|
@@ -209,6 +213,13 @@ export declare const categorySearchProps: {
|
|
|
209
213
|
type: BooleanConstructor;
|
|
210
214
|
default: boolean;
|
|
211
215
|
};
|
|
216
|
+
collapseTags: {
|
|
217
|
+
type: (BooleanConstructor | NumberConstructor)[];
|
|
218
|
+
default: boolean;
|
|
219
|
+
};
|
|
220
|
+
collapseTagsTooltip: {
|
|
221
|
+
type: PropType<PopoverProps>;
|
|
222
|
+
};
|
|
212
223
|
};
|
|
213
224
|
export type CategorySearchProps = ExtractPropTypes<typeof categorySearchProps>;
|
|
214
225
|
export interface CategorySearchInjection {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CategorySearchProps } from '../category-search-types';
|
|
2
|
+
export declare function useCategorySelectedTags(props: CategorySearchProps): {
|
|
3
|
+
isCollapseTags: import("vue").Ref<boolean, boolean>;
|
|
4
|
+
collapseTagsCount: import("vue").Ref<number, number>;
|
|
5
|
+
popoverConfig: import("vue").Ref<{
|
|
6
|
+
trigger: string;
|
|
7
|
+
position: string[];
|
|
8
|
+
}, {
|
|
9
|
+
trigger: string;
|
|
10
|
+
position: string[];
|
|
11
|
+
} | {
|
|
12
|
+
trigger: string;
|
|
13
|
+
position: string[];
|
|
14
|
+
}>;
|
|
15
|
+
};
|
|
@@ -56,5 +56,9 @@ export declare const flexibleOverlayProps: {
|
|
|
56
56
|
type: BooleanConstructor;
|
|
57
57
|
default: boolean;
|
|
58
58
|
};
|
|
59
|
+
autoUpdatePosition: {
|
|
60
|
+
type: BooleanConstructor;
|
|
61
|
+
default: boolean;
|
|
62
|
+
};
|
|
59
63
|
};
|
|
60
64
|
export type FlexibleOverlayProps = ExtractPropTypes<typeof flexibleOverlayProps>;
|
|
@@ -8,6 +8,7 @@ export declare const FlexibleOverlay: import("vue").DefineComponent<{
|
|
|
8
8
|
isArrowCenter: boolean;
|
|
9
9
|
clickEventBubble: boolean;
|
|
10
10
|
fitOriginWidth: boolean;
|
|
11
|
+
autoUpdatePosition: boolean;
|
|
11
12
|
origin?: HTMLElement | undefined;
|
|
12
13
|
shiftOffset?: number | undefined;
|
|
13
14
|
}, () => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "positionChange")[], "update:modelValue" | "positionChange", import("vue").PublicProps, Readonly<{
|
|
@@ -19,6 +20,7 @@ export declare const FlexibleOverlay: import("vue").DefineComponent<{
|
|
|
19
20
|
isArrowCenter: boolean;
|
|
20
21
|
clickEventBubble: boolean;
|
|
21
22
|
fitOriginWidth: boolean;
|
|
23
|
+
autoUpdatePosition: boolean;
|
|
22
24
|
origin?: HTMLElement | undefined;
|
|
23
25
|
shiftOffset?: number | undefined;
|
|
24
26
|
}> & Readonly<{
|
|
@@ -33,4 +35,5 @@ export declare const FlexibleOverlay: import("vue").DefineComponent<{
|
|
|
33
35
|
isArrowCenter: boolean;
|
|
34
36
|
clickEventBubble: boolean;
|
|
35
37
|
fitOriginWidth: boolean;
|
|
38
|
+
autoUpdatePosition: boolean;
|
|
36
39
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
package/vue-devui.es.js
CHANGED
|
@@ -8002,6 +8002,10 @@ const flexibleOverlayProps = {
|
|
|
8002
8002
|
fitOriginWidth: {
|
|
8003
8003
|
type: Boolean,
|
|
8004
8004
|
default: false
|
|
8005
|
+
},
|
|
8006
|
+
autoUpdatePosition: {
|
|
8007
|
+
type: Boolean,
|
|
8008
|
+
default: false
|
|
8005
8009
|
}
|
|
8006
8010
|
};
|
|
8007
8011
|
function adjustArrowPosition(isArrowCenter, point, placement, originRect) {
|
|
@@ -8029,6 +8033,7 @@ function useOverlay(props, emit) {
|
|
|
8029
8033
|
const arrowRef = ref();
|
|
8030
8034
|
const overlayWidth = ref(0);
|
|
8031
8035
|
let originObserver;
|
|
8036
|
+
let overlayObserver;
|
|
8032
8037
|
const styles = computed(() => {
|
|
8033
8038
|
if (fitOriginWidth.value) {
|
|
8034
8039
|
return { width: overlayWidth.value + "px" };
|
|
@@ -8099,6 +8104,15 @@ function useOverlay(props, emit) {
|
|
|
8099
8104
|
const originEl = (_b = (_a = props.origin) == null ? void 0 : _a.$el) != null ? _b : props.origin;
|
|
8100
8105
|
originEl && (originObserver == null ? void 0 : originObserver.unobserve(originEl));
|
|
8101
8106
|
};
|
|
8107
|
+
const observeOverlay = () => {
|
|
8108
|
+
if (props.autoUpdatePosition && typeof window !== "undefined" && overlayRef.value) {
|
|
8109
|
+
overlayObserver = new window.ResizeObserver(updatePosition);
|
|
8110
|
+
overlayObserver.observe(overlayRef.value);
|
|
8111
|
+
}
|
|
8112
|
+
};
|
|
8113
|
+
const unobserveOverlay = () => {
|
|
8114
|
+
overlayRef.value && (overlayObserver == null ? void 0 : overlayObserver.unobserve(overlayRef.value));
|
|
8115
|
+
};
|
|
8102
8116
|
watch(
|
|
8103
8117
|
() => props.modelValue,
|
|
8104
8118
|
() => {
|
|
@@ -8107,10 +8121,12 @@ function useOverlay(props, emit) {
|
|
|
8107
8121
|
window.addEventListener("scroll", scrollCallback, true);
|
|
8108
8122
|
window.addEventListener("resize", updatePosition);
|
|
8109
8123
|
observeOrigin();
|
|
8124
|
+
nextTick(observeOverlay);
|
|
8110
8125
|
} else {
|
|
8111
8126
|
window.removeEventListener("scroll", scrollCallback, true);
|
|
8112
8127
|
window.removeEventListener("resize", updatePosition);
|
|
8113
8128
|
unobserveOrigin();
|
|
8129
|
+
unobserveOverlay();
|
|
8114
8130
|
}
|
|
8115
8131
|
}
|
|
8116
8132
|
);
|
|
@@ -8118,6 +8134,7 @@ function useOverlay(props, emit) {
|
|
|
8118
8134
|
window.removeEventListener("scroll", scrollCallback, true);
|
|
8119
8135
|
window.removeEventListener("resize", updatePosition);
|
|
8120
8136
|
unobserveOrigin();
|
|
8137
|
+
unobserveOverlay();
|
|
8121
8138
|
});
|
|
8122
8139
|
return { arrowRef, overlayRef, styles, updatePosition };
|
|
8123
8140
|
}
|
|
@@ -14472,7 +14489,6 @@ var Tag = defineComponent({
|
|
|
14472
14489
|
} = toRefs(props);
|
|
14473
14490
|
const tagClass = useClass(props);
|
|
14474
14491
|
const themeColor = useColor(props);
|
|
14475
|
-
const tagTitle = titleContent.value || "";
|
|
14476
14492
|
const isDefaultTag = () => !type4.value && !color2.value;
|
|
14477
14493
|
const handleClick = (e) => {
|
|
14478
14494
|
emit("click", e);
|
|
@@ -14511,7 +14527,7 @@ var Tag = defineComponent({
|
|
|
14511
14527
|
color: contentColor.value,
|
|
14512
14528
|
backgroundColor: checked.value ? themeColor.value : !color2.value ? "" : "var(--devui-base-bg, #ffffff)"
|
|
14513
14529
|
},
|
|
14514
|
-
"title":
|
|
14530
|
+
"title": titleContent.value || ""
|
|
14515
14531
|
}, [(_a = slots.default) == null ? void 0 : _a.call(slots), closeIconEl()])]);
|
|
14516
14532
|
};
|
|
14517
14533
|
}
|
|
@@ -14599,6 +14615,13 @@ const categorySearchProps = {
|
|
|
14599
14615
|
inputAutofocus: {
|
|
14600
14616
|
type: Boolean,
|
|
14601
14617
|
default: true
|
|
14618
|
+
},
|
|
14619
|
+
collapseTags: {
|
|
14620
|
+
type: [Boolean, Number],
|
|
14621
|
+
default: false
|
|
14622
|
+
},
|
|
14623
|
+
collapseTagsTooltip: {
|
|
14624
|
+
type: Object
|
|
14602
14625
|
}
|
|
14603
14626
|
};
|
|
14604
14627
|
const categorySearchInjectionKey = Symbol("d-category-search");
|
|
@@ -15397,37 +15420,40 @@ var TextInputMenu = defineComponent({
|
|
|
15397
15420
|
props: typeMenuProps,
|
|
15398
15421
|
emits: ["close"],
|
|
15399
15422
|
setup(props, ctx2) {
|
|
15400
|
-
const
|
|
15401
|
-
tag: tag2
|
|
15402
|
-
} = toRefs(props);
|
|
15423
|
+
const formEl = ref();
|
|
15403
15424
|
const {
|
|
15404
15425
|
getTextInputValue
|
|
15405
15426
|
} = inject(categorySearchInjectionKey);
|
|
15406
15427
|
const formData = reactive({
|
|
15407
|
-
text:
|
|
15428
|
+
text: props.tag.value.value
|
|
15408
15429
|
});
|
|
15409
15430
|
const onConfirmClick = () => {
|
|
15410
|
-
|
|
15411
|
-
|
|
15431
|
+
formEl.value.validate((isValid2) => {
|
|
15432
|
+
if (isValid2) {
|
|
15433
|
+
getTextInputValue(props.tag, formData.text);
|
|
15434
|
+
ctx2.emit("close");
|
|
15435
|
+
}
|
|
15436
|
+
});
|
|
15412
15437
|
};
|
|
15413
15438
|
const onCancelClick = () => {
|
|
15414
15439
|
ctx2.emit("close");
|
|
15415
15440
|
};
|
|
15416
15441
|
return () => createVNode(resolveComponent("d-form"), {
|
|
15442
|
+
"ref": formEl,
|
|
15417
15443
|
"data": formData,
|
|
15418
15444
|
"pop-position": ["right"]
|
|
15419
15445
|
}, {
|
|
15420
15446
|
default: () => [createVNode(resolveComponent("d-form-item"), {
|
|
15421
15447
|
"field": "text",
|
|
15422
|
-
"rules":
|
|
15448
|
+
"rules": props.tag.validateRules
|
|
15423
15449
|
}, {
|
|
15424
15450
|
default: () => [createVNode(resolveComponent("d-input"), {
|
|
15425
15451
|
"modelValue": formData.text,
|
|
15426
15452
|
"onUpdate:modelValue": ($event) => formData.text = $event,
|
|
15427
15453
|
"autocomplete": "off",
|
|
15428
15454
|
"autofocus": true,
|
|
15429
|
-
"maxlength":
|
|
15430
|
-
"placeholder":
|
|
15455
|
+
"maxlength": props.tag.maxLength,
|
|
15456
|
+
"placeholder": props.tag.placeholder || ""
|
|
15431
15457
|
}, null)]
|
|
15432
15458
|
}), createVNode("div", {
|
|
15433
15459
|
"class": "dp-dropdown-operation-area"
|
|
@@ -15980,6 +16006,7 @@ function useCategorySearch(props, ctx2) {
|
|
|
15980
16006
|
currentSelectTag.value.title = setTitle(currentSelectTag.value, currentSelectTag.value.type || "", "");
|
|
15981
16007
|
inputRef.value.openMenu();
|
|
15982
16008
|
props.inputAutofocus && inputRef.value.focus();
|
|
16009
|
+
ctx2.emit("selectedCategory", { tag: item });
|
|
15983
16010
|
}, DROPDOWN_ANIMATION_TIMEOUT);
|
|
15984
16011
|
};
|
|
15985
16012
|
const searchKeyChangeEvent = (event) => {
|
|
@@ -16012,6 +16039,7 @@ function useCategorySearch(props, ctx2) {
|
|
|
16012
16039
|
innerSearchKey.value = "";
|
|
16013
16040
|
inputRef.value.closeMenu();
|
|
16014
16041
|
chooseCategory(tag2);
|
|
16042
|
+
ctx2.emit("selectedCategory", { tag: tag2 });
|
|
16015
16043
|
setTimeout(() => {
|
|
16016
16044
|
isFocus.value = true;
|
|
16017
16045
|
enterSearch.value = false;
|
|
@@ -16457,11 +16485,44 @@ function useCategorySearch(props, ctx2) {
|
|
|
16457
16485
|
onSearch
|
|
16458
16486
|
};
|
|
16459
16487
|
}
|
|
16488
|
+
function useCategorySelectedTags(props) {
|
|
16489
|
+
const isCollapseTags = ref(false);
|
|
16490
|
+
const collapseTagsCount = ref(0);
|
|
16491
|
+
const defaultPopoverConfig = {
|
|
16492
|
+
trigger: "hover",
|
|
16493
|
+
position: ["top", "bottom"]
|
|
16494
|
+
};
|
|
16495
|
+
const popoverConfig = ref(defaultPopoverConfig);
|
|
16496
|
+
watch(
|
|
16497
|
+
() => props.collapseTags,
|
|
16498
|
+
(val) => {
|
|
16499
|
+
if (typeof val === "boolean") {
|
|
16500
|
+
isCollapseTags.value = val;
|
|
16501
|
+
collapseTagsCount.value = val ? 1 : 0;
|
|
16502
|
+
}
|
|
16503
|
+
if (typeof val === "number") {
|
|
16504
|
+
isCollapseTags.value = true;
|
|
16505
|
+
collapseTagsCount.value = val;
|
|
16506
|
+
}
|
|
16507
|
+
},
|
|
16508
|
+
{ immediate: true }
|
|
16509
|
+
);
|
|
16510
|
+
watch(
|
|
16511
|
+
() => props.collapseTagsTooltip,
|
|
16512
|
+
(val) => {
|
|
16513
|
+
if (val) {
|
|
16514
|
+
popoverConfig.value = { ...defaultPopoverConfig, ...val };
|
|
16515
|
+
}
|
|
16516
|
+
},
|
|
16517
|
+
{ immediate: true }
|
|
16518
|
+
);
|
|
16519
|
+
return { isCollapseTags, collapseTagsCount, popoverConfig };
|
|
16520
|
+
}
|
|
16460
16521
|
var categorySearch = "";
|
|
16461
16522
|
var CategorySearch = defineComponent({
|
|
16462
16523
|
name: "DCategorySearch",
|
|
16463
16524
|
props: categorySearchProps,
|
|
16464
|
-
emits: ["search", "selectedTagsChange", "createFilter", "clearAll", "searchKeyChange"],
|
|
16525
|
+
emits: ["search", "selectedTagsChange", "selectedCategory", "createFilter", "clearAll", "searchKeyChange"],
|
|
16465
16526
|
setup(props, ctx2) {
|
|
16466
16527
|
const {
|
|
16467
16528
|
rootRef,
|
|
@@ -16475,6 +16536,11 @@ var CategorySearch = defineComponent({
|
|
|
16475
16536
|
operationConfig,
|
|
16476
16537
|
onSearch
|
|
16477
16538
|
} = useCategorySearch(props, ctx2);
|
|
16539
|
+
const {
|
|
16540
|
+
isCollapseTags,
|
|
16541
|
+
collapseTagsCount,
|
|
16542
|
+
popoverConfig
|
|
16543
|
+
} = useCategorySelectedTags(props);
|
|
16478
16544
|
return () => {
|
|
16479
16545
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t;
|
|
16480
16546
|
return createVNode("div", {
|
|
@@ -16490,10 +16556,31 @@ var CategorySearch = defineComponent({
|
|
|
16490
16556
|
"class": "dp-category-search-line-container"
|
|
16491
16557
|
}, [createVNode("ul", {
|
|
16492
16558
|
"class": "dp-category-search-line"
|
|
16493
|
-
}, [innerSelectedTags.value.map((item) =>
|
|
16494
|
-
|
|
16495
|
-
|
|
16496
|
-
|
|
16559
|
+
}, [innerSelectedTags.value.map((item, index2) => {
|
|
16560
|
+
if (isCollapseTags.value) {
|
|
16561
|
+
return index2 < collapseTagsCount.value && createVNode(CategorySearchTagDropdown, {
|
|
16562
|
+
"item": item,
|
|
16563
|
+
"isJoinLabelType": joinLabelTypes.includes(item.type || "")
|
|
16564
|
+
}, null);
|
|
16565
|
+
} else {
|
|
16566
|
+
return createVNode(CategorySearchTagDropdown, {
|
|
16567
|
+
"item": item,
|
|
16568
|
+
"isJoinLabelType": joinLabelTypes.includes(item.type || "")
|
|
16569
|
+
}, null);
|
|
16570
|
+
}
|
|
16571
|
+
}), isCollapseTags.value && innerSelectedTags.value.length > collapseTagsCount.value && createVNode(Popover, mergeProps({
|
|
16572
|
+
"auto-update-position": true
|
|
16573
|
+
}, popoverConfig.value), {
|
|
16574
|
+
default: () => createVNode(Tag, {
|
|
16575
|
+
"deletable": false
|
|
16576
|
+
}, {
|
|
16577
|
+
default: () => [`+${innerSelectedTags.value.length - collapseTagsCount.value}`]
|
|
16578
|
+
}),
|
|
16579
|
+
content: () => innerSelectedTags.value.map((item, index2) => index2 >= collapseTagsCount.value && createVNode(CategorySearchTagDropdown, {
|
|
16580
|
+
"item": item,
|
|
16581
|
+
"isJoinLabelType": joinLabelTypes.includes(item.type || "")
|
|
16582
|
+
}, null))
|
|
16583
|
+
}), createVNode(CategorySearchInput, {
|
|
16497
16584
|
"ref": inputRef
|
|
16498
16585
|
}, null)])]), showExtendedConfig.value && createVNode("div", {
|
|
16499
16586
|
"class": "dp-category-search-extended-container"
|