@opentiny/vue-renderless 3.6.8 → 3.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/action-sheet/index.js +28 -1
- package/action-sheet/vue.js +10 -4
- package/alert/index.js +24 -2
- package/alert/vue.js +15 -11
- package/amount/index.js +4 -4
- package/anchor/index.js +1 -1
- package/autocomplete/vue.js +3 -3
- package/autonavi-map/index.js +1 -1
- package/badge/vue.js +6 -6
- package/baidu-map/index.js +1 -1
- package/bulletin-board/index.js +1 -1
- package/button-group/vue.js +5 -4
- package/calendar/index.js +2 -2
- package/calendar-bar/index.js +268 -0
- package/calendar-bar/vue.js +87 -0
- package/card/index.js +84 -0
- package/card/vue.js +70 -0
- package/card-group/index.js +16 -0
- package/card-group/vue.js +21 -0
- package/card-template/index.js +1 -1
- package/carousel/index.js +89 -2
- package/carousel/vue.js +14 -5
- package/carousel-item/index.js +8 -0
- package/carousel-item/vue.js +7 -3
- package/cascader/index.js +6 -6
- package/cascader/vue.js +3 -3
- package/cascader-menu/vue.js +2 -2
- package/cascader-panel/index.js +4 -4
- package/cascader-panel/node.js +4 -4
- package/cascader-panel/vue.js +2 -2
- package/cascader-select/index.js +179 -0
- package/cascader-select/vue.js +74 -0
- package/cell/vue.js +16 -0
- package/chart-bar/index.js +3 -3
- package/chart-boxplot/index.js +2 -2
- package/chart-candle/index.js +3 -3
- package/chart-core/deps/utils.js +7 -7
- package/chart-core/index.js +2 -2
- package/chart-funnel/index.js +3 -3
- package/chart-gauge/index.js +3 -3
- package/chart-graph/index.js +1 -1
- package/chart-heatmap/index.js +2 -2
- package/chart-line/index.js +3 -3
- package/chart-liquidfill/index.js +2 -2
- package/chart-map/index.js +3 -3
- package/chart-pie/index.js +3 -3
- package/chart-radar/index.js +3 -3
- package/chart-sankey/index.js +3 -3
- package/chart-scatter/index.js +4 -4
- package/chart-sunburst/index.js +1 -1
- package/chart-tree/index.js +2 -2
- package/chart-waterfall/index.js +3 -3
- package/chart-wordcloud/index.js +2 -2
- package/checkbox/index.js +21 -0
- package/checkbox/vue.js +16 -3
- package/checkbox-button/vue.js +1 -1
- package/collapse-item/vue.js +1 -1
- package/column-list-group/index.js +0 -0
- package/column-list-group/vue.js +14 -0
- package/column-list-item/index.js +50 -0
- package/column-list-item/vue.js +39 -0
- package/common/array.js +3 -3
- package/common/bigInt.js +5 -2
- package/common/dataset/index.js +3 -3
- package/common/date.js +2 -2
- package/common/deps/ResizeObserver.js +1 -1
- package/common/deps/clickoutside.js +1 -1
- package/common/deps/date-util.js +4 -4
- package/common/deps/date.js +2 -2
- package/common/deps/debounce.js +1 -1
- package/common/deps/dom.js +1 -1
- package/common/deps/fullscreen/apis.js +3 -3
- package/common/deps/fullscreen/screenfull.js +1 -1
- package/common/deps/infinite-scroll.js +176 -0
- package/common/deps/letter-only.js +1 -1
- package/common/deps/number-only.js +1 -1
- package/common/deps/observe-visibility.js +106 -0
- package/common/deps/popper.js +20 -22
- package/common/deps/popup-manager.js +2 -2
- package/common/deps/repeat-click.js +1 -1
- package/common/deps/resize-event.js +1 -1
- package/common/deps/tree-model/node.js +5 -5
- package/common/deps/tree-model/tree-store.js +3 -3
- package/common/deps/upload-ajax.js +2 -2
- package/common/deps/vue-popper.js +6 -6
- package/common/deps/vue-popup.js +4 -4
- package/common/index.js +2 -2
- package/common/object.js +1 -1
- package/common/runtime.js +24 -24
- package/common/string.js +23 -4
- package/common/validate/rules/range.js +2 -2
- package/common/validate/rules/required.js +1 -1
- package/common/validate/rules/type.js +3 -3
- package/common/validate/schema.js +1 -1
- package/common/validate/util.js +1 -1
- package/common/validate/validations/array.js +1 -1
- package/common/validate/validations/date.js +1 -1
- package/common/validate/validations/enum.js +1 -1
- package/common/validate/validations/float.js +1 -1
- package/common/validate/validations/integer.js +1 -1
- package/common/validate/validations/method.js +1 -1
- package/common/validate/validations/number.js +1 -1
- package/common/validate/validations/pattern.js +1 -1
- package/common/validate/validations/string.js +1 -1
- package/common/validate/validations/type.js +1 -1
- package/container/index.js +1 -1
- package/crop/index.js +2 -2
- package/currency/index.js +2 -2
- package/date-panel/index.js +7 -7
- package/date-panel/vue.js +3 -2
- package/date-picker-mobile/index.js +250 -0
- package/date-picker-mobile/vue.js +86 -0
- package/date-range/index.js +1 -1
- package/date-range/vue.js +1 -1
- package/date-table/index.js +3 -3
- package/date-table/vue.js +1 -1
- package/dialog-box/index.js +6 -4
- package/dialog-box/vue.js +1 -1
- package/dialog-select/index.js +345 -0
- package/dialog-select/vue.js +110 -0
- package/drawer/index.js +83 -0
- package/drawer/vue.js +51 -0
- package/drop-times/index.js +1 -1
- package/dropdown/index.js +2 -2
- package/dropdown/vue.js +4 -3
- package/dropdown-item/index.js +5 -1
- package/dropdown-item/mf.js +79 -0
- package/dropdown-item/vue.js +9 -6
- package/dropdown-menu/index.js +30 -1
- package/dropdown-menu/vue.js +17 -7
- package/dynamic-scroller/index.js +117 -0
- package/dynamic-scroller/vue.js +88 -0
- package/dynamic-scroller-item/index.js +147 -0
- package/dynamic-scroller-item/vue.js +92 -0
- package/espace/index.js +1 -1
- package/espace/vue.js +1 -1
- package/exception/vue.js +3 -1
- package/fall-menu/index.js +4 -4
- package/file-upload/index.js +872 -408
- package/file-upload/vue.js +87 -36
- package/filter/index.js +131 -0
- package/filter/tag-group.js +43 -0
- package/filter/vue.js +73 -0
- package/filter-bar/index.js +9 -0
- package/filter-bar/vue.js +16 -0
- package/filter-box/index.js +17 -0
- package/filter-box/vue.js +19 -0
- package/filter-panel/index.js +42 -0
- package/filter-panel/vue.js +33 -0
- package/floatbar/index.js +1 -1
- package/flowchart/index.js +721 -0
- package/flowchart/vue.js +81 -0
- package/form/index.js +15 -1
- package/form/vue.js +10 -4
- package/form-item/index.js +46 -6
- package/form-item/vue.js +27 -3
- package/fullscreen/index.js +1 -1
- package/fullscreen/vue.js +1 -1
- package/grid/plugins/export.js +2 -2
- package/grid/plugins/exportExcel.js +2 -2
- package/grid/plugins/resize.js +1 -1
- package/grid/static/base/helperEqualCompare.js +1 -1
- package/grid/static/base/isPlainObject.js +1 -1
- package/grid/utils/common.js +3 -3
- package/grid/utils/dom.js +3 -3
- package/grid/utils/event.js +2 -2
- package/guide/index.js +168 -0
- package/guide/vue.js +36 -0
- package/hrapprover/index.js +1 -1
- package/image/index.js +8 -4
- package/image/vue.js +12 -6
- package/image-viewer/index.js +3 -3
- package/image-viewer/vue.js +16 -6
- package/input/index.js +34 -1
- package/input/vue.js +22 -6
- package/ip-address/index.js +1 -1
- package/ip-address/vue.js +1 -1
- package/link-menu/index.js +2 -2
- package/link-menu/vue.js +2 -2
- package/loading/index.js +2 -2
- package/loading/vue.js +2 -1
- package/locales/index.js +1 -1
- package/logout/index.js +1 -1
- package/milestone/index.js +5 -1
- package/modal/index.js +68 -39
- package/modal/vue.js +15 -12
- package/month-range/index.js +1 -1
- package/month-range/vue.js +1 -1
- package/month-table/index.js +5 -5
- package/month-table/vue.js +1 -1
- package/multi-select/index.js +5 -2
- package/multi-select/vue.js +4 -5
- package/nav-menu/index.js +6 -6
- package/notify/index.js +3 -3
- package/numeric/index.js +15 -5
- package/numeric/vue.js +15 -6
- package/option/index.js +1 -1
- package/package.json +2 -1
- package/pager/vue.js +10 -0
- package/pager-item/index.js +1 -1
- package/panel/index.js +1 -1
- package/picker/index.js +7 -7
- package/picker/vue.js +1 -1
- package/picker-column/index.js +1 -1
- package/popconfirm/index.js +25 -0
- package/popconfirm/vue.js +22 -0
- package/popeditor/index.js +7 -7
- package/popeditor/vue.js +2 -2
- package/popover/index.js +11 -3
- package/popover/vue.js +33 -10
- package/popup/index.js +4 -4
- package/pull-refresh/index.js +8 -11
- package/pull-refresh/vue.js +7 -7
- package/radio/index.js +17 -0
- package/radio/vue.js +18 -3
- package/radio-button/index.js +8 -0
- package/radio-button/vue.js +19 -4
- package/radio-group/index.js +1 -1
- package/radio-group/vue.js +5 -2
- package/rate/index.js +4 -2
- package/rate/vue.js +1 -1
- package/record/index.js +190 -0
- package/record/vue.js +44 -0
- package/recycle-scroller/index.js +470 -0
- package/recycle-scroller/vue.js +135 -0
- package/river/index.js +371 -0
- package/river/river.js +352 -0
- package/river/vue.js +77 -0
- package/roles/index.js +1 -1
- package/scrollbar/vue-bar.js +1 -1
- package/scrollbar/vue.js +1 -1
- package/search/index.js +3 -3
- package/select/index.js +21 -14
- package/select/vue.js +38 -15
- package/select-dropdown/vue.js +1 -1
- package/select-mobile/index.js +111 -0
- package/select-mobile/vue.js +58 -0
- package/select-view/index.js +170 -0
- package/select-view/vue.js +82 -0
- package/selected-box/index.js +216 -0
- package/selected-box/vue.js +98 -0
- package/slide-bar/index.js +1 -1
- package/slider/index.js +49 -4
- package/slider/vue.js +15 -4
- package/split/vue.js +1 -1
- package/standard-list-item/index.js +18 -0
- package/standard-list-item/vue.js +22 -0
- package/steps/index.js +30 -0
- package/steps/slide-bar.js +122 -0
- package/steps/vue.js +15 -3
- package/switch/index.js +1 -1
- package/switch/vue.js +2 -1
- package/tab-bar/index.js +2 -2
- package/tab-item/index.js +3 -3
- package/tab-item/vue.js +4 -3
- package/tab-item-mf/index.js +0 -0
- package/tab-item-mf/vue.js +16 -0
- package/tab-nav/index.js +78 -4
- package/tab-nav/vue.js +11 -3
- package/tabbar-item/index.js +1 -1
- package/tabbar-item/vue.js +1 -1
- package/tabs/index.js +8 -9
- package/tabs/vue.js +1 -1
- package/tabs-mf/index.js +109 -0
- package/tabs-mf/vue-bar.js +49 -0
- package/tabs-mf/vue-nav-item.js +22 -0
- package/tabs-mf/vue-nav.js +13 -0
- package/tabs-mf/vue.js +45 -0
- package/tabs-mf/wheel.js +71 -0
- package/tag/index.js +8 -2
- package/tag/vue.js +13 -5
- package/tag-group/index.js +24 -0
- package/tag-group/vue.js +29 -0
- package/tall-storage/index.js +1 -1
- package/tall-storage/vue.js +1 -1
- package/time/index.js +1 -1
- package/time/vue.js +2 -2
- package/time-line/index.js +28 -7
- package/time-line/vue.js +9 -4
- package/time-panel/index.js +2 -2
- package/time-panel/vue.js +1 -1
- package/time-picker-mobile/index.js +30 -0
- package/time-picker-mobile/vue.js +30 -0
- package/time-range/index.js +1 -1
- package/time-range/vue.js +1 -1
- package/time-spinner/index.js +2 -2
- package/time-spinner/vue.js +1 -1
- package/toggle-menu/index.js +2 -2
- package/toggle-menu/vue.js +1 -1
- package/tooltip/index.js +30 -3
- package/tooltip/vue.js +34 -13
- package/top-box/index.js +3 -3
- package/transfer/index.js +1 -1
- package/transfer-panel/index.js +2 -2
- package/tree/index.js +6 -6
- package/tree/vue.js +1 -1
- package/tree-node/index.js +1 -1
- package/upload/index.js +1 -1
- package/upload/vue.js +2 -2
- package/upload-dragger/index.js +5 -1
- package/upload-dragger/vue.js +9 -3
- package/upload-list/index.js +158 -8
- package/upload-list/vue.js +77 -25
- package/user/index.js +86 -70
- package/user/vue.js +15 -5
- package/user-account/vue.js +1 -1
- package/user-contact/index.js +49 -3
- package/user-contact/vue.js +17 -8
- package/user-head-group/vue.js +17 -0
- package/user-link/index.js +10 -2
- package/user-link/vue.js +11 -6
- package/wheel/index.js +1 -1
- package/wizard/index.js +3 -3
- package/year-range/index.js +125 -0
- package/year-range/vue.js +88 -0
- package/year-table/index.js +175 -11
- package/year-table/vue.js +17 -5
package/multi-select/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
import { cloneDeep } from "
|
|
2
|
+
import { cloneDeep } from "../chart-core/deps/utils";
|
|
3
3
|
const created = ({ props, state, refs, nextTick }) => () => {
|
|
4
4
|
nextTick(() => {
|
|
5
5
|
state.dataSource = cloneDeep(props.dataSource);
|
|
@@ -163,7 +163,10 @@ const getLabelsStyle = (state) => {
|
|
|
163
163
|
const over25Labels = state.labelLevelsInfo.filter((i) => i && !i.isOver25);
|
|
164
164
|
let widthInfo = over25Labels;
|
|
165
165
|
const len = state.dataSource.length;
|
|
166
|
-
if (
|
|
166
|
+
if (len >= 4) {
|
|
167
|
+
return getStyleConfig(state.labelLevelsInfo, { width: `${(1 / len * 100).toFixed(2)}%` });
|
|
168
|
+
}
|
|
169
|
+
if (!widthInfo.length || widthInfo.length === state.labelLevelsInfo.length) {
|
|
167
170
|
return getStyleConfig(state.labelLevelsInfo, { maxWidth: `${(1 / len * 100).toFixed(2)}%` });
|
|
168
171
|
}
|
|
169
172
|
let fillArr;
|
package/multi-select/vue.js
CHANGED
|
@@ -18,7 +18,7 @@ const api = [
|
|
|
18
18
|
"clickWheelItem",
|
|
19
19
|
"loadDefault"
|
|
20
20
|
];
|
|
21
|
-
const initState = (
|
|
21
|
+
const initState = (reactive) => {
|
|
22
22
|
const state = reactive({
|
|
23
23
|
dataSource: [],
|
|
24
24
|
wheelData: [],
|
|
@@ -30,8 +30,7 @@ const initState = ({ computed, reactive }) => {
|
|
|
30
30
|
wheelText: "",
|
|
31
31
|
headerInfo: [],
|
|
32
32
|
defaultSelectedIndexs: [],
|
|
33
|
-
defaultSelectedArray: []
|
|
34
|
-
isActive: computed(() => state.headerInfo.some((item) => item.isUP))
|
|
33
|
+
defaultSelectedArray: []
|
|
35
34
|
});
|
|
36
35
|
return state;
|
|
37
36
|
};
|
|
@@ -61,9 +60,9 @@ const initWatch = ({ watch, props, state, refs, nextTick }) => {
|
|
|
61
60
|
}
|
|
62
61
|
);
|
|
63
62
|
};
|
|
64
|
-
const renderless = (props, {
|
|
63
|
+
const renderless = (props, { onMounted, reactive, watch }, { emit, nextTick, refs }) => {
|
|
65
64
|
const api2 = {};
|
|
66
|
-
const state = initState(
|
|
65
|
+
const state = initState(reactive);
|
|
67
66
|
initApi({ api: api2, props, state, emit, nextTick, refs });
|
|
68
67
|
initWatch({ watch, props, state, refs, nextTick });
|
|
69
68
|
onMounted(() => {
|
package/nav-menu/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
import { isEmptyObject, isObject } from "
|
|
3
|
-
import PopupManager from "
|
|
4
|
-
import { mapTree } from "
|
|
5
|
-
import { transformTreeData } from "
|
|
6
|
-
import { on, off } from "
|
|
7
|
-
import { xss } from "
|
|
2
|
+
import { isEmptyObject, isObject } from "../common/type";
|
|
3
|
+
import PopupManager from "../common/deps/popup-manager";
|
|
4
|
+
import { mapTree } from "../grid/static";
|
|
5
|
+
import { transformTreeData } from "../common/array";
|
|
6
|
+
import { on, off } from "../common/deps/dom";
|
|
7
|
+
import { xss } from "../common/xss.js";
|
|
8
8
|
const { nextZIndex } = PopupManager;
|
|
9
9
|
const computedIsShowMore = ({ props, state }) => () => !/^(retract|fixed|hidden)$/.test(props.overflow) && state.more && state.more.length;
|
|
10
10
|
const computedPopClass = (state) => () => !state.showMore && state.subMenus && state.subMenus.length === 1 ? "single" : "";
|
package/notify/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
import { KEY_CODE } from "
|
|
3
|
-
import { on, off } from "
|
|
4
|
-
import PopupManager from "
|
|
2
|
+
import { KEY_CODE } from "../common";
|
|
3
|
+
import { on, off } from "../common/deps/dom";
|
|
4
|
+
import PopupManager from "../common/deps/popup-manager";
|
|
5
5
|
const startTimer = ({ api, state }) => () => {
|
|
6
6
|
if (state.duration > 0) {
|
|
7
7
|
state.timer = setTimeout(() => {
|
package/numeric/index.js
CHANGED
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
__spreadProps,
|
|
3
3
|
__spreadValues
|
|
4
4
|
} from "../chunk-PKUHTIDK.js";
|
|
5
|
-
import { formatNumber, roundFixed } from "
|
|
6
|
-
import { getMiniDecimal, lessEquals, equalsDecimal } from "
|
|
7
|
-
import { isNumber, isNull } from "
|
|
8
|
-
import { MOUSEDELTA } from "
|
|
9
|
-
import { on, off } from "
|
|
5
|
+
import { formatNumber, roundFixed } from "../common/decimal";
|
|
6
|
+
import { getMiniDecimal, lessEquals, equalsDecimal } from "../common/bigInt";
|
|
7
|
+
import { isNumber, isNull } from "../common/type";
|
|
8
|
+
import { MOUSEDELTA } from "../common";
|
|
9
|
+
import { on, off } from "../common/deps/dom";
|
|
10
10
|
const initService = (service) => {
|
|
11
11
|
const { utils = {} } = service || {};
|
|
12
12
|
const noopFn = () => null;
|
|
@@ -263,11 +263,21 @@ const getUnitPrecision = ({ service, props }) => {
|
|
|
263
263
|
rounding = isNumber(format.rounding) ? format.rounding : serFra.rounding;
|
|
264
264
|
return __spreadValues(__spreadValues(__spreadProps(__spreadValues({}, defaultFmt), { fraction, rounding }), serFmt), format);
|
|
265
265
|
};
|
|
266
|
+
const dispatchDisplayedValue = ({ state, api, dispatch }) => () => {
|
|
267
|
+
if (state.isDisplayOnly) {
|
|
268
|
+
dispatch("FormItem", "displayed-value-changed", { type: "numeric", val: api.getDisplayedValue() });
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
const getDisplayedValue = ({ state, props }) => () => {
|
|
272
|
+
return state.displayValue || state.displayValue === 0 ? state.displayValue + " " + (props.unit || "") : "-";
|
|
273
|
+
};
|
|
266
274
|
export {
|
|
267
275
|
decrease,
|
|
276
|
+
dispatchDisplayedValue,
|
|
268
277
|
displayValue,
|
|
269
278
|
focus,
|
|
270
279
|
getDecimal,
|
|
280
|
+
getDisplayedValue,
|
|
271
281
|
getNumPecision,
|
|
272
282
|
getPrecision,
|
|
273
283
|
getUnitPrecision,
|
package/numeric/vue.js
CHANGED
|
@@ -22,7 +22,9 @@ import {
|
|
|
22
22
|
getUnitPrecision,
|
|
23
23
|
getDecimal,
|
|
24
24
|
unmounted,
|
|
25
|
-
initService
|
|
25
|
+
initService,
|
|
26
|
+
dispatchDisplayedValue,
|
|
27
|
+
getDisplayedValue
|
|
26
28
|
} from "./index";
|
|
27
29
|
const api = ["state", "decrease", "increase", "handleBlur", "handleFocus", "handleInput", "handleInputChange", "mouseEvent", "focus", "select"];
|
|
28
30
|
const initState = ({ reactive, computed, props, api: api2, $service, parent }) => {
|
|
@@ -42,7 +44,8 @@ const initState = ({ reactive, computed, props, api: api2, $service, parent }) =
|
|
|
42
44
|
minDisabled: computed(() => !props.circulate && api2.internalDecrease({ val: props.modelValue, step: props.step }) < props.min || state.formDisabled),
|
|
43
45
|
maxDisabled: computed(() => !props.circulate && api2.internalIncrease({ val: props.modelValue, step: props.step }) > props.max || state.formDisabled),
|
|
44
46
|
controlsAtRight: computed(() => props.controls && props.controlsPosition === "right"),
|
|
45
|
-
format: computed(() => getUnitPrecision({ service: $service, props }))
|
|
47
|
+
format: computed(() => getUnitPrecision({ service: $service, props })),
|
|
48
|
+
isDisplayOnly: computed(() => props.displayOnly || (parent.tinyForm || {}).displayOnly)
|
|
46
49
|
});
|
|
47
50
|
return state;
|
|
48
51
|
};
|
|
@@ -69,12 +72,15 @@ const initApi = ({ api: api2, props, state, parent, refs, emit, dispatch, consta
|
|
|
69
72
|
mouseEvent: mouseEvent({ api: api2, props, state }),
|
|
70
73
|
handleBlur: handleBlur({ constants, dispatch, emit, props, state, api: api2 }),
|
|
71
74
|
watchValue: watchValue({ api: api2, state }),
|
|
72
|
-
setCurrentValue: setCurrentValue({ api: api2, constants, dispatch, emit, props, state })
|
|
75
|
+
setCurrentValue: setCurrentValue({ api: api2, constants, dispatch, emit, props, state }),
|
|
76
|
+
dispatchDisplayedValue: dispatchDisplayedValue({ api: api2, state, dispatch }),
|
|
77
|
+
getDisplayedValue: getDisplayedValue({ state, props })
|
|
73
78
|
});
|
|
74
79
|
api2.getDecimal(0);
|
|
75
80
|
};
|
|
76
|
-
const initWatch = ({ watch, props, api: api2 }) => {
|
|
81
|
+
const initWatch = ({ state, watch, props, api: api2 }) => {
|
|
77
82
|
watch(() => props.modelValue, api2.watchValue, { immediate: true });
|
|
83
|
+
watch(() => state.isDisplayOnly, api2.dispatchDisplayedValue);
|
|
78
84
|
};
|
|
79
85
|
const renderless = (props, { computed, onMounted, onUpdated, onUnmounted, reactive, watch, inject }, { parent, emit, refs, constants, dispatch, service }) => {
|
|
80
86
|
const api2 = {};
|
|
@@ -82,8 +88,11 @@ const renderless = (props, { computed, onMounted, onUpdated, onUnmounted, reacti
|
|
|
82
88
|
const state = initState({ reactive, computed, props, api: api2, $service, parent });
|
|
83
89
|
parent.tinyForm = parent.tinyForm || inject("form", null);
|
|
84
90
|
initApi({ api: api2, props, state, parent, refs, emit, dispatch, constants });
|
|
85
|
-
initWatch({ watch, props, api: api2 });
|
|
86
|
-
onMounted(
|
|
91
|
+
initWatch({ state, watch, props, api: api2 });
|
|
92
|
+
onMounted(() => {
|
|
93
|
+
api2.dispatchDisplayedValue();
|
|
94
|
+
api2.mounted();
|
|
95
|
+
});
|
|
87
96
|
onUpdated(api2.updated);
|
|
88
97
|
onUnmounted(api2.unmounted);
|
|
89
98
|
return api2;
|
package/option/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
import { getObj } from "
|
|
2
|
+
import { getObj } from "../common/object";
|
|
3
3
|
const escapeRegexpString = (value = "") => String(value).replace(/[|\\{}()[\]^$+*?.]/g, "\\$&");
|
|
4
4
|
const isEqual = ({ select, state }) => (a, b) => {
|
|
5
5
|
if (!state.isObject) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentiny/vue-renderless",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.8.2",
|
|
4
4
|
"description": "An enterprise-class UI component library, support both Vue.js 2 and Vue.js 3, as well as PC and mobile.",
|
|
5
5
|
"homepage": "https://opentiny.design/tiny-vue",
|
|
6
6
|
"keywords": [
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"sideEffects": false,
|
|
20
20
|
"scripts": {
|
|
21
21
|
"build": "tsup",
|
|
22
|
+
"build:fast": "npm run build && npm run release",
|
|
22
23
|
"postversion": "pnpm build",
|
|
23
24
|
"release": "esno ./scripts/postbuild.ts && cp README.md dist"
|
|
24
25
|
},
|
package/pager/vue.js
ADDED
package/pager-item/index.js
CHANGED
|
@@ -88,7 +88,7 @@ const onPagerClick = ({ emit, props, vm }) => (event) => {
|
|
|
88
88
|
};
|
|
89
89
|
if (props.isBeforePageChange && newPage !== currentPage) {
|
|
90
90
|
let params = { newPage, currentPage, callback };
|
|
91
|
-
vm.$parent.beforePagerChangeHandler(params);
|
|
91
|
+
vm.$parent.$parent.beforePagerChangeHandler(params);
|
|
92
92
|
} else {
|
|
93
93
|
callback();
|
|
94
94
|
}
|
package/panel/index.js
CHANGED
package/picker/index.js
CHANGED
|
@@ -2,13 +2,13 @@ import {
|
|
|
2
2
|
__spreadProps,
|
|
3
3
|
__spreadValues
|
|
4
4
|
} from "../chunk-PKUHTIDK.js";
|
|
5
|
-
import { toDate, getDateWithNewTimezone, getStrTimezone, getLocalTimezone } from "
|
|
6
|
-
import { isNumber, isDate } from "
|
|
7
|
-
import userPopper from "
|
|
8
|
-
import { DATEPICKER } from "
|
|
9
|
-
import { formatDate, parseDate, isDateObject, getWeekNumber } from "
|
|
10
|
-
import { extend } from "
|
|
11
|
-
import globalTimezone from "
|
|
5
|
+
import { toDate, getDateWithNewTimezone, getStrTimezone, getLocalTimezone } from "../common/date";
|
|
6
|
+
import { isNumber, isDate } from "../common/type";
|
|
7
|
+
import userPopper from "../common/deps/vue-popper";
|
|
8
|
+
import { DATEPICKER } from "../common";
|
|
9
|
+
import { formatDate, parseDate, isDateObject, getWeekNumber } from "../common/deps/date-util";
|
|
10
|
+
import { extend } from "../common/object";
|
|
11
|
+
import globalTimezone from "../picker/timezone";
|
|
12
12
|
const iso8601Reg = /^\d{4}-\d{2}-\d{2}(.)\d{2}:\d{2}:\d{2}(.+)$/;
|
|
13
13
|
const getPanel = ({ DatePanel, DateRangePanel, MonthRangePanel, TimePanel, TimeRangePanel, TimeSelect }) => (type) => {
|
|
14
14
|
if (type === DATEPICKER.DateRange || type === DATEPICKER.DateTimeRange) {
|
package/picker/vue.js
CHANGED
package/picker-column/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
import { on, off } from "
|
|
2
|
+
import { on, off } from "../common/deps/dom";
|
|
3
3
|
const computedWrapperStyle = (state) => () => {
|
|
4
4
|
const wrapperStyle = {
|
|
5
5
|
transform: `translate3d(0, ${state.offset + state.baseOffset}px, 0)`,
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import "../chunk-PKUHTIDK.js";
|
|
2
|
+
const hide = ({ state, emit }) => () => {
|
|
3
|
+
state.isLock = true;
|
|
4
|
+
setTimeout(() => {
|
|
5
|
+
state.isLock = false;
|
|
6
|
+
}, 300);
|
|
7
|
+
state.showPopover = false;
|
|
8
|
+
emit("hide", state);
|
|
9
|
+
};
|
|
10
|
+
const show = ({ state, emit, props }) => (trigger) => {
|
|
11
|
+
if (trigger && props.trigger !== trigger || state.isLock || state.showPopover) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
state.showPopover = true;
|
|
15
|
+
emit("show", state);
|
|
16
|
+
};
|
|
17
|
+
const confirm = ({ state, emit }) => () => {
|
|
18
|
+
state.showPopover = false;
|
|
19
|
+
emit("confirm", state);
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
confirm,
|
|
23
|
+
hide,
|
|
24
|
+
show
|
|
25
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import "../chunk-PKUHTIDK.js";
|
|
2
|
+
import { show, hide, confirm } from "./index";
|
|
3
|
+
const api = ["state", "show", "hide", "confirm"];
|
|
4
|
+
const renderless = (props, { computed, reactive }, { emit, constants }) => {
|
|
5
|
+
const api2 = {};
|
|
6
|
+
const state = reactive({
|
|
7
|
+
isLock: false,
|
|
8
|
+
showPopover: false,
|
|
9
|
+
getIcon: computed(() => typeof props.type === "object" ? props.type : constants.ICON_MAP[props.type])
|
|
10
|
+
});
|
|
11
|
+
Object.assign(api2, {
|
|
12
|
+
state,
|
|
13
|
+
show: show({ state, emit, props }),
|
|
14
|
+
hide: hide({ state, emit }),
|
|
15
|
+
confirm: confirm({ state, emit })
|
|
16
|
+
});
|
|
17
|
+
return api2;
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
api,
|
|
21
|
+
renderless
|
|
22
|
+
};
|
package/popeditor/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__spreadValues
|
|
3
3
|
} from "../chunk-PKUHTIDK.js";
|
|
4
|
-
import { find } from "
|
|
5
|
-
import { typeOf, isNull } from "
|
|
6
|
-
import { getDataset } from "
|
|
7
|
-
import { isNullOrEmpty } from "
|
|
8
|
-
import { isEqual } from "
|
|
9
|
-
import { eachTree } from "
|
|
10
|
-
import { on, off } from "
|
|
4
|
+
import { find } from "../common/array";
|
|
5
|
+
import { typeOf, isNull } from "../common/type";
|
|
6
|
+
import { getDataset } from "../common/dataset";
|
|
7
|
+
import { isNullOrEmpty } from "../common/string";
|
|
8
|
+
import { isEqual } from "../common/object";
|
|
9
|
+
import { eachTree } from "../grid/static";
|
|
10
|
+
import { on, off } from "../common/deps/dom";
|
|
11
11
|
const computedGetTitle = ({ constants, props, t }) => props.title || t(constants.TITLE);
|
|
12
12
|
const computedModalWidth = ({ constants, props }) => {
|
|
13
13
|
let modalWidth = 0;
|
package/popeditor/vue.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__spreadValues
|
|
3
3
|
} from "../chunk-PKUHTIDK.js";
|
|
4
|
-
import debounce from "
|
|
5
|
-
import userPopper from "
|
|
4
|
+
import debounce from "../common/deps/debounce";
|
|
5
|
+
import userPopper from "../common/deps/vue-popper";
|
|
6
6
|
import {
|
|
7
7
|
computedGetTitle,
|
|
8
8
|
computedTreeOp,
|
package/popover/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
import { on, off, addClass, removeClass } from "
|
|
3
|
-
import { guid } from "
|
|
4
|
-
import { KEY_CODE } from "
|
|
2
|
+
import { on, off, addClass, removeClass } from "../common/deps/dom";
|
|
3
|
+
import { guid } from "../common/string";
|
|
4
|
+
import { KEY_CODE } from "../common";
|
|
5
5
|
const processTrigger = ({ api, state, props, nextTick }) => {
|
|
6
6
|
const { referenceElm, popperElm } = state;
|
|
7
7
|
if (props.trigger === "click") {
|
|
@@ -155,6 +155,13 @@ const wrapMounted = ({ api, props, refs, state }) => () => {
|
|
|
155
155
|
}
|
|
156
156
|
state.referenceElm && api.mounted();
|
|
157
157
|
};
|
|
158
|
+
const observeCallback = ({ state, vm }) => (mutationsList) => {
|
|
159
|
+
for (let mutation of mutationsList) {
|
|
160
|
+
if (mutation.type === "attributes" && mutation.attributeName === "x-placement") {
|
|
161
|
+
state.xPlacement = vm.$refs.popper.getAttribute("x-placement") || "bottom";
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
};
|
|
158
165
|
export {
|
|
159
166
|
cleanup,
|
|
160
167
|
computedTooltipId,
|
|
@@ -173,5 +180,6 @@ export {
|
|
|
173
180
|
handleMouseEnter,
|
|
174
181
|
handleMouseLeave,
|
|
175
182
|
mounted,
|
|
183
|
+
observeCallback,
|
|
176
184
|
wrapMounted
|
|
177
185
|
};
|
package/popover/vue.js
CHANGED
|
@@ -17,9 +17,10 @@ import {
|
|
|
17
17
|
handleDocumentClick,
|
|
18
18
|
cleanup,
|
|
19
19
|
wrapMounted,
|
|
20
|
-
handleItemClick
|
|
20
|
+
handleItemClick,
|
|
21
|
+
observeCallback
|
|
21
22
|
} from "./index";
|
|
22
|
-
import userPopper from "
|
|
23
|
+
import userPopper from "../common/deps/vue-popper";
|
|
23
24
|
const api = ["state", "handleAfterEnter", "handleAfterLeave", "handleItemClick"];
|
|
24
25
|
const initState = ({ reactive, computed, api: api2, popperElm, showPopper, referenceElm }) => {
|
|
25
26
|
const state = reactive({
|
|
@@ -32,7 +33,7 @@ const initState = ({ reactive, computed, api: api2, popperElm, showPopper, refer
|
|
|
32
33
|
});
|
|
33
34
|
return state;
|
|
34
35
|
};
|
|
35
|
-
const initApi = ({ api: api2, props, state, refs, emit, doDestroy, constants, nextTick }) => {
|
|
36
|
+
const initApi = ({ api: api2, props, state, refs, emit, doDestroy, constants, nextTick, vm }) => {
|
|
36
37
|
Object.assign(api2, {
|
|
37
38
|
state,
|
|
38
39
|
mounted: mounted({ api: api2, state, constants, props, nextTick }),
|
|
@@ -53,10 +54,11 @@ const initApi = ({ api: api2, props, state, refs, emit, doDestroy, constants, ne
|
|
|
53
54
|
handleMouseEnter: handleMouseEnter({ props, state }),
|
|
54
55
|
handleDocumentClick: handleDocumentClick({ refs, state }),
|
|
55
56
|
wrapMounted: wrapMounted({ api: api2, props, refs, state }),
|
|
56
|
-
handleItemClick: handleItemClick({ emit, state })
|
|
57
|
+
handleItemClick: handleItemClick({ emit, state }),
|
|
58
|
+
observeCallback: observeCallback({ vm, state })
|
|
57
59
|
});
|
|
58
60
|
};
|
|
59
|
-
const initWatch = ({ watch, props, state, emit }) => {
|
|
61
|
+
const initWatch = ({ watch, props, state, emit, api: api2, nextTick }) => {
|
|
60
62
|
watch(
|
|
61
63
|
() => state.showPopper,
|
|
62
64
|
(val) => {
|
|
@@ -67,23 +69,44 @@ const initWatch = ({ watch, props, state, emit }) => {
|
|
|
67
69
|
},
|
|
68
70
|
{ immediate: true }
|
|
69
71
|
);
|
|
72
|
+
watch(
|
|
73
|
+
() => props.reference,
|
|
74
|
+
(val, oldVal) => {
|
|
75
|
+
if (val !== oldVal) {
|
|
76
|
+
api2.destroyed();
|
|
77
|
+
nextTick(() => {
|
|
78
|
+
api2.wrapMounted();
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
);
|
|
70
83
|
};
|
|
71
|
-
const renderless = (props, { reactive, computed, watch, toRefs, onBeforeUnmount, onMounted, onUnmounted, onActivated, onDeactivated }, { $prefix, emit, refs, slots, nextTick }) => {
|
|
84
|
+
const renderless = (props, { reactive, computed, watch, toRefs, onBeforeUnmount, onMounted, onUnmounted, onActivated, onDeactivated }, { $prefix, emit, vm, refs, slots, nextTick }) => {
|
|
72
85
|
const api2 = {};
|
|
73
86
|
const constants = { IDPREFIX: `${$prefix.toLowerCase()}-popover` };
|
|
74
87
|
const options = { emit, onBeforeUnmount, nextTick, reactive, props, watch, onDeactivated, refs, slots, toRefs };
|
|
75
88
|
const { showPopper, popperElm, referenceElm, doDestroy } = userPopper(options);
|
|
76
89
|
const state = initState({ reactive, computed, api: api2, popperElm, showPopper, referenceElm });
|
|
77
|
-
initApi({ api: api2, constants, props, state, refs, emit, doDestroy, nextTick });
|
|
90
|
+
initApi({ api: api2, constants, props, state, refs, emit, doDestroy, nextTick, vm });
|
|
78
91
|
onDeactivated(() => {
|
|
79
92
|
api2.destroyed();
|
|
80
93
|
api2.cleanup();
|
|
81
94
|
});
|
|
82
|
-
onMounted(
|
|
95
|
+
onMounted(() => {
|
|
96
|
+
api2.wrapMounted();
|
|
97
|
+
if (props.genArrowByHtml) {
|
|
98
|
+
const config = { attributes: true, childList: false, subtree: false };
|
|
99
|
+
api2.observer = new MutationObserver(api2.observeCallback);
|
|
100
|
+
api2.observer.observe(vm.$refs.popper, config);
|
|
101
|
+
}
|
|
102
|
+
});
|
|
83
103
|
onActivated(api2.mounted);
|
|
84
|
-
onUnmounted(
|
|
104
|
+
onUnmounted(() => {
|
|
105
|
+
api2.destroyed();
|
|
106
|
+
api2.observer && api2.observer.disconnect();
|
|
107
|
+
});
|
|
85
108
|
onBeforeUnmount(api2.cleanup);
|
|
86
|
-
initWatch({ watch, props, state, emit });
|
|
109
|
+
initWatch({ watch, props, state, emit, api: api2, nextTick });
|
|
87
110
|
return api2;
|
|
88
111
|
};
|
|
89
112
|
export {
|
package/popup/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__spreadValues
|
|
3
3
|
} from "../chunk-PKUHTIDK.js";
|
|
4
|
-
import { on, off } from "
|
|
5
|
-
import { touchStart, touchMove } from "
|
|
6
|
-
import { getScroller } from "
|
|
7
|
-
import { isNull } from "
|
|
4
|
+
import { on, off } from "../common/deps/dom";
|
|
5
|
+
import { touchStart, touchMove } from "../common/deps/touch";
|
|
6
|
+
import { getScroller } from "../dropdown-menu";
|
|
7
|
+
import { isNull } from "../common/type";
|
|
8
8
|
const getStyle = (props) => () => {
|
|
9
9
|
const style = __spreadValues({}, props.popupStyle);
|
|
10
10
|
if (!isNull(props.duration)) {
|
package/pull-refresh/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
__spreadValues
|
|
3
3
|
} from "../chunk-PKUHTIDK.js";
|
|
4
|
-
import { on, off } from "
|
|
4
|
+
import { on, off } from "../common/deps/dom";
|
|
5
5
|
const initPullRefresh = ({ t, props, state }) => () => {
|
|
6
|
+
var _a, _b, _c;
|
|
6
7
|
const defaultOption = {
|
|
7
8
|
pullingUpText: t("ui.pullRefresh.pullingUp"),
|
|
8
9
|
pullingDownText: t("ui.pullRefresh.pullingDown"),
|
|
@@ -17,17 +18,16 @@ const initPullRefresh = ({ t, props, state }) => () => {
|
|
|
17
18
|
paddingTop: state.pullDown.headHeight + "px",
|
|
18
19
|
paddingBottom: state.pullUp.footHeight + "px"
|
|
19
20
|
};
|
|
21
|
+
state.loosingText = (_a = props.loosingText) != null ? _a : t("ui.pullRefresh.loosing");
|
|
22
|
+
state.successText = (_b = props.successText) != null ? _b : t("ui.pullRefresh.success");
|
|
23
|
+
state.failedText = (_c = props.failedText) != null ? _c : t("ui.pullRefresh.failed");
|
|
20
24
|
};
|
|
21
25
|
const onTouchstart = (state) => (event) => {
|
|
22
26
|
state.draggposition = event.touches[0].clientY;
|
|
23
27
|
};
|
|
24
|
-
const onTouchmove = ({ props, state
|
|
28
|
+
const onTouchmove = ({ props, state }) => (event) => {
|
|
25
29
|
if (event.touches[0].clientY < state.draggposition) {
|
|
26
|
-
|
|
27
|
-
if (scrollBottom > 10) {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
if (!state.pullUp.pullUpDisabled && state.pullUp.handler) {
|
|
30
|
+
if (!state.pullUp.pullUpDisabled) {
|
|
31
31
|
if (props.hasMore) {
|
|
32
32
|
state.translate3d = (event.touches[0].clientY - state.draggposition) / 2;
|
|
33
33
|
state.pullUpReplaces = Math.abs(state.translate3d) > state.pullUp.footHeight ? state.loosingText : state.pullUp.pullingUpText;
|
|
@@ -35,10 +35,7 @@ const onTouchmove = ({ props, state, refs }) => (event) => {
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
} else {
|
|
38
|
-
if (
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
if (!state.pullDown.pullDownDisabled && state.pullDown.handler) {
|
|
38
|
+
if (!state.pullDown.pullDownDisabled) {
|
|
42
39
|
state.translate3d = (event.touches[0].clientY - state.draggposition) / 2;
|
|
43
40
|
state.pullDownReplaces = Math.abs(state.translate3d) > state.pullDown.headHeight ? state.loosingText : state.pullDown.pullingDownText;
|
|
44
41
|
state.pullUpReplaces = "";
|
package/pull-refresh/vue.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
2
|
import { mountedHandler, beforeUnmountHandler, handlerModelValue, onTouchstart, onTouchmove, onTouchend, initPullRefresh, clearPullRefresh } from "./index";
|
|
3
3
|
const api = ["state"];
|
|
4
|
-
const renderless = (props, { watch, onMounted,
|
|
4
|
+
const renderless = (props, { watch, onMounted, reactive, onBeforeUnmount }, { t, refs }) => {
|
|
5
5
|
const api2 = {};
|
|
6
6
|
const state = reactive({
|
|
7
7
|
pullUpReplaces: "",
|
|
@@ -11,10 +11,10 @@ const renderless = (props, { watch, onMounted, computed, reactive, onBeforeUnmou
|
|
|
11
11
|
draggposition: 0,
|
|
12
12
|
pullUpLoading: false,
|
|
13
13
|
pullDownLoading: false,
|
|
14
|
-
loosingText:
|
|
15
|
-
successText:
|
|
16
|
-
failedText:
|
|
17
|
-
noMoreText:
|
|
14
|
+
loosingText: "",
|
|
15
|
+
successText: "",
|
|
16
|
+
failedText: "",
|
|
17
|
+
noMoreText: "",
|
|
18
18
|
pullUp: null,
|
|
19
19
|
pullDown: null,
|
|
20
20
|
successDuration: props.successDuration,
|
|
@@ -23,7 +23,7 @@ const renderless = (props, { watch, onMounted, computed, reactive, onBeforeUnmou
|
|
|
23
23
|
Object.assign(api2, {
|
|
24
24
|
state,
|
|
25
25
|
onTouchstart: onTouchstart(state),
|
|
26
|
-
onTouchmove: onTouchmove({ props, state
|
|
26
|
+
onTouchmove: onTouchmove({ props, state }),
|
|
27
27
|
onTouchend: onTouchend({ api: api2, props, state }),
|
|
28
28
|
mountedHandler: mountedHandler({ api: api2, refs }),
|
|
29
29
|
beforeUnmountHandler: beforeUnmountHandler({ api: api2, refs }),
|
|
@@ -35,7 +35,7 @@ const renderless = (props, { watch, onMounted, computed, reactive, onBeforeUnmou
|
|
|
35
35
|
() => props.hasMore,
|
|
36
36
|
(value) => {
|
|
37
37
|
if (!value) {
|
|
38
|
-
state.
|
|
38
|
+
state.noMoreText = t("ui.pullRefresh.noMore");
|
|
39
39
|
api2.clearPullRefresh();
|
|
40
40
|
}
|
|
41
41
|
}
|
package/radio/index.js
CHANGED
|
@@ -35,7 +35,24 @@ const toggleEvent = ({ props, refs, type }) => {
|
|
|
35
35
|
radioEl[type + "EventListener"](ev, props.events[ev]);
|
|
36
36
|
});
|
|
37
37
|
};
|
|
38
|
+
const dispatchDisplayedValue = ({ state, dispatch, api }) => () => {
|
|
39
|
+
if (state.isDisplayOnly) {
|
|
40
|
+
dispatch("FormItem", "displayed-value-changed", {
|
|
41
|
+
type: "radio",
|
|
42
|
+
val: api.getDisplayedValue()
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
const getDisplayedValue = ({ vm, state, props }) => () => {
|
|
47
|
+
if (state.model === props.label) {
|
|
48
|
+
return vm.$refs.label && vm.$refs.label.innerText || props.text || props.label;
|
|
49
|
+
} else {
|
|
50
|
+
return "";
|
|
51
|
+
}
|
|
52
|
+
};
|
|
38
53
|
export {
|
|
54
|
+
dispatchDisplayedValue,
|
|
55
|
+
getDisplayedValue,
|
|
39
56
|
getModel,
|
|
40
57
|
handleChange,
|
|
41
58
|
isDisabled,
|
package/radio/vue.js
CHANGED
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
import "../chunk-PKUHTIDK.js";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
handleChange,
|
|
4
|
+
isGroup,
|
|
5
|
+
radioSize,
|
|
6
|
+
isDisabled,
|
|
7
|
+
tabIndex,
|
|
8
|
+
getModel,
|
|
9
|
+
setModel,
|
|
10
|
+
toggleEvent,
|
|
11
|
+
dispatchDisplayedValue,
|
|
12
|
+
getDisplayedValue
|
|
13
|
+
} from "./index";
|
|
3
14
|
const api = ["state", "handleChange"];
|
|
4
|
-
const renderless = (props, { onMounted, onBeforeUnmount, computed, reactive, inject }, { refs, parent, emit, constants, nextTick, dispatch }) => {
|
|
15
|
+
const renderless = (props, { onMounted, onBeforeUnmount, computed, reactive, inject, watch }, { refs, vm, parent, emit, constants, nextTick, dispatch }) => {
|
|
5
16
|
parent.tinyForm = parent.tinyForm || inject("form", null);
|
|
6
17
|
const api2 = {};
|
|
7
18
|
const state = reactive({
|
|
@@ -25,9 +36,13 @@ const renderless = (props, { onMounted, onBeforeUnmount, computed, reactive, inj
|
|
|
25
36
|
tabIndex: tabIndex({ props, state }),
|
|
26
37
|
isDisabled: isDisabled({ props, state }),
|
|
27
38
|
setModel: setModel({ constants, dispatch, emit, props, refs, state }),
|
|
28
|
-
handleChange: handleChange({ constants, dispatch, emit, state, nextTick })
|
|
39
|
+
handleChange: handleChange({ constants, dispatch, emit, state, nextTick }),
|
|
40
|
+
dispatchDisplayedValue: dispatchDisplayedValue({ state, api: api2, dispatch }),
|
|
41
|
+
getDisplayedValue: getDisplayedValue({ vm, state, props })
|
|
29
42
|
});
|
|
43
|
+
watch(() => state.isDisplayOnly, api2.dispatchDisplayedValue);
|
|
30
44
|
onMounted(() => {
|
|
45
|
+
api2.dispatchDisplayedValue();
|
|
31
46
|
dispatch("Tooltip", "tooltip-update");
|
|
32
47
|
toggleEvent({ props, refs, type: "add" });
|
|
33
48
|
});
|