@fangzhongya/fang-ui 0.1.25 → 0.1.27
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/components/array/index.css +5 -0
- package/dist/components/array/src/index2.cjs +0 -1
- package/dist/components/array/src/index2.js +0 -1
- package/dist/components/audios/index.css +5 -0
- package/dist/components/box/index.css +29 -0
- package/dist/components/box-adjust/index.css +29 -1
- package/dist/components/box-adjust/index.scss +0 -6
- package/dist/components/box-adjust/src/index2.cjs +6 -6
- package/dist/components/box-adjust/src/index2.js +3 -3
- package/dist/components/box-fun/index.cjs +7 -0
- package/dist/components/box-fun/index.d.ts +7 -0
- package/dist/components/box-fun/index.js +7 -0
- package/dist/components/box-fun/src/data.cjs +34 -0
- package/dist/components/box-fun/src/data.d.ts +35 -0
- package/dist/components/box-fun/src/data.js +34 -0
- package/dist/components/box-fun/src/function.cjs +97 -0
- package/dist/components/box-fun/src/function.d.ts +8 -0
- package/dist/components/box-fun/src/function.js +97 -0
- package/dist/components/box-fun/src/index.cjs +5 -0
- package/dist/components/box-fun/src/index.d.ts +2 -0
- package/dist/components/box-fun/src/index.js +5 -0
- package/dist/components/box-local/index.css +29 -0
- package/dist/components/box-mask/index.css +5 -0
- package/dist/components/box-teleport/src/index2.cjs +2 -11
- package/dist/components/box-teleport/src/index2.js +2 -11
- package/dist/components/box-title/index.css +29 -0
- package/dist/components/box-title/index.scss +1 -1
- package/dist/components/buttons/index.css +5 -0
- package/dist/components/cascaders/index.css +5 -0
- package/dist/components/checks/index.css +5 -0
- package/dist/components/dates/index.css +5 -0
- package/dist/components/dates-divide/index.css +5 -0
- package/dist/components/dates-picker/index.css +5 -0
- package/dist/components/dates2/index.css +5 -0
- package/dist/components/dialogs/index.css +5 -0
- package/dist/components/draggable/index.cjs +9 -0
- package/dist/components/draggable/index.d.ts +4 -0
- package/dist/components/draggable/index.js +9 -0
- package/dist/components/draggable/index.scss +5 -0
- package/dist/components/draggable/src/data.cjs +37 -0
- package/dist/components/draggable/src/data.d.ts +60 -0
- package/dist/components/draggable/src/data.js +37 -0
- package/dist/components/draggable/src/index.cjs +4 -0
- package/dist/components/draggable/src/index.js +4 -0
- package/dist/components/draggable/src/index2.cjs +101 -0
- package/dist/components/draggable/src/index2.js +101 -0
- package/dist/components/edit/index.css +5 -0
- package/dist/components/edit-float/index.css +5 -0
- package/dist/components/forms/common/config.cjs +7 -0
- package/dist/components/forms/common/config.d.ts +4 -0
- package/dist/components/forms/common/config.js +7 -0
- package/dist/components/forms/index.css +5 -0
- package/dist/components/forms/src/data.cjs +0 -5
- package/dist/components/forms/src/data.d.ts +0 -4
- package/dist/components/forms/src/data.js +1 -6
- package/dist/components/forms/src/setup.cjs +3 -2
- package/dist/components/forms/src/setup.js +2 -1
- package/dist/components/forms-div/index.css +5 -0
- package/dist/components/forms-div/src/index2.cjs +2 -2
- package/dist/components/forms-div/src/index2.js +1 -1
- package/dist/components/forms-drag/src/index2.cjs +12 -12
- package/dist/components/forms-drag/src/index2.js +1 -1
- package/dist/components/forms-item/index.css +5 -0
- package/dist/components/forms-item/src/index2.cjs +2 -2
- package/dist/components/forms-item/src/index2.js +1 -1
- package/dist/components/forms-item/src/label.cjs +7 -7
- package/dist/components/forms-item/src/label.js +1 -1
- package/dist/components/forms-items/src/index2.cjs +9 -9
- package/dist/components/forms-items/src/index2.js +1 -1
- package/dist/components/full-screen/index.css +5 -0
- package/dist/components/global-config/index.css +5 -0
- package/dist/components/global-config/index.d.ts +1 -1
- package/dist/components/global-config/src/index.d.ts +1 -1
- package/dist/components/history/index.css +5 -0
- package/dist/components/icon/index.css +5 -0
- package/dist/components/icon-picker/index.css +5 -0
- package/dist/components/iframe/index.css +5 -0
- package/dist/components/images/index.css +5 -0
- package/dist/components/index.cjs +411 -407
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +4 -0
- package/dist/components/index.scss +1 -0
- package/dist/components/index2.scss +1 -0
- package/dist/components/input-array/index.css +5 -0
- package/dist/components/input-history/index.css +5 -0
- package/dist/components/input-num/index.css +5 -0
- package/dist/components/input-select/index.css +5 -0
- package/dist/components/inputs/index.css +5 -0
- package/dist/components/labels/index.css +5 -0
- package/dist/components/list/index.css +5 -0
- package/dist/components/lists/index.css +5 -0
- package/dist/components/lists/src/index2.cjs +9 -9
- package/dist/components/lists/src/index2.js +9 -9
- package/dist/components/listsp/index.css +5 -0
- package/dist/components/listspd/index.css +5 -0
- package/dist/components/loading/src/data.cjs +13 -0
- package/dist/components/loading/src/data.d.ts +17 -0
- package/dist/components/loading/src/data.js +13 -0
- package/dist/components/loading/src/index.cjs +1 -0
- package/dist/components/loading/src/index.d.ts +0 -4
- package/dist/components/loading/src/index.js +1 -0
- package/dist/components/menus/index.css +5 -0
- package/dist/components/message/src/data.cjs +13 -0
- package/dist/components/message/src/data.d.ts +17 -0
- package/dist/components/message/src/data.js +13 -0
- package/dist/components/message/src/index.cjs +1 -0
- package/dist/components/message/src/index.d.ts +0 -4
- package/dist/components/message/src/index.js +1 -0
- package/dist/components/message-box/src/data.cjs +13 -0
- package/dist/components/message-box/src/data.d.ts +17 -0
- package/dist/components/message-box/src/data.js +13 -0
- package/dist/components/message-box/src/index.cjs +1 -0
- package/dist/components/message-box/src/index.d.ts +0 -4
- package/dist/components/message-box/src/index.js +1 -0
- package/dist/components/no-data/index.css +5 -0
- package/dist/components/page/index.css +5 -0
- package/dist/components/page/src/set-column2.cjs +2 -2
- package/dist/components/page/src/set-column2.js +1 -1
- package/dist/components/paging/index.css +5 -0
- package/dist/components/popup/index.css +29 -0
- package/dist/components/retract/index.css +5 -0
- package/dist/components/right-key/index.css +5 -0
- package/dist/components/scss/common.scss +5 -0
- package/dist/components/seamless-scroll/index.css +5 -0
- package/dist/components/select-scroll/index.css +5 -0
- package/dist/components/selector/index.css +5 -0
- package/dist/components/selects/index.css +5 -0
- package/dist/components/sliders/index.css +5 -0
- package/dist/components/switchs/index.css +5 -0
- package/dist/components/tables/common/pagin.cjs +49 -20
- package/dist/components/tables/common/pagin.d.ts +32 -8
- package/dist/components/tables/common/pagin.js +49 -20
- package/dist/components/tables/index.css +5 -0
- package/dist/components/tables/src/column.cjs +1 -2
- package/dist/components/tables/src/column.js +1 -2
- package/dist/components/tables/src/data.d.ts +1 -1
- package/dist/components/tables/src/index2.cjs +12 -1
- package/dist/components/tables/src/index2.js +12 -1
- package/dist/components/tablesp/index.css +5 -0
- package/dist/components/tablesp/src/index2.cjs +9 -5
- package/dist/components/tablesp/src/index2.js +9 -5
- package/dist/components/tablespd/index.css +5 -0
- package/dist/components/tabless/index.css +5 -0
- package/dist/components/tablesv/index.css +5 -0
- package/dist/components/tablesvp/index.css +5 -0
- package/dist/components/uploads/index.css +5 -0
- package/dist/components/videos/index.css +5 -0
- package/dist/components/window/index.css +29 -0
- package/dist/css/array.css +5 -0
- package/dist/css/audios.css +5 -0
- package/dist/css/box-adjust.css +29 -1
- package/dist/css/box-local.css +29 -0
- package/dist/css/box-mask.css +5 -0
- package/dist/css/box-title.css +29 -0
- package/dist/css/box.css +29 -0
- package/dist/css/buttons.css +5 -0
- package/dist/css/cascaders.css +5 -0
- package/dist/css/checks.css +5 -0
- package/dist/css/dates-divide.css +5 -0
- package/dist/css/dates-picker.css +5 -0
- package/dist/css/dates.css +5 -0
- package/dist/css/dates2.css +5 -0
- package/dist/css/dialogs.css +5 -0
- package/dist/css/edit-float.css +5 -0
- package/dist/css/edit.css +5 -0
- package/dist/css/forms-div.css +5 -0
- package/dist/css/forms-item.css +5 -0
- package/dist/css/forms.css +5 -0
- package/dist/css/full-screen.css +5 -0
- package/dist/css/global-config.css +5 -0
- package/dist/css/history.css +5 -0
- package/dist/css/icon-picker.css +5 -0
- package/dist/css/icon.css +5 -0
- package/dist/css/iframe.css +5 -0
- package/dist/css/images.css +5 -0
- package/dist/css/index.css +29 -25
- package/dist/css/input-array.css +5 -0
- package/dist/css/input-history.css +5 -0
- package/dist/css/input-num.css +5 -0
- package/dist/css/input-select.css +5 -0
- package/dist/css/inputs.css +5 -0
- package/dist/css/labels.css +5 -0
- package/dist/css/list.css +5 -0
- package/dist/css/lists.css +5 -0
- package/dist/css/listsp.css +5 -0
- package/dist/css/listspd.css +5 -0
- package/dist/css/menus.css +5 -0
- package/dist/css/no-data.css +5 -0
- package/dist/css/page.css +5 -0
- package/dist/css/paging.css +5 -0
- package/dist/css/popup.css +29 -0
- package/dist/css/retract.css +5 -0
- package/dist/css/right-key.css +5 -0
- package/dist/css/seamless-scroll.css +5 -0
- package/dist/css/select-scroll.css +5 -0
- package/dist/css/selector.css +5 -0
- package/dist/css/selects.css +5 -0
- package/dist/css/sliders.css +5 -0
- package/dist/css/switchs.css +5 -0
- package/dist/css/tables.css +5 -0
- package/dist/css/tablesp.css +5 -0
- package/dist/css/tablespd.css +5 -0
- package/dist/css/tabless.css +5 -0
- package/dist/css/tablesv.css +5 -0
- package/dist/css/tablesvp.css +5 -0
- package/dist/css/uploads.css +5 -0
- package/dist/css/videos.css +5 -0
- package/dist/css/window.css +29 -0
- package/dist/expand/{chunk-RBGCE6BS.js → chunk-CV4O5V2F.js} +3 -0
- package/dist/expand/{chunk-2L4PC7LZ.cjs → chunk-MC76Q3TQ.cjs} +3 -0
- package/dist/expand/components.cjs +5 -5
- package/dist/expand/components.js +1 -1
- package/dist/expand/config.cjs +2 -2
- package/dist/expand/config.js +1 -1
- package/dist/hooks/props-default/index.cjs +0 -12
- package/dist/hooks/props-default/index.d.ts +1 -1
- package/dist/hooks/props-default/index.js +0 -12
- package/dist/icons/index.json +1 -1
- package/dist/index.cjs +435 -431
- package/dist/index.css +29 -25
- package/dist/index.js +4 -0
- package/dist/type.d.ts +10 -5
- package/dist/utils/vues/getBoxDom.cjs +22 -0
- package/dist/utils/vues/getBoxDom.d.ts +1 -0
- package/dist/utils/vues/getBoxDom.js +22 -0
- package/dist/utils/vues/index.cjs +2 -0
- package/dist/utils/vues/index.d.ts +1 -0
- package/dist/utils/vues/index.js +2 -0
- package/package.json +11 -12
|
@@ -2,7 +2,7 @@ import { defineComponent, createBlock, openBlock, Teleport, unref, normalizeClas
|
|
|
2
2
|
import { name, dataProps, dataExpose, dataEmits } from "./data.js";
|
|
3
3
|
import { useCssName } from "../../../hooks/cssname/index.js";
|
|
4
4
|
import { useLocale } from "../../../hooks/locale/index.js";
|
|
5
|
-
import {
|
|
5
|
+
import { getBoxDom } from "../../../utils/vues/getBoxDom.js";
|
|
6
6
|
import { usePropsDefault, viewProps, getProps } from "../../../hooks/props-default/index.js";
|
|
7
7
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
8
|
__name: "index",
|
|
@@ -15,16 +15,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
15
15
|
const props = usePropsDefault(name, prs, dataProps);
|
|
16
16
|
viewProps(props, name);
|
|
17
17
|
const emit = __emit;
|
|
18
|
-
|
|
19
|
-
if (document && !(document == null ? void 0 : document.querySelector(id))) {
|
|
20
|
-
const d = document.createElement("div");
|
|
21
|
-
if (id.startsWith("#")) {
|
|
22
|
-
d.id = id.replace(/^#/, "");
|
|
23
|
-
} else if (id.startsWith(".")) {
|
|
24
|
-
d.className = id.replace(/./g, " ");
|
|
25
|
-
}
|
|
26
|
-
document.body.appendChild(d);
|
|
27
|
-
}
|
|
18
|
+
getBoxDom();
|
|
28
19
|
__expose({
|
|
29
20
|
...dataExpose
|
|
30
21
|
});
|
|
@@ -12,6 +12,35 @@
|
|
|
12
12
|
--g-main-bg: var(--bg-color-page);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
.com-footer {
|
|
16
|
+
border-top: 1px solid var(--border);
|
|
17
|
+
padding: 20px 20px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.icon {
|
|
21
|
+
--color: inherit;
|
|
22
|
+
height: 1em;
|
|
23
|
+
width: 1em;
|
|
24
|
+
line-height: 1em;
|
|
25
|
+
display: inline-flex;
|
|
26
|
+
justify-content: center;
|
|
27
|
+
align-items: center;
|
|
28
|
+
position: relative;
|
|
29
|
+
fill: currentColor;
|
|
30
|
+
color: var(--color);
|
|
31
|
+
font-size: inherit;
|
|
32
|
+
}
|
|
33
|
+
.icon-cont {
|
|
34
|
+
border: 0;
|
|
35
|
+
display: inline-flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
object-fit: contain;
|
|
38
|
+
justify-content: center;
|
|
39
|
+
font-size: inherit !important;
|
|
40
|
+
width: inherit !important;
|
|
41
|
+
height: inherit !important;
|
|
42
|
+
}
|
|
43
|
+
|
|
15
44
|
.box-title {
|
|
16
45
|
padding: 10px;
|
|
17
46
|
position: relative;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
;/* empty css */
|
|
4
|
+
require("./src/index.cjs");
|
|
5
|
+
const withInstall = require("../../utils/vues/withInstall.cjs");
|
|
6
|
+
const index_vue_vue_type_script_setup_true_lang = require("./src/index2.cjs");
|
|
7
|
+
const Draggable = withInstall.withInstall(index_vue_vue_type_script_setup_true_lang.default, "Draggable");
|
|
8
|
+
exports.Draggable = Draggable;
|
|
9
|
+
exports.default = Draggable;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const buildProps = require("../../../utils/vues/buildProps.cjs");
|
|
4
|
+
const name = "draggable";
|
|
5
|
+
const dataProps = buildProps.buildProps({
|
|
6
|
+
modelValue: {
|
|
7
|
+
type: Array,
|
|
8
|
+
default() {
|
|
9
|
+
return [];
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
/**
|
|
13
|
+
* @props { String } handle= ( )
|
|
14
|
+
* 拖拽的地方
|
|
15
|
+
*/
|
|
16
|
+
handle: {
|
|
17
|
+
type: String
|
|
18
|
+
},
|
|
19
|
+
itemKey: {
|
|
20
|
+
type: [String, Function]
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const dataEmits = ["update:modelValue", "start", "end"];
|
|
24
|
+
const dataSlot = {
|
|
25
|
+
default: "default",
|
|
26
|
+
item: "item",
|
|
27
|
+
footer: "footer",
|
|
28
|
+
header: "header"
|
|
29
|
+
};
|
|
30
|
+
const dataExpose = {
|
|
31
|
+
name
|
|
32
|
+
};
|
|
33
|
+
exports.dataEmits = dataEmits;
|
|
34
|
+
exports.dataExpose = dataExpose;
|
|
35
|
+
exports.dataProps = dataProps;
|
|
36
|
+
exports.dataSlot = dataSlot;
|
|
37
|
+
exports.name = name;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { ExtractPublicPropTypes } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* @title {h3} Draggable
|
|
4
|
+
* @text draggable
|
|
5
|
+
*/
|
|
6
|
+
export declare const name = "draggable";
|
|
7
|
+
export declare const dataProps: {
|
|
8
|
+
modelValue: {
|
|
9
|
+
type: {
|
|
10
|
+
(arrayLength: number): ObjAny[];
|
|
11
|
+
(...items: ObjAny[]): ObjAny[];
|
|
12
|
+
new (arrayLength: number): ObjAny[];
|
|
13
|
+
new (...items: ObjAny[]): ObjAny[];
|
|
14
|
+
isArray(arg: any): arg is any[];
|
|
15
|
+
readonly prototype: any[];
|
|
16
|
+
from<T>(arrayLike: ArrayLike<T>): T[];
|
|
17
|
+
from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
|
|
18
|
+
from<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
|
|
19
|
+
from<T, U>(iterable: Iterable<T> | ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[];
|
|
20
|
+
of<T>(...items: T[]): T[];
|
|
21
|
+
fromAsync<T>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T | PromiseLike<T>> | ArrayLike<T | PromiseLike<T>>): Promise<T[]>;
|
|
22
|
+
fromAsync<T, U>(iterableOrArrayLike: AsyncIterable<T> | Iterable<T> | ArrayLike<T>, mapFn: (value: Awaited<T>, index: number) => U, thisArg?: any): Promise<Awaited<U>[]>;
|
|
23
|
+
readonly [Symbol.species]: ArrayConstructor;
|
|
24
|
+
};
|
|
25
|
+
default(): never[];
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* @props { String } handle= ( )
|
|
29
|
+
* 拖拽的地方
|
|
30
|
+
*/
|
|
31
|
+
handle: {
|
|
32
|
+
type: StringConstructor;
|
|
33
|
+
};
|
|
34
|
+
itemKey: {
|
|
35
|
+
type: (StringConstructor | FunctionConstructor)[];
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export type DataProps = ExtractPublicPropTypes<typeof dataProps>;
|
|
39
|
+
/**
|
|
40
|
+
* @emits change (val:[String, Array])
|
|
41
|
+
* 选择的时间
|
|
42
|
+
*/
|
|
43
|
+
export declare const dataEmits: string[];
|
|
44
|
+
export type DataEmits = typeof dataEmits;
|
|
45
|
+
/**
|
|
46
|
+
* @slot default 默认插槽
|
|
47
|
+
*/
|
|
48
|
+
export declare const dataSlot: {
|
|
49
|
+
default: string;
|
|
50
|
+
item: string;
|
|
51
|
+
footer: string;
|
|
52
|
+
header: string;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* @expose setValue (val:<string>设置的数据 )
|
|
56
|
+
* 设置值
|
|
57
|
+
*/
|
|
58
|
+
export declare const dataExpose: {
|
|
59
|
+
name: string;
|
|
60
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { buildProps } from "../../../utils/vues/buildProps.js";
|
|
2
|
+
const name = "draggable";
|
|
3
|
+
const dataProps = buildProps({
|
|
4
|
+
modelValue: {
|
|
5
|
+
type: Array,
|
|
6
|
+
default() {
|
|
7
|
+
return [];
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
/**
|
|
11
|
+
* @props { String } handle= ( )
|
|
12
|
+
* 拖拽的地方
|
|
13
|
+
*/
|
|
14
|
+
handle: {
|
|
15
|
+
type: String
|
|
16
|
+
},
|
|
17
|
+
itemKey: {
|
|
18
|
+
type: [String, Function]
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
const dataEmits = ["update:modelValue", "start", "end"];
|
|
22
|
+
const dataSlot = {
|
|
23
|
+
default: "default",
|
|
24
|
+
item: "item",
|
|
25
|
+
footer: "footer",
|
|
26
|
+
header: "header"
|
|
27
|
+
};
|
|
28
|
+
const dataExpose = {
|
|
29
|
+
name
|
|
30
|
+
};
|
|
31
|
+
export {
|
|
32
|
+
dataEmits,
|
|
33
|
+
dataExpose,
|
|
34
|
+
dataProps,
|
|
35
|
+
dataSlot,
|
|
36
|
+
name
|
|
37
|
+
};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const vue = require("vue");
|
|
4
|
+
const data = require("./data.cjs");
|
|
5
|
+
const index = require("../../../hooks/cssname/index.cjs");
|
|
6
|
+
const index$1 = require("../../../hooks/locale/index.cjs");
|
|
7
|
+
const index$3 = require("../../../directives/sortable/index.cjs");
|
|
8
|
+
const index$2 = require("../../../hooks/props-default/index.cjs");
|
|
9
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
10
|
+
__name: "index",
|
|
11
|
+
props: index$2.getProps(data.dataProps),
|
|
12
|
+
emits: data.dataEmits,
|
|
13
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
14
|
+
const cs = index.useCssName(data.name);
|
|
15
|
+
const { getLocale } = index$1.useLocale();
|
|
16
|
+
const prs = __props;
|
|
17
|
+
const props = index$2.usePropsDefault(data.name, prs, data.dataProps);
|
|
18
|
+
index$2.viewProps(props, data.name);
|
|
19
|
+
const emit = __emit;
|
|
20
|
+
function safeStringify(obj, space = 2) {
|
|
21
|
+
const seen = /* @__PURE__ */ new WeakSet();
|
|
22
|
+
return JSON.stringify(
|
|
23
|
+
obj,
|
|
24
|
+
(key, value2) => {
|
|
25
|
+
if (typeof value2 === "object" && value2 !== null) {
|
|
26
|
+
if (seen.has(value2)) {
|
|
27
|
+
return "[Circular]";
|
|
28
|
+
}
|
|
29
|
+
seen.add(value2);
|
|
30
|
+
}
|
|
31
|
+
return value2;
|
|
32
|
+
},
|
|
33
|
+
space
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
const getKey = (item, index2) => {
|
|
37
|
+
if (props.itemKey) {
|
|
38
|
+
if (typeof props.itemKey == "string") {
|
|
39
|
+
return item[props.itemKey] ?? index2;
|
|
40
|
+
} else {
|
|
41
|
+
const v = props.itemKey(item, index2) ?? index2;
|
|
42
|
+
if (typeof v === "object") {
|
|
43
|
+
return safeStringify(v);
|
|
44
|
+
} else {
|
|
45
|
+
return v;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return index2;
|
|
50
|
+
};
|
|
51
|
+
const onEnd = (obj) => {
|
|
52
|
+
const { oldIndex, newIndex } = obj;
|
|
53
|
+
if (oldIndex === newIndex) return;
|
|
54
|
+
const movedItem = value.value.splice(oldIndex, 1)[0];
|
|
55
|
+
value.value.splice(newIndex, 0, movedItem);
|
|
56
|
+
emit("update:modelValue", value.value);
|
|
57
|
+
emit("end", obj);
|
|
58
|
+
};
|
|
59
|
+
const onStart = (obj) => {
|
|
60
|
+
emit("start", obj);
|
|
61
|
+
};
|
|
62
|
+
const sortable = vue.computed(() => {
|
|
63
|
+
return {
|
|
64
|
+
handle: props.handle,
|
|
65
|
+
onStart,
|
|
66
|
+
onEnd
|
|
67
|
+
};
|
|
68
|
+
});
|
|
69
|
+
const value = vue.computed({
|
|
70
|
+
get() {
|
|
71
|
+
return props.modelValue;
|
|
72
|
+
},
|
|
73
|
+
set(value2) {
|
|
74
|
+
emit("update:modelValue", value2);
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
__expose({
|
|
78
|
+
...data.dataExpose
|
|
79
|
+
});
|
|
80
|
+
return (_ctx, _cache) => {
|
|
81
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
82
|
+
class: vue.normalizeClass(vue.unref(cs).z())
|
|
83
|
+
}, [
|
|
84
|
+
vue.renderSlot(_ctx.$slots, vue.unref(data.dataSlot).header),
|
|
85
|
+
vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", null, [
|
|
86
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(value.value, (item, index2) => {
|
|
87
|
+
return vue.renderSlot(_ctx.$slots, vue.unref(data.dataSlot).item, {
|
|
88
|
+
key: getKey(item, index2),
|
|
89
|
+
element: item,
|
|
90
|
+
index: index2
|
|
91
|
+
});
|
|
92
|
+
}), 128))
|
|
93
|
+
])), [
|
|
94
|
+
[vue.unref(index$3.default), sortable.value]
|
|
95
|
+
]),
|
|
96
|
+
vue.renderSlot(_ctx.$slots, vue.unref(data.dataSlot).footer)
|
|
97
|
+
], 2);
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
exports.default = _sfc_main;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { defineComponent, computed, createElementBlock, openBlock, normalizeClass, unref, renderSlot, withDirectives, Fragment, renderList } from "vue";
|
|
2
|
+
import { name, dataProps, dataExpose, dataSlot, dataEmits } from "./data.js";
|
|
3
|
+
import { useCssName } from "../../../hooks/cssname/index.js";
|
|
4
|
+
import { useLocale } from "../../../hooks/locale/index.js";
|
|
5
|
+
import vSortable from "../../../directives/sortable/index.js";
|
|
6
|
+
import { usePropsDefault, viewProps, getProps } from "../../../hooks/props-default/index.js";
|
|
7
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
|
+
__name: "index",
|
|
9
|
+
props: getProps(dataProps),
|
|
10
|
+
emits: dataEmits,
|
|
11
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
12
|
+
const cs = useCssName(name);
|
|
13
|
+
const { getLocale } = useLocale();
|
|
14
|
+
const prs = __props;
|
|
15
|
+
const props = usePropsDefault(name, prs, dataProps);
|
|
16
|
+
viewProps(props, name);
|
|
17
|
+
const emit = __emit;
|
|
18
|
+
function safeStringify(obj, space = 2) {
|
|
19
|
+
const seen = /* @__PURE__ */ new WeakSet();
|
|
20
|
+
return JSON.stringify(
|
|
21
|
+
obj,
|
|
22
|
+
(key, value2) => {
|
|
23
|
+
if (typeof value2 === "object" && value2 !== null) {
|
|
24
|
+
if (seen.has(value2)) {
|
|
25
|
+
return "[Circular]";
|
|
26
|
+
}
|
|
27
|
+
seen.add(value2);
|
|
28
|
+
}
|
|
29
|
+
return value2;
|
|
30
|
+
},
|
|
31
|
+
space
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
const getKey = (item, index) => {
|
|
35
|
+
if (props.itemKey) {
|
|
36
|
+
if (typeof props.itemKey == "string") {
|
|
37
|
+
return item[props.itemKey] ?? index;
|
|
38
|
+
} else {
|
|
39
|
+
const v = props.itemKey(item, index) ?? index;
|
|
40
|
+
if (typeof v === "object") {
|
|
41
|
+
return safeStringify(v);
|
|
42
|
+
} else {
|
|
43
|
+
return v;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return index;
|
|
48
|
+
};
|
|
49
|
+
const onEnd = (obj) => {
|
|
50
|
+
const { oldIndex, newIndex } = obj;
|
|
51
|
+
if (oldIndex === newIndex) return;
|
|
52
|
+
const movedItem = value.value.splice(oldIndex, 1)[0];
|
|
53
|
+
value.value.splice(newIndex, 0, movedItem);
|
|
54
|
+
emit("update:modelValue", value.value);
|
|
55
|
+
emit("end", obj);
|
|
56
|
+
};
|
|
57
|
+
const onStart = (obj) => {
|
|
58
|
+
emit("start", obj);
|
|
59
|
+
};
|
|
60
|
+
const sortable = computed(() => {
|
|
61
|
+
return {
|
|
62
|
+
handle: props.handle,
|
|
63
|
+
onStart,
|
|
64
|
+
onEnd
|
|
65
|
+
};
|
|
66
|
+
});
|
|
67
|
+
const value = computed({
|
|
68
|
+
get() {
|
|
69
|
+
return props.modelValue;
|
|
70
|
+
},
|
|
71
|
+
set(value2) {
|
|
72
|
+
emit("update:modelValue", value2);
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
__expose({
|
|
76
|
+
...dataExpose
|
|
77
|
+
});
|
|
78
|
+
return (_ctx, _cache) => {
|
|
79
|
+
return openBlock(), createElementBlock("div", {
|
|
80
|
+
class: normalizeClass(unref(cs).z())
|
|
81
|
+
}, [
|
|
82
|
+
renderSlot(_ctx.$slots, unref(dataSlot).header),
|
|
83
|
+
withDirectives((openBlock(), createElementBlock("div", null, [
|
|
84
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(value.value, (item, index) => {
|
|
85
|
+
return renderSlot(_ctx.$slots, unref(dataSlot).item, {
|
|
86
|
+
key: getKey(item, index),
|
|
87
|
+
element: item,
|
|
88
|
+
index
|
|
89
|
+
});
|
|
90
|
+
}), 128))
|
|
91
|
+
])), [
|
|
92
|
+
[unref(vSortable), sortable.value]
|
|
93
|
+
]),
|
|
94
|
+
renderSlot(_ctx.$slots, unref(dataSlot).footer)
|
|
95
|
+
], 2);
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
export {
|
|
100
|
+
_sfc_main as default
|
|
101
|
+
};
|
|
@@ -2,10 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const urls = require("../../common/urls.cjs");
|
|
4
4
|
const name = "forms";
|
|
5
|
-
const provides = {
|
|
6
|
-
compons: "form-compons",
|
|
7
|
-
form: "form-form"
|
|
8
|
-
};
|
|
9
5
|
const dataProps = {
|
|
10
6
|
...urls.props,
|
|
11
7
|
/**
|
|
@@ -231,4 +227,3 @@ exports.dataHandle = dataHandle;
|
|
|
231
227
|
exports.dataProps = dataProps;
|
|
232
228
|
exports.dataSlot = dataSlot;
|
|
233
229
|
exports.name = name;
|
|
234
|
-
exports.provides = provides;
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { props, comHandle } from "../../common/urls.js";
|
|
2
2
|
const name = "forms";
|
|
3
|
-
const provides = {
|
|
4
|
-
compons: "form-compons",
|
|
5
|
-
form: "form-form"
|
|
6
|
-
};
|
|
7
3
|
const dataProps = {
|
|
8
4
|
...props,
|
|
9
5
|
/**
|
|
@@ -229,6 +225,5 @@ export {
|
|
|
229
225
|
dataHandle,
|
|
230
226
|
dataProps,
|
|
231
227
|
dataSlot,
|
|
232
|
-
name
|
|
233
|
-
provides
|
|
228
|
+
name
|
|
234
229
|
};
|