lew-ui 1.0.16 → 1.0.19
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/README.md +13 -3
- package/dist/lew.es.ts +42 -77
- package/dist/lew.umd.ts +16 -20
- package/dist/style.css +1 -1
- package/dist/style.css.gz +0 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
1
3
|
# Lew-UI
|
|
2
4
|
|
|
3
5
|
A Component Library for Vue3.js.
|
|
4
6
|
Doc address: https://lew.kamtao.com
|
|
5
7
|
|
|
6
|
-
|
|
7
8
|
## Install
|
|
8
9
|
|
|
9
10
|
```bash
|
|
@@ -12,13 +13,15 @@ npm install lew-ui --save
|
|
|
12
13
|
|
|
13
14
|
## How to use
|
|
14
15
|
|
|
15
|
-
引入css
|
|
16
|
+
引入 css
|
|
17
|
+
|
|
16
18
|
```js
|
|
17
19
|
// main.ts
|
|
18
|
-
import
|
|
20
|
+
import 'lew-ui/dist/style.css';
|
|
19
21
|
```
|
|
20
22
|
|
|
21
23
|
页面
|
|
24
|
+
|
|
22
25
|
```vue
|
|
23
26
|
<script setup lang="ts">
|
|
24
27
|
import { LewButton } from 'lew-ui';
|
|
@@ -28,3 +31,10 @@ import { LewButton } from 'lew-ui';
|
|
|
28
31
|
<lew-button> 发送 </lew-button>
|
|
29
32
|
</template>
|
|
30
33
|
```
|
|
34
|
+
|
|
35
|
+
## Thanks
|
|
36
|
+
|
|
37
|
+
- https://github.com/TuSimple/naive-ui
|
|
38
|
+
- https://github.com/atomiks/tippyjs
|
|
39
|
+
- https://github.com/fancyapps/ui
|
|
40
|
+
- https://github.com/sampotts/plyr
|
package/dist/lew.es.ts
CHANGED
|
@@ -29,7 +29,7 @@ var __objRest = (source2, exclude) => {
|
|
|
29
29
|
}
|
|
30
30
|
return target;
|
|
31
31
|
};
|
|
32
|
-
import { defineComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, renderSlot,
|
|
32
|
+
import { defineComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, renderSlot, onUnmounted, onMounted, getCurrentInstance, unref, ref, createElementVNode, Fragment, renderList, toDisplayString, createCommentVNode, pushScopeId, popScopeId, watch, withDirectives, vModelText, vShow, createTextVNode, createBlock, createVNode, vModelCheckbox, provide, inject, computed, onBeforeMount, h as h$1, withCtx, Teleport, createApp, Transition, withModifiers, resolveComponent, resolveDirective, isRef } from "vue";
|
|
33
33
|
var LewFlex_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
34
34
|
var _export_sfc = (sfc, props) => {
|
|
35
35
|
const target = sfc.__vccOpts || sfc;
|
|
@@ -128,33 +128,34 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
128
128
|
}
|
|
129
129
|
});
|
|
130
130
|
var LewLayout = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__scopeId", "data-v-38cc287d"], ["__file", "/Users/kamtao/Documents/GitHub/Lew-UI/packages/components/layout/src/LewLayout.vue"]]);
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
})
|
|
156
|
-
|
|
157
|
-
|
|
131
|
+
function useDOMCreate(nodeId) {
|
|
132
|
+
const node = document.createElement("div");
|
|
133
|
+
node.id = nodeId;
|
|
134
|
+
document.body.appendChild(node);
|
|
135
|
+
onUnmounted(() => {
|
|
136
|
+
document.body.removeChild(node);
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
let instance$1;
|
|
140
|
+
function useLewTo() {
|
|
141
|
+
const lewTo = (path) => {
|
|
142
|
+
var _a;
|
|
143
|
+
const router = (_a = instance$1.appContext.config) == null ? void 0 : _a.globalProperties.$router;
|
|
144
|
+
if (!path)
|
|
145
|
+
return;
|
|
146
|
+
if (path && path.startsWith("http")) {
|
|
147
|
+
window.open(path);
|
|
148
|
+
} else {
|
|
149
|
+
router.push(path);
|
|
150
|
+
}
|
|
151
|
+
return;
|
|
152
|
+
};
|
|
153
|
+
onMounted(() => {
|
|
154
|
+
instance$1 = getCurrentInstance();
|
|
155
|
+
});
|
|
156
|
+
return {
|
|
157
|
+
lewTo
|
|
158
|
+
};
|
|
158
159
|
}
|
|
159
160
|
var LewMark_vue_vue_type_style_index_0_lang = "";
|
|
160
161
|
const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
@@ -168,7 +169,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
168
169
|
type: Boolean,
|
|
169
170
|
default: false
|
|
170
171
|
},
|
|
171
|
-
|
|
172
|
+
to: {
|
|
172
173
|
type: String,
|
|
173
174
|
default: ""
|
|
174
175
|
},
|
|
@@ -178,22 +179,12 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
178
179
|
}
|
|
179
180
|
},
|
|
180
181
|
setup(__props) {
|
|
181
|
-
const
|
|
182
|
-
const router = useRouter();
|
|
183
|
-
const toPath = () => {
|
|
184
|
-
if (props.link) {
|
|
185
|
-
if (props.link.startsWith("http")) {
|
|
186
|
-
window.open(props.link);
|
|
187
|
-
} else {
|
|
188
|
-
router.push(props.link);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
};
|
|
182
|
+
const { lewTo } = useLewTo();
|
|
192
183
|
return (_ctx, _cache) => {
|
|
193
184
|
return openBlock(), createElementBlock("span", {
|
|
194
|
-
class: normalizeClass(["lew-mark", `lew-mark-${__props.type} ${__props.round ? "lew-mark-round" : ""} ${__props.
|
|
185
|
+
class: normalizeClass(["lew-mark", `lew-mark-${__props.type} ${__props.round ? "lew-mark-round" : ""} ${__props.to ? "lew-mark-to" : ""}`]),
|
|
195
186
|
style: normalizeStyle(`font-weight:${__props.bold};`),
|
|
196
|
-
onClick:
|
|
187
|
+
onClick: _cache[0] || (_cache[0] = ($event) => unref(lewTo)(__props.to))
|
|
197
188
|
}, [
|
|
198
189
|
renderSlot(_ctx.$slots, "default")
|
|
199
190
|
], 6);
|
|
@@ -350,16 +341,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
350
341
|
}
|
|
351
342
|
},
|
|
352
343
|
setup(__props) {
|
|
353
|
-
const
|
|
354
|
-
const toPath = (path) => {
|
|
355
|
-
if (path) {
|
|
356
|
-
if (path.startsWith("http")) {
|
|
357
|
-
window.open(path);
|
|
358
|
-
} else {
|
|
359
|
-
router.push(path);
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
};
|
|
344
|
+
const { lewTo } = useLewTo();
|
|
363
345
|
return (_ctx, _cache) => {
|
|
364
346
|
return openBlock(), createElementBlock("div", _hoisted_1$r, [
|
|
365
347
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (item, index2) => {
|
|
@@ -368,8 +350,8 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
368
350
|
class: normalizeClass(["lew-breadcrumb-item", { "lew-breadcrumb-active": item.active }])
|
|
369
351
|
}, [
|
|
370
352
|
createElementVNode("span", {
|
|
371
|
-
class: normalizeClass({ "lew-breadcrumb-isPath": !!item.
|
|
372
|
-
onClick: ($event) =>
|
|
353
|
+
class: normalizeClass({ "lew-breadcrumb-isPath": !!item.to }),
|
|
354
|
+
onClick: ($event) => unref(lewTo)(item.to)
|
|
373
355
|
}, toDisplayString(item.label), 11, _hoisted_2$l),
|
|
374
356
|
index2 != __props.options.length - 1 ? (openBlock(), createElementBlock("div", _hoisted_3$f, [
|
|
375
357
|
__props.iconType == "sprit" ? (openBlock(), createElementBlock("svg", _hoisted_4$4, _hoisted_6$2)) : createCommentVNode("v-if", true),
|
|
@@ -3702,8 +3684,8 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
3702
3684
|
return openBlock(), createElementBlock("div", _hoisted_1$i, [
|
|
3703
3685
|
createElementVNode("img", {
|
|
3704
3686
|
src: __props.src,
|
|
3705
|
-
|
|
3706
|
-
|
|
3687
|
+
alt: __props.alt,
|
|
3688
|
+
class: normalizeClass(__props.round ? "lew-avarar-round" : "")
|
|
3707
3689
|
}, null, 10, _hoisted_2$g),
|
|
3708
3690
|
__props.status ? (openBlock(), createElementBlock("span", {
|
|
3709
3691
|
key: 0,
|
|
@@ -4478,7 +4460,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
4478
4460
|
type: Boolean,
|
|
4479
4461
|
default: false
|
|
4480
4462
|
},
|
|
4481
|
-
|
|
4463
|
+
to: {
|
|
4482
4464
|
type: String,
|
|
4483
4465
|
default: ""
|
|
4484
4466
|
}
|
|
@@ -4486,26 +4468,17 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
4486
4468
|
emits: ["close"],
|
|
4487
4469
|
setup(__props, { emit }) {
|
|
4488
4470
|
const props = __props;
|
|
4489
|
-
const
|
|
4471
|
+
const { lewTo } = useLewTo();
|
|
4490
4472
|
const close = () => {
|
|
4491
4473
|
if (props.disabled) {
|
|
4492
4474
|
return;
|
|
4493
4475
|
}
|
|
4494
4476
|
emit("close");
|
|
4495
4477
|
};
|
|
4496
|
-
const toPath = () => {
|
|
4497
|
-
if (props.link) {
|
|
4498
|
-
if (props.link.startsWith("http")) {
|
|
4499
|
-
window.open(props.link);
|
|
4500
|
-
} else {
|
|
4501
|
-
router.push(props.link);
|
|
4502
|
-
}
|
|
4503
|
-
}
|
|
4504
|
-
};
|
|
4505
4478
|
return (_ctx, _cache) => {
|
|
4506
4479
|
return openBlock(), createElementBlock("div", {
|
|
4507
|
-
class: normalizeClass(["lew-tag", `lew-tag-${__props.size} lew-tag-${__props.type} ${__props.round ? "lew-tag-round" : ""} ${__props.disabled ? "lew-tag-disabled" : ""} ${__props.
|
|
4508
|
-
onClick:
|
|
4480
|
+
class: normalizeClass(["lew-tag", `lew-tag-${__props.size} lew-tag-${__props.type} ${__props.round ? "lew-tag-round" : ""} ${__props.disabled ? "lew-tag-disabled" : ""} ${__props.to ? "lew-tag-to" : ""}`]),
|
|
4481
|
+
onClick: _cache[0] || (_cache[0] = ($event) => unref(lewTo)(__props.to))
|
|
4509
4482
|
}, [
|
|
4510
4483
|
createElementVNode("div", _hoisted_1$7, [
|
|
4511
4484
|
renderSlot(_ctx.$slots, "left")
|
|
@@ -4823,14 +4796,6 @@ const addMessage = (type, text) => {
|
|
|
4823
4796
|
}, 10);
|
|
4824
4797
|
};
|
|
4825
4798
|
var index$3 = { warning, info, normal, success, error };
|
|
4826
|
-
function useDOMCreate(nodeId) {
|
|
4827
|
-
const node = document.createElement("div");
|
|
4828
|
-
node.id = nodeId;
|
|
4829
|
-
document.body.appendChild(node);
|
|
4830
|
-
onUnmounted(() => {
|
|
4831
|
-
document.body.removeChild(node);
|
|
4832
|
-
});
|
|
4833
|
-
}
|
|
4834
4799
|
var LewModal_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
4835
4800
|
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
4836
4801
|
name: "LewModal",
|