@nutui/nutui 3.1.22-beta.0 → 3.1.22-beta.3
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/nutui.es.js +4019 -19251
- package/dist/nutui.umd.js +4012 -19344
- package/dist/packages/_es/ActionSheet.js +26 -157
- package/dist/packages/_es/Address.js +119 -542
- package/dist/packages/_es/AddressList.js +113 -613
- package/dist/packages/_es/Audio.js +62 -264
- package/dist/packages/_es/AudioOperate.js +18 -107
- package/dist/packages/_es/Avatar.js +42 -165
- package/dist/packages/_es/AvatarGroup.js +14 -73
- package/dist/packages/_es/BackTop.js +43 -156
- package/dist/packages/_es/Badge.js +14 -86
- package/dist/packages/_es/Barrage.js +41 -120
- package/dist/packages/_es/Button.js +23 -128
- package/dist/packages/_es/Calendar.js +24 -237
- package/dist/packages/_es/CalendarItem.js +1 -1
- package/dist/packages/_es/Card.js +10 -107
- package/dist/packages/_es/Cascader.js +156 -500
- package/dist/packages/_es/Category.js +15 -58
- package/dist/packages/_es/CategoryPane.js +11 -111
- package/dist/packages/_es/Cell.js +21 -100
- package/dist/packages/_es/CellGroup.js +9 -44
- package/dist/packages/_es/Checkbox.js +31 -113
- package/dist/packages/_es/CheckboxGroup.js +29 -58
- package/dist/packages/_es/CircleProgress.js +28 -151
- package/dist/packages/_es/Col.js +14 -56
- package/dist/packages/_es/Collapse.js +24 -85
- package/dist/packages/_es/CollapseItem.js +70 -261
- package/dist/packages/_es/Comment.js +64 -434
- package/dist/packages/_es/CountDown.js +61 -242
- package/dist/packages/_es/CountUp.js +149 -546
- package/dist/packages/_es/DatePicker.js +107 -322
- package/dist/packages/_es/Dialog.js +69 -261
- package/dist/packages/_es/Divider.js +18 -68
- package/dist/packages/_es/Drag.js +56 -197
- package/dist/packages/_es/Ecard.js +24 -159
- package/dist/packages/_es/Elevator.js +63 -198
- package/dist/packages/_es/Empty.js +12 -71
- package/dist/packages/_es/FixedNav.js +15 -122
- package/dist/packages/_es/Form.js +64 -151
- package/dist/packages/_es/FormItem.js +15 -110
- package/dist/packages/_es/Grid.js +5 -6
- package/dist/packages/_es/GridItem.js +33 -144
- package/dist/packages/_es/Icon.js +15 -40
- package/dist/packages/_es/ImagePreview.js +74 -298
- package/dist/packages/_es/Indicator.js +15 -62
- package/dist/packages/_es/InfiniteLoading.js +66 -258
- package/dist/packages/_es/Input.js +51 -413
- package/dist/packages/_es/InputNumber.js +41 -160
- package/dist/packages/_es/Layout.js +4 -5
- package/dist/packages/_es/List.js +23 -110
- package/dist/packages/_es/Menu.js +30 -118
- package/dist/packages/_es/MenuItem.js +34 -162
- package/dist/packages/_es/Navbar.js +30 -192
- package/dist/packages/_es/NoticeBar.js +83 -387
- package/dist/packages/_es/Notify.js +81 -236
- package/dist/packages/_es/NumberKeyboard.js +41 -272
- package/dist/packages/_es/OldPicker.js +140 -464
- package/dist/packages/_es/OverLay.js +32 -105
- package/dist/packages/_es/Pagination.js +39 -157
- package/dist/packages/_es/Picker.js +138 -459
- package/dist/packages/_es/Popover.js +327 -965
- package/dist/packages/_es/Popup.js +64 -303
- package/dist/packages/_es/Price.js +16 -118
- package/dist/packages/_es/Progress.js +14 -146
- package/dist/packages/_es/PullRefresh.js +92 -346
- package/dist/packages/_es/Radio.js +22 -90
- package/dist/packages/_es/RadioGroup.js +8 -37
- package/dist/packages/_es/Range.js +92 -417
- package/dist/packages/_es/Rate.js +16 -139
- package/dist/packages/_es/Row.js +22 -64
- package/dist/packages/_es/SearchBar.js +46 -247
- package/dist/packages/_es/ShortPassword.js +35 -225
- package/dist/packages/_es/SideNavBar.js +33 -89
- package/dist/packages/_es/SideNavBarItem.js +11 -46
- package/dist/packages/_es/Signature.js +46 -165
- package/dist/packages/_es/Skeleton.js +20 -136
- package/dist/packages/_es/Sku.js +93 -499
- package/dist/packages/_es/Step.js +25 -119
- package/dist/packages/_es/Steps.js +18 -53
- package/dist/packages/_es/Sticky.js +53 -138
- package/dist/packages/_es/SubSideNavBar.js +26 -90
- package/dist/packages/_es/Swipe.js +46 -183
- package/dist/packages/_es/Swiper.js +121 -433
- package/dist/packages/_es/SwiperItem.js +22 -53
- package/dist/packages/_es/Switch.js +21 -116
- package/dist/packages/_es/TabPane.js +12 -39
- package/dist/packages/_es/Tabbar.js +17 -72
- package/dist/packages/_es/TabbarItem.js +29 -151
- package/dist/packages/_es/Table.js +27 -186
- package/dist/packages/_es/Tabs.js +51 -209
- package/dist/packages/_es/Tag.js +20 -97
- package/dist/packages/_es/TextArea.js +42 -160
- package/dist/packages/_es/TimeDetail.js +23 -84
- package/dist/packages/_es/TimePannel.js +19 -52
- package/dist/packages/_es/TimeSelect.js +15 -103
- package/dist/packages/_es/Toast.js +80 -319
- package/dist/packages/_es/Uploader.js +112 -460
- package/dist/packages/_es/Video.js +83 -340
- package/dist/packages/_es/common.js +38 -128
- package/dist/packages/_es/component.js +35 -76
- package/dist/packages/_es/index.js +5 -6
- package/dist/packages/_es/index2.js +9 -30
- package/dist/packages/_es/index3.js +6 -8
- package/dist/packages/_es/index4.js +13 -58
- package/dist/packages/_es/index5.js +120 -675
- package/dist/packages/_es/plugin-vue_export-helper.js +7 -8
- package/dist/packages/_es/pxCheck.js +3 -5
- package/dist/packages/_es/raf.js +8 -15
- package/dist/packages/button/index.scss +2 -1
- package/dist/packages/cell/index.scss +11 -0
- package/dist/packages/checkbox/index.scss +6 -0
- package/dist/packages/dialog/index.scss +1 -0
- package/dist/packages/elevator/index.scss +21 -0
- package/dist/packages/input/index.scss +13 -1
- package/dist/packages/locale/lang/baseLang.d.ts +1 -0
- package/dist/packages/locale/lang/baseLang.js +3 -3
- package/dist/packages/locale/lang/en-US.d.ts +8 -0
- package/dist/packages/locale/lang/en-US.js +5 -97
- package/dist/packages/locale/lang/id-ID.d.ts +8 -0
- package/dist/packages/locale/lang/id-ID.js +5 -97
- package/dist/packages/locale/lang/index.js +16 -38
- package/dist/packages/locale/lang/zh-CN.d.ts +8 -0
- package/dist/packages/locale/lang/zh-CN.js +5 -97
- package/dist/packages/locale/lang/zh-TW.d.ts +8 -0
- package/dist/packages/locale/lang/zh-TW.js +5 -97
- package/dist/packages/radio/index.scss +1 -0
- package/dist/packages/switch/index.scss +3 -3
- package/dist/packages/tabpane/index.scss +1 -0
- package/dist/smartips/attributes.json +62 -10
- package/dist/smartips/tags.json +17 -4
- package/dist/style.css +1 -1
- package/dist/styles/themes/default.scss +49 -49
- package/dist/styles/themes/jdb.scss +49 -49
- package/dist/styles/themes/jdt.scss +49 -49
- package/dist/styles/variables-jdb.scss +10 -1
- package/dist/styles/variables-jdt.scss +10 -1
- package/dist/styles/variables.scss +10 -1
- package/dist/types/__VUE/address/index.vue.d.ts +5 -5
- package/dist/types/__VUE/addresslist/components/ItemContents.vue.d.ts +1 -0
- package/dist/types/__VUE/audiooperate/index.vue.d.ts +1 -0
- package/dist/types/__VUE/avatar/index.vue.d.ts +4 -4
- package/dist/types/__VUE/backtop/index.vue.d.ts +2 -2
- package/dist/types/__VUE/badge/index.vue.d.ts +2 -2
- package/dist/types/__VUE/button/index.vue.d.ts +2 -2
- package/dist/types/__VUE/cascader/index.vue.d.ts +1 -1
- package/dist/types/__VUE/cell/index.vue.d.ts +11 -4
- package/dist/types/__VUE/checkbox/common.d.ts +59 -0
- package/dist/types/__VUE/checkbox/index.vue.d.ts +18 -5
- package/dist/types/__VUE/checkboxgroup/index.vue.d.ts +7 -0
- package/dist/types/__VUE/collapseitem/index.vue.d.ts +2 -2
- package/dist/types/__VUE/dialog/index.d.ts +9 -2
- package/dist/types/__VUE/dialog/index.vue.d.ts +23 -8
- package/dist/types/__VUE/ecard/index.vue.d.ts +3 -3
- package/dist/types/__VUE/elevator/index.vue.d.ts +29 -0
- package/dist/types/__VUE/empty/index.vue.d.ts +2 -2
- package/dist/types/__VUE/formitem/index.vue.d.ts +3 -10
- package/dist/types/__VUE/grid/index.vue.d.ts +4 -4
- package/dist/types/__VUE/griditem/index.vue.d.ts +1 -1
- package/dist/types/__VUE/input/index.vue.d.ts +2 -2
- package/dist/types/__VUE/noticebar/index.vue.d.ts +1 -1
- package/dist/types/__VUE/oldpicker/index.vue.d.ts +2 -2
- package/dist/types/__VUE/picker/index.vue.d.ts +2 -2
- package/dist/types/__VUE/popover/index.vue.d.ts +2 -2
- package/dist/types/__VUE/range/index.vue.d.ts +1 -1
- package/dist/types/__VUE/rate/index.vue.d.ts +2 -2
- package/dist/types/__VUE/row/index.vue.d.ts +2 -2
- package/dist/types/__VUE/shortpassword/index.vue.d.ts +2 -2
- package/dist/types/__VUE/step/index.vue.d.ts +2 -2
- package/dist/types/__VUE/switch/index.vue.d.ts +2 -2
- package/dist/types/__VUE/tabbaritem/index.vue.d.ts +2 -2
- package/dist/types/__VUE/timeselect/index.vue.d.ts +9 -2
- package/dist/types/__VUE/toast/index.vue.d.ts +3 -3
- package/dist/types/__VUE/uploader/index.vue.d.ts +2 -2
- package/dist/types/__VUE/video/index.vue.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -1
|
@@ -5,197 +5,38 @@ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
|
5
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
6
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
7
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (
|
|
9
|
-
for (var prop in
|
|
10
|
-
if (__hasOwnProp.call(
|
|
11
|
-
__defNormalProp(
|
|
8
|
+
var __spreadValues = (a2, b2) => {
|
|
9
|
+
for (var prop in b2 || (b2 = {}))
|
|
10
|
+
if (__hasOwnProp.call(b2, prop))
|
|
11
|
+
__defNormalProp(a2, prop, b2[prop]);
|
|
12
12
|
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(
|
|
14
|
-
if (__propIsEnum.call(
|
|
15
|
-
__defNormalProp(
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b2)) {
|
|
14
|
+
if (__propIsEnum.call(b2, prop))
|
|
15
|
+
__defNormalProp(a2, prop, b2[prop]);
|
|
16
16
|
}
|
|
17
|
-
return
|
|
17
|
+
return a2;
|
|
18
18
|
};
|
|
19
|
-
var __spreadProps = (
|
|
19
|
+
var __spreadProps = (a2, b2) => __defProps(a2, __getOwnPropDescs(b2));
|
|
20
20
|
/*!
|
|
21
|
-
* @nutui/nutui v3.1.22-beta.
|
|
21
|
+
* @nutui/nutui v3.1.22-beta.3 Wed Jun 15 2022 20:12:30 GMT+0800 (中国标准时间)
|
|
22
22
|
* (c) 2022 @jdf2e.
|
|
23
23
|
* Released under the MIT License.
|
|
24
24
|
*/
|
|
25
|
-
import { c as
|
|
26
|
-
import { h, reactive, computed, watch, toRefs, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, Fragment, renderList, createTextVNode, toDisplayString, renderSlot, createBlock, createCommentVNode } from "vue";
|
|
27
|
-
import { _ as
|
|
25
|
+
import { c as t } from "./component.js";
|
|
26
|
+
import { h as e, reactive as a, computed as s, watch as l, toRefs as r, resolveComponent as n, openBlock as o, createElementBlock as _, normalizeClass as u, createElementVNode as c, Fragment as i, renderList as d, createTextVNode as m, toDisplayString as p, renderSlot as y, createBlock as b, createCommentVNode as f } from "vue";
|
|
27
|
+
import { _ as v } from "./plugin-vue_export-helper.js";
|
|
28
28
|
import "../locale/lang";
|
|
29
|
-
var
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
props: {
|
|
44
|
-
bordered: {
|
|
45
|
-
type: Boolean,
|
|
46
|
-
default: true
|
|
47
|
-
},
|
|
48
|
-
columns: {
|
|
49
|
-
type: Array,
|
|
50
|
-
default: () => {
|
|
51
|
-
return [];
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
data: {
|
|
55
|
-
type: Object,
|
|
56
|
-
default: () => {
|
|
57
|
-
return {};
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
summary: {
|
|
61
|
-
type: Function,
|
|
62
|
-
default: null
|
|
63
|
-
},
|
|
64
|
-
striped: {
|
|
65
|
-
type: Boolean,
|
|
66
|
-
default: false
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
emits: ["sorter"],
|
|
70
|
-
setup(props, { emit, slots }) {
|
|
71
|
-
const state = reactive({
|
|
72
|
-
curData: props.data
|
|
73
|
-
});
|
|
74
|
-
const classes = computed(() => {
|
|
75
|
-
const prefixCls = componentName2;
|
|
76
|
-
return {
|
|
77
|
-
[prefixCls]: true
|
|
78
|
-
};
|
|
79
|
-
});
|
|
80
|
-
const cellClasses = (item) => {
|
|
81
|
-
return {
|
|
82
|
-
"nut-table__main__head__tr--border": props.bordered,
|
|
83
|
-
[`nut-table__main__head__tr--align${item.align ? item.align : ""}`]: true
|
|
84
|
-
};
|
|
85
|
-
};
|
|
86
|
-
const getColumnItem = (value) => {
|
|
87
|
-
return props.columns.filter((item) => item.key === value)[0];
|
|
88
|
-
};
|
|
89
|
-
const handleSorterClick = (item) => {
|
|
90
|
-
if (item.sorter) {
|
|
91
|
-
emit("sorter", item);
|
|
92
|
-
state.curData = typeof item.sorter === "function" ? state.curData.sort(item.sorter) : item.sorter === "default" ? state.curData.sort() : state.curData;
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
const sortDataItem = () => {
|
|
96
|
-
return props.columns.map((columns) => {
|
|
97
|
-
return [columns.key, columns.render];
|
|
98
|
-
});
|
|
99
|
-
};
|
|
100
|
-
watch(() => props.data, (val) => {
|
|
101
|
-
state.curData = val.slice();
|
|
102
|
-
});
|
|
103
|
-
return __spreadProps(__spreadValues({}, toRefs(state)), {
|
|
104
|
-
classes,
|
|
105
|
-
cellClasses,
|
|
106
|
-
getColumnItem,
|
|
107
|
-
handleSorterClick,
|
|
108
|
-
sortDataItem,
|
|
109
|
-
translate: translate2
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
};
|
|
114
|
-
const { componentName, create, translate } = createComponent("table");
|
|
115
|
-
const _sfc_main = create(component(componentName, translate));
|
|
116
|
-
const _hoisted_1 = { class: "nut-table__main__head" };
|
|
117
|
-
const _hoisted_2 = { class: "nut-table__main__head__tr" };
|
|
118
|
-
const _hoisted_3 = ["onClick"];
|
|
119
|
-
const _hoisted_4 = { class: "nut-table__main__body" };
|
|
120
|
-
const _hoisted_5 = { key: 1 };
|
|
121
|
-
const _hoisted_6 = {
|
|
122
|
-
key: 0,
|
|
123
|
-
class: "nut-table__summary"
|
|
124
|
-
};
|
|
125
|
-
const _hoisted_7 = ["innerHTML"];
|
|
126
|
-
const _hoisted_8 = {
|
|
127
|
-
key: 1,
|
|
128
|
-
class: "nut-table__nodata"
|
|
129
|
-
};
|
|
130
|
-
const _hoisted_9 = {
|
|
131
|
-
key: 0,
|
|
132
|
-
class: "nut-table__nodata__text"
|
|
133
|
-
};
|
|
134
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
135
|
-
const _component_nut_icon = resolveComponent("nut-icon");
|
|
136
|
-
const _component_RenderColumn = resolveComponent("RenderColumn");
|
|
137
|
-
return openBlock(), createElementBlock("view", {
|
|
138
|
-
class: normalizeClass(_ctx.classes)
|
|
139
|
-
}, [
|
|
140
|
-
createElementVNode("view", {
|
|
141
|
-
class: normalizeClass(["nut-table__main", { "nut-table__main--striped": _ctx.striped }])
|
|
142
|
-
}, [
|
|
143
|
-
createElementVNode("view", _hoisted_1, [
|
|
144
|
-
createElementVNode("view", _hoisted_2, [
|
|
145
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.columns, (item) => {
|
|
146
|
-
return openBlock(), createElementBlock("span", {
|
|
147
|
-
class: normalizeClass(["nut-table__main__head__tr__th", _ctx.cellClasses(item)]),
|
|
148
|
-
key: item.key,
|
|
149
|
-
onClick: ($event) => _ctx.handleSorterClick(item)
|
|
150
|
-
}, [
|
|
151
|
-
createTextVNode(toDisplayString(item.title) + " ", 1),
|
|
152
|
-
renderSlot(_ctx.$slots, "icon"),
|
|
153
|
-
!_ctx.$slots.icon && item.sorter ? (openBlock(), createBlock(_component_nut_icon, {
|
|
154
|
-
key: 0,
|
|
155
|
-
name: "down-arrow",
|
|
156
|
-
size: "12px"
|
|
157
|
-
})) : createCommentVNode("", true)
|
|
158
|
-
], 10, _hoisted_3);
|
|
159
|
-
}), 128))
|
|
160
|
-
])
|
|
161
|
-
]),
|
|
162
|
-
createElementVNode("view", _hoisted_4, [
|
|
163
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.curData, (item) => {
|
|
164
|
-
return openBlock(), createElementBlock("view", {
|
|
165
|
-
class: "nut-table__main__body__tr",
|
|
166
|
-
key: item
|
|
167
|
-
}, [
|
|
168
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.sortDataItem(), ([value, render]) => {
|
|
169
|
-
return openBlock(), createElementBlock("span", {
|
|
170
|
-
class: normalizeClass(["nut-table__main__body__tr__td", _ctx.cellClasses(_ctx.getColumnItem(value))]),
|
|
171
|
-
key: value
|
|
172
|
-
}, [
|
|
173
|
-
typeof item[value] === "function" || typeof render === "function" ? (openBlock(), createBlock(_component_RenderColumn, {
|
|
174
|
-
key: 0,
|
|
175
|
-
slots: [render, item[value]],
|
|
176
|
-
record: item
|
|
177
|
-
}, null, 8, ["slots", "record"])) : (openBlock(), createElementBlock("view", _hoisted_5, toDisplayString(item[value]), 1))
|
|
178
|
-
], 2);
|
|
179
|
-
}), 128))
|
|
180
|
-
]);
|
|
181
|
-
}), 128))
|
|
182
|
-
])
|
|
183
|
-
], 2),
|
|
184
|
-
_ctx.summary ? (openBlock(), createElementBlock("view", _hoisted_6, [
|
|
185
|
-
createElementVNode("span", {
|
|
186
|
-
class: "nut-table__summary__text",
|
|
187
|
-
innerHTML: _ctx.summary().value
|
|
188
|
-
}, null, 8, _hoisted_7)
|
|
189
|
-
])) : createCommentVNode("", true),
|
|
190
|
-
!_ctx.curData.length ? (openBlock(), createElementBlock("view", _hoisted_8, [
|
|
191
|
-
createElementVNode("div", {
|
|
192
|
-
class: normalizeClass(["nut-table__nodata", { "nut-table__nodata--border": _ctx.bordered }])
|
|
193
|
-
}, [
|
|
194
|
-
renderSlot(_ctx.$slots, "nodata"),
|
|
195
|
-
!_ctx.$slots.nodata ? (openBlock(), createElementBlock("div", _hoisted_9, toDisplayString(_ctx.translate("noData")), 1)) : createCommentVNode("", true)
|
|
196
|
-
], 2)
|
|
197
|
-
])) : createCommentVNode("", true)
|
|
198
|
-
], 2);
|
|
199
|
-
}
|
|
200
|
-
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
201
|
-
export { index as default };
|
|
29
|
+
var k = { setup: (t2) => () => e("view", {}, t2.slots[0] ? t2.slots[0](t2.record) : t2.slots[1](t2.record)), props: { slots: Array, record: Object } };
|
|
30
|
+
const { componentName: w, create: C, translate: D } = t("table"), h = C(((t2, e2) => ({ components: { RenderColumn: k }, props: { bordered: { type: Boolean, default: true }, columns: { type: Array, default: () => [] }, data: { type: Object, default: () => ({}) }, summary: { type: Function, default: null }, striped: { type: Boolean, default: false } }, emits: ["sorter"], setup(n2, { emit: o2, slots: _2 }) {
|
|
31
|
+
const u2 = a({ curData: n2.data }), c2 = s(() => ({ [t2]: true }));
|
|
32
|
+
return l(() => n2.data, (t3) => {
|
|
33
|
+
u2.curData = t3.slice();
|
|
34
|
+
}), __spreadProps(__spreadValues({}, r(u2)), { classes: c2, cellClasses: (t3) => ({ "nut-table__main__head__tr--border": n2.bordered, [`nut-table__main__head__tr--align${t3.align ? t3.align : ""}`]: true }), getColumnItem: (t3) => n2.columns.filter((e3) => e3.key === t3)[0], handleSorterClick: (t3) => {
|
|
35
|
+
t3.sorter && (o2("sorter", t3), u2.curData = typeof t3.sorter == "function" ? u2.curData.sort(t3.sorter) : t3.sorter === "default" ? u2.curData.sort() : u2.curData);
|
|
36
|
+
}, sortDataItem: () => n2.columns.map((t3) => [t3.key, t3.render]), translate: e2 });
|
|
37
|
+
} }))(w, D)), g = { class: "nut-table__main__head" }, x = { class: "nut-table__main__head__tr" }, $ = ["onClick"], j = { class: "nut-table__main__body" }, I = { key: 1 }, A = { key: 0, class: "nut-table__summary" }, B = ["innerHTML"], H = { key: 1, class: "nut-table__nodata" }, L = { key: 0, class: "nut-table__nodata__text" };
|
|
38
|
+
var M = v(h, [["render", function(t2, e2, a2, s2, l2, r2) {
|
|
39
|
+
const v2 = n("nut-icon"), k2 = n("RenderColumn");
|
|
40
|
+
return o(), _("view", { class: u(t2.classes) }, [c("view", { class: u(["nut-table__main", { "nut-table__main--striped": t2.striped }]) }, [c("view", g, [c("view", x, [(o(true), _(i, null, d(t2.columns, (e3) => (o(), _("span", { class: u(["nut-table__main__head__tr__th", t2.cellClasses(e3)]), key: e3.key, onClick: (a3) => t2.handleSorterClick(e3) }, [m(p(e3.title) + " ", 1), y(t2.$slots, "icon"), !t2.$slots.icon && e3.sorter ? (o(), b(v2, { key: 0, name: "down-arrow", size: "12px" })) : f("", true)], 10, $))), 128))])]), c("view", j, [(o(true), _(i, null, d(t2.curData, (e3) => (o(), _("view", { class: "nut-table__main__body__tr", key: e3 }, [(o(true), _(i, null, d(t2.sortDataItem(), ([a3, s3]) => (o(), _("span", { class: u(["nut-table__main__body__tr__td", t2.cellClasses(t2.getColumnItem(a3))]), key: a3 }, [typeof e3[a3] == "function" || typeof s3 == "function" ? (o(), b(k2, { key: 0, slots: [s3, e3[a3]], record: e3 }, null, 8, ["slots", "record"])) : (o(), _("view", I, p(e3[a3]), 1))], 2))), 128))]))), 128))])], 2), t2.summary ? (o(), _("view", A, [c("span", { class: "nut-table__summary__text", innerHTML: t2.summary().value }, null, 8, B)])) : f("", true), t2.curData.length ? f("", true) : (o(), _("view", H, [c("div", { class: u(["nut-table__nodata", { "nut-table__nodata--border": t2.bordered }]) }, [y(t2.$slots, "nodata"), t2.$slots.nodata ? f("", true) : (o(), _("div", L, p(t2.translate("noData")), 1))], 2)]))], 2);
|
|
41
|
+
}]]);
|
|
42
|
+
export { M as default };
|
|
@@ -3,224 +3,66 @@ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
|
3
3
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
4
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
5
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
-
var __spreadValues = (
|
|
7
|
-
for (var prop in
|
|
8
|
-
if (__hasOwnProp.call(
|
|
9
|
-
__defNormalProp(
|
|
6
|
+
var __spreadValues = (a2, b2) => {
|
|
7
|
+
for (var prop in b2 || (b2 = {}))
|
|
8
|
+
if (__hasOwnProp.call(b2, prop))
|
|
9
|
+
__defNormalProp(a2, prop, b2[prop]);
|
|
10
10
|
if (__getOwnPropSymbols)
|
|
11
|
-
for (var prop of __getOwnPropSymbols(
|
|
12
|
-
if (__propIsEnum.call(
|
|
13
|
-
__defNormalProp(
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b2)) {
|
|
12
|
+
if (__propIsEnum.call(b2, prop))
|
|
13
|
+
__defNormalProp(a2, prop, b2[prop]);
|
|
14
14
|
}
|
|
15
|
-
return
|
|
15
|
+
return a2;
|
|
16
16
|
};
|
|
17
17
|
/*!
|
|
18
|
-
* @nutui/nutui v3.1.22-beta.
|
|
18
|
+
* @nutui/nutui v3.1.22-beta.3 Wed Jun 15 2022 20:12:30 GMT+0800 (中国标准时间)
|
|
19
19
|
* (c) 2022 @jdf2e.
|
|
20
20
|
* Released under the MIT License.
|
|
21
21
|
*/
|
|
22
|
-
import { c as
|
|
23
|
-
import { p as
|
|
24
|
-
import { provide, computed, ref, watch, onMounted, onActivated, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, renderSlot, Fragment, renderList, createCommentVNode, createVNode, toDisplayString } from "vue";
|
|
25
|
-
import { _
|
|
22
|
+
import { c as e } from "./component.js";
|
|
23
|
+
import { p as t } from "./pxCheck.js";
|
|
24
|
+
import { provide as l, computed as a, ref as i, watch as s, onMounted as n, onActivated as o, resolveComponent as r, openBlock as u, createElementBlock as p, normalizeClass as c, createElementVNode as d, normalizeStyle as y, renderSlot as m, Fragment as b, renderList as g, createCommentVNode as v, createVNode as f, toDisplayString as h } from "vue";
|
|
25
|
+
import { _ } from "./plugin-vue_export-helper.js";
|
|
26
26
|
import "../locale/lang";
|
|
27
|
-
class
|
|
27
|
+
class S {
|
|
28
28
|
constructor() {
|
|
29
|
-
this.title = "";
|
|
30
|
-
this.paneKey = "";
|
|
31
|
-
this.disabled = false;
|
|
29
|
+
this.title = "", this.paneKey = "", this.disabled = false;
|
|
32
30
|
}
|
|
33
31
|
}
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
type: String,
|
|
46
|
-
default: "horizontal"
|
|
47
|
-
},
|
|
48
|
-
size: {
|
|
49
|
-
type: String,
|
|
50
|
-
default: "normal"
|
|
51
|
-
},
|
|
52
|
-
type: {
|
|
53
|
-
type: String,
|
|
54
|
-
default: "line"
|
|
55
|
-
},
|
|
56
|
-
titleScroll: {
|
|
57
|
-
type: Boolean,
|
|
58
|
-
default: false
|
|
59
|
-
},
|
|
60
|
-
ellipsis: {
|
|
61
|
-
type: Boolean,
|
|
62
|
-
default: true
|
|
63
|
-
},
|
|
64
|
-
autoHeight: {
|
|
65
|
-
type: Boolean,
|
|
66
|
-
default: false
|
|
67
|
-
},
|
|
68
|
-
background: {
|
|
69
|
-
type: String,
|
|
70
|
-
default: ""
|
|
71
|
-
},
|
|
72
|
-
animatedTime: {
|
|
73
|
-
type: [Number, String],
|
|
74
|
-
default: 300
|
|
75
|
-
},
|
|
76
|
-
titleGutter: {
|
|
77
|
-
type: [Number, String],
|
|
78
|
-
default: 0
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
components: {},
|
|
82
|
-
emits: ["update:modelValue", "click", "change"],
|
|
83
|
-
setup(props, { emit, slots }) {
|
|
84
|
-
provide("activeKey", { activeKey: computed(() => props.modelValue) });
|
|
85
|
-
provide("autoHeight", { autoHeight: computed(() => props.autoHeight) });
|
|
86
|
-
const titles = ref([]);
|
|
87
|
-
const renderTitles = (vnodes) => {
|
|
88
|
-
vnodes.forEach((vnode, index2) => {
|
|
89
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
90
|
-
let type = vnode.type;
|
|
91
|
-
type = type.name || type;
|
|
92
|
-
if (type == "nut-tabpane") {
|
|
93
|
-
let title = new Title();
|
|
94
|
-
if (((_a = vnode.props) == null ? void 0 : _a.title) || ((_b = vnode.props) == null ? void 0 : _b["pane-key"]) || ((_c = vnode.props) == null ? void 0 : _c["paneKey"])) {
|
|
95
|
-
title.title = (_d = vnode.props) == null ? void 0 : _d.title;
|
|
96
|
-
title.paneKey = ((_e = vnode.props) == null ? void 0 : _e["pane-key"]) || ((_f = vnode.props) == null ? void 0 : _f["paneKey"]) || index2;
|
|
97
|
-
title.disabled = (_g = vnode.props) == null ? void 0 : _g.disabled;
|
|
98
|
-
}
|
|
99
|
-
titles.value.push(title);
|
|
100
|
-
} else {
|
|
101
|
-
renderTitles(vnode.children);
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
};
|
|
105
|
-
const currentIndex = ref(props.modelValue || 0);
|
|
106
|
-
const findTabsIndex = (value) => {
|
|
107
|
-
let index2 = titles.value.findIndex((item) => item.paneKey == value);
|
|
108
|
-
if (titles.value.length == 0) {
|
|
109
|
-
console.error("[NutUI] <Tabs> \u5F53\u524D\u672A\u627E\u5230 TabPane \u7EC4\u4EF6\u5143\u7D20 , \u8BF7\u68C0\u67E5 .");
|
|
110
|
-
} else if (index2 == -1) {
|
|
111
|
-
console.error("[NutUI] <Tabs> \u8BF7\u68C0\u67E5 v-model \u503C\u662F\u5426\u4E3A paneKey ,\u5982 paneKey \u672A\u8BBE\u7F6E\uFF0C\u8BF7\u91C7\u7528\u4E0B\u6807\u63A7\u5236 .");
|
|
112
|
-
} else {
|
|
113
|
-
currentIndex.value = index2;
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
const init = (vnodes = ((_a) => (_a = slots.default) == null ? void 0 : _a.call(slots))()) => {
|
|
117
|
-
titles.value = [];
|
|
118
|
-
if (vnodes && vnodes.length) {
|
|
119
|
-
renderTitles(vnodes);
|
|
120
|
-
}
|
|
121
|
-
findTabsIndex(props.modelValue);
|
|
122
|
-
};
|
|
123
|
-
watch(() => {
|
|
124
|
-
var _a;
|
|
125
|
-
return (_a = slots.default) == null ? void 0 : _a.call(slots);
|
|
126
|
-
}, (vnodes) => {
|
|
127
|
-
init(vnodes);
|
|
128
|
-
});
|
|
129
|
-
watch(() => props.modelValue, (value) => {
|
|
130
|
-
findTabsIndex(value);
|
|
131
|
-
});
|
|
132
|
-
onMounted(init);
|
|
133
|
-
onActivated(init);
|
|
134
|
-
const contentStyle = computed(() => {
|
|
135
|
-
return {
|
|
136
|
-
transform: props.direction == "horizontal" ? `translate3d(-${currentIndex.value * 100}%, 0, 0)` : `translate3d( 0,-${currentIndex.value * 100}%, 0)`,
|
|
137
|
-
transitionDuration: `${props.animatedTime}ms`
|
|
138
|
-
};
|
|
139
|
-
});
|
|
140
|
-
const tabsNavStyle = computed(() => {
|
|
141
|
-
return {
|
|
142
|
-
background: props.background
|
|
143
|
-
};
|
|
144
|
-
});
|
|
145
|
-
const tabsActiveStyle = computed(() => {
|
|
146
|
-
return {
|
|
147
|
-
color: props.type == "smile" ? props.color : "",
|
|
148
|
-
background: props.type == "line" ? props.color : ""
|
|
149
|
-
};
|
|
32
|
+
const k = { props: { modelValue: { type: [String, Number], default: 0 }, color: { type: String, default: "" }, direction: { type: String, default: "horizontal" }, size: { type: String, default: "normal" }, type: { type: String, default: "line" }, titleScroll: { type: Boolean, default: false }, ellipsis: { type: Boolean, default: true }, autoHeight: { type: Boolean, default: false }, background: { type: String, default: "" }, animatedTime: { type: [Number, String], default: 300 }, titleGutter: { type: [Number, String], default: 0 } }, components: {}, emits: ["update:modelValue", "click", "change"], setup(e2, { emit: r2, slots: u2 }) {
|
|
33
|
+
l("activeKey", { activeKey: a(() => e2.modelValue) }), l("autoHeight", { autoHeight: a(() => e2.autoHeight) });
|
|
34
|
+
const p2 = i([]), c2 = (e3) => {
|
|
35
|
+
e3.forEach((e4, t2) => {
|
|
36
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
37
|
+
let l2 = e4.type;
|
|
38
|
+
if (l2 = l2.name || l2, l2 == "nut-tabpane") {
|
|
39
|
+
let l3 = new S();
|
|
40
|
+
(((_a = e4.props) == null ? void 0 : _a.title) || ((_b = e4.props) == null ? void 0 : _b["pane-key"]) || ((_c = e4.props) == null ? void 0 : _c.paneKey)) && (l3.title = (_d = e4.props) == null ? void 0 : _d.title, l3.paneKey = ((_e = e4.props) == null ? void 0 : _e["pane-key"]) || ((_f = e4.props) == null ? void 0 : _f.paneKey) || t2, l3.disabled = (_g = e4.props) == null ? void 0 : _g.disabled), p2.value.push(l3);
|
|
41
|
+
} else
|
|
42
|
+
c2(e4.children);
|
|
150
43
|
});
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
};
|
|
177
|
-
const _hoisted_1 = ["onClick"];
|
|
178
|
-
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
179
|
-
const _component_nut_icon = resolveComponent("nut-icon");
|
|
180
|
-
return openBlock(), createElementBlock("view", {
|
|
181
|
-
class: normalizeClass(["nut-tabs", [_ctx.direction]])
|
|
182
|
-
}, [
|
|
183
|
-
createElementVNode("view", {
|
|
184
|
-
class: normalizeClass(["nut-tabs__titles", { [_ctx.type]: _ctx.type, scrollable: _ctx.titleScroll, [_ctx.size]: _ctx.size }]),
|
|
185
|
-
style: normalizeStyle(_ctx.tabsNavStyle)
|
|
186
|
-
}, [
|
|
187
|
-
_ctx.$slots.titles ? renderSlot(_ctx.$slots, "titles", { key: 0 }) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(_ctx.titles, (item, index2) => {
|
|
188
|
-
return openBlock(), createElementBlock("view", {
|
|
189
|
-
class: normalizeClass(["nut-tabs__titles-item", { active: item.paneKey == _ctx.modelValue, disabled: item.disabled }]),
|
|
190
|
-
style: normalizeStyle(_ctx.titleStyle),
|
|
191
|
-
onClick: ($event) => _ctx.tabChange(item, index2),
|
|
192
|
-
key: item.paneKey
|
|
193
|
-
}, [
|
|
194
|
-
_ctx.type == "line" ? (openBlock(), createElementBlock("view", {
|
|
195
|
-
key: 0,
|
|
196
|
-
class: "nut-tabs__titles-item__line",
|
|
197
|
-
style: normalizeStyle(_ctx.tabsActiveStyle)
|
|
198
|
-
}, null, 4)) : createCommentVNode("", true),
|
|
199
|
-
_ctx.type == "smile" ? (openBlock(), createElementBlock("view", {
|
|
200
|
-
key: 1,
|
|
201
|
-
class: "nut-tabs__titles-item__smile",
|
|
202
|
-
style: normalizeStyle(_ctx.tabsActiveStyle)
|
|
203
|
-
}, [
|
|
204
|
-
createVNode(_component_nut_icon, {
|
|
205
|
-
color: _ctx.color,
|
|
206
|
-
name: "joy-smile"
|
|
207
|
-
}, null, 8, ["color"])
|
|
208
|
-
], 4)) : createCommentVNode("", true),
|
|
209
|
-
createElementVNode("view", {
|
|
210
|
-
class: normalizeClass(["nut-tabs__titles-item__text", { ellipsis: _ctx.ellipsis }])
|
|
211
|
-
}, toDisplayString(item.title), 3)
|
|
212
|
-
], 14, _hoisted_1);
|
|
213
|
-
}), 128))
|
|
214
|
-
], 6),
|
|
215
|
-
createElementVNode("view", {
|
|
216
|
-
class: "nut-tabs__content",
|
|
217
|
-
style: normalizeStyle(_ctx.contentStyle)
|
|
218
|
-
}, [
|
|
219
|
-
renderSlot(_ctx.$slots, "default")
|
|
220
|
-
], 4)
|
|
221
|
-
], 2);
|
|
222
|
-
}
|
|
223
|
-
const { create } = createComponent("tabs");
|
|
224
|
-
const _sfc_main = create(component);
|
|
225
|
-
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", render]]);
|
|
226
|
-
export { index as default };
|
|
44
|
+
}, d2 = i(e2.modelValue || 0), y2 = (e3) => {
|
|
45
|
+
let t2 = p2.value.findIndex((t3) => t3.paneKey == e3);
|
|
46
|
+
p2.value.length == 0 || t2 == -1 || (d2.value = t2);
|
|
47
|
+
}, m2 = (t2 = ((_a) => (_a = u2.default) == null ? void 0 : _a.call(u2))()) => {
|
|
48
|
+
p2.value = [], t2 && t2.length && c2(t2), y2(e2.modelValue);
|
|
49
|
+
};
|
|
50
|
+
s(() => {
|
|
51
|
+
var _a;
|
|
52
|
+
return (_a = u2.default) == null ? void 0 : _a.call(u2);
|
|
53
|
+
}, (e3) => {
|
|
54
|
+
m2(e3);
|
|
55
|
+
}), s(() => e2.modelValue, (e3) => {
|
|
56
|
+
y2(e3);
|
|
57
|
+
}), n(m2), o(m2);
|
|
58
|
+
const b2 = a(() => ({ transform: e2.direction == "horizontal" ? `translate3d(-${100 * d2.value}%, 0, 0)` : `translate3d( 0,-${100 * d2.value}%, 0)`, transitionDuration: `${e2.animatedTime}ms` })), g2 = a(() => ({ background: e2.background })), v2 = a(() => ({ color: e2.type == "smile" ? e2.color : "", background: e2.type == "line" ? e2.color : "" })), f2 = a(() => ({ marginLeft: t(e2.titleGutter), marginRight: t(e2.titleGutter) })), h2 = { tabChange: (e3, t2) => {
|
|
59
|
+
r2("click", e3), e3.disabled || (d2.value = t2, r2("update:modelValue", e3.paneKey), r2("change", e3));
|
|
60
|
+
} };
|
|
61
|
+
return __spreadValues({ titles: p2, contentStyle: b2, tabsNavStyle: g2, titleStyle: f2, tabsActiveStyle: v2 }, h2);
|
|
62
|
+
} }, K = ["onClick"];
|
|
63
|
+
const { create: w } = e("tabs");
|
|
64
|
+
var V = _(w(k), [["render", function(e2, t2, l2, a2, i2, s2) {
|
|
65
|
+
const n2 = r("nut-icon");
|
|
66
|
+
return u(), p("view", { class: c(["nut-tabs", [e2.direction]]) }, [d("view", { class: c(["nut-tabs__titles", { [e2.type]: e2.type, scrollable: e2.titleScroll, [e2.size]: e2.size }]), style: y(e2.tabsNavStyle) }, [e2.$slots.titles ? m(e2.$slots, "titles", { key: 0 }) : (u(true), p(b, { key: 1 }, g(e2.titles, (t3, l3) => (u(), p("view", { class: c(["nut-tabs__titles-item", { active: t3.paneKey == e2.modelValue, disabled: t3.disabled }]), style: y(e2.titleStyle), onClick: (a3) => e2.tabChange(t3, l3), key: t3.paneKey }, [e2.type == "line" ? (u(), p("view", { key: 0, class: "nut-tabs__titles-item__line", style: y(e2.tabsActiveStyle) }, null, 4)) : v("", true), e2.type == "smile" ? (u(), p("view", { key: 1, class: "nut-tabs__titles-item__smile", style: y(e2.tabsActiveStyle) }, [f(n2, { color: e2.color, name: "joy-smile" }, null, 8, ["color"])], 4)) : v("", true), d("view", { class: c(["nut-tabs__titles-item__text", { ellipsis: e2.ellipsis }]) }, h(t3.title), 3)], 14, K))), 128))], 6), d("view", { class: "nut-tabs__content", style: y(e2.contentStyle) }, [m(e2.$slots, "default")], 4)], 2);
|
|
67
|
+
}]]);
|
|
68
|
+
export { V as default };
|
package/dist/packages/_es/Tag.js
CHANGED
|
@@ -1,102 +1,25 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v3.1.22-beta.
|
|
2
|
+
* @nutui/nutui v3.1.22-beta.3 Wed Jun 15 2022 20:12:30 GMT+0800 (中国标准时间)
|
|
3
3
|
* (c) 2022 @jdf2e.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
import { toRefs, computed, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, renderSlot, createBlock, createCommentVNode } from "vue";
|
|
7
|
-
import { c as
|
|
8
|
-
import { _ as
|
|
6
|
+
import { toRefs as e, computed as o, resolveComponent as l, openBlock as t, createElementBlock as a, normalizeClass as n, normalizeStyle as r, renderSlot as c, createBlock as s, createCommentVNode as u } from "vue";
|
|
7
|
+
import { c as p } from "./component.js";
|
|
8
|
+
import { _ as i } from "./plugin-vue_export-helper.js";
|
|
9
9
|
import "../locale/lang";
|
|
10
|
-
const { componentName, create } =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
mark: {
|
|
28
|
-
type: Boolean,
|
|
29
|
-
default: false
|
|
30
|
-
},
|
|
31
|
-
closeable: {
|
|
32
|
-
type: Boolean,
|
|
33
|
-
default: false
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
emits: ["close", "click"],
|
|
37
|
-
setup(props, { emit }) {
|
|
38
|
-
const { type, color, plain, round, mark, textColor } = toRefs(props);
|
|
39
|
-
const classes = computed(() => {
|
|
40
|
-
const prefixCls = componentName;
|
|
41
|
-
return {
|
|
42
|
-
[prefixCls]: true,
|
|
43
|
-
[`${prefixCls}--${type.value}`]: type.value,
|
|
44
|
-
[`${prefixCls}--plain`]: plain.value,
|
|
45
|
-
[`${prefixCls}--round`]: round.value,
|
|
46
|
-
[`${prefixCls}--mark`]: mark.value
|
|
47
|
-
};
|
|
48
|
-
});
|
|
49
|
-
const getStyle = () => {
|
|
50
|
-
if (color == null ? void 0 : color.value) {
|
|
51
|
-
return {
|
|
52
|
-
background: color.value,
|
|
53
|
-
color: textColor.value
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
if (plain.value) {
|
|
57
|
-
return {
|
|
58
|
-
color: "#FA2400",
|
|
59
|
-
background: "#fff",
|
|
60
|
-
border: "1px solid rgba(250,36,0,1)"
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
return {
|
|
64
|
-
color: "",
|
|
65
|
-
background: ""
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
const onClose = (event) => {
|
|
69
|
-
event.stopPropagation();
|
|
70
|
-
emit("close", event);
|
|
71
|
-
};
|
|
72
|
-
const onClick = (event) => {
|
|
73
|
-
event.stopPropagation();
|
|
74
|
-
emit("click", event);
|
|
75
|
-
};
|
|
76
|
-
return {
|
|
77
|
-
classes,
|
|
78
|
-
getStyle,
|
|
79
|
-
onClose,
|
|
80
|
-
onClick
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
85
|
-
const _component_nut_icon = resolveComponent("nut-icon");
|
|
86
|
-
return openBlock(), createElementBlock("view", {
|
|
87
|
-
class: normalizeClass(_ctx.classes),
|
|
88
|
-
style: normalizeStyle(_ctx.getStyle()),
|
|
89
|
-
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClick && _ctx.onClick(...args))
|
|
90
|
-
}, [
|
|
91
|
-
renderSlot(_ctx.$slots, "default"),
|
|
92
|
-
_ctx.closeable ? (openBlock(), createBlock(_component_nut_icon, {
|
|
93
|
-
key: 0,
|
|
94
|
-
class: "nut-tag--close",
|
|
95
|
-
name: "close",
|
|
96
|
-
size: "12",
|
|
97
|
-
onClick: _ctx.onClose
|
|
98
|
-
}, null, 8, ["onClick"])) : createCommentVNode("", true)
|
|
99
|
-
], 6);
|
|
100
|
-
}
|
|
101
|
-
var index = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
102
|
-
export { index as default };
|
|
10
|
+
const { componentName: d, create: f } = p("tag");
|
|
11
|
+
var m = i(f({ props: { color: { type: String, default: "" }, textColor: { type: String, default: "" }, type: { type: String, default: "default" }, plain: { type: Boolean, default: false }, round: { type: Boolean, default: false }, mark: { type: Boolean, default: false }, closeable: { type: Boolean, default: false } }, emits: ["close", "click"], setup(l2, { emit: t2 }) {
|
|
12
|
+
const { type: a2, color: n2, plain: r2, round: c2, mark: s2, textColor: u2 } = e(l2);
|
|
13
|
+
return { classes: o(() => {
|
|
14
|
+
const e2 = d;
|
|
15
|
+
return { [e2]: true, [`${e2}--${a2.value}`]: a2.value, [`${e2}--plain`]: r2.value, [`${e2}--round`]: c2.value, [`${e2}--mark`]: s2.value };
|
|
16
|
+
}), getStyle: () => (n2 == null ? void 0 : n2.value) ? { background: n2.value, color: u2.value } : r2.value ? { color: "#FA2400", background: "#fff", border: "1px solid rgba(250,36,0,1)" } : { color: "", background: "" }, onClose: (e2) => {
|
|
17
|
+
e2.stopPropagation(), t2("close", e2);
|
|
18
|
+
}, onClick: (e2) => {
|
|
19
|
+
e2.stopPropagation(), t2("click", e2);
|
|
20
|
+
} };
|
|
21
|
+
} }), [["render", function(e2, o2, p2, i2, d2, f2) {
|
|
22
|
+
const m2 = l("nut-icon");
|
|
23
|
+
return t(), a("view", { class: n(e2.classes), style: r(e2.getStyle()), onClick: o2[0] || (o2[0] = (...o3) => e2.onClick && e2.onClick(...o3)) }, [c(e2.$slots, "default"), e2.closeable ? (t(), s(m2, { key: 0, class: "nut-tag--close", name: "close", size: "12", onClick: e2.onClose }, null, 8, ["onClick"])) : u("", true)], 6);
|
|
24
|
+
}]]);
|
|
25
|
+
export { m as default };
|