@aplus-frontend/ui 7.13.8 → 7.13.10
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/es/src/ag-grid/components/body-cell/index.vue2.mjs +7 -7
- package/es/src/ag-grid/components/empty/index.vue2.mjs +10 -10
- package/es/src/ag-grid/components/header-cell/index.vue2.mjs +37 -37
- package/es/src/ag-grid/components/row/index.vue2.mjs +5 -5
- package/es/src/ag-grid/components/tooltip/index.vue2.mjs +12 -12
- package/es/src/ag-grid/editable/form-item.vue.mjs +49 -49
- package/es/src/ag-grid/editable/index.vue.mjs +27 -27
- package/es/src/ag-grid/hooks/use-columns.d.ts +2 -0
- package/es/src/ag-grid/hooks/use-columns.mjs +35 -17
- package/es/src/ag-grid/index.vue.mjs +349 -318
- package/es/src/ap-action/group/index.vue.mjs +15 -15
- package/es/src/ap-action/item/index.vue2.mjs +28 -28
- package/es/src/ap-action/item-dropdown/index.vue.mjs +39 -39
- package/es/src/ap-field/checkbox/index.vue.mjs +19 -19
- package/es/src/ap-field/checkbox/read.vue2.mjs +9 -9
- package/es/src/ap-field/date/index.vue.mjs +50 -50
- package/es/src/ap-field/date/read.vue2.mjs +7 -7
- package/es/src/ap-field/date-range/index.vue.mjs +29 -29
- package/es/src/ap-field/date-range/read.vue2.mjs +22 -22
- package/es/src/ap-field/hooks/use-default-presets.mjs +59 -16
- package/es/src/ap-field/interface.d.ts +46 -1
- package/es/src/ap-field/number/index.vue.mjs +24 -24
- package/es/src/ap-field/radio/index.vue.mjs +24 -24
- package/es/src/ap-field/second/index.vue.mjs +15 -15
- package/es/src/ap-field/second/read.vue2.mjs +7 -7
- package/es/src/ap-field/segmented/index.vue.mjs +24 -24
- package/es/src/ap-field/select/index.vue.d.ts +12 -2
- package/es/src/ap-field/select/index.vue.mjs +127 -124
- package/es/src/ap-field/select/read.vue2.mjs +6 -6
- package/es/src/ap-field/slider/index.vue.mjs +11 -11
- package/es/src/ap-field/style/select.mjs +53 -36
- package/es/src/ap-field/switch/index.vue.mjs +45 -45
- package/es/src/ap-field/text/read-password.vue2.mjs +13 -13
- package/es/src/ap-field/text/read.vue2.mjs +3 -3
- package/es/src/ap-field/text-area/index.vue.mjs +29 -29
- package/es/src/ap-field/text-area/read.vue2.mjs +12 -12
- package/es/src/ap-field/tree-select/index.vue.mjs +31 -31
- package/es/src/ap-form/ap-form.vue2.mjs +46 -46
- package/es/src/ap-form/drawer-form/index.vue.mjs +30 -30
- package/es/src/ap-form/item/index.vue.mjs +75 -75
- package/es/src/ap-form/items/checkbox/index.vue.mjs +10 -10
- package/es/src/ap-form/items/number/index.vue.mjs +17 -17
- package/es/src/ap-form/items/radio/index.vue.mjs +13 -13
- package/es/src/ap-form/items/switch/index.vue.mjs +14 -14
- package/es/src/ap-form/items/text/index.vue2.mjs +26 -26
- package/es/src/ap-form/items/text/password.vue.mjs +19 -19
- package/es/src/ap-form/items/text-area/index.vue.mjs +17 -17
- package/es/src/ap-form/modal-form/index.vue.mjs +34 -34
- package/es/src/ap-form/search-form/components/popover-filter.vue2.mjs +39 -39
- package/es/src/ap-form/search-form/components/popover-sorter/sortable-item.vue2.mjs +7 -7
- package/es/src/ap-grid/editable/form-item.vue.mjs +46 -46
- package/es/src/ap-grid/editable/index.vue.mjs +19 -19
- package/es/src/ap-grid/index.vue.mjs +212 -212
- package/es/src/ap-list/index.vue.mjs +116 -116
- package/es/src/ap-table/ap-table.vue2.mjs +217 -217
- package/es/src/ap-table/components/index/index.vue2.mjs +9 -9
- package/es/src/ap-table/components/setting/modal/index.vue2.mjs +52 -51
- package/es/src/ap-table/components/setting/select-group/index.vue2.mjs +21 -21
- package/es/src/ap-table/components/setting/sortable/index.vue2.mjs +15 -15
- package/es/src/ap-table/components/setting/sortable/item.vue2.mjs +69 -69
- package/es/src/ap-table/components/setting/template/edit-form.vue.d.ts +1 -0
- package/es/src/ap-table/components/setting/template/edit-form.vue2.mjs +31 -30
- package/es/src/ap-table/components/setting/template/index.vue2.mjs +25 -25
- package/es/src/ap-table/components/setting/template/item.vue2.mjs +41 -40
- package/es/src/ap-table/components/setting/tree-select/index.vue2.mjs +14 -14
- package/es/src/ap-table/hooks/use-sorted-filtered.d.ts +18 -2
- package/es/src/ap-table/hooks/use-sorted-filtered.mjs +13 -11
- package/es/src/ap-table/hooks/use-table-paging-ng.d.ts +17 -2
- package/es/src/ap-table/hooks/use-table-paging-ng.mjs +148 -142
- package/es/src/ap-table/style/setting.mjs +2 -2
- package/es/src/business/ag-grid-modal/modal-layout/index.vue2.mjs +54 -54
- package/es/src/business/ag-grid-modal/selected-items/default.vue2.mjs +13 -13
- package/es/src/business/ag-grid-modal/wrapper/index.vue2.mjs +20 -20
- package/es/src/business/ap-descriptions/ap-descriptions.vue.mjs +33 -33
- package/es/src/business/ap-descriptions/help-message/index.vue2.mjs +13 -13
- package/es/src/business/ap-download/ap-download.vue.mjs +24 -24
- package/es/src/business/ap-expand-alert/ApExpandAlert.vue.mjs +77 -77
- package/es/src/business/ap-export-group/ApExportGroup.vue2.mjs +119 -112
- package/es/src/business/ap-export-group/handleExportDownload.d.ts +1 -1
- package/es/src/business/ap-export-group/handleExportDownload.mjs +2 -2
- package/es/src/business/ap-export-group/interface.d.ts +9 -0
- package/es/src/business/ap-radio-group/ap-radio-group.vue2.mjs +33 -33
- package/es/src/business/ap-status/group/ApStatusGroup.vue2.mjs +12 -12
- package/es/src/business/ap-table-modal/table-layout/index.vue2.mjs +43 -43
- package/es/src/business/ap-table-modal/table-modal.vue2.mjs +57 -57
- package/es/src/business/ap-tag/ap-tag-group.vue.mjs +37 -37
- package/es/src/business/ap-tag/ap-tag.vue.mjs +24 -24
- package/es/src/business/ap-title/ApTitle.vue2.mjs +27 -27
- package/es/src/business/ap-value-select-card/index.vue2.mjs +98 -98
- package/es/src/business/ap-view/components/main-button-content.vue.d.ts +1 -1
- package/es/src/business/batch-input-group/form-item.vue.mjs +25 -25
- package/es/src/business/batch-input-group/index.vue.mjs +60 -60
- package/es/src/business/batch-input-group/popover-input/index.vue2.mjs +29 -29
- package/es/src/config-provider/config-provider-props.d.ts +1 -1
- package/es/src/config-provider/config-provider.d.ts +3 -0
- package/es/src/config-provider/hooks/use-global-config.d.ts +1 -0
- package/es/src/config-provider/index.d.ts +6 -0
- package/es/src/editable-table/form-item.vue.mjs +35 -35
- package/es/src/editable-table/index.vue.mjs +19 -19
- package/es/src/full-screen/index.vue.mjs +46 -46
- package/es/src/locale/lang/en.mjs +2 -1
- package/es/src/locale/lang/zh-cn.mjs +2 -1
- package/es/src/mask/index.vue.mjs +48 -48
- package/es/src/portal/index.vue.mjs +5 -5
- package/es/src/scroll-bar/internal.vue.mjs +62 -62
- package/es/src/scroll-view/index.vue.mjs +66 -66
- package/es/src/skeleton/components/desc/index.vue2.mjs +9 -9
- package/es/src/skeleton/components/desc/item-large.vue2.mjs +25 -25
- package/es/src/skeleton/components/desc/item.vue2.mjs +13 -13
- package/es/src/skeleton/components/list/index.vue2.mjs +14 -14
- package/es/src/skeleton/components/list/item.vue2.mjs +12 -12
- package/es/src/skeleton/components/page-header/index.vue2.mjs +8 -8
- package/es/src/skeleton/components/search-form/index.vue2.mjs +35 -35
- package/es/src/skeleton/components/table/index.vue2.mjs +17 -17
- package/es/src/skeleton/components/table/item.vue2.mjs +23 -23
- package/es/src/skeleton/descriptions.vue2.mjs +15 -15
- package/es/src/skeleton/list-page.vue2.mjs +12 -12
- package/es/src/splitter/Panel.vue2.mjs +11 -11
- package/es/src/splitter/SplitBar.vue2.mjs +79 -79
- package/es/src/splitter/Splitter.vue2.mjs +50 -50
- package/es/src/text/group.vue.mjs +8 -8
- package/es/src/text/index.vue.mjs +48 -48
- package/es/src/version.d.ts +1 -1
- package/es/src/version.mjs +1 -1
- package/lib/src/ag-grid/components/body-cell/index.vue2.js +1 -1
- package/lib/src/ag-grid/components/empty/index.vue2.js +1 -1
- package/lib/src/ag-grid/components/header-cell/index.vue2.js +1 -1
- package/lib/src/ag-grid/components/row/index.vue2.js +1 -1
- package/lib/src/ag-grid/components/tooltip/index.vue2.js +1 -1
- package/lib/src/ag-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ag-grid/editable/index.vue.js +1 -1
- package/lib/src/ag-grid/hooks/use-columns.d.ts +2 -0
- package/lib/src/ag-grid/hooks/use-columns.js +1 -1
- package/lib/src/ag-grid/index.vue.js +1 -1
- package/lib/src/ap-action/group/index.vue.js +1 -1
- package/lib/src/ap-action/item/index.vue2.js +1 -1
- package/lib/src/ap-action/item-dropdown/index.vue.js +1 -1
- package/lib/src/ap-field/checkbox/index.vue.js +1 -1
- package/lib/src/ap-field/checkbox/read.vue2.js +1 -1
- package/lib/src/ap-field/date/index.vue.js +1 -1
- package/lib/src/ap-field/date/read.vue2.js +1 -1
- package/lib/src/ap-field/date-range/index.vue.js +1 -1
- package/lib/src/ap-field/date-range/read.vue2.js +1 -1
- package/lib/src/ap-field/hooks/use-default-presets.js +1 -1
- package/lib/src/ap-field/interface.d.ts +46 -1
- package/lib/src/ap-field/number/index.vue.js +1 -1
- package/lib/src/ap-field/radio/index.vue.js +1 -1
- package/lib/src/ap-field/second/index.vue.js +1 -1
- package/lib/src/ap-field/second/read.vue2.js +1 -1
- package/lib/src/ap-field/segmented/index.vue.js +1 -1
- package/lib/src/ap-field/select/index.vue.d.ts +12 -2
- package/lib/src/ap-field/select/index.vue.js +1 -1
- package/lib/src/ap-field/select/read.vue2.js +1 -1
- package/lib/src/ap-field/slider/index.vue.js +1 -1
- package/lib/src/ap-field/style/select.js +1 -1
- package/lib/src/ap-field/switch/index.vue.js +1 -1
- package/lib/src/ap-field/text/read-password.vue2.js +1 -1
- package/lib/src/ap-field/text/read.vue2.js +1 -1
- package/lib/src/ap-field/text-area/index.vue.js +1 -1
- package/lib/src/ap-field/text-area/read.vue2.js +1 -1
- package/lib/src/ap-field/tree-select/index.vue.js +1 -1
- package/lib/src/ap-form/ap-form.vue2.js +1 -1
- package/lib/src/ap-form/drawer-form/index.vue.js +1 -1
- package/lib/src/ap-form/item/index.vue.js +1 -1
- package/lib/src/ap-form/items/checkbox/index.vue.js +1 -1
- package/lib/src/ap-form/items/number/index.vue.js +1 -1
- package/lib/src/ap-form/items/radio/index.vue.js +1 -1
- package/lib/src/ap-form/items/switch/index.vue.js +1 -1
- package/lib/src/ap-form/items/text/index.vue2.js +1 -1
- package/lib/src/ap-form/items/text/password.vue.js +1 -1
- package/lib/src/ap-form/items/text-area/index.vue.js +1 -1
- package/lib/src/ap-form/modal-form/index.vue.js +1 -1
- package/lib/src/ap-form/search-form/components/popover-filter.vue2.js +1 -1
- package/lib/src/ap-form/search-form/components/popover-sorter/sortable-item.vue2.js +1 -1
- package/lib/src/ap-grid/editable/form-item.vue.js +1 -1
- package/lib/src/ap-grid/editable/index.vue.js +1 -1
- package/lib/src/ap-grid/index.vue.js +1 -1
- package/lib/src/ap-list/index.vue.js +1 -1
- package/lib/src/ap-table/ap-table.vue2.js +1 -1
- package/lib/src/ap-table/components/index/index.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/modal/index.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/select-group/index.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/sortable/index.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/sortable/item.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/template/edit-form.vue.d.ts +1 -0
- package/lib/src/ap-table/components/setting/template/edit-form.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/template/index.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/template/item.vue2.js +1 -1
- package/lib/src/ap-table/components/setting/tree-select/index.vue2.js +1 -1
- package/lib/src/ap-table/hooks/use-sorted-filtered.d.ts +18 -2
- package/lib/src/ap-table/hooks/use-sorted-filtered.js +1 -1
- package/lib/src/ap-table/hooks/use-table-paging-ng.d.ts +17 -2
- package/lib/src/ap-table/hooks/use-table-paging-ng.js +1 -1
- package/lib/src/ap-table/style/setting.js +1 -1
- package/lib/src/business/ag-grid-modal/modal-layout/index.vue2.js +1 -1
- package/lib/src/business/ag-grid-modal/selected-items/default.vue2.js +1 -1
- package/lib/src/business/ag-grid-modal/wrapper/index.vue2.js +1 -1
- package/lib/src/business/ap-descriptions/ap-descriptions.vue.js +1 -1
- package/lib/src/business/ap-descriptions/help-message/index.vue2.js +1 -1
- package/lib/src/business/ap-download/ap-download.vue.js +1 -1
- package/lib/src/business/ap-expand-alert/ApExpandAlert.vue.js +1 -1
- package/lib/src/business/ap-export-group/ApExportGroup.vue2.js +1 -1
- package/lib/src/business/ap-export-group/handleExportDownload.d.ts +1 -1
- package/lib/src/business/ap-export-group/handleExportDownload.js +1 -1
- package/lib/src/business/ap-export-group/interface.d.ts +9 -0
- package/lib/src/business/ap-radio-group/ap-radio-group.vue2.js +1 -1
- package/lib/src/business/ap-status/group/ApStatusGroup.vue2.js +1 -1
- package/lib/src/business/ap-table-modal/table-layout/index.vue2.js +1 -1
- package/lib/src/business/ap-table-modal/table-modal.vue2.js +1 -1
- package/lib/src/business/ap-tag/ap-tag-group.vue.js +1 -1
- package/lib/src/business/ap-tag/ap-tag.vue.js +1 -1
- package/lib/src/business/ap-title/ApTitle.vue2.js +1 -1
- package/lib/src/business/ap-value-select-card/index.vue2.js +1 -1
- package/lib/src/business/ap-view/components/main-button-content.vue.d.ts +1 -1
- package/lib/src/business/batch-input-group/form-item.vue.js +1 -1
- package/lib/src/business/batch-input-group/index.vue.js +2 -2
- package/lib/src/business/batch-input-group/popover-input/index.vue2.js +2 -2
- package/lib/src/config-provider/config-provider-props.d.ts +1 -1
- package/lib/src/config-provider/config-provider.d.ts +3 -0
- package/lib/src/config-provider/hooks/use-global-config.d.ts +1 -0
- package/lib/src/config-provider/index.d.ts +6 -0
- package/lib/src/editable-table/form-item.vue.js +1 -1
- package/lib/src/editable-table/index.vue.js +1 -1
- package/lib/src/full-screen/index.vue.js +1 -1
- package/lib/src/locale/lang/en.js +1 -1
- package/lib/src/locale/lang/zh-cn.js +1 -1
- package/lib/src/mask/index.vue.js +1 -1
- package/lib/src/portal/index.vue.js +1 -1
- package/lib/src/scroll-bar/internal.vue.js +1 -1
- package/lib/src/scroll-view/index.vue.js +1 -1
- package/lib/src/skeleton/components/desc/index.vue2.js +1 -1
- package/lib/src/skeleton/components/desc/item-large.vue2.js +1 -1
- package/lib/src/skeleton/components/desc/item.vue2.js +1 -1
- package/lib/src/skeleton/components/list/index.vue2.js +1 -1
- package/lib/src/skeleton/components/list/item.vue2.js +1 -1
- package/lib/src/skeleton/components/page-header/index.vue2.js +1 -1
- package/lib/src/skeleton/components/search-form/index.vue2.js +1 -1
- package/lib/src/skeleton/components/table/index.vue2.js +1 -1
- package/lib/src/skeleton/components/table/item.vue2.js +1 -1
- package/lib/src/skeleton/descriptions.vue2.js +1 -1
- package/lib/src/skeleton/list-page.vue2.js +1 -1
- package/lib/src/splitter/Panel.vue2.js +1 -1
- package/lib/src/splitter/SplitBar.vue2.js +1 -1
- package/lib/src/splitter/Splitter.vue2.js +1 -1
- package/lib/src/text/group.vue.js +1 -1
- package/lib/src/text/index.vue.js +1 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/src/version.js +1 -1
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as B, ref as C, useSlots as S, onMounted as h, computed as U, unref as
|
|
1
|
+
import { defineComponent as B, ref as C, useSlots as S, onMounted as h, computed as U, unref as t, createVNode as s, Fragment as a, createBlock as i, createElementBlock as V, openBlock as u, resolveDynamicComponent as _, mergeProps as N, withCtx as q, renderSlot as z, normalizeProps as F, guardReactiveProps as P } from "vue";
|
|
2
2
|
import { Spin as T, Segmented as O } from "@aplus-frontend/antdv";
|
|
3
|
-
import { isFunction as
|
|
3
|
+
import { isFunction as f, isUndefined as R, isString as w, isNumber as A, omit as D } from "lodash-unified";
|
|
4
4
|
import "../../hooks/index.mjs";
|
|
5
5
|
import E from "../hooks/use-options.mjs";
|
|
6
6
|
import { useControllableValue as M } from "../../hooks/useControllableValue.mjs";
|
|
@@ -40,48 +40,48 @@ const K = /* @__PURE__ */ B({
|
|
|
40
40
|
request: {}
|
|
41
41
|
},
|
|
42
42
|
emits: ["update:value"],
|
|
43
|
-
setup(
|
|
43
|
+
setup(c, {
|
|
44
44
|
emit: v
|
|
45
45
|
}) {
|
|
46
|
-
const
|
|
46
|
+
const o = c, {
|
|
47
47
|
options: p,
|
|
48
48
|
updateOptions: y
|
|
49
|
-
} = E(
|
|
50
|
-
value:
|
|
49
|
+
} = E(o), g = v, {
|
|
50
|
+
value: d,
|
|
51
51
|
updateValue: b
|
|
52
|
-
} = M(
|
|
52
|
+
} = M(o, g), r = C(!1), k = S();
|
|
53
53
|
h(() => {
|
|
54
|
-
|
|
54
|
+
f(o.request) && (r.value = !0, o.request().then((e) => y(e)).finally(() => {
|
|
55
55
|
r.value = !1;
|
|
56
56
|
}));
|
|
57
57
|
});
|
|
58
58
|
const x = U(() => {
|
|
59
|
-
const
|
|
60
|
-
if (R(
|
|
61
|
-
return
|
|
62
|
-
const l =
|
|
59
|
+
const e = t(d);
|
|
60
|
+
if (R(e))
|
|
61
|
+
return s(a, null, [o.emptyText]);
|
|
62
|
+
const l = t(p)?.find((m) => m === e || m?.value === e);
|
|
63
63
|
if (w(l) || A(l))
|
|
64
|
-
return
|
|
64
|
+
return s(a, null, [l]);
|
|
65
65
|
const n = l?.label || k.label;
|
|
66
|
-
return
|
|
66
|
+
return f(n) ? s(a, null, [n?.({
|
|
67
67
|
...l
|
|
68
|
-
})]) :
|
|
68
|
+
})]) : s(a, null, [n || o.emptyText]);
|
|
69
69
|
});
|
|
70
|
-
return (
|
|
70
|
+
return (e, l) => r.value ? (u(), i(t(T), {
|
|
71
71
|
key: 0,
|
|
72
72
|
size: "small"
|
|
73
|
-
})) : (
|
|
73
|
+
})) : (u(), V(a, {
|
|
74
74
|
key: 1
|
|
75
|
-
}, [
|
|
75
|
+
}, [e.mode === "read" ? (u(), i(_(x.value), {
|
|
76
76
|
key: 0
|
|
77
|
-
})) : (
|
|
77
|
+
})) : (u(), i(t(O), N({
|
|
78
78
|
key: 1
|
|
79
|
-
},
|
|
80
|
-
value:
|
|
81
|
-
options:
|
|
82
|
-
"onUpdate:value":
|
|
79
|
+
}, t(D)(o, ["onUpdate:value", "value", "defaultValue", "options"]), {
|
|
80
|
+
value: t(d),
|
|
81
|
+
options: t(p),
|
|
82
|
+
"onUpdate:value": t(b)
|
|
83
83
|
}), {
|
|
84
|
-
label: q((n) => [z(
|
|
84
|
+
label: q((n) => [z(e.$slots, "label", F(P(n)))]),
|
|
85
85
|
_: 3
|
|
86
86
|
}, 16, ["value", "options", "onUpdate:value"]))], 64));
|
|
87
87
|
}
|
|
@@ -170,7 +170,12 @@ declare function __VLS_template(): {
|
|
|
170
170
|
type: PropType<(props: CustomTagProps) => any>;
|
|
171
171
|
};
|
|
172
172
|
optionLabelRender: {
|
|
173
|
-
type:
|
|
173
|
+
type: **
|
|
174
|
+
* 在聚焦时再次发起网络请求的前提:
|
|
175
|
+
* 1. 设置了`refetchOnFocus=true`
|
|
176
|
+
* 2. `fetchId > 0`表示已经发起过一次网络请求
|
|
177
|
+
* 3. 当前并不处于loading状态
|
|
178
|
+
*/).PropType<(option: Record<string, any>) => any>;
|
|
174
179
|
};
|
|
175
180
|
onClear: PropType<() => void>;
|
|
176
181
|
defaultOpen: {
|
|
@@ -630,7 +635,12 @@ declare const __VLS_component: DefineComponent<ApFieldSelectProps, {
|
|
|
630
635
|
type: PropType<(props: CustomTagProps) => any>;
|
|
631
636
|
};
|
|
632
637
|
optionLabelRender: {
|
|
633
|
-
type:
|
|
638
|
+
type: **
|
|
639
|
+
* 在聚焦时再次发起网络请求的前提:
|
|
640
|
+
* 1. 设置了`refetchOnFocus=true`
|
|
641
|
+
* 2. `fetchId > 0`表示已经发起过一次网络请求
|
|
642
|
+
* 3. 当前并不处于loading状态
|
|
643
|
+
*/).PropType<(option: Record<string, any>) => any>;
|
|
634
644
|
};
|
|
635
645
|
onClear: PropType<() => void>;
|
|
636
646
|
defaultOpen: {
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Select as
|
|
3
|
-
import { debounce as
|
|
1
|
+
import { defineComponent as ie, useSlots as de, ref as I, shallowRef as ce, computed as s, onMounted as pe, watch as fe, unref as n, createVNode as c, createElementBlock as _, createBlock as C, openBlock as p, toDisplayString as N, mergeProps as me, h as he, createSlots as ve, withCtx as f, createElementVNode as x, normalizeClass as m, createCommentVNode as M, resolveDynamicComponent as P, withModifiers as ye, renderList as ge, renderSlot as Ce, normalizeProps as be, guardReactiveProps as we } from "vue";
|
|
2
|
+
import { Select as Se, Flex as D, Checkbox as T, Spin as ke } from "@aplus-frontend/antdv";
|
|
3
|
+
import { debounce as Be, isFunction as q, isArray as Ne, isNil as xe, omit as L, isNumber as Fe } from "lodash-unified";
|
|
4
4
|
import "../../config-provider/index.mjs";
|
|
5
5
|
import "../../utils/index.mjs";
|
|
6
6
|
import "../../hooks/index.mjs";
|
|
7
|
-
import { useDefaultPlaceholder as
|
|
8
|
-
import
|
|
9
|
-
import { useSelectOptions as
|
|
10
|
-
import { useNamespace as
|
|
11
|
-
import { useLocale as
|
|
12
|
-
import { useControllableValue as
|
|
7
|
+
import { useDefaultPlaceholder as Oe } from "../hooks/use-default-placeholder.mjs";
|
|
8
|
+
import Ae from "../style/index.mjs";
|
|
9
|
+
import { useSelectOptions as Ve } from "./use-select-options.mjs";
|
|
10
|
+
import { useNamespace as R } from "../../config-provider/hooks/use-namespace.mjs";
|
|
11
|
+
import { useLocale as Ie } from "../../config-provider/hooks/use-locale.mjs";
|
|
12
|
+
import { useControllableValue as _e } from "../../hooks/useControllableValue.mjs";
|
|
13
13
|
import { isDef as z } from "../../utils/is.mjs";
|
|
14
|
-
const
|
|
14
|
+
const Me = {
|
|
15
15
|
key: 0
|
|
16
|
-
},
|
|
16
|
+
}, Pe = ["onClick"], Ge = /* @__PURE__ */ ie({
|
|
17
17
|
name: "ApFieldSelect",
|
|
18
18
|
__name: "index",
|
|
19
19
|
props: {
|
|
@@ -172,189 +172,192 @@ const Ie = {
|
|
|
172
172
|
}
|
|
173
173
|
},
|
|
174
174
|
emits: ["update:value"],
|
|
175
|
-
setup(
|
|
175
|
+
setup(E, {
|
|
176
176
|
expose: U,
|
|
177
177
|
emit: $
|
|
178
178
|
}) {
|
|
179
179
|
let r = 0;
|
|
180
|
-
const
|
|
181
|
-
b
|
|
182
|
-
} =
|
|
180
|
+
const F = de(), e = E, {
|
|
181
|
+
b
|
|
182
|
+
} = R("field-select"), {
|
|
183
|
+
b: i
|
|
184
|
+
} = R("field-select-popup-option"), K = Ae("field"), O = I(!1), {
|
|
183
185
|
t: A
|
|
184
|
-
} =
|
|
185
|
-
if (!
|
|
186
|
+
} = Ie(), j = Be((t) => {
|
|
187
|
+
if (!q(e.request))
|
|
186
188
|
return;
|
|
187
189
|
r += 1;
|
|
188
|
-
const
|
|
189
|
-
|
|
190
|
-
r ===
|
|
190
|
+
const o = r;
|
|
191
|
+
y([]), u.value = !0, e.request(t).then((l) => {
|
|
192
|
+
r === o && (y(l), u.value = !1);
|
|
191
193
|
});
|
|
192
|
-
}, e.searchDelay),
|
|
193
|
-
const
|
|
194
|
-
return typeof
|
|
194
|
+
}, e.searchDelay), H = (t, o) => {
|
|
195
|
+
const l = e.fieldNames?.label || "label";
|
|
196
|
+
return typeof o?.[l] == "string" && o[l].toLowerCase().indexOf(t.toLowerCase()) > -1;
|
|
195
197
|
}, {
|
|
196
198
|
options: h,
|
|
197
|
-
updateOptions:
|
|
198
|
-
} =
|
|
199
|
+
updateOptions: y
|
|
200
|
+
} = Ve(e), w = ce(), u = I(e?.loading || !1), W = $, G = s(() => {
|
|
199
201
|
if (e.multiple)
|
|
200
202
|
return e.tokenSeparators ? "tags" : "multiple";
|
|
201
203
|
});
|
|
202
|
-
async function
|
|
203
|
-
if (!
|
|
204
|
+
async function g(t = !0) {
|
|
205
|
+
if (!q(e.request))
|
|
204
206
|
return;
|
|
205
207
|
u.value = !0, r += 1;
|
|
206
|
-
const
|
|
208
|
+
const o = r;
|
|
207
209
|
try {
|
|
208
|
-
t &&
|
|
209
|
-
const
|
|
210
|
-
if (
|
|
210
|
+
t && y([]);
|
|
211
|
+
const l = await e.request(void 0, e.params);
|
|
212
|
+
if (o !== r)
|
|
211
213
|
return;
|
|
212
|
-
|
|
214
|
+
y(l);
|
|
213
215
|
} finally {
|
|
214
216
|
u.value = !1;
|
|
215
217
|
}
|
|
216
218
|
}
|
|
217
|
-
function
|
|
218
|
-
e.onFocus?.(t), e.refetchOnFocus && r > 0 && !u.value &&
|
|
219
|
+
function J(t) {
|
|
220
|
+
e.onFocus?.(t), e.refetchOnFocus && r > 0 && !u.value && g(!0);
|
|
219
221
|
}
|
|
220
|
-
|
|
221
|
-
e.lazy ||
|
|
222
|
-
}),
|
|
223
|
-
|
|
222
|
+
pe(() => {
|
|
223
|
+
e.lazy || g();
|
|
224
|
+
}), fe(() => e.params, () => {
|
|
225
|
+
g();
|
|
224
226
|
}, {
|
|
225
227
|
deep: !0
|
|
226
228
|
});
|
|
227
229
|
const {
|
|
228
|
-
value:
|
|
229
|
-
updateValue:
|
|
230
|
-
} =
|
|
231
|
-
const t =
|
|
230
|
+
value: d,
|
|
231
|
+
updateValue: S
|
|
232
|
+
} = _e(e, W), Q = Oe("Select", e), X = s(() => {
|
|
233
|
+
const t = n(d);
|
|
232
234
|
if (!t)
|
|
233
235
|
return e.emptyText;
|
|
234
|
-
const
|
|
235
|
-
return
|
|
236
|
-
}),
|
|
237
|
-
const t = !!e?.showSearch,
|
|
238
|
-
let
|
|
239
|
-
return t && (
|
|
236
|
+
const o = e.fieldNames?.label || "label", l = e.fieldNames?.value || "value";
|
|
237
|
+
return Ne(t) ? t.map((v) => n(h).find((re) => re[l] === v)?.[o]).filter(Boolean).join("、") || e.emptyText : n(h).find((v) => v[l] === t)?.[o] || e.emptyText;
|
|
238
|
+
}), Y = s(() => {
|
|
239
|
+
const t = !!e?.showSearch, o = e.searchMode;
|
|
240
|
+
let l = {};
|
|
241
|
+
return t && (l = o === "request" ? {
|
|
240
242
|
defaultActiveFirstOption: !1,
|
|
241
243
|
onSearch: j,
|
|
242
244
|
notFoundContent: u.value ? void 0 : null,
|
|
243
245
|
filterOption: !1,
|
|
244
246
|
suffixIcon: null
|
|
245
247
|
} : {
|
|
246
|
-
filterOption: xe(e?.filterOption) ?
|
|
248
|
+
filterOption: xe(e?.filterOption) ? H : e?.filterOption
|
|
247
249
|
}), {
|
|
248
|
-
...
|
|
249
|
-
placeholder:
|
|
250
|
-
...
|
|
250
|
+
...L(e, ["mode", "value", "onUpdate:value", "onSearch", "request", "searchMode", "onFocus", "onBeforeSelect"]),
|
|
251
|
+
placeholder: n(Q),
|
|
252
|
+
...l
|
|
251
253
|
};
|
|
252
|
-
}),
|
|
253
|
-
function
|
|
254
|
-
|
|
254
|
+
}), Z = s(() => h.value.map((t) => t[e.fieldNames?.value || "value"])), k = s(() => h.value.filter((t) => !t.disabled).map((t) => t[e.fieldNames?.value || "value"])), V = s(() => !e.multiple || z(e.maxCount) ? !1 : Fe(e.addAll) ? Z.value.length >= e.addAll : !!e.addAll), ee = s(() => e.multiple && e.allowOnlySelect && (!z(e.maxCount) || e.maxCount >= 1));
|
|
255
|
+
function te() {
|
|
256
|
+
w.value?.focus();
|
|
255
257
|
}
|
|
256
|
-
function
|
|
257
|
-
|
|
258
|
+
function oe() {
|
|
259
|
+
w.value?.blur();
|
|
258
260
|
}
|
|
259
|
-
function
|
|
260
|
-
const
|
|
261
|
-
return t[
|
|
261
|
+
function B(t, o) {
|
|
262
|
+
const l = e.fieldNames?.[o] ?? o;
|
|
263
|
+
return t[l];
|
|
262
264
|
}
|
|
263
|
-
function
|
|
264
|
-
const
|
|
265
|
-
|
|
265
|
+
function le(t) {
|
|
266
|
+
const o = B(t, "value");
|
|
267
|
+
S(e.multiple ? [o] : o);
|
|
266
268
|
}
|
|
267
|
-
function
|
|
268
|
-
return
|
|
269
|
-
class:
|
|
270
|
-
}, [
|
|
271
|
-
class:
|
|
272
|
-
}, [
|
|
269
|
+
function ne(t) {
|
|
270
|
+
return F.option ? c("div", {
|
|
271
|
+
class: i("custom")
|
|
272
|
+
}, [F.option(t)]) : c("span", {
|
|
273
|
+
class: i("label")
|
|
274
|
+
}, [B(t, "label")]);
|
|
273
275
|
}
|
|
274
|
-
const
|
|
275
|
-
const t =
|
|
276
|
-
return
|
|
277
|
-
}),
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
276
|
+
const ae = s(() => {
|
|
277
|
+
const t = n(d) || [], o = k.value;
|
|
278
|
+
return o.length > 0 && o.every((l) => t.includes(l));
|
|
279
|
+
}), se = s(() => {
|
|
280
|
+
const t = n(d) || [], o = k.value, l = o.filter((a) => t.includes(a)).length;
|
|
281
|
+
return l > 0 && l < o.length;
|
|
282
|
+
});
|
|
283
|
+
function ue() {
|
|
284
|
+
const t = new Set(n(d) || []), o = k.value;
|
|
285
|
+
o.length > 0 && o.every((a) => t.has(a)) ? o.forEach((a) => t.delete(a)) : o.forEach((a) => t.add(a)), S([...t]);
|
|
282
286
|
}
|
|
283
287
|
return U({
|
|
284
|
-
focus:
|
|
285
|
-
blur:
|
|
286
|
-
request:
|
|
287
|
-
}), (t,
|
|
288
|
+
focus: te,
|
|
289
|
+
blur: oe,
|
|
290
|
+
request: g
|
|
291
|
+
}), (t, o) => t.mode === "read" ? (p(), _("span", Me, N(X.value), 1)) : (p(), C(n(Se), me({
|
|
288
292
|
key: 1,
|
|
289
293
|
ref_key: "selectRef",
|
|
290
|
-
ref:
|
|
294
|
+
ref: w,
|
|
291
295
|
"allow-clear": ""
|
|
292
|
-
},
|
|
293
|
-
mode:
|
|
294
|
-
value:
|
|
295
|
-
options:
|
|
296
|
+
}, Y.value, {
|
|
297
|
+
mode: G.value,
|
|
298
|
+
value: n(d),
|
|
299
|
+
options: n(h),
|
|
296
300
|
loading: u.value,
|
|
297
|
-
"menu-item-selected-icon":
|
|
298
|
-
"popup-class-name": `${
|
|
299
|
-
open:
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
301
|
+
"menu-item-selected-icon": he("span"),
|
|
302
|
+
"popup-class-name": `${n(b)("popup")} ${n(K)}`,
|
|
303
|
+
open: O.value,
|
|
304
|
+
"onUpdate:value": n(S),
|
|
305
|
+
onFocus: J,
|
|
306
|
+
onDropdownVisibleChange: o[0] || (o[0] = (l) => O.value = l)
|
|
307
|
+
}), ve({
|
|
308
|
+
option: f((l) => [x("div", {
|
|
309
|
+
class: m(n(i)("outter"))
|
|
310
|
+
}, [c(n(D), {
|
|
306
311
|
justify: "space-between",
|
|
307
312
|
align: "center",
|
|
308
|
-
class:
|
|
313
|
+
class: m(n(i)("wrapper")),
|
|
309
314
|
gap: 8
|
|
310
315
|
}, {
|
|
311
|
-
default:
|
|
316
|
+
default: f(() => [c(n(D), {
|
|
312
317
|
gap: 8,
|
|
313
318
|
align: "center",
|
|
314
|
-
class:
|
|
319
|
+
class: m(n(i)("content-wrapper"))
|
|
315
320
|
}, {
|
|
316
|
-
default:
|
|
321
|
+
default: f(() => [V.value ? (p(), C(n(T), {
|
|
317
322
|
key: 0,
|
|
318
|
-
checked:
|
|
319
|
-
}, null, 8, ["checked"])) :
|
|
323
|
+
checked: n(d)?.includes(B(l, "value"))
|
|
324
|
+
}, null, 8, ["checked"])) : M("", !0), (p(), C(P(ne(l))))]),
|
|
320
325
|
_: 2
|
|
321
|
-
}, 1032, ["class"]),
|
|
326
|
+
}, 1032, ["class"]), ee.value && !l?.disabled ? (p(), _("span", {
|
|
322
327
|
key: 0,
|
|
323
|
-
class:
|
|
324
|
-
onClick:
|
|
325
|
-
},
|
|
328
|
+
class: m(n(i)("action")),
|
|
329
|
+
onClick: ye(() => le(l), ["stop"])
|
|
330
|
+
}, N(n(A)("ap.field.chooseOnly")), 11, Pe)) : M("", !0)]),
|
|
326
331
|
_: 2
|
|
327
|
-
}, 1032, ["class"])]),
|
|
332
|
+
}, 1032, ["class"])], 2)]),
|
|
328
333
|
_: 2
|
|
329
|
-
}, [
|
|
330
|
-
name:
|
|
331
|
-
fn:
|
|
334
|
+
}, [ge(n(L)(t.$slots, ["option"]), (l, a) => ({
|
|
335
|
+
name: a,
|
|
336
|
+
fn: f((v) => [Ce(t.$slots, a, be(we(v || {})))])
|
|
332
337
|
})), u.value ? {
|
|
333
338
|
name: "notFoundContent",
|
|
334
|
-
fn:
|
|
339
|
+
fn: f(() => [c(n(ke), {
|
|
335
340
|
size: "small"
|
|
336
341
|
})]),
|
|
337
342
|
key: "0"
|
|
338
343
|
} : void 0, V.value ? {
|
|
339
344
|
name: "dropdownRender",
|
|
340
|
-
fn:
|
|
341
|
-
menuNode:
|
|
342
|
-
}) => [
|
|
343
|
-
class: f(o(a)("popup-all-option-wrapper"))
|
|
344
|
-
}, [k("div", {
|
|
345
|
+
fn: f(({
|
|
346
|
+
menuNode: l
|
|
347
|
+
}) => [x("div", {
|
|
345
348
|
tabindex: -1,
|
|
346
|
-
class:
|
|
347
|
-
onClick:
|
|
348
|
-
}, [
|
|
349
|
-
checked:
|
|
350
|
-
indeterminate:
|
|
351
|
-
}, null, 8, ["checked", "indeterminate"]),
|
|
352
|
-
class:
|
|
353
|
-
},
|
|
349
|
+
class: m(n(b)("popup-all-option")),
|
|
350
|
+
onClick: ue
|
|
351
|
+
}, [c(n(T), {
|
|
352
|
+
checked: ae.value,
|
|
353
|
+
indeterminate: se.value
|
|
354
|
+
}, null, 8, ["checked", "indeterminate"]), x("span", {
|
|
355
|
+
class: m(n(b)("popup-all-option-label"))
|
|
356
|
+
}, N(n(A)("ap.field.selectAll")), 3)], 2), (p(), C(P(l)))]),
|
|
354
357
|
key: "1"
|
|
355
358
|
} : void 0]), 1040, ["mode", "value", "options", "loading", "menu-item-selected-icon", "popup-class-name", "open", "onUpdate:value"]));
|
|
356
359
|
}
|
|
357
360
|
});
|
|
358
361
|
export {
|
|
359
|
-
|
|
362
|
+
Ge as default
|
|
360
363
|
};
|
|
@@ -96,19 +96,19 @@ const f = { key: 0 }, C = /* @__PURE__ */ i({
|
|
|
96
96
|
searchDelay: {},
|
|
97
97
|
allowOnlySelect: { type: Boolean }
|
|
98
98
|
},
|
|
99
|
-
setup(
|
|
100
|
-
const e =
|
|
99
|
+
setup(l) {
|
|
100
|
+
const e = l, r = s(() => {
|
|
101
101
|
const o = e.value;
|
|
102
102
|
if (!o)
|
|
103
103
|
return e.emptyText;
|
|
104
|
-
const t = e.fieldNames?.label || "label",
|
|
104
|
+
const t = e.fieldNames?.label || "label", a = e.fieldNames?.value || "value";
|
|
105
105
|
return y(o) ? o.map(
|
|
106
|
-
(n) => e.options?.find((p) => p[
|
|
106
|
+
(n) => e.options?.find((p) => p[a] === n)?.[t]
|
|
107
107
|
).filter(Boolean).join("、") || e.emptyText : e.options?.find(
|
|
108
|
-
(n) => n[
|
|
108
|
+
(n) => n[a] === o
|
|
109
109
|
)?.[t] || e.emptyText;
|
|
110
110
|
});
|
|
111
|
-
return (o, t) =>
|
|
111
|
+
return (o, t) => o.mode === "read" ? (u(), d("span", f, m(r.value), 1)) : c("", !0);
|
|
112
112
|
}
|
|
113
113
|
});
|
|
114
114
|
export {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as B, useSlots as x, shallowRef as C, computed as b, unref as t, createElementBlock as g, createBlock as k, openBlock as
|
|
1
|
+
import { defineComponent as B, useSlots as x, shallowRef as C, computed as b, unref as t, createElementBlock as g, createBlock as k, openBlock as n, Fragment as F, createTextVNode as S, toDisplayString as h, mergeProps as T, createSlots as V, renderList as _, withCtx as P, renderSlot as R, normalizeProps as N, guardReactiveProps as U } from "vue";
|
|
2
2
|
import { Slider as A } from "@aplus-frontend/antdv";
|
|
3
3
|
import { isNil as H, isArray as L, omit as $ } from "lodash-unified";
|
|
4
4
|
import "../../hooks/index.mjs";
|
|
@@ -52,9 +52,9 @@ const G = /* @__PURE__ */ B({
|
|
|
52
52
|
emptyText: { default: "--" }
|
|
53
53
|
},
|
|
54
54
|
emits: ["update:value"],
|
|
55
|
-
setup(
|
|
56
|
-
const
|
|
57
|
-
const e = t(
|
|
55
|
+
setup(s, { expose: u, emit: i }) {
|
|
56
|
+
const p = x(), o = C(), a = s, d = i, { value: l, updateValue: m } = w(a, d), c = b(() => {
|
|
57
|
+
const e = t(l);
|
|
58
58
|
return H(e) ? a.emptyText : L(e) ? `${e[0]}-${e[1]}` : e;
|
|
59
59
|
});
|
|
60
60
|
function f() {
|
|
@@ -66,9 +66,9 @@ const G = /* @__PURE__ */ B({
|
|
|
66
66
|
return u({
|
|
67
67
|
focus: f,
|
|
68
68
|
blur: y
|
|
69
|
-
}), (e, j) =>
|
|
69
|
+
}), (e, j) => e.mode === "read" ? (n(), g(F, { key: 0 }, [
|
|
70
70
|
S(h(c.value), 1)
|
|
71
|
-
], 64)) : (
|
|
71
|
+
], 64)) : (n(), k(t(A), T(
|
|
72
72
|
{ key: 1 },
|
|
73
73
|
t($)(a, [
|
|
74
74
|
"value",
|
|
@@ -80,14 +80,14 @@ const G = /* @__PURE__ */ B({
|
|
|
80
80
|
{
|
|
81
81
|
ref_key: "sliderRef",
|
|
82
82
|
ref: o,
|
|
83
|
-
value: t(
|
|
83
|
+
value: t(l),
|
|
84
84
|
"onUpdate:value": t(m)
|
|
85
85
|
}
|
|
86
86
|
), V({ _: 2 }, [
|
|
87
|
-
|
|
88
|
-
name:
|
|
89
|
-
fn:
|
|
90
|
-
|
|
87
|
+
_(p, (q, r) => ({
|
|
88
|
+
name: r,
|
|
89
|
+
fn: P((v) => [
|
|
90
|
+
R(e.$slots, r, N(U(v || {})))
|
|
91
91
|
])
|
|
92
92
|
}))
|
|
93
93
|
]), 1040, ["value", "onUpdate:value"]));
|