@opentiny/vue-renderless 3.9.2 → 3.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/action-sheet/vue.js +25 -2
- package/anchor/index.js +3 -3
- package/anchor/vue.js +7 -1
- package/area/index.js +4 -4
- package/button/vue.js +4 -2
- package/button-group/index.js +8 -1
- package/button-group/vue.js +5 -10
- package/calendar/index.js +14 -14
- package/calendar-bar/index.js +3 -3
- package/carousel-item/index.js +1 -1
- package/cascader/vue.js +1 -1
- package/cascader-mobile/index.js +299 -0
- package/cascader-mobile/vue.js +102 -0
- package/cascader-panel/store.js +3 -1
- package/chart-boxplot/index.js +0 -1
- package/chart-core/deps/constants.js +20 -2
- package/chart-core/index.js +9 -1
- package/chart-core/modules/extend.js +14 -1
- package/chart-gauge/index.js +3 -1
- package/chart-graph/index.js +3 -1
- package/chart-map/index.js +11 -1
- package/chart-scatter/index.js +10 -2
- package/chart-waterfall/index.js +4 -1
- package/checkbox/index.js +16 -14
- package/checkbox/vue.js +14 -10
- package/checkbox-button/vue.js +7 -3
- package/column-list-item/vue.js +10 -1
- package/common/bigInt.js +4 -11
- package/common/date.js +2 -2
- package/common/deps/ResizeObserver.js +3 -1
- package/common/deps/date-util.js +9 -1
- package/common/deps/date.js +18 -5
- package/common/deps/fastdom/async.js +41 -0
- package/common/deps/fastdom/index.js +9 -0
- package/common/deps/fastdom/sandbox.js +53 -0
- package/common/deps/fastdom/singleton.js +80 -0
- package/common/deps/fullscreen/screenfull.js +16 -2
- package/common/deps/memorize.js +3 -3
- package/common/deps/popup-manager.js +0 -1
- package/common/deps/requestAnimationFrame.js +1 -1
- package/common/deps/throttle.js +2 -2
- package/common/deps/tree-model/node.js +23 -11
- package/common/deps/tree-model/tree-store.js +28 -7
- package/common/deps/vue-popper.js +14 -2
- package/common/deps/vue-popup.js +16 -23
- package/common/index.js +7 -35
- package/common/runtime.js +1 -1
- package/common/validate/rules/type.js +3 -1
- package/credit-card-form/vue.js +2 -2
- package/date-panel/index.js +35 -31
- package/date-panel/vue.js +12 -12
- package/date-picker/index.js +9 -5
- package/date-picker/vue.js +20 -8
- package/date-picker-mobile/index.js +3 -3
- package/date-range/index.js +91 -19
- package/date-range/vue.js +19 -11
- package/date-table/index.js +39 -6
- package/date-table/vue.js +2 -2
- package/dept/index.js +1 -1
- package/detail-page/vue.js +9 -1
- package/dialog-box/index.js +11 -2
- package/dialog-box/vue.js +30 -6
- package/dialog-select/index.js +27 -5
- package/dialog-select/vue.js +11 -4
- package/drop-roles/index.js +3 -1
- package/dropdown/index.js +28 -7
- package/dropdown/vue.js +12 -7
- package/dropdown-item/index.js +9 -1
- package/dropdown-item/mf.js +3 -3
- package/dropdown-item/vue.js +12 -10
- package/dropdown-menu/index.js +13 -14
- package/dropdown-menu/vue.js +8 -7
- package/espace/vue.js +9 -1
- package/fall-menu/vue.js +12 -1
- package/file-upload/index.js +137 -89
- package/file-upload/vue.js +24 -14
- package/filter/index.js +1 -1
- package/filter/vue.js +1 -3
- package/floating-button/index.js +73 -0
- package/floating-button/vue.js +35 -0
- package/form/index.js +13 -4
- package/form/vue.js +7 -2
- package/form-item/index.js +4 -1
- package/form-item/vue.js +6 -3
- package/fullscreen/vue.js +24 -3
- package/grid/plugins/exportExcel.js +54 -8
- package/grid/static/base/helperGetHGSKeys.js +1 -4
- package/grid/utils/common.js +15 -11
- package/grid/utils/dom.js +5 -1
- package/guide/index.js +2 -3
- package/hrapprover/index.js +3 -1
- package/index-bar/vue.js +8 -1
- package/input/index.js +1 -11
- package/input/vue.js +6 -12
- package/ip-address/index.js +66 -33
- package/ip-address/vue.js +8 -1
- package/link-menu/vue.js +22 -2
- package/locales/index.js +4 -2
- package/logon-user/index.js +3 -1
- package/logout/index.js +6 -2
- package/milestone/vue.js +1 -1
- package/mini-picker/index.js +12 -10
- package/mini-picker/vue.js +10 -10
- package/modal/index.js +5 -3
- package/modal/vue.js +4 -2
- package/month-range/index.js +18 -18
- package/month-range/vue.js +16 -4
- package/month-table/index.js +7 -3
- package/multi-select/vue.js +1 -9
- package/nav-menu/index.js +33 -4
- package/nav-menu/vue.js +9 -1
- package/notify/vue.js +12 -1
- package/numeric/vue.js +6 -2
- package/option/index.js +10 -2
- package/option/vue.js +20 -9
- package/option-group/index.js +3 -1
- package/package.json +2 -1
- package/picker/index.js +88 -17
- package/picker/vue.js +42 -17
- package/picker-column/index.js +6 -6
- package/picker-column/vue.js +5 -5
- package/popconfirm/vue.js +3 -1
- package/popeditor/index.js +55 -13
- package/popeditor/vue.js +23 -7
- package/popover/vue.js +1 -2
- package/popup/vue.js +15 -2
- package/progress/index.js +9 -7
- package/progress/vue.js +12 -4
- package/pull-refresh/vue.js +10 -1
- package/query-builder/index.js +9 -0
- package/query-builder/vue.js +18 -0
- package/radio/vue.js +3 -1
- package/radio-button/vue.js +1 -1
- package/rate/index.js +8 -2
- package/rate/vue.js +27 -4
- package/recycle-scroller/index.js +0 -1
- package/scrollbar/vue-bar.js +18 -2
- package/search/index.js +12 -5
- package/search/vue.js +7 -5
- package/select/index.js +596 -304
- package/select/vue.js +167 -101
- package/select-dropdown/vue.js +8 -6
- package/select-mobile/index.js +26 -13
- package/select-mobile/vue.js +14 -5
- package/select-view/index.js +5 -21
- package/select-view/vue.js +0 -3
- package/selected-box/index.js +3 -1
- package/slider/index.js +5 -5
- package/slider/vue.js +16 -0
- package/slider-button/index.js +41 -0
- package/slider-button/vue.js +36 -0
- package/slider-button-group/slide-button.js +142 -0
- package/slider-button-group/vue.js +52 -0
- package/steps/slide-bar.js +0 -1
- package/switch/index.js +1 -1
- package/switch/vue.js +1 -1
- package/tab-bar/index.js +8 -6
- package/tab-nav/index.js +19 -13
- package/tab-nav/vue.js +10 -9
- package/tabs/index.js +21 -17
- package/tabs/vue.js +1 -4
- package/tag/vue.js +2 -1
- package/tag-group/index.js +23 -10
- package/tag-group/vue.js +5 -4
- package/time/index.js +8 -8
- package/time/vue.js +9 -9
- package/time-line/index.js +24 -2
- package/time-line/vue.js +30 -4
- package/time-panel/index.js +2 -2
- package/time-panel/vue.js +2 -2
- package/time-range/index.js +24 -21
- package/time-range/vue.js +26 -16
- package/time-spinner/index.js +32 -21
- package/time-spinner/vue.js +37 -12
- package/timeline-item/index.js +77 -0
- package/timeline-item/vue.js +44 -0
- package/toggle-menu/vue.js +0 -1
- package/tooltip/index.js +11 -12
- package/tooltip/vue.js +11 -1
- package/top-box/vue.js +13 -1
- package/tree/index.js +228 -15
- package/tree/vue.js +119 -15
- package/tree-menu/index.js +35 -0
- package/tree-menu/vue.js +27 -5
- package/tree-node/index.js +75 -10
- package/tree-node/vue.js +45 -23
- package/upload/index.js +90 -49
- package/upload/vue.js +22 -10
- package/upload-dragger/index.js +4 -3
- package/upload-list/index.js +67 -16
- package/upload-list/vue.js +26 -9
- package/user/index.js +7 -4
- package/user-link/index.js +2 -1
- package/wizard/index.js +4 -1
- package/wizard/vue.js +19 -2
- package/year-range/index.js +1 -1
- package/year-range/vue.js +3 -3
- package/year-table/index.js +2 -2
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import "../chunk-PKUHTIDK.js";
|
|
2
|
+
import {
|
|
3
|
+
close,
|
|
4
|
+
watchVisible,
|
|
5
|
+
selectOption,
|
|
6
|
+
confirm,
|
|
7
|
+
searchMethod,
|
|
8
|
+
searchSelectHandler,
|
|
9
|
+
searchBoxToggle,
|
|
10
|
+
watchModelValue,
|
|
11
|
+
isSelected,
|
|
12
|
+
setLevel,
|
|
13
|
+
created,
|
|
14
|
+
loadData,
|
|
15
|
+
getNodeConfig,
|
|
16
|
+
initTreeStore,
|
|
17
|
+
renderSearchOption,
|
|
18
|
+
computedNavListHandler,
|
|
19
|
+
disabledNavOption,
|
|
20
|
+
syncCheckStatus
|
|
21
|
+
} from "./index";
|
|
22
|
+
const api = [
|
|
23
|
+
"state",
|
|
24
|
+
"close",
|
|
25
|
+
"selectOption",
|
|
26
|
+
"confirm",
|
|
27
|
+
"searchMethod",
|
|
28
|
+
"searchSelectHandler",
|
|
29
|
+
"searchBoxToggle",
|
|
30
|
+
"setLevel",
|
|
31
|
+
"loadData",
|
|
32
|
+
"renderSearchOption",
|
|
33
|
+
"disabledNavOption",
|
|
34
|
+
"isSelected"
|
|
35
|
+
];
|
|
36
|
+
const renderless = (props, { computed, reactive, watch }, { emit, constants }) => {
|
|
37
|
+
const api2 = {};
|
|
38
|
+
const state = reactive({
|
|
39
|
+
toggle: false,
|
|
40
|
+
loading: false,
|
|
41
|
+
root: null,
|
|
42
|
+
store: null,
|
|
43
|
+
navList: [],
|
|
44
|
+
rootData: [],
|
|
45
|
+
level: 0,
|
|
46
|
+
isLeaf: false,
|
|
47
|
+
search: {
|
|
48
|
+
show: false,
|
|
49
|
+
input: "",
|
|
50
|
+
options: [],
|
|
51
|
+
filterOptions: []
|
|
52
|
+
},
|
|
53
|
+
options: computed(() => {
|
|
54
|
+
let arr, list = [state.rootData];
|
|
55
|
+
state.navList.map((option) => {
|
|
56
|
+
arr = option.childNodes;
|
|
57
|
+
arr && arr.length && list.push(arr);
|
|
58
|
+
});
|
|
59
|
+
return list;
|
|
60
|
+
}),
|
|
61
|
+
checkIds: computed(() => state.navList.map((option) => option.data[props.valueField])),
|
|
62
|
+
checkLabels: computed(() => state.navList.map((option) => option.data[props.textField])),
|
|
63
|
+
waitLoadList: computed(
|
|
64
|
+
() => state.navList.filter((option) => option.selfWaitLoad).map((option) => option.data[props.valueField])
|
|
65
|
+
),
|
|
66
|
+
computedNavList: computed(() => api2.computedNavListHandler()),
|
|
67
|
+
showButton: computed(() => {
|
|
68
|
+
const len = state.navList.length;
|
|
69
|
+
return len && (props.nodeConfig.checkStrictly || state.navList[len - 1].isLeaf);
|
|
70
|
+
})
|
|
71
|
+
});
|
|
72
|
+
Object.assign(api2, {
|
|
73
|
+
state,
|
|
74
|
+
confirm: confirm({ state, emit, props, api: api2 }),
|
|
75
|
+
selectOption: selectOption({ state, emit, props, api: api2 }),
|
|
76
|
+
close: close({ state, emit }),
|
|
77
|
+
watchVisible: watchVisible({ emit, state, props, api: api2 }),
|
|
78
|
+
watchModelValue: watchModelValue({ props, state, emit }),
|
|
79
|
+
searchMethod: searchMethod({ state, props, api: api2 }),
|
|
80
|
+
searchSelectHandler: searchSelectHandler({ state, emit, api: api2, props }),
|
|
81
|
+
searchBoxToggle: searchBoxToggle({ state, props, api: api2 }),
|
|
82
|
+
syncCheckStatus: syncCheckStatus({ state, props, api: api2 }),
|
|
83
|
+
setLevel: setLevel({ state, api: api2 }),
|
|
84
|
+
created: created({ api: api2 }),
|
|
85
|
+
loadData: loadData({ state, props }),
|
|
86
|
+
getNodeConfig: getNodeConfig({ state, constants, props }),
|
|
87
|
+
initTreeStore: initTreeStore({ props, state, api: api2 }),
|
|
88
|
+
renderSearchOption: renderSearchOption({ props, state, api: api2 }),
|
|
89
|
+
computedNavListHandler: computedNavListHandler({ props, state, api: api2 }),
|
|
90
|
+
disabledNavOption: disabledNavOption({ state }),
|
|
91
|
+
isSelected: isSelected({ state, api: api2, props })
|
|
92
|
+
});
|
|
93
|
+
api2.created();
|
|
94
|
+
watch(() => props.visible, api2.watchVisible);
|
|
95
|
+
watch(() => props.modelValue, api2.watchModelValue, { immediate: true, deep: true });
|
|
96
|
+
watch(() => props.data, api2.loadData, { deep: true });
|
|
97
|
+
return api2;
|
|
98
|
+
};
|
|
99
|
+
export {
|
|
100
|
+
api,
|
|
101
|
+
renderless
|
|
102
|
+
};
|
package/cascader-panel/store.js
CHANGED
|
@@ -42,7 +42,9 @@ class Store {
|
|
|
42
42
|
getNodeByValue(value) {
|
|
43
43
|
if (value) {
|
|
44
44
|
const lazy = !this.config.lazy;
|
|
45
|
-
const nodes = this.getFlattedNodes(false, lazy).filter(
|
|
45
|
+
const nodes = this.getFlattedNodes(false, lazy).filter(
|
|
46
|
+
(node) => valueEquals(node.path, value) || node.value === value
|
|
47
|
+
);
|
|
46
48
|
return nodes && nodes.length ? nodes[0] : null;
|
|
47
49
|
}
|
|
48
50
|
return null;
|
package/chart-boxplot/index.js
CHANGED
|
@@ -10,7 +10,18 @@ let DEFAULT_COLORS = ["#19d4ae", "#5ab1ef", "#fa6e86", "#ffb980", "#0067a6", "#c
|
|
|
10
10
|
DEFAULT_COLORS = DEFAULT_COLORS.concat(["#d87a80", "#9cbbff", "#d9d0c7", "#87a997", "#d49ea2", "#5b4947", "#7ba3a8"]);
|
|
11
11
|
const HEAT_MAP_COLOR = ["#5990FD", "#2DA769", "#EEBA18", "#F43146"];
|
|
12
12
|
const HEAT_BMAP_COLOR = ["blue", "blue", "green", "yellow", "red"];
|
|
13
|
-
const SAAS_DEFAULT_COLORS_10 = [
|
|
13
|
+
const SAAS_DEFAULT_COLORS_10 = [
|
|
14
|
+
"#6d8ff0",
|
|
15
|
+
"#00a874",
|
|
16
|
+
"#bd72f0",
|
|
17
|
+
"#54bcce",
|
|
18
|
+
"#fdc000",
|
|
19
|
+
"#9185f0",
|
|
20
|
+
"#82dbb1",
|
|
21
|
+
"#f46087",
|
|
22
|
+
"#2070f3",
|
|
23
|
+
"#ee8ddb"
|
|
24
|
+
];
|
|
14
25
|
const SAAS_DEFAULT_COLORS_18 = [
|
|
15
26
|
"#2070f3",
|
|
16
27
|
"#50c291",
|
|
@@ -64,7 +75,14 @@ const itemPoint = (color) => [
|
|
|
64
75
|
"vertical-align:middle;",
|
|
65
76
|
'"></span>'
|
|
66
77
|
].join("");
|
|
67
|
-
const itemLabel = (seriesName, onlyLabel) => [
|
|
78
|
+
const itemLabel = (seriesName, onlyLabel) => [
|
|
79
|
+
'<span style="',
|
|
80
|
+
"display:inline-block;",
|
|
81
|
+
"font-size:12px;",
|
|
82
|
+
"color:#4E4E4E;",
|
|
83
|
+
`${onlyLabel ? "" : "margin-right:25px;"}`,
|
|
84
|
+
`">${seriesName}</span>`
|
|
85
|
+
].join("");
|
|
68
86
|
const itemContent = (content) => ['<span style="', "float:right;", "font-size:14px;", "color:#191919;", `">${content}</span>`].join("");
|
|
69
87
|
const STATIC_PROPS = ["initOptions", "loading", "dataEmpty", "judgeWidth", "widthChangeDelay"];
|
|
70
88
|
let ECHARTS_SETTINGS = ["grid", "dataZoom", "visualMap", "toolbox", "title", "legend", "xAxis"];
|
package/chart-core/index.js
CHANGED
|
@@ -2,7 +2,15 @@ import {
|
|
|
2
2
|
__spreadValues
|
|
3
3
|
} from "../chunk-PKUHTIDK.js";
|
|
4
4
|
import { on, off } from "../common/deps/dom";
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
DEFAULT_COLORS,
|
|
7
|
+
DEFAULT_THEME,
|
|
8
|
+
STATIC_PROPS,
|
|
9
|
+
ECHARTS_SETTINGS,
|
|
10
|
+
SAAS_DEFAULT_COLORS_10,
|
|
11
|
+
SAAS_DEFAULT_COLORS_18,
|
|
12
|
+
DEFAULT_CONFIG
|
|
13
|
+
} from "./deps/constants";
|
|
6
14
|
import { getType, debounce, isObject, cloneDeep, isEqual, htmlHandler } from "./deps/utils";
|
|
7
15
|
import setAnimation from "./modules/animation";
|
|
8
16
|
import setExtend from "./modules/extend";
|
|
@@ -14,7 +14,20 @@ var extend_default = ({ options, extend }) => {
|
|
|
14
14
|
} else if (typeof value === "function") {
|
|
15
15
|
options[key] = value(options[key]);
|
|
16
16
|
} else if (isArr(options[key]) && isArr(value)) {
|
|
17
|
-
const attrList = [
|
|
17
|
+
const attrList = [
|
|
18
|
+
"series",
|
|
19
|
+
"yAxis",
|
|
20
|
+
"xAxis",
|
|
21
|
+
"color",
|
|
22
|
+
"dataZoom",
|
|
23
|
+
"legend",
|
|
24
|
+
"toolbox",
|
|
25
|
+
"grid",
|
|
26
|
+
"graphic",
|
|
27
|
+
"timeline",
|
|
28
|
+
"visualMap",
|
|
29
|
+
"brush"
|
|
30
|
+
];
|
|
18
31
|
if (~attrList.indexOf(key)) {
|
|
19
32
|
options[key] = merge(options[key], value);
|
|
20
33
|
}
|
package/chart-gauge/index.js
CHANGED
|
@@ -59,7 +59,9 @@ function getSeries(args) {
|
|
|
59
59
|
title: { offsetCenter: [0, "25%"], color: "#191919", fontSize: 14 }
|
|
60
60
|
};
|
|
61
61
|
if (seriesItem) {
|
|
62
|
-
Object.keys(seriesItem).forEach(
|
|
62
|
+
Object.keys(seriesItem).forEach(
|
|
63
|
+
(key) => isObject(result[key]) ? Object.assign(result[key], seriesItem[key]) : result[key] = seriesItem[key]
|
|
64
|
+
);
|
|
63
65
|
}
|
|
64
66
|
return result;
|
|
65
67
|
});
|
package/chart-graph/index.js
CHANGED
|
@@ -13,7 +13,9 @@ const getTooltip = () => ({
|
|
|
13
13
|
return tpl.join("");
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
-
const getGraphSeries = () => [
|
|
16
|
+
const getGraphSeries = () => [
|
|
17
|
+
{ type: "graph", label: { textBorderWidth: 1, color: "#fff", textBorderColor: "inherit" } }
|
|
18
|
+
];
|
|
17
19
|
const graph = (columns, rows, settings, extra) => {
|
|
18
20
|
const { tooltipVisible } = extra;
|
|
19
21
|
const tooltip = tooltipVisible && getTooltip({});
|
package/chart-map/index.js
CHANGED
|
@@ -40,7 +40,17 @@ const getSeries = (args) => {
|
|
|
40
40
|
metrics.forEach((itemName) => {
|
|
41
41
|
const name = !isNull(labelMap[itemName]) ? labelMap[itemName] : itemName;
|
|
42
42
|
const data = [];
|
|
43
|
-
const itemResult = __spreadValues({
|
|
43
|
+
const itemResult = __spreadValues({
|
|
44
|
+
name,
|
|
45
|
+
data,
|
|
46
|
+
selectedMode,
|
|
47
|
+
roam,
|
|
48
|
+
center,
|
|
49
|
+
aspectScale,
|
|
50
|
+
boundingCoords,
|
|
51
|
+
zoom,
|
|
52
|
+
scaleLimit
|
|
53
|
+
}, mapBase);
|
|
44
54
|
if (mapGrid) {
|
|
45
55
|
Object.keys(mapGrid).forEach((key) => itemResult[key] = mapGrid[key]);
|
|
46
56
|
}
|
package/chart-scatter/index.js
CHANGED
|
@@ -91,7 +91,11 @@ const getScatterSeries = (args) => {
|
|
|
91
91
|
data: result,
|
|
92
92
|
name: dataLabel,
|
|
93
93
|
label,
|
|
94
|
-
itemStyle: __spreadValues({
|
|
94
|
+
itemStyle: __spreadValues({
|
|
95
|
+
borderWidth: 1,
|
|
96
|
+
borderColor: color[index],
|
|
97
|
+
color: `rgba(${hexToRgb(color[index])}, 0.3)`
|
|
98
|
+
}, itemStyle || {})
|
|
95
99
|
};
|
|
96
100
|
Object.assign(serie, { symbol, symbolRotate, symbolOffset, cursor });
|
|
97
101
|
series.push(serie);
|
|
@@ -117,7 +121,11 @@ const getSeries = (args) => {
|
|
|
117
121
|
cursor,
|
|
118
122
|
label,
|
|
119
123
|
tooltip,
|
|
120
|
-
itemStyle: __spreadValues({
|
|
124
|
+
itemStyle: __spreadValues({
|
|
125
|
+
borderWidth: 1,
|
|
126
|
+
borderColor: color[index],
|
|
127
|
+
color: `rgba(${hexToRgb(color[index])}, 0.3)`
|
|
128
|
+
}, itemStyle || {}),
|
|
121
129
|
emphasis: { itemStyle: { borderWidth: 1, borderColor: color[index] } }
|
|
122
130
|
});
|
|
123
131
|
Object.assign(item, itemBase);
|
package/chart-waterfall/index.js
CHANGED
|
@@ -10,7 +10,10 @@ const getWaterfallTooltip = (dataType, digit) => {
|
|
|
10
10
|
let axisPointer = { type: "shadow" };
|
|
11
11
|
let formatter = function(items) {
|
|
12
12
|
const item = items[1];
|
|
13
|
-
return [
|
|
13
|
+
return [
|
|
14
|
+
`${itemContent(item.name)}<br/>${itemLabel(item.seriesName)}`,
|
|
15
|
+
`${itemContent(getFormated(item.value, dataType, digit))}`
|
|
16
|
+
].join("");
|
|
14
17
|
};
|
|
15
18
|
return { trigger, axisPointer, formatter };
|
|
16
19
|
};
|
package/checkbox/index.js
CHANGED
|
@@ -89,26 +89,28 @@ const toggleEvent = ({ parent, props, type }) => {
|
|
|
89
89
|
inputEl[type + "EventListener"](ev, props.events[ev]);
|
|
90
90
|
}
|
|
91
91
|
};
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
92
|
+
const computedIsDisplayOnly = ({ state, props }) => () => props.displayOnly || state.formDisplayOnly;
|
|
93
|
+
const computedIsGroupDisplayOnly = ({ state }) => () => state.isGroup && (state.checkboxGroup.displayOnly || state.formDisplayOnly);
|
|
94
|
+
const computedDisplayLabel = ({ state, props, t }) => () => {
|
|
95
|
+
state.showLabel = true;
|
|
96
|
+
if (props.trueLabel !== void 0 && props.falseLabel !== void 0) {
|
|
97
|
+
return props.modelValue ? props.trueLabel : props.falseLabel;
|
|
98
|
+
} else {
|
|
99
|
+
return props.modelValue ? t("yes") : t("no");
|
|
98
100
|
}
|
|
99
101
|
};
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
102
|
+
const computedIsShowText = ({ props }) => () => props.text || props.label || !isNull(props.text) || !isNull(props.label);
|
|
103
|
+
const computedShowText = ({ props }) => () => {
|
|
104
|
+
if (props.text || !isNull(props.text)) {
|
|
105
|
+
return props.text;
|
|
103
106
|
} else {
|
|
104
|
-
return
|
|
107
|
+
return props.label;
|
|
105
108
|
}
|
|
106
109
|
};
|
|
107
|
-
const computedIsDisplayOnly = ({ state, props }) => () => props.displayOnly || state.formDisplayOnly;
|
|
108
|
-
const computedIsGroupDisplayOnly = ({ state }) => () => state.isGroup && (state.checkboxGroup.displayOnly || state.formDisplayOnly);
|
|
109
110
|
export {
|
|
110
111
|
addToStore,
|
|
111
112
|
computedCheckboxSize,
|
|
113
|
+
computedDisplayLabel,
|
|
112
114
|
computedFormItemSize,
|
|
113
115
|
computedGetModelGet,
|
|
114
116
|
computedGetModelSet,
|
|
@@ -118,9 +120,9 @@ export {
|
|
|
118
120
|
computedIsGroup,
|
|
119
121
|
computedIsGroupDisplayOnly,
|
|
120
122
|
computedIsLimitDisabled,
|
|
123
|
+
computedIsShowText,
|
|
124
|
+
computedShowText,
|
|
121
125
|
computedStore,
|
|
122
|
-
dispatchDisplayedValue,
|
|
123
|
-
getDisplayedValue,
|
|
124
126
|
handleChange,
|
|
125
127
|
mounted,
|
|
126
128
|
removeFromStore,
|
package/checkbox/vue.js
CHANGED
|
@@ -14,10 +14,11 @@ import {
|
|
|
14
14
|
computedIsGroupDisplayOnly,
|
|
15
15
|
computedFormItemSize,
|
|
16
16
|
computedCheckboxSize,
|
|
17
|
+
computedDisplayLabel,
|
|
17
18
|
mounted,
|
|
18
19
|
toggleEvent,
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
computedIsShowText,
|
|
21
|
+
computedShowText
|
|
21
22
|
} from "./index";
|
|
22
23
|
const api = ["state", "handleChange", "computedStore"];
|
|
23
24
|
const initState = ({ reactive, computed, parent, api: api2, inject, props }) => {
|
|
@@ -37,14 +38,18 @@ const initState = ({ reactive, computed, parent, api: api2, inject, props }) =>
|
|
|
37
38
|
formDisplayOnly: computed(() => (parent.tinyForm || {}).displayOnly),
|
|
38
39
|
isDisplayOnly: computed(() => api2.computedIsDisplayOnly()),
|
|
39
40
|
isGroupDisplayOnly: computed(() => api2.computedIsGroupDisplayOnly()),
|
|
41
|
+
displayLabel: computed(() => api2.computedDisplayLabel()),
|
|
42
|
+
inputDisabled: computed(() => state.isDisabled || state.isDisplayOnly || state.isGroupDisplayOnly),
|
|
40
43
|
model: computed({
|
|
41
44
|
get: () => api2.computedGetModelGet(),
|
|
42
45
|
set: (value) => api2.computedGetModelSet(value)
|
|
43
|
-
})
|
|
46
|
+
}),
|
|
47
|
+
showText: computed(() => api2.computedShowText()),
|
|
48
|
+
isShowText: computed(() => api2.computedIsShowText())
|
|
44
49
|
});
|
|
45
50
|
return state;
|
|
46
51
|
};
|
|
47
|
-
const initApi = ({
|
|
52
|
+
const initApi = ({ api: api2, state, dispatch, props, parent, constants, formItemSize, emit, nextTick, t }) => {
|
|
48
53
|
Object.assign(api2, {
|
|
49
54
|
state,
|
|
50
55
|
addToStore: addToStore({ state, props }),
|
|
@@ -62,21 +67,21 @@ const initApi = ({ vm, api: api2, state, dispatch, props, parent, constants, for
|
|
|
62
67
|
computedGetModelSet: computedGetModelSet({ state, dispatch, emit, constants }),
|
|
63
68
|
mounted: mounted({ emit, props, api: api2, parent }),
|
|
64
69
|
handleChange: handleChange({ state, props, emit, nextTick, dispatch, constants }),
|
|
65
|
-
|
|
66
|
-
|
|
70
|
+
computedDisplayLabel: computedDisplayLabel({ state, props, t }),
|
|
71
|
+
computedIsShowText: computedIsShowText({ props }),
|
|
72
|
+
computedShowText: computedShowText({ props })
|
|
67
73
|
});
|
|
68
74
|
};
|
|
69
|
-
const renderless = (props, { computed, onMounted, onBeforeUnmount, reactive, watch, inject }, { vm, parent, emit, constants, nextTick, dispatch }) => {
|
|
75
|
+
const renderless = (props, { computed, onMounted, onBeforeUnmount, reactive, watch, inject }, { vm, parent, emit, constants, nextTick, dispatch, t }) => {
|
|
70
76
|
const api2 = { dispatch };
|
|
71
77
|
const formItemSize = computed(() => api2.computedFormItemSize());
|
|
72
78
|
const state = initState({ reactive, computed, parent, api: api2, inject, props });
|
|
73
79
|
parent.tinyForm = parent.tinyForm || inject("form", null);
|
|
74
|
-
initApi({
|
|
80
|
+
initApi({ api: api2, state, dispatch, props, parent, constants, formItemSize, emit, nextTick, t });
|
|
75
81
|
watch(
|
|
76
82
|
() => props.modelValue,
|
|
77
83
|
(value) => props.validateEvent && api2.dispatch(constants.FORM_ITEM, constants.FORM_CHANGE, value)
|
|
78
84
|
);
|
|
79
|
-
watch(() => state.isDisplayOnly, api2.dispatchDisplayedValue);
|
|
80
85
|
watch(
|
|
81
86
|
() => props.checked,
|
|
82
87
|
(value) => {
|
|
@@ -89,7 +94,6 @@ const renderless = (props, { computed, onMounted, onBeforeUnmount, reactive, wat
|
|
|
89
94
|
onMounted(() => {
|
|
90
95
|
dispatch("Tooltip", "tooltip-update");
|
|
91
96
|
toggleEvent({ parent, props, type: "add" });
|
|
92
|
-
api2.dispatchDisplayedValue();
|
|
93
97
|
api2.mounted();
|
|
94
98
|
});
|
|
95
99
|
return api2;
|
package/checkbox-button/vue.js
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
computedIsDisabled,
|
|
11
11
|
toggleEvent
|
|
12
12
|
} from "./index";
|
|
13
|
-
import { addToStore, computedIsChecked, computedStore, computedIsLimitDisabled } from "../checkbox";
|
|
13
|
+
import { addToStore, computedIsChecked, computedStore, computedIsLimitDisabled, computedIsShowText, computedShowText } from "../checkbox";
|
|
14
14
|
const api = ["state", "handleChange"];
|
|
15
15
|
const initState = ({ reactive, computed, api: api2 }) => {
|
|
16
16
|
const state = reactive({
|
|
@@ -27,7 +27,9 @@ const initState = ({ reactive, computed, api: api2 }) => {
|
|
|
27
27
|
isDisabled: computed(() => api2.computedIsDisabled()),
|
|
28
28
|
activeStyle: computed(() => api2.computedActiveStyle()),
|
|
29
29
|
checkboxGroup: computed(() => api2.computedCheckboxGroup()),
|
|
30
|
-
isLimitDisabled: computed(() => api2.computedIsLimitDisabled())
|
|
30
|
+
isLimitDisabled: computed(() => api2.computedIsLimitDisabled()),
|
|
31
|
+
showText: computed(() => api2.computedShowText()),
|
|
32
|
+
isShowText: computed(() => api2.computedIsShowText())
|
|
31
33
|
});
|
|
32
34
|
return state;
|
|
33
35
|
};
|
|
@@ -45,7 +47,9 @@ const initApi = ({ api: api2, state, props, formItemSize, parent, constants, emi
|
|
|
45
47
|
computedGetModelGet: computedGetModelGet({ state, props }),
|
|
46
48
|
computedCheckboxGroup: computedCheckboxGroup({ parent, constants }),
|
|
47
49
|
handleChange: handleChange({ state, props, emit, nextTick, dispatch, constants }),
|
|
48
|
-
computedGetModelSet: computedGetModelSet({ state, props, emit, dispatch, constants })
|
|
50
|
+
computedGetModelSet: computedGetModelSet({ state, props, emit, dispatch, constants }),
|
|
51
|
+
computedIsShowText: computedIsShowText({ props }),
|
|
52
|
+
computedShowText: computedShowText({ props })
|
|
49
53
|
});
|
|
50
54
|
};
|
|
51
55
|
const renderless = (props, { computed, onMounted, onBeforeUnmount, reactive }, { parent, emit, dispatch, constants, nextTick }) => {
|
package/column-list-item/vue.js
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
handelIconClick,
|
|
4
|
+
handleChange,
|
|
5
|
+
getIsGroup,
|
|
6
|
+
getSize,
|
|
7
|
+
isDisabled,
|
|
8
|
+
getModel,
|
|
9
|
+
setModel,
|
|
10
|
+
computedStore
|
|
11
|
+
} from "./index";
|
|
3
12
|
const api = ["state", "handelIconClick"];
|
|
4
13
|
const renderless = (props, { reactive, watch, computed }, { vm, parent, emit, constants, nextTick, dispatch }) => {
|
|
5
14
|
const api2 = {};
|
package/common/bigInt.js
CHANGED
|
@@ -43,12 +43,7 @@ function validateNumber(num) {
|
|
|
43
43
|
if (!num) {
|
|
44
44
|
return false;
|
|
45
45
|
}
|
|
46
|
-
return (
|
|
47
|
-
// Normal type: 11.28
|
|
48
|
-
/^\s*-?\d+(\.\d+)?\s*$/.test(num) || // Pre-number: 1.
|
|
49
|
-
/^\s*-?\d+\.\s*$/.test(num) || // Post-number: .1
|
|
50
|
-
/^\s*-?\.\d+\s*$/.test(num)
|
|
51
|
-
);
|
|
46
|
+
return /^\s*-?\d+(\.\d+)?\s*$/.test(num) || /^\s*-?\d+\.\s*$/.test(num) || /^\s*-?\.\d+\s*$/.test(num);
|
|
52
47
|
}
|
|
53
48
|
function getNumberPrecision(number) {
|
|
54
49
|
let numStr = String(number);
|
|
@@ -142,10 +137,6 @@ class BigIntDecimal {
|
|
|
142
137
|
getMark() {
|
|
143
138
|
return this.negative ? "-" : "";
|
|
144
139
|
}
|
|
145
|
-
/**
|
|
146
|
-
* Align BigIntDecimal with same decimal length. e.g. 12.3 + 5 = 1230000
|
|
147
|
-
* This is used for add function only.
|
|
148
|
-
*/
|
|
149
140
|
alignDecimal(decimalLength) {
|
|
150
141
|
const string = `${this.getMark()}${this.getIntegerStr()}${this.getDecimalStr().padEnd(decimalLength, "0")}`;
|
|
151
142
|
return BigInt(string);
|
|
@@ -283,7 +274,9 @@ function toFixed(numStr, precision, rounding = 5) {
|
|
|
283
274
|
if (precision >= 0) {
|
|
284
275
|
const advancedNum = Number(decimalStr[precision]);
|
|
285
276
|
if (advancedNum >= rounding && rounding !== 0) {
|
|
286
|
-
const advancedDecimal = getMiniDecimal(`${integerStr}${separatorStr}${decimalStr}`).add(
|
|
277
|
+
const advancedDecimal = getMiniDecimal(`${integerStr}${separatorStr}${decimalStr}`).add(
|
|
278
|
+
`0.${fillChar("", precision, true)}${10 - advancedNum}`
|
|
279
|
+
);
|
|
287
280
|
return toFixed(negativeStr + advancedDecimal.toString(), precision, 0);
|
|
288
281
|
}
|
|
289
282
|
if (precision === 0) {
|
package/common/date.js
CHANGED
|
@@ -314,7 +314,7 @@ const toDateStr = (date, dateFormat, timezone) => {
|
|
|
314
314
|
};
|
|
315
315
|
const getWeekOfFirstDay = (date, isSunFirst) => {
|
|
316
316
|
typeof date === "boolean" && (isSunFirst = date);
|
|
317
|
-
isDate(date) || (date =
|
|
317
|
+
isDate(date) || (date = new Date());
|
|
318
318
|
const day = date.getDay();
|
|
319
319
|
let dayOfMonth = date.getDate();
|
|
320
320
|
if (day === 0) {
|
|
@@ -325,7 +325,7 @@ const getWeekOfFirstDay = (date, isSunFirst) => {
|
|
|
325
325
|
return new Date(date.getFullYear(), date.getMonth(), dayOfMonth);
|
|
326
326
|
};
|
|
327
327
|
const TZRE = /(-|\+)(\d{2}):?(\d{2})$/;
|
|
328
|
-
const getLocalTimezone = () => 0 -
|
|
328
|
+
const getLocalTimezone = () => 0 - new Date().getTimezoneOffset() / 60;
|
|
329
329
|
const getStrTimezone = (value) => {
|
|
330
330
|
const localTimeZone = getLocalTimezone();
|
|
331
331
|
const match = typeof value === "string" && value.match(TZRE);
|
|
@@ -409,7 +409,9 @@ const ResizeObserverSPI = function() {
|
|
|
409
409
|
return;
|
|
410
410
|
}
|
|
411
411
|
const ctx = this.callbackCtx_;
|
|
412
|
-
const entries = this.activeObservations_.map(
|
|
412
|
+
const entries = this.activeObservations_.map(
|
|
413
|
+
(observation) => new ResizeObserverEntry(observation.target, observation.broadcastRect())
|
|
414
|
+
);
|
|
413
415
|
this.callback_.call(ctx, entries, ctx);
|
|
414
416
|
this.clearActive();
|
|
415
417
|
};
|
package/common/deps/date-util.js
CHANGED
|
@@ -155,7 +155,15 @@ const modifyWithTimeString = (date, time, t) => {
|
|
|
155
155
|
return modifyTime(date, time.getHours(), time.getMinutes(), time.getSeconds());
|
|
156
156
|
};
|
|
157
157
|
const clearTime = (date) => new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
|
158
|
-
const clearMilliseconds = (date) => new Date(
|
|
158
|
+
const clearMilliseconds = (date) => new Date(
|
|
159
|
+
date.getFullYear(),
|
|
160
|
+
date.getMonth(),
|
|
161
|
+
date.getDate(),
|
|
162
|
+
date.getHours(),
|
|
163
|
+
date.getMinutes(),
|
|
164
|
+
date.getSeconds(),
|
|
165
|
+
0
|
|
166
|
+
);
|
|
159
167
|
const limitTimeRange = (date, ranges, format = defaultHMS) => {
|
|
160
168
|
if (ranges.length === 0) {
|
|
161
169
|
return date;
|
package/common/deps/date.js
CHANGED
|
@@ -109,7 +109,7 @@ const parseFlags = {
|
|
|
109
109
|
yy: [
|
|
110
110
|
twoDigits,
|
|
111
111
|
(date, value) => {
|
|
112
|
-
const now =
|
|
112
|
+
const now = new Date();
|
|
113
113
|
const cent = Number(String(now.getFullYear()).substr(0, 2));
|
|
114
114
|
date.year = String(value > 68 ? cent - 1 : cent) + value;
|
|
115
115
|
}
|
|
@@ -207,7 +207,10 @@ fecha.format = (dateObj, mask, i18nSettings) => {
|
|
|
207
207
|
literals.push($1);
|
|
208
208
|
return "@@@";
|
|
209
209
|
});
|
|
210
|
-
mask = mask.replace(
|
|
210
|
+
mask = mask.replace(
|
|
211
|
+
fullTimeReg,
|
|
212
|
+
($0) => $0 in formatFlags ? formatFlags[$0](dateObj, i18n) : $0.slice(1, $0.length - 1)
|
|
213
|
+
);
|
|
211
214
|
return mask.replace(/@@@/g, () => literals.shift());
|
|
212
215
|
};
|
|
213
216
|
const getNewFormat = (format, parseInfo) => {
|
|
@@ -225,14 +228,24 @@ const getNewFormat = (format, parseInfo) => {
|
|
|
225
228
|
};
|
|
226
229
|
const getDate = (dateInfo) => {
|
|
227
230
|
let date;
|
|
228
|
-
const today =
|
|
231
|
+
const today = new Date();
|
|
229
232
|
if (!isNull(dateInfo.timezoneOffset)) {
|
|
230
233
|
dateInfo.minute = Number(dateInfo.minute || 0) - Number(dateInfo.timezoneOffset);
|
|
231
234
|
const { year, month, day, hour, minute, second, millisecond } = dateInfo;
|
|
232
|
-
date = new Date(
|
|
235
|
+
date = new Date(
|
|
236
|
+
Date.UTC(year || today.getFullYear(), month || 0, day || 1, hour || 0, minute || 0, second || 0, millisecond || 0)
|
|
237
|
+
);
|
|
233
238
|
} else {
|
|
234
239
|
const { year, month, day, hour, minute, second, millisecond } = dateInfo;
|
|
235
|
-
date = new Date(
|
|
240
|
+
date = new Date(
|
|
241
|
+
year || today.getFullYear(),
|
|
242
|
+
month || 0,
|
|
243
|
+
day || 1,
|
|
244
|
+
hour || 0,
|
|
245
|
+
minute || 0,
|
|
246
|
+
second || 0,
|
|
247
|
+
millisecond || 0
|
|
248
|
+
);
|
|
236
249
|
}
|
|
237
250
|
return date;
|
|
238
251
|
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import "../../../chunk-PKUHTIDK.js";
|
|
2
|
+
import fastdomSingleton from "./singleton";
|
|
3
|
+
const create = (promised, type, fn, ctx) => {
|
|
4
|
+
const tasks = promised._tasks;
|
|
5
|
+
const fastdom = promised.fastdom;
|
|
6
|
+
let task;
|
|
7
|
+
const promise = new Promise(function(resolve, reject) {
|
|
8
|
+
task = fastdom[type](function() {
|
|
9
|
+
tasks.delete(promise);
|
|
10
|
+
try {
|
|
11
|
+
resolve(ctx ? fn.call(ctx) : fn());
|
|
12
|
+
} catch (e) {
|
|
13
|
+
reject(e);
|
|
14
|
+
}
|
|
15
|
+
}, ctx);
|
|
16
|
+
});
|
|
17
|
+
tasks.set(promise, task);
|
|
18
|
+
return promise;
|
|
19
|
+
};
|
|
20
|
+
const exports = {
|
|
21
|
+
initialize() {
|
|
22
|
+
this._tasks = /* @__PURE__ */ new Map();
|
|
23
|
+
},
|
|
24
|
+
mutate(fn, ctx) {
|
|
25
|
+
return create(this, "mutate", fn, ctx);
|
|
26
|
+
},
|
|
27
|
+
measure(fn, ctx) {
|
|
28
|
+
return create(this, "measure", fn, ctx);
|
|
29
|
+
},
|
|
30
|
+
clear(promise) {
|
|
31
|
+
const tasks = this._tasks;
|
|
32
|
+
const task = tasks.get(promise);
|
|
33
|
+
this.fastdom.clear(task);
|
|
34
|
+
tasks.delete(promise);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
const fastdomAsync = fastdomSingleton.extend(exports);
|
|
38
|
+
var async_default = fastdomAsync;
|
|
39
|
+
export {
|
|
40
|
+
async_default as default
|
|
41
|
+
};
|