lew-ui 1.0.13 → 1.0.14
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 +23 -9
- package/dist/lew.es.ts +568 -127
- package/dist/lew.umd.ts +31 -7
- package/dist/style.css +1 -1
- package/package.json +4 -3
package/dist/lew.es.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, openBlock, createElementBlock, createElementVNode, normalizeClass, createCommentVNode, renderSlot, inject, normalizeStyle, toDisplayString, ref, watch, withDirectives, vModelText, onMounted, createVNode, unref, Fragment, renderList, vModelCheckbox, vShow, createTextVNode, pushScopeId, popScopeId, createBlock, provide, computed, onBeforeMount, h, withCtx, onUnmounted, Teleport, Transition, withModifiers } from "vue";
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, createElementVNode, normalizeClass, createCommentVNode, renderSlot, inject, normalizeStyle, toDisplayString, ref, watch, withDirectives, vModelText, onMounted, createVNode, unref, Fragment, renderList, vModelCheckbox, vShow, createTextVNode, pushScopeId, popScopeId, createBlock, provide, computed, onBeforeMount, h, withCtx, onUnmounted, Teleport, Transition, withModifiers, createApp } from "vue";
|
|
2
2
|
var LewAvatar_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
3
3
|
var _export_sfc = (sfc, props) => {
|
|
4
4
|
const target = sfc.__vccOpts || sfc;
|
|
@@ -7,9 +7,9 @@ var _export_sfc = (sfc, props) => {
|
|
|
7
7
|
}
|
|
8
8
|
return target;
|
|
9
9
|
};
|
|
10
|
-
const _hoisted_1$
|
|
11
|
-
const _hoisted_2$
|
|
12
|
-
const _sfc_main$
|
|
10
|
+
const _hoisted_1$h = { class: "lew-avatar" };
|
|
11
|
+
const _hoisted_2$c = ["src", "alt"];
|
|
12
|
+
const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
13
13
|
name: "LewAvatar",
|
|
14
14
|
props: {
|
|
15
15
|
round: {
|
|
@@ -35,25 +35,25 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
35
35
|
},
|
|
36
36
|
setup(__props) {
|
|
37
37
|
return (_ctx, _cache) => {
|
|
38
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
38
|
+
return openBlock(), createElementBlock("div", _hoisted_1$h, [
|
|
39
39
|
createElementVNode("img", {
|
|
40
40
|
src: __props.src,
|
|
41
41
|
class: normalizeClass({ round: __props.round }),
|
|
42
42
|
alt: __props.alt
|
|
43
|
-
}, null, 10, _hoisted_2$
|
|
43
|
+
}, null, 10, _hoisted_2$c),
|
|
44
44
|
__props.status ? (openBlock(), createElementBlock("span", {
|
|
45
45
|
key: 0,
|
|
46
46
|
class: normalizeClass(["dot", `dot-${__props.status} dot-${__props.statusPosition}`])
|
|
47
|
-
}, null, 2)) : createCommentVNode("", true)
|
|
47
|
+
}, null, 2)) : createCommentVNode("v-if", true)
|
|
48
48
|
]);
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
51
|
});
|
|
52
|
-
var LewAvatar = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
52
|
+
var LewAvatar = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-303f2aca"], ["__file", "/Users/kamtao/Documents/GitHub/Lew-UI/packages/components/general/LewAvatar.vue"]]);
|
|
53
53
|
var LewButton_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
54
54
|
var LewButton_vue_vue_type_style_index_1_lang = "";
|
|
55
|
-
const _hoisted_1$
|
|
56
|
-
const _sfc_main$
|
|
55
|
+
const _hoisted_1$g = ["disabled"];
|
|
56
|
+
const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
57
57
|
name: "LewButton",
|
|
58
58
|
props: {
|
|
59
59
|
type: {
|
|
@@ -80,19 +80,19 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
80
80
|
disabled: __props.disabled
|
|
81
81
|
}, [
|
|
82
82
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
83
|
-
], 10, _hoisted_1$
|
|
83
|
+
], 10, _hoisted_1$g);
|
|
84
84
|
};
|
|
85
85
|
}
|
|
86
86
|
});
|
|
87
|
-
var LewButton = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
87
|
+
var LewButton = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-15473bf4"], ["__file", "/Users/kamtao/Documents/GitHub/Lew-UI/packages/components/general/LewButton.vue"]]);
|
|
88
88
|
/*!
|
|
89
89
|
* vue-router v4.0.13
|
|
90
90
|
* (c) 2022 Eduardo San Martin Morote
|
|
91
91
|
* @license MIT
|
|
92
92
|
*/
|
|
93
93
|
const hasSymbol = typeof Symbol === "function" && typeof Symbol.toStringTag === "symbol";
|
|
94
|
-
const PolySymbol = (name) => hasSymbol ? Symbol(name) : "
|
|
95
|
-
const routerKey = /* @__PURE__ */ PolySymbol("
|
|
94
|
+
const PolySymbol = (name) => hasSymbol ? Symbol("[vue-router]: " + name) : "[vue-router]: " + name;
|
|
95
|
+
const routerKey = /* @__PURE__ */ PolySymbol("router");
|
|
96
96
|
var NavigationType;
|
|
97
97
|
(function(NavigationType2) {
|
|
98
98
|
NavigationType2["pop"] = "pop";
|
|
@@ -114,7 +114,7 @@ function useRouter() {
|
|
|
114
114
|
return inject(routerKey);
|
|
115
115
|
}
|
|
116
116
|
var LewBadge_vue_vue_type_style_index_0_lang = "";
|
|
117
|
-
const _sfc_main$
|
|
117
|
+
const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
118
118
|
name: "LewBadge",
|
|
119
119
|
props: {
|
|
120
120
|
type: {
|
|
@@ -161,8 +161,9 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
161
161
|
};
|
|
162
162
|
}
|
|
163
163
|
});
|
|
164
|
+
var LewBadge = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__file", "/Users/kamtao/Documents/GitHub/Lew-UI/packages/components/general/LewBadge.vue"]]);
|
|
164
165
|
var LewTitle_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
165
|
-
const _sfc_main$
|
|
166
|
+
const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
166
167
|
name: "LewTitle",
|
|
167
168
|
props: {
|
|
168
169
|
bold: {
|
|
@@ -185,10 +186,10 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
185
186
|
};
|
|
186
187
|
}
|
|
187
188
|
});
|
|
188
|
-
var LewTitle = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
189
|
+
var LewTitle = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-701d9086"], ["__file", "/Users/kamtao/Documents/GitHub/Lew-UI/packages/components/general/LewTitle.vue"]]);
|
|
189
190
|
var LewFormItem_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
190
|
-
const _hoisted_1$
|
|
191
|
-
const _sfc_main$
|
|
191
|
+
const _hoisted_1$f = { class: "title-label" };
|
|
192
|
+
const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
192
193
|
name: "LewFormItem",
|
|
193
194
|
props: {
|
|
194
195
|
title: {
|
|
@@ -206,16 +207,16 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
206
207
|
return openBlock(), createElementBlock("div", {
|
|
207
208
|
class: normalizeClass(["lew-form-item", `lew-form-item-${__props.direction}`])
|
|
208
209
|
}, [
|
|
209
|
-
createElementVNode("label", _hoisted_1$
|
|
210
|
+
createElementVNode("label", _hoisted_1$f, toDisplayString(props.title), 1),
|
|
210
211
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
211
212
|
], 2);
|
|
212
213
|
};
|
|
213
214
|
}
|
|
214
215
|
});
|
|
215
|
-
var LewFormItem = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
216
|
+
var LewFormItem = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-0e9705e2"], ["__file", "/Users/kamtao/Documents/GitHub/Lew-UI/packages/components/form/LewFormItem.vue"]]);
|
|
216
217
|
var LewInput_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
217
|
-
const _hoisted_1$
|
|
218
|
-
const _sfc_main$
|
|
218
|
+
const _hoisted_1$e = ["disabled"];
|
|
219
|
+
const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
219
220
|
name: "LewInput",
|
|
220
221
|
props: {
|
|
221
222
|
modelValue: {
|
|
@@ -245,17 +246,17 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
245
246
|
disabled: props.disabled,
|
|
246
247
|
placeholder: "\u8BF7\u8F93\u5165",
|
|
247
248
|
onInput: input
|
|
248
|
-
}, null, 40, _hoisted_1$
|
|
249
|
+
}, null, 40, _hoisted_1$e)), [
|
|
249
250
|
[vModelText, v.value]
|
|
250
251
|
]);
|
|
251
252
|
};
|
|
252
253
|
}
|
|
253
254
|
});
|
|
254
|
-
var LewInput = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
255
|
+
var LewInput = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-9b461d3c"], ["__file", "/Users/kamtao/Documents/GitHub/Lew-UI/packages/components/form/LewInput.vue"]]);
|
|
255
256
|
var LewSelect_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
256
|
-
const _hoisted_1$
|
|
257
|
-
const _hoisted_2$
|
|
258
|
-
const _sfc_main$
|
|
257
|
+
const _hoisted_1$d = { class: "lew-select" };
|
|
258
|
+
const _hoisted_2$b = ["onClick"];
|
|
259
|
+
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
259
260
|
name: "LewSelect",
|
|
260
261
|
props: {
|
|
261
262
|
modelValue: {
|
|
@@ -293,7 +294,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
293
294
|
emit("update:modelValue", item.value);
|
|
294
295
|
};
|
|
295
296
|
return (_ctx, _cache) => {
|
|
296
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
297
|
+
return openBlock(), createElementBlock("div", _hoisted_1$d, [
|
|
297
298
|
createVNode(LewInput, {
|
|
298
299
|
modelValue: label.value,
|
|
299
300
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => label.value = $event),
|
|
@@ -309,17 +310,17 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
309
310
|
key: item.value,
|
|
310
311
|
class: "item",
|
|
311
312
|
onClick: ($event) => changeFn(item)
|
|
312
|
-
}, toDisplayString(item.label), 9, _hoisted_2$
|
|
313
|
+
}, toDisplayString(item.label), 9, _hoisted_2$b);
|
|
313
314
|
}), 128))
|
|
314
315
|
], 2)
|
|
315
316
|
]);
|
|
316
317
|
};
|
|
317
318
|
}
|
|
318
319
|
});
|
|
319
|
-
var LewSelect = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
320
|
+
var LewSelect = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-32f2a4d8"], ["__file", "/Users/kamtao/Documents/GitHub/Lew-UI/packages/components/form/LewSelect.vue"]]);
|
|
320
321
|
var LewSwitch_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
321
|
-
const _hoisted_1$
|
|
322
|
-
const _sfc_main$
|
|
322
|
+
const _hoisted_1$c = ["disabled"];
|
|
323
|
+
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
323
324
|
name: "LewSwitch",
|
|
324
325
|
props: {
|
|
325
326
|
modelValue: {
|
|
@@ -354,16 +355,16 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
354
355
|
type: "checkbox",
|
|
355
356
|
disabled: props.disabled,
|
|
356
357
|
onChange: change
|
|
357
|
-
}, null, 42, _hoisted_1$
|
|
358
|
+
}, null, 42, _hoisted_1$c)), [
|
|
358
359
|
[vModelCheckbox, v.value]
|
|
359
360
|
]);
|
|
360
361
|
};
|
|
361
362
|
}
|
|
362
363
|
});
|
|
363
|
-
var LewSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
364
|
+
var LewSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-348753cc"], ["__file", "/Users/kamtao/Documents/GitHub/Lew-UI/packages/components/form/LewSwitch.vue"]]);
|
|
364
365
|
var LewTextarea_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
365
|
-
const _hoisted_1$
|
|
366
|
-
const _sfc_main$
|
|
366
|
+
const _hoisted_1$b = ["disabled"];
|
|
367
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
367
368
|
name: "LewTextarea",
|
|
368
369
|
props: {
|
|
369
370
|
modelValue: {
|
|
@@ -399,21 +400,21 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
399
400
|
disabled: props.disabled,
|
|
400
401
|
placeholder: "\u8BF7\u8F93\u5165",
|
|
401
402
|
onInput: input
|
|
402
|
-
}, null, 42, _hoisted_1$
|
|
403
|
+
}, null, 42, _hoisted_1$b)), [
|
|
403
404
|
[vModelText, v.value]
|
|
404
405
|
]);
|
|
405
406
|
};
|
|
406
407
|
}
|
|
407
408
|
});
|
|
408
|
-
var LewTextarea = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
409
|
+
var LewTextarea = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-a48a3e5c"], ["__file", "/Users/kamtao/Documents/GitHub/Lew-UI/packages/components/form/LewTextarea.vue"]]);
|
|
409
410
|
var LewCheckbox_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
410
|
-
const _withScopeId$1 = (n) => (pushScopeId("data-v-
|
|
411
|
-
const _hoisted_1$
|
|
412
|
-
const _hoisted_2$
|
|
413
|
-
_hoisted_1$
|
|
411
|
+
const _withScopeId$1 = (n) => (pushScopeId("data-v-7b4a4e4a"), n = n(), popScopeId(), n);
|
|
412
|
+
const _hoisted_1$a = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ createElementVNode("polyline", { points: "20 6 9 17 4 12" }, null, -1));
|
|
413
|
+
const _hoisted_2$a = [
|
|
414
|
+
_hoisted_1$a
|
|
414
415
|
];
|
|
415
|
-
const _hoisted_3$
|
|
416
|
-
const _sfc_main$
|
|
416
|
+
const _hoisted_3$9 = ["checked"];
|
|
417
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
417
418
|
name: "LewCheckbox",
|
|
418
419
|
props: {
|
|
419
420
|
label: {
|
|
@@ -458,13 +459,13 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
458
459
|
fill: "none",
|
|
459
460
|
"stroke-linecap": "round",
|
|
460
461
|
"stroke-linejoin": "round"
|
|
461
|
-
}, _hoisted_2$
|
|
462
|
+
}, _hoisted_2$a, 2))
|
|
462
463
|
], 2),
|
|
463
464
|
withDirectives(createElementVNode("input", {
|
|
464
465
|
type: "checkbox",
|
|
465
466
|
checked: __props.checked,
|
|
466
467
|
onInput: setChecked
|
|
467
|
-
}, null, 40, _hoisted_3$
|
|
468
|
+
}, null, 40, _hoisted_3$9), [
|
|
468
469
|
[vShow, false]
|
|
469
470
|
]),
|
|
470
471
|
createTextVNode(" " + toDisplayString(__props.label), 1)
|
|
@@ -472,9 +473,9 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
472
473
|
};
|
|
473
474
|
}
|
|
474
475
|
});
|
|
475
|
-
var LewCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
476
|
+
var LewCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-7b4a4e4a"], ["__file", "/Users/kamtao/Documents/GitHub/Lew-UI/packages/components/form/LewCheckbox.vue"]]);
|
|
476
477
|
var LewCheckboxGroup_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
477
|
-
const _sfc_main$
|
|
478
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
478
479
|
name: "LewCheckboxGroup",
|
|
479
480
|
props: {
|
|
480
481
|
modelValue: {
|
|
@@ -548,15 +549,15 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
548
549
|
};
|
|
549
550
|
}
|
|
550
551
|
});
|
|
551
|
-
var LewCheckboxGroup = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
552
|
+
var LewCheckboxGroup = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-71b4bd14"], ["__file", "/Users/kamtao/Documents/GitHub/Lew-UI/packages/components/form/LewCheckboxGroup.vue"]]);
|
|
552
553
|
var LewRadio_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
553
|
-
const _withScopeId = (n) => (pushScopeId("data-v-
|
|
554
|
-
const _hoisted_1$
|
|
555
|
-
const _hoisted_2$
|
|
556
|
-
_hoisted_1$
|
|
554
|
+
const _withScopeId = (n) => (pushScopeId("data-v-12ca2d13"), n = n(), popScopeId(), n);
|
|
555
|
+
const _hoisted_1$9 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("div", { class: "icon-radio" }, null, -1));
|
|
556
|
+
const _hoisted_2$9 = [
|
|
557
|
+
_hoisted_1$9
|
|
557
558
|
];
|
|
558
|
-
const _hoisted_3$
|
|
559
|
-
const _sfc_main$
|
|
559
|
+
const _hoisted_3$8 = ["checked"];
|
|
560
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
560
561
|
name: "LewRadio",
|
|
561
562
|
props: {
|
|
562
563
|
label: {
|
|
@@ -584,12 +585,12 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
584
585
|
}, [
|
|
585
586
|
createElementVNode("div", {
|
|
586
587
|
class: normalizeClass(["icon-radio-box", { "icon-checked-box": __props.checked }])
|
|
587
|
-
}, _hoisted_2$
|
|
588
|
+
}, _hoisted_2$9, 2),
|
|
588
589
|
withDirectives(createElementVNode("input", {
|
|
589
590
|
type: "radio",
|
|
590
591
|
checked: __props.checked,
|
|
591
592
|
onInput: setChecked
|
|
592
|
-
}, null, 40, _hoisted_3$
|
|
593
|
+
}, null, 40, _hoisted_3$8), [
|
|
593
594
|
[vShow, false]
|
|
594
595
|
]),
|
|
595
596
|
createTextVNode(" " + toDisplayString(__props.label), 1)
|
|
@@ -597,9 +598,9 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
597
598
|
};
|
|
598
599
|
}
|
|
599
600
|
});
|
|
600
|
-
var LewRadio = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
601
|
+
var LewRadio = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-12ca2d13"], ["__file", "/Users/kamtao/Documents/GitHub/Lew-UI/packages/components/form/LewRadio.vue"]]);
|
|
601
602
|
var LewRadioGroup_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
602
|
-
const _sfc_main$
|
|
603
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
603
604
|
name: "LewRadioGroup",
|
|
604
605
|
props: {
|
|
605
606
|
modelValue: {
|
|
@@ -654,11 +655,11 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
654
655
|
};
|
|
655
656
|
}
|
|
656
657
|
});
|
|
657
|
-
var LewRadioGroup = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
658
|
+
var LewRadioGroup = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-756d6848"], ["__file", "/Users/kamtao/Documents/GitHub/Lew-UI/packages/components/form/LewRadioGroup.vue"]]);
|
|
658
659
|
var LewTabs_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
659
|
-
const _hoisted_1$
|
|
660
|
-
const _hoisted_2$
|
|
661
|
-
const _sfc_main$
|
|
660
|
+
const _hoisted_1$8 = { class: "lew-tabs" };
|
|
661
|
+
const _hoisted_2$8 = ["onClick"];
|
|
662
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
662
663
|
name: "LewTabs",
|
|
663
664
|
props: {
|
|
664
665
|
modelValue: {
|
|
@@ -679,22 +680,22 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
679
680
|
let v = ref(props.modelValue);
|
|
680
681
|
let itemRef = ref([]);
|
|
681
682
|
const init = () => {
|
|
682
|
-
let
|
|
683
|
-
if (
|
|
684
|
-
|
|
685
|
-
activeItemStyle.value = `width:${itemRef.value[
|
|
683
|
+
let index2 = props.options.findIndex((e) => e.value == v.value);
|
|
684
|
+
if (index2 < 0)
|
|
685
|
+
index2 = 0;
|
|
686
|
+
activeItemStyle.value = `width:${itemRef.value[index2].offsetWidth}px;transform: translateX(${itemRef.value[index2].offsetLeft}px);`;
|
|
686
687
|
};
|
|
687
|
-
const changeIndex = (item,
|
|
688
|
+
const changeIndex = (item, index2) => {
|
|
688
689
|
if (item.value == props.modelValue) {
|
|
689
690
|
return;
|
|
690
691
|
}
|
|
691
|
-
v.value = props.options[
|
|
692
|
-
let activeRef = itemRef.value[
|
|
692
|
+
v.value = props.options[index2].value;
|
|
693
|
+
let activeRef = itemRef.value[index2];
|
|
693
694
|
activeItemStyle.value = `width:${activeRef.offsetWidth}px;transform: translateX(${activeRef.offsetLeft}px);`;
|
|
694
695
|
emit("update:change", {
|
|
695
696
|
label: item.label,
|
|
696
697
|
value: item.value,
|
|
697
|
-
activeIndex:
|
|
698
|
+
activeIndex: index2
|
|
698
699
|
});
|
|
699
700
|
emit("update:modelValue", item.value);
|
|
700
701
|
};
|
|
@@ -702,31 +703,31 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
702
703
|
init();
|
|
703
704
|
});
|
|
704
705
|
return (_ctx, _cache) => {
|
|
705
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
706
|
+
return openBlock(), createElementBlock("div", _hoisted_1$8, [
|
|
706
707
|
createElementVNode("div", {
|
|
707
708
|
style: normalizeStyle(unref(activeItemStyle)),
|
|
708
709
|
class: "activeItem"
|
|
709
710
|
}, null, 4),
|
|
710
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (item,
|
|
711
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (item, index2) => {
|
|
711
712
|
return openBlock(), createElementBlock("div", {
|
|
712
713
|
key: item.value,
|
|
713
714
|
ref_for: true,
|
|
714
715
|
ref: (el) => unref(itemRef).push(el),
|
|
715
716
|
class: "lew-tabs-item",
|
|
716
|
-
onClick: ($event) => changeIndex(item,
|
|
717
|
-
}, toDisplayString(item.label), 9, _hoisted_2$
|
|
717
|
+
onClick: ($event) => changeIndex(item, index2)
|
|
718
|
+
}, toDisplayString(item.label), 9, _hoisted_2$8);
|
|
718
719
|
}), 128))
|
|
719
720
|
]);
|
|
720
721
|
};
|
|
721
722
|
}
|
|
722
723
|
});
|
|
723
|
-
var LewTabs = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
724
|
-
const _hoisted_1$
|
|
724
|
+
var LewTabs = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-7acf9b16"], ["__file", "/Users/kamtao/Documents/GitHub/Lew-UI/packages/components/form/LewTabs.vue"]]);
|
|
725
|
+
const _hoisted_1$7 = {
|
|
725
726
|
xmlns: "http://www.w3.org/2000/svg",
|
|
726
727
|
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
727
728
|
viewBox: "0 0 24 24"
|
|
728
729
|
};
|
|
729
|
-
const _hoisted_2$
|
|
730
|
+
const _hoisted_2$7 = /* @__PURE__ */ createElementVNode("g", {
|
|
730
731
|
fill: "none"
|
|
731
732
|
}, [
|
|
732
733
|
/* @__PURE__ */ createElementVNode("path", {
|
|
@@ -734,19 +735,19 @@ const _hoisted_2$6 = /* @__PURE__ */ createElementVNode("g", {
|
|
|
734
735
|
fill: "currentColor"
|
|
735
736
|
})
|
|
736
737
|
], -1);
|
|
737
|
-
const _hoisted_3$
|
|
738
|
+
const _hoisted_3$7 = [_hoisted_2$7];
|
|
738
739
|
var Alert24Regular = defineComponent({
|
|
739
740
|
name: "Alert24Regular",
|
|
740
741
|
render: function render(_ctx, _cache) {
|
|
741
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
742
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$7, _hoisted_3$7);
|
|
742
743
|
}
|
|
743
744
|
});
|
|
744
|
-
const _hoisted_1$
|
|
745
|
+
const _hoisted_1$6 = {
|
|
745
746
|
xmlns: "http://www.w3.org/2000/svg",
|
|
746
747
|
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
747
748
|
viewBox: "0 0 24 24"
|
|
748
749
|
};
|
|
749
|
-
const _hoisted_2$
|
|
750
|
+
const _hoisted_2$6 = /* @__PURE__ */ createElementVNode("g", {
|
|
750
751
|
fill: "none"
|
|
751
752
|
}, [
|
|
752
753
|
/* @__PURE__ */ createElementVNode("path", {
|
|
@@ -754,19 +755,19 @@ const _hoisted_2$5 = /* @__PURE__ */ createElementVNode("g", {
|
|
|
754
755
|
fill: "currentColor"
|
|
755
756
|
})
|
|
756
757
|
], -1);
|
|
757
|
-
const _hoisted_3$
|
|
758
|
+
const _hoisted_3$6 = [_hoisted_2$6];
|
|
758
759
|
var CheckmarkCircle24Regular = defineComponent({
|
|
759
760
|
name: "CheckmarkCircle24Regular",
|
|
760
761
|
render: function render2(_ctx, _cache) {
|
|
761
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
762
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$6, _hoisted_3$6);
|
|
762
763
|
}
|
|
763
764
|
});
|
|
764
|
-
const _hoisted_1$
|
|
765
|
+
const _hoisted_1$5 = {
|
|
765
766
|
xmlns: "http://www.w3.org/2000/svg",
|
|
766
767
|
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
767
768
|
viewBox: "0 0 20 20"
|
|
768
769
|
};
|
|
769
|
-
const _hoisted_2$
|
|
770
|
+
const _hoisted_2$5 = /* @__PURE__ */ createElementVNode("g", {
|
|
770
771
|
fill: "none"
|
|
771
772
|
}, [
|
|
772
773
|
/* @__PURE__ */ createElementVNode("path", {
|
|
@@ -774,19 +775,19 @@ const _hoisted_2$4 = /* @__PURE__ */ createElementVNode("g", {
|
|
|
774
775
|
fill: "currentColor"
|
|
775
776
|
})
|
|
776
777
|
], -1);
|
|
777
|
-
const _hoisted_3$
|
|
778
|
+
const _hoisted_3$5 = [_hoisted_2$5];
|
|
778
779
|
var Dismiss20Filled = defineComponent({
|
|
779
780
|
name: "Dismiss20Filled",
|
|
780
781
|
render: function render3(_ctx, _cache) {
|
|
781
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
782
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$5, _hoisted_3$5);
|
|
782
783
|
}
|
|
783
784
|
});
|
|
784
|
-
const _hoisted_1$
|
|
785
|
+
const _hoisted_1$4 = {
|
|
785
786
|
xmlns: "http://www.w3.org/2000/svg",
|
|
786
787
|
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
787
788
|
viewBox: "0 0 24 24"
|
|
788
789
|
};
|
|
789
|
-
const _hoisted_2$
|
|
790
|
+
const _hoisted_2$4 = /* @__PURE__ */ createElementVNode("g", {
|
|
790
791
|
fill: "none"
|
|
791
792
|
}, [
|
|
792
793
|
/* @__PURE__ */ createElementVNode("path", {
|
|
@@ -794,19 +795,19 @@ const _hoisted_2$3 = /* @__PURE__ */ createElementVNode("g", {
|
|
|
794
795
|
fill: "currentColor"
|
|
795
796
|
})
|
|
796
797
|
], -1);
|
|
797
|
-
const _hoisted_3$
|
|
798
|
+
const _hoisted_3$4 = [_hoisted_2$4];
|
|
798
799
|
var ErrorCircle24Regular = defineComponent({
|
|
799
800
|
name: "ErrorCircle24Regular",
|
|
800
801
|
render: function render4(_ctx, _cache) {
|
|
801
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
802
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$4, _hoisted_3$4);
|
|
802
803
|
}
|
|
803
804
|
});
|
|
804
|
-
const _hoisted_1$
|
|
805
|
+
const _hoisted_1$3 = {
|
|
805
806
|
xmlns: "http://www.w3.org/2000/svg",
|
|
806
807
|
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
807
808
|
viewBox: "0 0 24 24"
|
|
808
809
|
};
|
|
809
|
-
const _hoisted_2$
|
|
810
|
+
const _hoisted_2$3 = /* @__PURE__ */ createElementVNode("g", {
|
|
810
811
|
fill: "none"
|
|
811
812
|
}, [
|
|
812
813
|
/* @__PURE__ */ createElementVNode("path", {
|
|
@@ -814,19 +815,19 @@ const _hoisted_2$2 = /* @__PURE__ */ createElementVNode("g", {
|
|
|
814
815
|
fill: "currentColor"
|
|
815
816
|
})
|
|
816
817
|
], -1);
|
|
817
|
-
const _hoisted_3$
|
|
818
|
+
const _hoisted_3$3 = [_hoisted_2$3];
|
|
818
819
|
var Info24Regular = defineComponent({
|
|
819
820
|
name: "Info24Regular",
|
|
820
821
|
render: function render5(_ctx, _cache) {
|
|
821
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
822
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$3, _hoisted_3$3);
|
|
822
823
|
}
|
|
823
824
|
});
|
|
824
|
-
const _hoisted_1$
|
|
825
|
+
const _hoisted_1$2 = {
|
|
825
826
|
xmlns: "http://www.w3.org/2000/svg",
|
|
826
827
|
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
827
828
|
viewBox: "0 0 24 24"
|
|
828
829
|
};
|
|
829
|
-
const _hoisted_2$
|
|
830
|
+
const _hoisted_2$2 = /* @__PURE__ */ createElementVNode("g", {
|
|
830
831
|
fill: "none"
|
|
831
832
|
}, [
|
|
832
833
|
/* @__PURE__ */ createElementVNode("path", {
|
|
@@ -834,11 +835,11 @@ const _hoisted_2$1 = /* @__PURE__ */ createElementVNode("g", {
|
|
|
834
835
|
fill: "currentColor"
|
|
835
836
|
})
|
|
836
837
|
], -1);
|
|
837
|
-
const _hoisted_3$
|
|
838
|
+
const _hoisted_3$2 = [_hoisted_2$2];
|
|
838
839
|
var Warning24Regular = defineComponent({
|
|
839
840
|
name: "Warning24Regular",
|
|
840
841
|
render: function render6(_ctx, _cache) {
|
|
841
|
-
return openBlock(), createElementBlock("svg", _hoisted_1$
|
|
842
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$2, _hoisted_3$2);
|
|
842
843
|
}
|
|
843
844
|
});
|
|
844
845
|
function ampCount(selector) {
|
|
@@ -1317,12 +1318,12 @@ const Icon = defineComponent({
|
|
|
1317
1318
|
}
|
|
1318
1319
|
});
|
|
1319
1320
|
var LewAlert_vue_vue_type_style_index_0_lang = "";
|
|
1320
|
-
const _hoisted_1 = { class: "lew-alert-group" };
|
|
1321
|
-
const _hoisted_2 = { class: "alert-icon" };
|
|
1322
|
-
const _hoisted_3 = { class: "message" };
|
|
1321
|
+
const _hoisted_1$1 = { class: "lew-alert-group" };
|
|
1322
|
+
const _hoisted_2$1 = { class: "alert-icon" };
|
|
1323
|
+
const _hoisted_3$1 = { class: "message" };
|
|
1323
1324
|
const _hoisted_4 = { class: "title" };
|
|
1324
1325
|
const _hoisted_5 = ["onClick"];
|
|
1325
|
-
const _sfc_main$
|
|
1326
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
1326
1327
|
name: "LewAlert",
|
|
1327
1328
|
props: {
|
|
1328
1329
|
alertList: {
|
|
@@ -1335,13 +1336,13 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1335
1336
|
emits: ["close"],
|
|
1336
1337
|
setup(__props, { emit }) {
|
|
1337
1338
|
return (_ctx, _cache) => {
|
|
1338
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
1339
|
+
return openBlock(), createElementBlock("div", _hoisted_1$1, [
|
|
1339
1340
|
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.alertList, (item, i) => {
|
|
1340
1341
|
return openBlock(), createElementBlock("div", {
|
|
1341
1342
|
key: i,
|
|
1342
1343
|
class: normalizeClass(["lew-alert", `lew-alert-${item.type}`])
|
|
1343
1344
|
}, [
|
|
1344
|
-
createElementVNode("div", _hoisted_2, [
|
|
1345
|
+
createElementVNode("div", _hoisted_2$1, [
|
|
1345
1346
|
item.type == `normal` ? (openBlock(), createBlock(unref(Icon), {
|
|
1346
1347
|
key: 0,
|
|
1347
1348
|
size: "24"
|
|
@@ -1350,7 +1351,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1350
1351
|
createVNode(unref(Info24Regular))
|
|
1351
1352
|
]),
|
|
1352
1353
|
_: 1
|
|
1353
|
-
})) : createCommentVNode("", true),
|
|
1354
|
+
})) : createCommentVNode("v-if", true),
|
|
1354
1355
|
item.type == `warning` ? (openBlock(), createBlock(unref(Icon), {
|
|
1355
1356
|
key: 1,
|
|
1356
1357
|
size: "24"
|
|
@@ -1359,7 +1360,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1359
1360
|
createVNode(unref(Warning24Regular))
|
|
1360
1361
|
]),
|
|
1361
1362
|
_: 1
|
|
1362
|
-
})) : createCommentVNode("", true),
|
|
1363
|
+
})) : createCommentVNode("v-if", true),
|
|
1363
1364
|
item.type == `success` ? (openBlock(), createBlock(unref(Icon), {
|
|
1364
1365
|
key: 2,
|
|
1365
1366
|
size: "24"
|
|
@@ -1368,7 +1369,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1368
1369
|
createVNode(unref(CheckmarkCircle24Regular))
|
|
1369
1370
|
]),
|
|
1370
1371
|
_: 1
|
|
1371
|
-
})) : createCommentVNode("", true),
|
|
1372
|
+
})) : createCommentVNode("v-if", true),
|
|
1372
1373
|
item.type == `danger` ? (openBlock(), createBlock(unref(Icon), {
|
|
1373
1374
|
key: 3,
|
|
1374
1375
|
size: "24"
|
|
@@ -1377,7 +1378,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1377
1378
|
createVNode(unref(ErrorCircle24Regular))
|
|
1378
1379
|
]),
|
|
1379
1380
|
_: 1
|
|
1380
|
-
})) : createCommentVNode("", true),
|
|
1381
|
+
})) : createCommentVNode("v-if", true),
|
|
1381
1382
|
item.type == `primary` ? (openBlock(), createBlock(unref(Icon), {
|
|
1382
1383
|
key: 4,
|
|
1383
1384
|
size: "24"
|
|
@@ -1386,9 +1387,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1386
1387
|
createVNode(unref(Alert24Regular))
|
|
1387
1388
|
]),
|
|
1388
1389
|
_: 1
|
|
1389
|
-
})) : createCommentVNode("", true)
|
|
1390
|
+
})) : createCommentVNode("v-if", true)
|
|
1390
1391
|
]),
|
|
1391
|
-
createElementVNode("div", _hoisted_3, [
|
|
1392
|
+
createElementVNode("div", _hoisted_3$1, [
|
|
1392
1393
|
createElementVNode("div", _hoisted_4, toDisplayString(item.title), 1),
|
|
1393
1394
|
withDirectives(createElementVNode("div", { class: "content" }, toDisplayString(item.content), 513), [
|
|
1394
1395
|
[vShow, item.content]
|
|
@@ -1411,6 +1412,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
1411
1412
|
};
|
|
1412
1413
|
}
|
|
1413
1414
|
});
|
|
1415
|
+
var LewAlert = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__file", "/Users/kamtao/Documents/GitHub/Lew-UI/packages/components/feedback/LewAlert.vue"]]);
|
|
1414
1416
|
function useDOMCreate(nodeId) {
|
|
1415
1417
|
const node = document.createElement("div");
|
|
1416
1418
|
node.id = nodeId;
|
|
@@ -1420,7 +1422,7 @@ function useDOMCreate(nodeId) {
|
|
|
1420
1422
|
});
|
|
1421
1423
|
}
|
|
1422
1424
|
var LewModal_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
1423
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
1425
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
1424
1426
|
name: "LewModal",
|
|
1425
1427
|
props: {
|
|
1426
1428
|
title: {
|
|
@@ -1448,7 +1450,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1448
1450
|
};
|
|
1449
1451
|
return (_ctx, _cache) => {
|
|
1450
1452
|
return openBlock(), createBlock(Teleport, { to: "#lew-modal" }, [
|
|
1451
|
-
createVNode(Transition, { name: "
|
|
1453
|
+
createVNode(Transition, { name: "lew-modal" }, {
|
|
1452
1454
|
default: withCtx(() => [
|
|
1453
1455
|
__props.visible ? (openBlock(), createElementBlock("div", {
|
|
1454
1456
|
key: 0,
|
|
@@ -1463,8 +1465,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1463
1465
|
}, ["stop"]))
|
|
1464
1466
|
}, [
|
|
1465
1467
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
1466
|
-
], 4)) : createCommentVNode("", true)
|
|
1467
|
-
])) : createCommentVNode("", true)
|
|
1468
|
+
], 4)) : createCommentVNode("v-if", true)
|
|
1469
|
+
])) : createCommentVNode("v-if", true)
|
|
1468
1470
|
]),
|
|
1469
1471
|
_: 3
|
|
1470
1472
|
})
|
|
@@ -1472,7 +1474,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1472
1474
|
};
|
|
1473
1475
|
}
|
|
1474
1476
|
});
|
|
1475
|
-
var LewModal = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
1477
|
+
var LewModal = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-f98cc7b8"], ["__file", "/Users/kamtao/Documents/GitHub/Lew-UI/packages/components/feedback/LewModal.vue"]]);
|
|
1476
1478
|
var top = "top";
|
|
1477
1479
|
var bottom = "bottom";
|
|
1478
1480
|
var right = "right";
|
|
@@ -1789,7 +1791,15 @@ function effect$1(_ref2) {
|
|
|
1789
1791
|
return;
|
|
1790
1792
|
}
|
|
1791
1793
|
}
|
|
1794
|
+
{
|
|
1795
|
+
if (!isHTMLElement(arrowElement)) {
|
|
1796
|
+
console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).', "To use an SVG arrow, wrap it in an HTMLElement that will be used as", "the arrow."].join(" "));
|
|
1797
|
+
}
|
|
1798
|
+
}
|
|
1792
1799
|
if (!contains(state.elements.popper, arrowElement)) {
|
|
1800
|
+
{
|
|
1801
|
+
console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper', "element."].join(" "));
|
|
1802
|
+
}
|
|
1793
1803
|
return;
|
|
1794
1804
|
}
|
|
1795
1805
|
state.elements.arrow = arrowElement;
|
|
@@ -1885,6 +1895,14 @@ function mapToStyles(_ref2) {
|
|
|
1885
1895
|
function computeStyles(_ref5) {
|
|
1886
1896
|
var state = _ref5.state, options = _ref5.options;
|
|
1887
1897
|
var _options$gpuAccelerat = options.gpuAcceleration, gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, _options$adaptive = options.adaptive, adaptive = _options$adaptive === void 0 ? true : _options$adaptive, _options$roundOffsets = options.roundOffsets, roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
|
|
1898
|
+
{
|
|
1899
|
+
var transitionProperty = getComputedStyle(state.elements.popper).transitionProperty || "";
|
|
1900
|
+
if (adaptive && ["transform", "top", "right", "bottom", "left"].some(function(property) {
|
|
1901
|
+
return transitionProperty.indexOf(property) >= 0;
|
|
1902
|
+
})) {
|
|
1903
|
+
console.warn(["Popper: Detected CSS transitions on at least one of the following", 'CSS properties: "transform", "top", "right", "bottom", "left".', "\n\n", 'Disable the "computeStyles" modifier\'s `adaptive` option to allow', "for smooth transitions, or remove these properties from the CSS", "transition declaration on the popper element if only transitioning", "opacity or background-color for example.", "\n\n", "We recommend using the popper element as a wrapper around an inner", "element that can have any CSS property transitioned for animations."].join(" "));
|
|
1904
|
+
}
|
|
1905
|
+
}
|
|
1888
1906
|
var commonStyles = {
|
|
1889
1907
|
placement: getBasePlacement$1(state.placement),
|
|
1890
1908
|
variation: getVariation(state.placement),
|
|
@@ -2209,6 +2227,9 @@ function computeAutoPlacement(state, options) {
|
|
|
2209
2227
|
});
|
|
2210
2228
|
if (allowedPlacements.length === 0) {
|
|
2211
2229
|
allowedPlacements = placements$1;
|
|
2230
|
+
{
|
|
2231
|
+
console.error(["Popper: The `allowedAutoPlacements` option did not allow any", "placements. Ensure the `placement` option matches the variation", "of the allowed placements.", 'For example, "auto" cannot be used to allow "bottom-start".', 'Use "auto-start" instead.'].join(" "));
|
|
2232
|
+
}
|
|
2212
2233
|
}
|
|
2213
2234
|
var overflows = allowedPlacements.reduce(function(acc, placement2) {
|
|
2214
2235
|
acc[placement2] = detectOverflow(state, {
|
|
@@ -2629,6 +2650,86 @@ function debounce$1(fn2) {
|
|
|
2629
2650
|
return pending;
|
|
2630
2651
|
};
|
|
2631
2652
|
}
|
|
2653
|
+
function format(str) {
|
|
2654
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
2655
|
+
args[_key - 1] = arguments[_key];
|
|
2656
|
+
}
|
|
2657
|
+
return [].concat(args).reduce(function(p, c2) {
|
|
2658
|
+
return p.replace(/%s/, c2);
|
|
2659
|
+
}, str);
|
|
2660
|
+
}
|
|
2661
|
+
var INVALID_MODIFIER_ERROR = 'Popper: modifier "%s" provided an invalid %s property, expected %s but got %s';
|
|
2662
|
+
var MISSING_DEPENDENCY_ERROR = 'Popper: modifier "%s" requires "%s", but "%s" modifier is not available';
|
|
2663
|
+
var VALID_PROPERTIES = ["name", "enabled", "phase", "fn", "effect", "requires", "options"];
|
|
2664
|
+
function validateModifiers(modifiers) {
|
|
2665
|
+
modifiers.forEach(function(modifier) {
|
|
2666
|
+
[].concat(Object.keys(modifier), VALID_PROPERTIES).filter(function(value, index2, self) {
|
|
2667
|
+
return self.indexOf(value) === index2;
|
|
2668
|
+
}).forEach(function(key) {
|
|
2669
|
+
switch (key) {
|
|
2670
|
+
case "name":
|
|
2671
|
+
if (typeof modifier.name !== "string") {
|
|
2672
|
+
console.error(format(INVALID_MODIFIER_ERROR, String(modifier.name), '"name"', '"string"', '"' + String(modifier.name) + '"'));
|
|
2673
|
+
}
|
|
2674
|
+
break;
|
|
2675
|
+
case "enabled":
|
|
2676
|
+
if (typeof modifier.enabled !== "boolean") {
|
|
2677
|
+
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"enabled"', '"boolean"', '"' + String(modifier.enabled) + '"'));
|
|
2678
|
+
}
|
|
2679
|
+
break;
|
|
2680
|
+
case "phase":
|
|
2681
|
+
if (modifierPhases.indexOf(modifier.phase) < 0) {
|
|
2682
|
+
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"phase"', "either " + modifierPhases.join(", "), '"' + String(modifier.phase) + '"'));
|
|
2683
|
+
}
|
|
2684
|
+
break;
|
|
2685
|
+
case "fn":
|
|
2686
|
+
if (typeof modifier.fn !== "function") {
|
|
2687
|
+
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"fn"', '"function"', '"' + String(modifier.fn) + '"'));
|
|
2688
|
+
}
|
|
2689
|
+
break;
|
|
2690
|
+
case "effect":
|
|
2691
|
+
if (modifier.effect != null && typeof modifier.effect !== "function") {
|
|
2692
|
+
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"effect"', '"function"', '"' + String(modifier.fn) + '"'));
|
|
2693
|
+
}
|
|
2694
|
+
break;
|
|
2695
|
+
case "requires":
|
|
2696
|
+
if (modifier.requires != null && !Array.isArray(modifier.requires)) {
|
|
2697
|
+
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requires"', '"array"', '"' + String(modifier.requires) + '"'));
|
|
2698
|
+
}
|
|
2699
|
+
break;
|
|
2700
|
+
case "requiresIfExists":
|
|
2701
|
+
if (!Array.isArray(modifier.requiresIfExists)) {
|
|
2702
|
+
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requiresIfExists"', '"array"', '"' + String(modifier.requiresIfExists) + '"'));
|
|
2703
|
+
}
|
|
2704
|
+
break;
|
|
2705
|
+
case "options":
|
|
2706
|
+
case "data":
|
|
2707
|
+
break;
|
|
2708
|
+
default:
|
|
2709
|
+
console.error('PopperJS: an invalid property has been provided to the "' + modifier.name + '" modifier, valid properties are ' + VALID_PROPERTIES.map(function(s) {
|
|
2710
|
+
return '"' + s + '"';
|
|
2711
|
+
}).join(", ") + '; but "' + key + '" was provided.');
|
|
2712
|
+
}
|
|
2713
|
+
modifier.requires && modifier.requires.forEach(function(requirement) {
|
|
2714
|
+
if (modifiers.find(function(mod) {
|
|
2715
|
+
return mod.name === requirement;
|
|
2716
|
+
}) == null) {
|
|
2717
|
+
console.error(format(MISSING_DEPENDENCY_ERROR, String(modifier.name), requirement, requirement));
|
|
2718
|
+
}
|
|
2719
|
+
});
|
|
2720
|
+
});
|
|
2721
|
+
});
|
|
2722
|
+
}
|
|
2723
|
+
function uniqueBy(arr, fn2) {
|
|
2724
|
+
var identifiers = /* @__PURE__ */ new Set();
|
|
2725
|
+
return arr.filter(function(item) {
|
|
2726
|
+
var identifier = fn2(item);
|
|
2727
|
+
if (!identifiers.has(identifier)) {
|
|
2728
|
+
identifiers.add(identifier);
|
|
2729
|
+
return true;
|
|
2730
|
+
}
|
|
2731
|
+
});
|
|
2732
|
+
}
|
|
2632
2733
|
function mergeByName(modifiers) {
|
|
2633
2734
|
var merged = modifiers.reduce(function(merged2, current) {
|
|
2634
2735
|
var existing = merged2[current.name];
|
|
@@ -2642,6 +2743,8 @@ function mergeByName(modifiers) {
|
|
|
2642
2743
|
return merged[key];
|
|
2643
2744
|
});
|
|
2644
2745
|
}
|
|
2746
|
+
var INVALID_ELEMENT_ERROR = "Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.";
|
|
2747
|
+
var INFINITE_LOOP_ERROR = "Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.";
|
|
2645
2748
|
var DEFAULT_OPTIONS = {
|
|
2646
2749
|
placement: "bottom",
|
|
2647
2750
|
modifiers: [],
|
|
@@ -2692,6 +2795,28 @@ function popperGenerator(generatorOptions) {
|
|
|
2692
2795
|
state.orderedModifiers = orderedModifiers.filter(function(m) {
|
|
2693
2796
|
return m.enabled;
|
|
2694
2797
|
});
|
|
2798
|
+
{
|
|
2799
|
+
var modifiers = uniqueBy([].concat(orderedModifiers, state.options.modifiers), function(_ref) {
|
|
2800
|
+
var name = _ref.name;
|
|
2801
|
+
return name;
|
|
2802
|
+
});
|
|
2803
|
+
validateModifiers(modifiers);
|
|
2804
|
+
if (getBasePlacement$1(state.options.placement) === auto) {
|
|
2805
|
+
var flipModifier = state.orderedModifiers.find(function(_ref2) {
|
|
2806
|
+
var name = _ref2.name;
|
|
2807
|
+
return name === "flip";
|
|
2808
|
+
});
|
|
2809
|
+
if (!flipModifier) {
|
|
2810
|
+
console.error(['Popper: "auto" placements require the "flip" modifier be', "present and enabled to work."].join(" "));
|
|
2811
|
+
}
|
|
2812
|
+
}
|
|
2813
|
+
var _getComputedStyle = getComputedStyle(popper2), marginTop = _getComputedStyle.marginTop, marginRight = _getComputedStyle.marginRight, marginBottom = _getComputedStyle.marginBottom, marginLeft = _getComputedStyle.marginLeft;
|
|
2814
|
+
if ([marginTop, marginRight, marginBottom, marginLeft].some(function(margin) {
|
|
2815
|
+
return parseFloat(margin);
|
|
2816
|
+
})) {
|
|
2817
|
+
console.warn(['Popper: CSS "margin" styles cannot be used to apply padding', "between the popper and its reference element or boundary.", "To replicate margin, use the `offset` modifier, as well as", "the `padding` option in the `preventOverflow` and `flip`", "modifiers."].join(" "));
|
|
2818
|
+
}
|
|
2819
|
+
}
|
|
2695
2820
|
runModifierEffects();
|
|
2696
2821
|
return instance.update();
|
|
2697
2822
|
},
|
|
@@ -2701,6 +2826,9 @@ function popperGenerator(generatorOptions) {
|
|
|
2701
2826
|
}
|
|
2702
2827
|
var _state$elements = state.elements, reference3 = _state$elements.reference, popper3 = _state$elements.popper;
|
|
2703
2828
|
if (!areValidElements(reference3, popper3)) {
|
|
2829
|
+
{
|
|
2830
|
+
console.error(INVALID_ELEMENT_ERROR);
|
|
2831
|
+
}
|
|
2704
2832
|
return;
|
|
2705
2833
|
}
|
|
2706
2834
|
state.rects = {
|
|
@@ -2712,13 +2840,21 @@ function popperGenerator(generatorOptions) {
|
|
|
2712
2840
|
state.orderedModifiers.forEach(function(modifier) {
|
|
2713
2841
|
return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
|
|
2714
2842
|
});
|
|
2715
|
-
|
|
2843
|
+
var __debug_loops__ = 0;
|
|
2844
|
+
for (var index2 = 0; index2 < state.orderedModifiers.length; index2++) {
|
|
2845
|
+
{
|
|
2846
|
+
__debug_loops__ += 1;
|
|
2847
|
+
if (__debug_loops__ > 100) {
|
|
2848
|
+
console.error(INFINITE_LOOP_ERROR);
|
|
2849
|
+
break;
|
|
2850
|
+
}
|
|
2851
|
+
}
|
|
2716
2852
|
if (state.reset === true) {
|
|
2717
2853
|
state.reset = false;
|
|
2718
|
-
|
|
2854
|
+
index2 = -1;
|
|
2719
2855
|
continue;
|
|
2720
2856
|
}
|
|
2721
|
-
var _state$orderedModifie = state.orderedModifiers[
|
|
2857
|
+
var _state$orderedModifie = state.orderedModifiers[index2], fn2 = _state$orderedModifie.fn, _state$orderedModifie2 = _state$orderedModifie.options, _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, name = _state$orderedModifie.name;
|
|
2722
2858
|
if (typeof fn2 === "function") {
|
|
2723
2859
|
state = fn2({
|
|
2724
2860
|
state,
|
|
@@ -2741,6 +2877,9 @@ function popperGenerator(generatorOptions) {
|
|
|
2741
2877
|
}
|
|
2742
2878
|
};
|
|
2743
2879
|
if (!areValidElements(reference2, popper2)) {
|
|
2880
|
+
{
|
|
2881
|
+
console.error(INVALID_ELEMENT_ERROR);
|
|
2882
|
+
}
|
|
2744
2883
|
return instance;
|
|
2745
2884
|
}
|
|
2746
2885
|
instance.setOptions(options).then(function(state2) {
|
|
@@ -2789,10 +2928,13 @@ var TOUCH_OPTIONS = {
|
|
|
2789
2928
|
var TIPPY_DEFAULT_APPEND_TO = function TIPPY_DEFAULT_APPEND_TO2() {
|
|
2790
2929
|
return document.body;
|
|
2791
2930
|
};
|
|
2792
|
-
function
|
|
2931
|
+
function hasOwnProperty(obj, key) {
|
|
2932
|
+
return {}.hasOwnProperty.call(obj, key);
|
|
2933
|
+
}
|
|
2934
|
+
function getValueAtIndexOrReturn(value, index2, defaultValue) {
|
|
2793
2935
|
if (Array.isArray(value)) {
|
|
2794
|
-
var v = value[
|
|
2795
|
-
return v == null ? Array.isArray(defaultValue) ? defaultValue[
|
|
2936
|
+
var v = value[index2];
|
|
2937
|
+
return v == null ? Array.isArray(defaultValue) ? defaultValue[index2] : defaultValue : v;
|
|
2796
2938
|
}
|
|
2797
2939
|
return value;
|
|
2798
2940
|
}
|
|
@@ -2815,6 +2957,13 @@ function debounce(fn2, ms) {
|
|
|
2815
2957
|
}, ms);
|
|
2816
2958
|
};
|
|
2817
2959
|
}
|
|
2960
|
+
function removeProperties(obj, keys) {
|
|
2961
|
+
var clone = Object.assign({}, obj);
|
|
2962
|
+
keys.forEach(function(key) {
|
|
2963
|
+
delete clone[key];
|
|
2964
|
+
});
|
|
2965
|
+
return clone;
|
|
2966
|
+
}
|
|
2818
2967
|
function splitBySpaces(value) {
|
|
2819
2968
|
return value.split(/\s+/).filter(Boolean);
|
|
2820
2969
|
}
|
|
@@ -2827,8 +2976,8 @@ function pushIfUnique(arr, value) {
|
|
|
2827
2976
|
}
|
|
2828
2977
|
}
|
|
2829
2978
|
function unique(arr) {
|
|
2830
|
-
return arr.filter(function(item,
|
|
2831
|
-
return arr.indexOf(item) ===
|
|
2979
|
+
return arr.filter(function(item, index2) {
|
|
2980
|
+
return arr.indexOf(item) === index2;
|
|
2832
2981
|
});
|
|
2833
2982
|
}
|
|
2834
2983
|
function getBasePlacement(placement) {
|
|
@@ -2967,6 +3116,53 @@ function bindGlobalEventListeners() {
|
|
|
2967
3116
|
}
|
|
2968
3117
|
var isBrowser = typeof window !== "undefined" && typeof document !== "undefined";
|
|
2969
3118
|
var isIE11 = isBrowser ? !!window.msCrypto : false;
|
|
3119
|
+
function createMemoryLeakWarning(method) {
|
|
3120
|
+
var txt = method === "destroy" ? "n already-" : " ";
|
|
3121
|
+
return [method + "() was called on a" + txt + "destroyed instance. This is a no-op but", "indicates a potential memory leak."].join(" ");
|
|
3122
|
+
}
|
|
3123
|
+
function clean(value) {
|
|
3124
|
+
var spacesAndTabs = /[ \t]{2,}/g;
|
|
3125
|
+
var lineStartWithSpaces = /^[ \t]*/gm;
|
|
3126
|
+
return value.replace(spacesAndTabs, " ").replace(lineStartWithSpaces, "").trim();
|
|
3127
|
+
}
|
|
3128
|
+
function getDevMessage(message) {
|
|
3129
|
+
return clean("\n %ctippy.js\n\n %c" + clean(message) + "\n\n %c\u{1F477}\u200D This is a development-only message. It will be removed in production.\n ");
|
|
3130
|
+
}
|
|
3131
|
+
function getFormattedMessage(message) {
|
|
3132
|
+
return [
|
|
3133
|
+
getDevMessage(message),
|
|
3134
|
+
"color: #00C584; font-size: 1.3em; font-weight: bold;",
|
|
3135
|
+
"line-height: 1.5",
|
|
3136
|
+
"color: #a6a095;"
|
|
3137
|
+
];
|
|
3138
|
+
}
|
|
3139
|
+
var visitedMessages;
|
|
3140
|
+
{
|
|
3141
|
+
resetVisitedMessages();
|
|
3142
|
+
}
|
|
3143
|
+
function resetVisitedMessages() {
|
|
3144
|
+
visitedMessages = /* @__PURE__ */ new Set();
|
|
3145
|
+
}
|
|
3146
|
+
function warnWhen(condition, message) {
|
|
3147
|
+
if (condition && !visitedMessages.has(message)) {
|
|
3148
|
+
var _console;
|
|
3149
|
+
visitedMessages.add(message);
|
|
3150
|
+
(_console = console).warn.apply(_console, getFormattedMessage(message));
|
|
3151
|
+
}
|
|
3152
|
+
}
|
|
3153
|
+
function errorWhen(condition, message) {
|
|
3154
|
+
if (condition && !visitedMessages.has(message)) {
|
|
3155
|
+
var _console2;
|
|
3156
|
+
visitedMessages.add(message);
|
|
3157
|
+
(_console2 = console).error.apply(_console2, getFormattedMessage(message));
|
|
3158
|
+
}
|
|
3159
|
+
}
|
|
3160
|
+
function validateTargets(targets) {
|
|
3161
|
+
var didPassFalsyValue = !targets;
|
|
3162
|
+
var didPassPlainObject = Object.prototype.toString.call(targets) === "[object Object]" && !targets.addEventListener;
|
|
3163
|
+
errorWhen(didPassFalsyValue, ["tippy() was passed", "`" + String(targets) + "`", "as its targets (first) argument. Valid types are: String, Element,", "Element[], or NodeList."].join(" "));
|
|
3164
|
+
errorWhen(didPassPlainObject, ["tippy() was passed a plain object which is not supported as an argument", "for virtual positioning. Use props.getReferenceClientRect instead."].join(" "));
|
|
3165
|
+
}
|
|
2970
3166
|
var pluginProps = {
|
|
2971
3167
|
animateFill: false,
|
|
2972
3168
|
followCursor: false,
|
|
@@ -3035,6 +3231,9 @@ var defaultProps = Object.assign({
|
|
|
3035
3231
|
}, pluginProps, renderProps);
|
|
3036
3232
|
var defaultKeys = Object.keys(defaultProps);
|
|
3037
3233
|
var setDefaultProps = function setDefaultProps2(partialProps) {
|
|
3234
|
+
{
|
|
3235
|
+
validateProps(partialProps, []);
|
|
3236
|
+
}
|
|
3038
3237
|
var keys = Object.keys(partialProps);
|
|
3039
3238
|
keys.forEach(function(key) {
|
|
3040
3239
|
defaultProps[key] = partialProps[key];
|
|
@@ -3085,6 +3284,25 @@ function evaluateProps(reference2, props) {
|
|
|
3085
3284
|
};
|
|
3086
3285
|
return out;
|
|
3087
3286
|
}
|
|
3287
|
+
function validateProps(partialProps, plugins) {
|
|
3288
|
+
if (partialProps === void 0) {
|
|
3289
|
+
partialProps = {};
|
|
3290
|
+
}
|
|
3291
|
+
if (plugins === void 0) {
|
|
3292
|
+
plugins = [];
|
|
3293
|
+
}
|
|
3294
|
+
var keys = Object.keys(partialProps);
|
|
3295
|
+
keys.forEach(function(prop) {
|
|
3296
|
+
var nonPluginProps = removeProperties(defaultProps, Object.keys(pluginProps));
|
|
3297
|
+
var didPassUnknownProp = !hasOwnProperty(nonPluginProps, prop);
|
|
3298
|
+
if (didPassUnknownProp) {
|
|
3299
|
+
didPassUnknownProp = plugins.filter(function(plugin) {
|
|
3300
|
+
return plugin.name === prop;
|
|
3301
|
+
}).length === 0;
|
|
3302
|
+
}
|
|
3303
|
+
warnWhen(didPassUnknownProp, ["`" + prop + "`", "is not a valid prop. You may have spelled it incorrectly, or if it's", "a plugin, forgot to pass it in an array as props.plugins.", "\n\n", "All props: https://atomiks.github.io/tippyjs/v6/all-props/\n", "Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "));
|
|
3304
|
+
});
|
|
3305
|
+
}
|
|
3088
3306
|
var innerHTML = function innerHTML2() {
|
|
3089
3307
|
return "innerHTML";
|
|
3090
3308
|
};
|
|
@@ -3237,6 +3455,9 @@ function createTippy(reference2, passedProps) {
|
|
|
3237
3455
|
destroy
|
|
3238
3456
|
};
|
|
3239
3457
|
if (!props.render) {
|
|
3458
|
+
{
|
|
3459
|
+
errorWhen(true, "render() function has not been supplied.");
|
|
3460
|
+
}
|
|
3240
3461
|
return instance;
|
|
3241
3462
|
}
|
|
3242
3463
|
var _props$render = props.render(instance), popper2 = _props$render.popper, onUpdate = _props$render.onUpdate;
|
|
@@ -3652,6 +3873,9 @@ function createTippy(reference2, passedProps) {
|
|
|
3652
3873
|
}
|
|
3653
3874
|
instance.state.isMounted = true;
|
|
3654
3875
|
createPopperInstance();
|
|
3876
|
+
{
|
|
3877
|
+
warnWhen(instance.props.interactive && appendTo === defaultProps.appendTo && node.nextElementSibling !== popper2, ["Interactive tippy element may not be accessible via keyboard", "navigation because it is not directly after the reference element", "in the DOM source order.", "\n\n", "Using a wrapper <div> or <span> tag around the reference element", "solves this by creating a new parentNode context.", "\n\n", "Specifying `appendTo: document.body` silences this warning, but it", "assumes you are using a focus management solution to handle", "keyboard navigation.", "\n\n", "See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "));
|
|
3878
|
+
}
|
|
3655
3879
|
}
|
|
3656
3880
|
function getNestedPopperTree() {
|
|
3657
3881
|
return arrayFrom(popper2.querySelectorAll("[data-tippy-root]"));
|
|
@@ -3711,6 +3935,9 @@ function createTippy(reference2, passedProps) {
|
|
|
3711
3935
|
cancelAnimationFrame(scheduleHideAnimationFrame);
|
|
3712
3936
|
}
|
|
3713
3937
|
function setProps(partialProps) {
|
|
3938
|
+
{
|
|
3939
|
+
warnWhen(instance.state.isDestroyed, createMemoryLeakWarning("setProps"));
|
|
3940
|
+
}
|
|
3714
3941
|
if (instance.state.isDestroyed) {
|
|
3715
3942
|
return;
|
|
3716
3943
|
}
|
|
@@ -3752,6 +3979,9 @@ function createTippy(reference2, passedProps) {
|
|
|
3752
3979
|
});
|
|
3753
3980
|
}
|
|
3754
3981
|
function show() {
|
|
3982
|
+
{
|
|
3983
|
+
warnWhen(instance.state.isDestroyed, createMemoryLeakWarning("show"));
|
|
3984
|
+
}
|
|
3755
3985
|
var isAlreadyVisible = instance.state.isVisible;
|
|
3756
3986
|
var isDestroyed = instance.state.isDestroyed;
|
|
3757
3987
|
var isDisabled = !instance.state.isEnabled;
|
|
@@ -3808,6 +4038,9 @@ function createTippy(reference2, passedProps) {
|
|
|
3808
4038
|
mount2();
|
|
3809
4039
|
}
|
|
3810
4040
|
function hide2() {
|
|
4041
|
+
{
|
|
4042
|
+
warnWhen(instance.state.isDestroyed, createMemoryLeakWarning("hide"));
|
|
4043
|
+
}
|
|
3811
4044
|
var isAlreadyHidden = !instance.state.isVisible;
|
|
3812
4045
|
var isDestroyed = instance.state.isDestroyed;
|
|
3813
4046
|
var isDisabled = !instance.state.isEnabled;
|
|
@@ -3847,11 +4080,17 @@ function createTippy(reference2, passedProps) {
|
|
|
3847
4080
|
}
|
|
3848
4081
|
}
|
|
3849
4082
|
function hideWithInteractivity(event) {
|
|
4083
|
+
{
|
|
4084
|
+
warnWhen(instance.state.isDestroyed, createMemoryLeakWarning("hideWithInteractivity"));
|
|
4085
|
+
}
|
|
3850
4086
|
getDocument().addEventListener("mousemove", debouncedOnMouseMove);
|
|
3851
4087
|
pushIfUnique(mouseMoveListeners, debouncedOnMouseMove);
|
|
3852
4088
|
debouncedOnMouseMove(event);
|
|
3853
4089
|
}
|
|
3854
4090
|
function unmount2() {
|
|
4091
|
+
{
|
|
4092
|
+
warnWhen(instance.state.isDestroyed, createMemoryLeakWarning("unmount"));
|
|
4093
|
+
}
|
|
3855
4094
|
if (instance.state.isVisible) {
|
|
3856
4095
|
instance.hide();
|
|
3857
4096
|
}
|
|
@@ -3872,6 +4111,9 @@ function createTippy(reference2, passedProps) {
|
|
|
3872
4111
|
invokeHook("onHidden", [instance]);
|
|
3873
4112
|
}
|
|
3874
4113
|
function destroy() {
|
|
4114
|
+
{
|
|
4115
|
+
warnWhen(instance.state.isDestroyed, createMemoryLeakWarning("destroy"));
|
|
4116
|
+
}
|
|
3875
4117
|
if (instance.state.isDestroyed) {
|
|
3876
4118
|
return;
|
|
3877
4119
|
}
|
|
@@ -3888,11 +4130,20 @@ function tippy$1(targets, optionalProps) {
|
|
|
3888
4130
|
optionalProps = {};
|
|
3889
4131
|
}
|
|
3890
4132
|
var plugins = defaultProps.plugins.concat(optionalProps.plugins || []);
|
|
4133
|
+
{
|
|
4134
|
+
validateTargets(targets);
|
|
4135
|
+
validateProps(optionalProps, plugins);
|
|
4136
|
+
}
|
|
3891
4137
|
bindGlobalEventListeners();
|
|
3892
4138
|
var passedProps = Object.assign({}, optionalProps, {
|
|
3893
4139
|
plugins
|
|
3894
4140
|
});
|
|
3895
4141
|
var elements = getArrayOfElements(targets);
|
|
4142
|
+
{
|
|
4143
|
+
var isSingleContentElement = isElement(passedProps.content);
|
|
4144
|
+
var isMoreThanOneReferenceElement = elements.length > 1;
|
|
4145
|
+
warnWhen(isSingleContentElement && isMoreThanOneReferenceElement, ["tippy() was passed an Element as the `content` prop, but more than", "one tippy instance was created by this invocation. This means the", "content element will only be appended to the last tippy instance.", "\n\n", "Instead, pass the .innerHTML of the element, or use a function that", "returns a cloned version of the element instead.", "\n\n", "1) content: element.innerHTML\n", "2) content: () => element.cloneNode(true)"].join(" "));
|
|
4146
|
+
}
|
|
3896
4147
|
var instances = elements.reduce(function(acc, reference2) {
|
|
3897
4148
|
var instance = reference2 && createTippy(reference2, passedProps);
|
|
3898
4149
|
if (instance) {
|
|
@@ -3951,7 +4202,197 @@ var LewTooltips = {
|
|
|
3951
4202
|
});
|
|
3952
4203
|
}
|
|
3953
4204
|
};
|
|
4205
|
+
var LewDialog_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
4206
|
+
var LewDialog_vue_vue_type_style_index_1_lang = "";
|
|
4207
|
+
const _hoisted_1 = { class: "lew-dialog-box" };
|
|
4208
|
+
const _hoisted_2 = /* @__PURE__ */ createTextVNode("\u53D6\u6D88");
|
|
4209
|
+
const _hoisted_3 = /* @__PURE__ */ createTextVNode("\u786E\u8BA4");
|
|
4210
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4211
|
+
name: "LewDialog",
|
|
4212
|
+
props: {
|
|
4213
|
+
visible: {
|
|
4214
|
+
type: Boolean,
|
|
4215
|
+
default: false
|
|
4216
|
+
},
|
|
4217
|
+
closeOnClickOverlay: {
|
|
4218
|
+
type: Boolean,
|
|
4219
|
+
default: true
|
|
4220
|
+
},
|
|
4221
|
+
ok: {
|
|
4222
|
+
type: Function
|
|
4223
|
+
},
|
|
4224
|
+
cancel: {
|
|
4225
|
+
type: Function
|
|
4226
|
+
}
|
|
4227
|
+
},
|
|
4228
|
+
emits: ["update:visible"],
|
|
4229
|
+
setup(__props, { emit }) {
|
|
4230
|
+
const props = __props;
|
|
4231
|
+
const OnClickOverlay = () => {
|
|
4232
|
+
if (props.closeOnClickOverlay) {
|
|
4233
|
+
close();
|
|
4234
|
+
}
|
|
4235
|
+
};
|
|
4236
|
+
let isShowDialog = ref(true);
|
|
4237
|
+
const close = () => {
|
|
4238
|
+
isShowDialog.value = false;
|
|
4239
|
+
setTimeout(() => {
|
|
4240
|
+
emit("update:visible", false);
|
|
4241
|
+
}, 245);
|
|
4242
|
+
};
|
|
4243
|
+
const okFn = () => {
|
|
4244
|
+
if (typeof props.ok === "function") {
|
|
4245
|
+
props.ok();
|
|
4246
|
+
}
|
|
4247
|
+
close();
|
|
4248
|
+
};
|
|
4249
|
+
const cancelFn = () => {
|
|
4250
|
+
if (typeof props.cancel === "function") {
|
|
4251
|
+
props.cancel();
|
|
4252
|
+
}
|
|
4253
|
+
close();
|
|
4254
|
+
};
|
|
4255
|
+
return (_ctx, _cache) => {
|
|
4256
|
+
return openBlock(), createBlock(Teleport, { to: "body" }, [
|
|
4257
|
+
__props.visible ? (openBlock(), createElementBlock("div", {
|
|
4258
|
+
key: 0,
|
|
4259
|
+
class: "lew-dialog",
|
|
4260
|
+
style: normalizeStyle(unref(isShowDialog) ? "animation: lewDialogOpen 0.25s;" : "animation: lewDialogClose 0.25s;"),
|
|
4261
|
+
onClick: OnClickOverlay
|
|
4262
|
+
}, [
|
|
4263
|
+
createElementVNode("div", _hoisted_1, [
|
|
4264
|
+
createElementVNode("header", null, [
|
|
4265
|
+
renderSlot(_ctx.$slots, "title", {}, void 0, true),
|
|
4266
|
+
createElementVNode("span", {
|
|
4267
|
+
class: "gulu-dialog-close",
|
|
4268
|
+
onClick: close
|
|
4269
|
+
})
|
|
4270
|
+
]),
|
|
4271
|
+
createElementVNode("main", null, [
|
|
4272
|
+
renderSlot(_ctx.$slots, "content", {}, void 0, true)
|
|
4273
|
+
]),
|
|
4274
|
+
createElementVNode("footer", null, [
|
|
4275
|
+
createVNode(unref(LewButton), {
|
|
4276
|
+
type: "normal",
|
|
4277
|
+
onClick: cancelFn
|
|
4278
|
+
}, {
|
|
4279
|
+
default: withCtx(() => [
|
|
4280
|
+
_hoisted_2
|
|
4281
|
+
]),
|
|
4282
|
+
_: 1
|
|
4283
|
+
}),
|
|
4284
|
+
createVNode(unref(LewButton), { onClick: okFn }, {
|
|
4285
|
+
default: withCtx(() => [
|
|
4286
|
+
_hoisted_3
|
|
4287
|
+
]),
|
|
4288
|
+
_: 1
|
|
4289
|
+
})
|
|
4290
|
+
])
|
|
4291
|
+
])
|
|
4292
|
+
], 4)) : createCommentVNode("v-if", true)
|
|
4293
|
+
]);
|
|
4294
|
+
};
|
|
4295
|
+
}
|
|
4296
|
+
});
|
|
4297
|
+
var LewDialog = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-21634138"], ["__file", "/Users/kamtao/Documents/GitHub/Lew-UI/packages/components/feedback/LewDialog/LewDialog.vue"]]);
|
|
4298
|
+
const warning$1 = (options) => {
|
|
4299
|
+
dialog$1("warning", options);
|
|
4300
|
+
};
|
|
4301
|
+
const error$1 = (options) => {
|
|
4302
|
+
dialog$1("error", options);
|
|
4303
|
+
};
|
|
4304
|
+
const info$1 = (options) => {
|
|
4305
|
+
dialog$1("info", options);
|
|
4306
|
+
};
|
|
4307
|
+
const normal$1 = (options) => {
|
|
4308
|
+
dialog$1("normal", options);
|
|
4309
|
+
};
|
|
4310
|
+
const success$1 = (options) => {
|
|
4311
|
+
dialog$1("success", options);
|
|
4312
|
+
};
|
|
4313
|
+
const dialog$1 = (type, options) => {
|
|
4314
|
+
const { title, content, ok, cancel } = options;
|
|
4315
|
+
const div2 = document.createElement("div");
|
|
4316
|
+
document.body.appendChild(div2);
|
|
4317
|
+
const close = () => {
|
|
4318
|
+
app.unmount(div2);
|
|
4319
|
+
div2.remove();
|
|
4320
|
+
};
|
|
4321
|
+
const app = createApp({
|
|
4322
|
+
render() {
|
|
4323
|
+
return h(LewDialog, {
|
|
4324
|
+
closeOnClickOverlay: false,
|
|
4325
|
+
visible: true,
|
|
4326
|
+
"onUpdate:visible": (newVisible) => {
|
|
4327
|
+
if (newVisible === false) {
|
|
4328
|
+
close();
|
|
4329
|
+
}
|
|
4330
|
+
},
|
|
4331
|
+
ok,
|
|
4332
|
+
cancel
|
|
4333
|
+
}, {
|
|
4334
|
+
title: () => title,
|
|
4335
|
+
content: () => content
|
|
4336
|
+
});
|
|
4337
|
+
}
|
|
4338
|
+
});
|
|
4339
|
+
app.mount(div2);
|
|
4340
|
+
};
|
|
4341
|
+
var index$1 = { warning: warning$1, info: info$1, normal: normal$1, success: success$1, error: error$1 };
|
|
4342
|
+
var LewMessage = "";
|
|
4343
|
+
const warning = (content) => {
|
|
4344
|
+
dialog("warning", content);
|
|
4345
|
+
};
|
|
4346
|
+
const error = (content) => {
|
|
4347
|
+
dialog("error", content);
|
|
4348
|
+
};
|
|
4349
|
+
const info = (content) => {
|
|
4350
|
+
dialog("info", content);
|
|
4351
|
+
};
|
|
4352
|
+
const normal = (content) => {
|
|
4353
|
+
dialog("normal", content);
|
|
4354
|
+
};
|
|
4355
|
+
const success = (content) => {
|
|
4356
|
+
dialog("success", content);
|
|
4357
|
+
};
|
|
4358
|
+
const createMessageList = () => {
|
|
4359
|
+
const div2 = document.createElement("div");
|
|
4360
|
+
div2.setAttribute("id", "lew-message");
|
|
4361
|
+
document.body.appendChild(div2);
|
|
4362
|
+
};
|
|
4363
|
+
const dialog = (type, content) => {
|
|
4364
|
+
if (!document.getElementById("lew-message")) {
|
|
4365
|
+
createMessageList();
|
|
4366
|
+
dialog(type, content);
|
|
4367
|
+
} else {
|
|
4368
|
+
addMessage(type, content);
|
|
4369
|
+
}
|
|
4370
|
+
};
|
|
4371
|
+
const addMessage = (type, text) => {
|
|
4372
|
+
const LewMessageDom = document.getElementById("lew-message");
|
|
4373
|
+
const newMessage = document.createElement("div");
|
|
4374
|
+
const svgArr = {
|
|
4375
|
+
success: `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><g fill="none"><path d="M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12S6.477 2 12 2zm0 1.5a8.5 8.5 0 1 0 0 17a8.5 8.5 0 0 0 0-17zm-1.25 9.94l4.47-4.47a.75.75 0 0 1 1.133.976l-.073.084l-5 5a.75.75 0 0 1-.976.073l-.084-.073l-2.5-2.5a.75.75 0 0 1 .976-1.133l.084.073l1.97 1.97l4.47-4.47l-4.47 4.47z" fill="currentColor"></path></g></svg>`,
|
|
4376
|
+
warning: `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><g fill="none"><path d="M10.91 2.782a2.25 2.25 0 0 1 2.975.74l.083.138l7.759 14.009a2.25 2.25 0 0 1-1.814 3.334l-.154.006H4.243a2.25 2.25 0 0 1-2.041-3.197l.072-.143L10.031 3.66a2.25 2.25 0 0 1 .878-.878zm9.505 15.613l-7.76-14.008a.75.75 0 0 0-1.254-.088l-.057.088l-7.757 14.008a.75.75 0 0 0 .561 1.108l.095.006h15.516a.75.75 0 0 0 .696-1.028l-.04-.086l-7.76-14.008l7.76 14.008zM12 16.002a.999.999 0 1 1 0 1.997a.999.999 0 0 1 0-1.997zM11.995 8.5a.75.75 0 0 1 .744.647l.007.102l.004 4.502a.75.75 0 0 1-1.494.103l-.006-.102l-.004-4.502a.75.75 0 0 1 .75-.75z" fill="currentColor"></path></g></svg>`,
|
|
4377
|
+
error: `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><g fill="none"><path d="M12 2c5.523 0 10 4.478 10 10s-4.477 10-10 10S2 17.522 2 12S6.477 2 12 2zm0 1.667c-4.595 0-8.333 3.738-8.333 8.333c0 4.595 3.738 8.333 8.333 8.333c4.595 0 8.333-3.738 8.333-8.333c0-4.595-3.738-8.333-8.333-8.333zm-.001 10.835a.999.999 0 1 1 0 1.998a.999.999 0 0 1 0-1.998zM11.994 7a.75.75 0 0 1 .744.648l.007.101l.004 4.502a.75.75 0 0 1-1.493.103l-.007-.102l-.004-4.501a.75.75 0 0 1 .75-.751z" fill="currentColor"></path></g></svg>`,
|
|
4378
|
+
normal: `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><g fill="none"><path d="M12 1.999c5.524 0 10.002 4.478 10.002 10.002c0 5.523-4.478 10.001-10.002 10.001C6.476 22.002 2 17.524 2 12.001C1.999 6.477 6.476 1.999 12 1.999zm0 1.5a8.502 8.502 0 1 0 0 17.003A8.502 8.502 0 0 0 12 3.5zm-.004 7a.75.75 0 0 1 .744.648l.007.102l.004 5.502a.75.75 0 0 1-1.494.102l-.006-.101l-.004-5.502a.75.75 0 0 1 .75-.75zm.005-3.497a.999.999 0 1 1 0 1.997a.999.999 0 0 1 0-1.997z" fill="currentColor"></path></g></svg>`,
|
|
4379
|
+
info: `<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><g fill="none"><path d="M12 1.996a7.49 7.49 0 0 1 7.496 7.25l.004.25v4.097l1.38 3.156a1.249 1.249 0 0 1-1.145 1.75L15 18.502a3 3 0 0 1-5.995.177L9 18.499H4.275a1.251 1.251 0 0 1-1.147-1.747L4.5 13.594V9.496c0-4.155 3.352-7.5 7.5-7.5zM13.5 18.5l-3 .002a1.5 1.5 0 0 0 2.993.145l.007-.147zM12 3.496c-3.32 0-6 2.674-6 6v4.41L4.656 17h14.697L18 13.907V9.509l-.003-.225A5.988 5.988 0 0 0 12 3.496z" fill="currentColor"></path></g></svg>`
|
|
4380
|
+
};
|
|
4381
|
+
newMessage.innerHTML = `${svgArr[type]}<span>${text}</span>`;
|
|
4382
|
+
LewMessageDom == null ? void 0 : LewMessageDom.appendChild(newMessage, LewMessageDom == null ? void 0 : LewMessageDom.childNodes[0]);
|
|
4383
|
+
newMessage.setAttribute("class", `message message-${type}`);
|
|
4384
|
+
setTimeout(() => {
|
|
4385
|
+
newMessage.setAttribute("class", `message message-${type} message-show`);
|
|
4386
|
+
setTimeout(() => {
|
|
4387
|
+
newMessage.setAttribute("class", `message message-${type} message-hidden`);
|
|
4388
|
+
setTimeout(() => {
|
|
4389
|
+
LewMessageDom == null ? void 0 : LewMessageDom.removeChild(newMessage);
|
|
4390
|
+
}, 250);
|
|
4391
|
+
}, 3e3);
|
|
4392
|
+
}, 10);
|
|
4393
|
+
};
|
|
4394
|
+
var index = { warning, info, normal, success, error };
|
|
3954
4395
|
var reset = "";
|
|
3955
4396
|
var main = "";
|
|
3956
4397
|
var _var = "";
|
|
3957
|
-
export {
|
|
4398
|
+
export { LewAlert, LewAvatar, LewBadge, LewButton, LewCheckbox, LewCheckboxGroup, index$1 as LewDialog, LewFormItem, LewInput, index as LewMessage, LewModal, LewRadio as LewRadiobox, LewRadioGroup as LewRadioboxGroup, LewSelect, LewSwitch, LewTabs, LewTextarea, LewTitle, LewTooltips };
|