eco-vue-js 0.12.39 → 0.12.41
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/components/Input/WInput.vue.d.ts.map +1 -1
- package/dist/components/Input/WInput.vue_vue_type_script_setup_true_lang.js +28 -15
- package/dist/components/Input/components/ContentEditable.vue.d.ts +2 -2
- package/dist/components/Input/components/ContentEditable.vue.d.ts.map +1 -1
- package/dist/components/Input/components/ContentEditable.vue_vue_type_script_setup_true_lang.js +163 -42
- package/dist/components/Input/components/InputActions.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/Input/components/InputActionsButton.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/Input/models/utils.d.ts.map +1 -1
- package/dist/components/Input/models/utils.js +109 -26
- package/dist/components/Input/types.d.ts +1 -0
- package/dist/components/Input/types.d.ts.map +1 -1
- package/dist/components/List/use/useListConfig.js +1 -1
- package/package.json +1 -1
- package/tailwind-base/index.ts +1 -1
- package/tailwind-base/plugins/default.ts +3 -3
- package/tailwind-base/plugins/internal-classes.ts +3 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WInput.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/WInput.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WInput.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/WInput.vue"],"names":[],"mappings":"AAmWA;AAkyBA,OAAO,KAAK,EAAC,UAAU,EAAE,aAAa,EAAC,MAAM,SAAS,CAAA;AACtD,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,mCAAmC,CAAA;AAkBlE,OAAO,EAAC,KAAK,WAAW,EAAC,MAAM,gBAAgB,CAAA;yBAI9B,IAAI,SAAS,SAAS,GAAG,MAAM,EAC/C,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI,C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AAE;AAzoCzE,wBAyoC4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
|
@@ -10,7 +10,7 @@ import FilePickerSvg_default from "../FilePicker/components/FilePickerSvg.vue.js
|
|
|
10
10
|
import IconCheckSecret_default from "../../assets/icons/IconCheckSecret.js";
|
|
11
11
|
import InputActions_default from "./components/InputActions.vue.js";
|
|
12
12
|
import { useInputAsync } from "./models/useInputAsync.js";
|
|
13
|
-
import { Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineAsyncComponent, defineComponent, guardReactiveProps, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onBeforeUnmount, onMounted, openBlock, ref, renderSlot, resolveDynamicComponent, toDisplayString, unref, useTemplateRef, watch, withCtx, withKeys, withModifiers } from "vue";
|
|
13
|
+
import { Fragment, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineAsyncComponent, defineComponent, guardReactiveProps, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onBeforeUnmount, onMounted, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, unref, useTemplateRef, watch, withCtx, withKeys, withModifiers } from "vue";
|
|
14
14
|
//#region src/components/Input/WInput.vue?vue&type=script&setup=true&lang.ts
|
|
15
15
|
var _hoisted_1 = ["onMousedown"];
|
|
16
16
|
var _hoisted_2 = {
|
|
@@ -24,7 +24,7 @@ var _hoisted_3 = {
|
|
|
24
24
|
var _hoisted_4 = { class: "relative flex min-h-full flex-1" };
|
|
25
25
|
var _hoisted_5 = {
|
|
26
26
|
key: 0,
|
|
27
|
-
class: "text-description pointer-events-none absolute"
|
|
27
|
+
class: "text-description -p--w-option-padding pointer-events-none absolute"
|
|
28
28
|
};
|
|
29
29
|
var _hoisted_6 = {
|
|
30
30
|
key: 3,
|
|
@@ -136,6 +136,7 @@ var WInput_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
136
136
|
const inputRef = useTemplateRef("input");
|
|
137
137
|
const isSecureVisible = ref(false);
|
|
138
138
|
const downed = ref(false);
|
|
139
|
+
const gateValue = (value) => typeof value !== "string" ? props.textSecure || typeof value !== "number" ? "" : `${value}` : value;
|
|
139
140
|
const asyncState = useInputAsync({
|
|
140
141
|
props,
|
|
141
142
|
emit,
|
|
@@ -313,6 +314,7 @@ var WInput_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
313
314
|
};
|
|
314
315
|
const paste = async () => {
|
|
315
316
|
if (props.loading || isDisabled.value || isReadonly.value || props.unclickable) return;
|
|
317
|
+
focus();
|
|
316
318
|
try {
|
|
317
319
|
await checkPermissionPaste();
|
|
318
320
|
await navigator.clipboard.readText().then((value) => {
|
|
@@ -444,17 +446,24 @@ var WInput_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
444
446
|
"flex-wrap": !__props.seamless,
|
|
445
447
|
"overflow-hidden": __props.seamless,
|
|
446
448
|
"w-full": __props.textarea
|
|
447
|
-
}]) }, [renderSlot(_ctx.$slots, "prefix"), !__props.hideInput ? (openBlock(),
|
|
449
|
+
}]) }, [renderSlot(_ctx.$slots, "prefix"), !__props.hideInput ? (openBlock(), createBlock(resolveDynamicComponent(__props.textarea ? "code" : "div"), {
|
|
448
450
|
key: 0,
|
|
449
451
|
class: normalizeClass([{
|
|
450
452
|
"font-mono": __props.mono,
|
|
451
453
|
"text-secure": __props.textSecure && !isSecureVisible.value && __props.modelValue,
|
|
452
|
-
"h-[--w-textarea-height,10rem] min-h-[--w-textarea-height,10rem] w-full overflow-auto overscroll-contain whitespace-pre": __props.textarea,
|
|
454
|
+
"h-[--w-textarea-height,10rem] min-h-[--w-textarea-height,10rem] w-full overflow-auto overscroll-contain whitespace-pre bg-[--w-input-bg,inherit]": __props.textarea,
|
|
453
455
|
"resize-y": __props.resize && __props.textarea,
|
|
454
|
-
"resize-none": !__props.resize && __props.textarea
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
456
|
+
"resize-none": !__props.resize && __props.textarea
|
|
457
|
+
}, "scrollbar-width-thin group/field -py--w-option-padding overflow-x-auto overscroll-x-contain"])
|
|
458
|
+
}, {
|
|
459
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "before", normalizeProps(guardReactiveProps({ modelValue: __props.modelValue }))), __props.textarea ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList((__props.modelValue || __props.emptyValue)?.toString().split("\n"), (line, index) => {
|
|
460
|
+
return openBlock(), createElementBlock("div", {
|
|
461
|
+
key: index,
|
|
462
|
+
class: "line"
|
|
463
|
+
}, [createElementVNode("div", null, toDisplayString(line), 1)]);
|
|
464
|
+
}), 128)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(__props.modelValue || __props.emptyValue), 1)], 64))]),
|
|
465
|
+
_: 3
|
|
466
|
+
}, 8, ["class"])) : createCommentVNode("", true)], 2)]),
|
|
458
467
|
key: "2"
|
|
459
468
|
} : {
|
|
460
469
|
name: "field",
|
|
@@ -507,7 +516,7 @@ var WInput_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
507
516
|
ref: "content",
|
|
508
517
|
class: normalizeClass(["group/input relative col-start-2 grid grid-cols-1", {
|
|
509
518
|
"py-[--w-input-gap,0.25rem] first:pl-[--w-input-gap,0.25rem] last:pr-[--w-input-gap,0.25rem]": _ctx.$slots.prefix,
|
|
510
|
-
"no-scrollbar overflow-x-auto overscroll-x-contain": __props.noWrap && !(__props.seamless && !focused),
|
|
519
|
+
"no-scrollbar scrollbar-width-thin overflow-x-auto overscroll-x-contain": __props.noWrap && !(__props.seamless && !focused),
|
|
511
520
|
"overflow-hidden": __props.seamless && !focused
|
|
512
521
|
}])
|
|
513
522
|
}, [__props.allowDropFile && unref(isDragging) ? (openBlock(), createElementBlock("div", _hoisted_2, [createVNode(FilePickerSvg_default, {
|
|
@@ -519,7 +528,7 @@ var WInput_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
519
528
|
"w-full min-w-max": !__props.textarea && __props.noWrap
|
|
520
529
|
}]) }, [
|
|
521
530
|
renderSlot(_ctx.$slots, "prefix", normalizeProps(guardReactiveProps({ modelValue: __props.modelValue }))),
|
|
522
|
-
__props.textSecure && __props.modelValue
|
|
531
|
+
__props.textSecure && __props.modelValue === true && (!unref(asyncState).isAsync.value || !unref(asyncState).value.value) && !focused ? (openBlock(), createElementBlock("div", _hoisted_3, [createVNode(unref(IconCheckSecret_default), { class: normalizeClass(["text-info dark:text-info-dark", {
|
|
523
532
|
"square-6": !__props.textarea,
|
|
524
533
|
"square-7": __props.textarea
|
|
525
534
|
}]) }, null, 8, ["class"])])) : createCommentVNode("", true),
|
|
@@ -533,11 +542,12 @@ var WInput_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
533
542
|
"font-mono": __props.mono,
|
|
534
543
|
"text-black-default dark:text-gray-200": !unref(isDisabled),
|
|
535
544
|
"text-black-default/50 dark:text-gray-200/50": unref(isDisabled),
|
|
536
|
-
"-
|
|
537
|
-
"absolute": __props.hideInput
|
|
545
|
+
"scrollbar-width-thin h-[--w-textarea-height,10rem] min-h-[--w-textarea-height,10rem] w-full overflow-auto overscroll-contain": __props.textarea,
|
|
546
|
+
"absolute": __props.hideInput,
|
|
547
|
+
"opacity-0": __props.textSecure && __props.modelValue === true && (!unref(asyncState).isAsync.value || !unref(asyncState).value.value) && !focused
|
|
538
548
|
}]) }, [createElementVNode("div", _hoisted_4, [
|
|
539
549
|
renderSlot(_ctx.$slots, "before", normalizeProps(guardReactiveProps({ modelValue: __props.modelValue }))),
|
|
540
|
-
__props.placeholder && __props.textarea && hasNoValue.value ? (openBlock(), createElementBlock("div", _hoisted_5, toDisplayString(__props.placeholder), 1)) : createCommentVNode("", true),
|
|
550
|
+
__props.placeholder && __props.textarea && hasNoValue.value && !focused ? (openBlock(), createElementBlock("div", _hoisted_5, toDisplayString(__props.placeholder), 1)) : createCommentVNode("", true),
|
|
541
551
|
(openBlock(), createBlock(resolveDynamicComponent(__props.textarea ? unref(ContentEditable) : "input"), {
|
|
542
552
|
id,
|
|
543
553
|
ref: "input",
|
|
@@ -545,9 +555,11 @@ var WInput_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
545
555
|
"w-0 max-w-0": __props.hideInput,
|
|
546
556
|
"text-secure w-input-whitespace-pre-wrap break-all": __props.textSecure && !isSecureVisible.value,
|
|
547
557
|
"[-webkit-text-fill-color:transparent]": __props.textTransparent,
|
|
548
|
-
"sm-not:text-[1rem]": !__props.unclickable
|
|
558
|
+
"sm-not:text-[1rem]": !__props.unclickable,
|
|
559
|
+
"opacity-0": __props.placeholder && __props.textarea && hasNoValue.value && !focused,
|
|
560
|
+
"-py--w-option-padding": __props.textarea
|
|
549
561
|
}]),
|
|
550
|
-
value:
|
|
562
|
+
value: gateValue(unref(asyncState).isAsync.value ? unref(asyncState).value.value : __props.modelValue),
|
|
551
563
|
placeholder: hasNoValue.value ? __props.placeholder : void 0,
|
|
552
564
|
type: __props.type ?? "text",
|
|
553
565
|
name: __props.name,
|
|
@@ -635,6 +647,7 @@ var WInput_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
635
647
|
"onShow:secure": _cache[7] || (_cache[7] = ($event) => {
|
|
636
648
|
isSecureVisible.value = true;
|
|
637
649
|
_ctx.$emit("click", $event);
|
|
650
|
+
focus();
|
|
638
651
|
}),
|
|
639
652
|
"onHide:secure": _cache[8] || (_cache[8] = ($event) => isSecureVisible.value = false),
|
|
640
653
|
"onClick:paste": paste,
|
|
@@ -26,7 +26,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {
|
|
|
26
26
|
onKeydown?: ((value: KeyboardEvent) => any) | undefined;
|
|
27
27
|
"onUpdate:model-value"?: ((value: string, noDebounce?: boolean | undefined) => any) | undefined;
|
|
28
28
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
29
|
-
element:
|
|
30
|
-
},
|
|
29
|
+
element: HTMLElement;
|
|
30
|
+
}, HTMLElement>;
|
|
31
31
|
export default _default;
|
|
32
32
|
//# sourceMappingURL=ContentEditable.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentEditable.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/Input/components/ContentEditable.vue"],"names":[],"mappings":"AAeA;
|
|
1
|
+
{"version":3,"file":"ContentEditable.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/Input/components/ContentEditable.vue"],"names":[],"mappings":"AAeA;AA+gBA,OAAO,KAAK,EAAC,QAAQ,EAAG,aAAa,EAAC,MAAM,UAAU,CAAA;AAStD,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,QAAQ,EAAE,GAAG,SAAS,CAAA;IACjC,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAA;IAC7B,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAA;CAC9B,CAAC;;;;2BA8T4B,aAAa,KAAG,IAAI;2BATpB,MAAM,aAAa,MAAM;;wBAhB5B,MAAM;;;;;;;;;;;;;;;AAkRjC,wBAUG"}
|
package/dist/components/Input/components/ContentEditable.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { WrapSelectionType } from "../../../utils/utils.js";
|
|
2
2
|
import { getCaretOffset, setCaretOffset } from "../models/utils.js";
|
|
3
3
|
import { preserveIndentation } from "../models/toolbarActions.js";
|
|
4
|
-
import { createElementBlock, defineComponent, nextTick, onMounted, openBlock, ref, useTemplateRef, watch } from "vue";
|
|
4
|
+
import { createElementBlock, defineComponent, nextTick, onMounted, onUnmounted, openBlock, ref, useTemplateRef, watch } from "vue";
|
|
5
5
|
//#region src/components/Input/components/ContentEditable.vue?vue&type=script&setup=true&lang.ts
|
|
6
6
|
var _hoisted_1 = ["contenteditable"];
|
|
7
7
|
var ContentEditable_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
@@ -25,53 +25,130 @@ var ContentEditable_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ *
|
|
|
25
25
|
const emit = __emit;
|
|
26
26
|
const elementRef = useTemplateRef("element");
|
|
27
27
|
const focused = ref(false);
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
const
|
|
28
|
+
const buildLines = (sourceParts) => {
|
|
29
|
+
const lines = [[]];
|
|
30
|
+
for (const part of sourceParts) if (typeof part === "string") {
|
|
31
|
+
const segments = part.split("\n");
|
|
32
|
+
lines[lines.length - 1].push(segments[0]);
|
|
33
|
+
for (let i = 1; i < segments.length; i++) lines.push([segments[i]]);
|
|
34
|
+
} else lines[lines.length - 1].push(part);
|
|
35
|
+
for (let i = 0; i < lines.length; i++) if (lines[i].every((item) => typeof item === "string" && item === "")) lines[i] = [];
|
|
36
|
+
return lines;
|
|
37
|
+
};
|
|
38
|
+
const setTaggedText = (el, text) => {
|
|
39
|
+
for (const child of el.childNodes) if (child.nodeType === Node.TEXT_NODE) {
|
|
40
|
+
if (child.nodeValue !== text) child.nodeValue = text;
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
el.insertBefore(document.createTextNode(text), el.firstChild);
|
|
44
|
+
};
|
|
45
|
+
const ensureInner = (outerLine) => {
|
|
46
|
+
if (outerLine.childNodes.length === 1 && outerLine.firstChild instanceof HTMLDivElement) return outerLine.firstChild;
|
|
47
|
+
while (outerLine.firstChild) outerLine.removeChild(outerLine.firstChild);
|
|
48
|
+
const inner = document.createElement("div");
|
|
49
|
+
outerLine.appendChild(inner);
|
|
50
|
+
return inner;
|
|
51
|
+
};
|
|
52
|
+
const reconcileLineChildren = (outerLine, line, taggedById) => {
|
|
53
|
+
const inner = ensureInner(outerLine);
|
|
54
|
+
if (line.length === 0) {
|
|
55
|
+
if (inner.childNodes.length === 1 && inner.firstChild instanceof HTMLBRElement) return;
|
|
56
|
+
while (inner.firstChild) inner.removeChild(inner.firstChild);
|
|
57
|
+
inner.appendChild(document.createElement("br"));
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
31
60
|
let nodeIndex = 0;
|
|
32
|
-
for (const item of
|
|
33
|
-
|
|
61
|
+
for (const item of line) {
|
|
62
|
+
let existingNode = inner.childNodes[nodeIndex] ?? null;
|
|
63
|
+
while (existingNode instanceof HTMLBRElement) {
|
|
64
|
+
inner.removeChild(existingNode);
|
|
65
|
+
existingNode = inner.childNodes[nodeIndex] ?? null;
|
|
66
|
+
}
|
|
34
67
|
if (typeof item === "string") if (existingNode instanceof Text) {
|
|
35
68
|
if (existingNode.textContent !== item) existingNode.textContent = item;
|
|
36
69
|
} else {
|
|
37
70
|
const textNode = document.createTextNode(item);
|
|
38
|
-
|
|
71
|
+
inner.insertBefore(textNode, existingNode);
|
|
39
72
|
}
|
|
40
|
-
else
|
|
41
|
-
|
|
42
|
-
if (
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
73
|
+
else {
|
|
74
|
+
let reused = null;
|
|
75
|
+
if (item.id) {
|
|
76
|
+
const fromMap = taggedById.get(item.id);
|
|
77
|
+
if (fromMap && fromMap.tagName.toLowerCase() === item.tag.toLowerCase()) {
|
|
78
|
+
taggedById.delete(item.id);
|
|
79
|
+
reused = fromMap;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
if (!reused && existingNode instanceof HTMLElement && existingNode.tagName.toLowerCase() === item.tag.toLowerCase() && !existingNode.id) reused = existingNode;
|
|
83
|
+
if (reused) {
|
|
84
|
+
if (reused !== existingNode) inner.insertBefore(reused, existingNode);
|
|
85
|
+
setTaggedText(reused, item.value);
|
|
86
|
+
if (reused.className !== (item.class || "")) reused.className = item.class || "";
|
|
87
|
+
if (reused.id !== (item.id || "")) reused.id = item.id || "";
|
|
88
|
+
if (item.edit === false && reused.getAttribute("contenteditable") !== "false") reused.setAttribute("contenteditable", "false");
|
|
89
|
+
} else {
|
|
90
|
+
const element = document.createElement(item.tag);
|
|
91
|
+
setTaggedText(element, item.value);
|
|
92
|
+
element.setAttribute("contenteditable", item.edit ? "plaintext-only" : "false");
|
|
93
|
+
if (item.class) element.className = item.class;
|
|
94
|
+
if (item.id) element.id = item.id;
|
|
95
|
+
inner.insertBefore(element, existingNode);
|
|
96
|
+
}
|
|
50
97
|
}
|
|
51
98
|
nodeIndex++;
|
|
52
99
|
}
|
|
53
|
-
while (
|
|
54
|
-
const nodeToRemove =
|
|
55
|
-
if (nodeToRemove)
|
|
100
|
+
while (inner.childNodes.length > line.length) {
|
|
101
|
+
const nodeToRemove = inner.childNodes[line.length];
|
|
102
|
+
if (nodeToRemove) inner.removeChild(nodeToRemove);
|
|
56
103
|
}
|
|
57
|
-
if (focused.value && !isSetCaretNext) setCaret(offsets.start, offsets.end !== offsets.start ? void 0 : offsets.end);
|
|
58
104
|
};
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
if (
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
105
|
+
const updateLines = () => {
|
|
106
|
+
const root = elementRef.value;
|
|
107
|
+
if (!root) return;
|
|
108
|
+
const offsets = focused.value ? getCaret() : null;
|
|
109
|
+
const lines = buildLines(props.textParts ?? [props.value ?? ""]);
|
|
110
|
+
const taggedById = /* @__PURE__ */ new Map();
|
|
111
|
+
for (const outer of Array.from(root.children)) {
|
|
112
|
+
if (!(outer instanceof HTMLElement) || !outer.classList.contains("line")) continue;
|
|
113
|
+
const inner = outer.firstChild;
|
|
114
|
+
if (!(inner instanceof HTMLElement)) continue;
|
|
115
|
+
for (const child of Array.from(inner.children)) if (child instanceof HTMLElement && child.id) taggedById.set(child.id, child);
|
|
116
|
+
}
|
|
117
|
+
for (let i = 0; i < lines.length; i++) {
|
|
118
|
+
let outerLine = root.childNodes[i];
|
|
119
|
+
if (!(outerLine instanceof HTMLElement) || !outerLine.classList.contains("line")) {
|
|
120
|
+
if (outerLine) root.removeChild(outerLine);
|
|
121
|
+
const newOuter = document.createElement("div");
|
|
122
|
+
newOuter.className = "line";
|
|
123
|
+
const next = root.childNodes[i] ?? null;
|
|
124
|
+
root.insertBefore(newOuter, next);
|
|
125
|
+
outerLine = newOuter;
|
|
126
|
+
}
|
|
127
|
+
reconcileLineChildren(outerLine, lines[i], taggedById);
|
|
128
|
+
}
|
|
129
|
+
while (root.childNodes.length > lines.length) {
|
|
130
|
+
const nodeToRemove = root.childNodes[lines.length];
|
|
131
|
+
if (nodeToRemove) root.removeChild(nodeToRemove);
|
|
66
132
|
}
|
|
133
|
+
if (offsets && !isSetCaretNext) setCaret(offsets.start, offsets.end !== offsets.start ? void 0 : offsets.end);
|
|
67
134
|
};
|
|
68
|
-
watch(() => props.
|
|
135
|
+
watch(() => props.textParts, updateLines, { immediate: true });
|
|
136
|
+
watch(() => props.value, () => {
|
|
137
|
+
if (!props.textParts) updateLines();
|
|
138
|
+
}, { immediate: true });
|
|
69
139
|
const textPartsToText = (parts) => {
|
|
70
140
|
return parts.map((part) => typeof part === "string" ? part : part.value).join("");
|
|
71
141
|
};
|
|
72
142
|
const getCurrentText = () => {
|
|
73
143
|
return props.textParts ? textPartsToText(props.textParts) : props.value;
|
|
74
144
|
};
|
|
145
|
+
const computeTextFromDom = () => {
|
|
146
|
+
const root = elementRef.value;
|
|
147
|
+
if (!root) return "";
|
|
148
|
+
const result = [];
|
|
149
|
+
for (const child of Array.from(root.childNodes)) if (child instanceof HTMLElement && child.classList.contains("line")) result.push(child.textContent ?? "");
|
|
150
|
+
return result.join("\n");
|
|
151
|
+
};
|
|
75
152
|
const lineBreakEvents = ["insertParagraph", "insertLineBreak"];
|
|
76
153
|
const autoPairMap = {
|
|
77
154
|
"(": ")",
|
|
@@ -81,6 +158,29 @@ var ContentEditable_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ *
|
|
|
81
158
|
"'": "'",
|
|
82
159
|
"`": "`"
|
|
83
160
|
};
|
|
161
|
+
const handleLineBoundaryDelete = (e) => {
|
|
162
|
+
const { start, end } = getCaret();
|
|
163
|
+
const currentText = getCurrentText();
|
|
164
|
+
if (start !== end) {
|
|
165
|
+
if (!currentText.slice(start, end).includes("\n")) return false;
|
|
166
|
+
e.preventDefault();
|
|
167
|
+
emit("update:model-value", currentText.slice(0, start) + currentText.slice(end), true);
|
|
168
|
+
nextTick(() => setCaret(start));
|
|
169
|
+
return true;
|
|
170
|
+
}
|
|
171
|
+
if (e.inputType === "deleteContentBackward") {
|
|
172
|
+
if (start === 0 || currentText[start - 1] !== "\n") return false;
|
|
173
|
+
e.preventDefault();
|
|
174
|
+
emit("update:model-value", currentText.slice(0, start - 1) + currentText.slice(start), true);
|
|
175
|
+
nextTick(() => setCaret(start - 1));
|
|
176
|
+
return true;
|
|
177
|
+
}
|
|
178
|
+
if (start >= currentText.length || currentText[start] !== "\n") return false;
|
|
179
|
+
e.preventDefault();
|
|
180
|
+
emit("update:model-value", currentText.slice(0, start) + currentText.slice(start + 1), true);
|
|
181
|
+
nextTick(() => setCaret(start));
|
|
182
|
+
return true;
|
|
183
|
+
};
|
|
84
184
|
const handleBeforeInput = (e) => {
|
|
85
185
|
if (lineBreakEvents.includes(e.inputType)) {
|
|
86
186
|
e.preventDefault();
|
|
@@ -90,6 +190,9 @@ var ContentEditable_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ *
|
|
|
90
190
|
insertPlain("\n" + (currentText.slice(lineStart, start).match(/^[ ]*/)?.[0] || ""));
|
|
91
191
|
return;
|
|
92
192
|
}
|
|
193
|
+
if (e.inputType === "deleteContentBackward" || e.inputType === "deleteContentForward") {
|
|
194
|
+
if (handleLineBoundaryDelete(e)) return;
|
|
195
|
+
}
|
|
93
196
|
if (e.inputType === "insertText" && e.data && autoPairMap[e.data]) {
|
|
94
197
|
e.preventDefault();
|
|
95
198
|
const { start, end } = getCaret();
|
|
@@ -110,22 +213,17 @@ var ContentEditable_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ *
|
|
|
110
213
|
const regexDifferentEnding = /\r\n?/g;
|
|
111
214
|
const onInput = (e) => {
|
|
112
215
|
e.stopImmediatePropagation();
|
|
113
|
-
if (!(e.target instanceof
|
|
114
|
-
const text = (
|
|
216
|
+
if (!(e.target instanceof HTMLElement)) return;
|
|
217
|
+
const text = computeTextFromDom().replace(regexDifferentEnding, "\n");
|
|
115
218
|
if (text === getCurrentText()) return;
|
|
116
|
-
if (props.maxLength &&
|
|
117
|
-
|
|
118
|
-
const substring = text.substring(0, props.maxLength);
|
|
119
|
-
if (!props.textParts) updateTextValue(substring);
|
|
120
|
-
else updateTextParts();
|
|
121
|
-
emit("update:model-value", substring);
|
|
122
|
-
} else emit("update:model-value", text);
|
|
219
|
+
if (props.maxLength && text.length > props.maxLength) emit("update:model-value", text.substring(0, props.maxLength));
|
|
220
|
+
else emit("update:model-value", text);
|
|
123
221
|
};
|
|
124
222
|
const insertPlain = (text) => {
|
|
125
223
|
if (!elementRef.value) return;
|
|
126
224
|
const { start, end } = getCaret();
|
|
127
225
|
const currentText = getCurrentText();
|
|
128
|
-
const next = (currentText ?? "").slice(0, start) + text + (
|
|
226
|
+
const next = (currentText ?? "").slice(0, start) + text + (currentText ?? "").slice(end);
|
|
129
227
|
const caretAfter = start + text.length;
|
|
130
228
|
emit("update:model-value", props.maxLength && next.length > props.maxLength ? next.substring(0, props.maxLength) : next, true);
|
|
131
229
|
nextTick(() => setCaret(props.maxLength ? Math.min(caretAfter, props.maxLength) : caretAfter));
|
|
@@ -245,9 +343,32 @@ var ContentEditable_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ *
|
|
|
245
343
|
const blur = () => {
|
|
246
344
|
elementRef.value?.blur();
|
|
247
345
|
};
|
|
346
|
+
const updateActiveLine = () => {
|
|
347
|
+
const root = elementRef.value;
|
|
348
|
+
if (!root) return;
|
|
349
|
+
const selection = window.getSelection();
|
|
350
|
+
let activeLine = null;
|
|
351
|
+
if (selection && selection.focusNode && root.contains(selection.focusNode)) {
|
|
352
|
+
let node = selection.focusNode;
|
|
353
|
+
while (node && node !== root) {
|
|
354
|
+
if (node instanceof HTMLElement && node.classList.contains("line")) {
|
|
355
|
+
activeLine = node;
|
|
356
|
+
break;
|
|
357
|
+
}
|
|
358
|
+
node = node.parentNode;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
for (const child of Array.from(root.children)) {
|
|
362
|
+
if (!(child instanceof HTMLElement)) continue;
|
|
363
|
+
child.classList.toggle("line-active", child === activeLine);
|
|
364
|
+
}
|
|
365
|
+
};
|
|
248
366
|
onMounted(() => {
|
|
249
|
-
|
|
250
|
-
|
|
367
|
+
updateLines();
|
|
368
|
+
document.addEventListener("selectionchange", updateActiveLine);
|
|
369
|
+
});
|
|
370
|
+
onUnmounted(() => {
|
|
371
|
+
document.removeEventListener("selectionchange", updateActiveLine);
|
|
251
372
|
});
|
|
252
373
|
__expose({
|
|
253
374
|
focus,
|
|
@@ -261,7 +382,7 @@ var ContentEditable_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ *
|
|
|
261
382
|
}
|
|
262
383
|
});
|
|
263
384
|
return (_ctx, _cache) => {
|
|
264
|
-
return openBlock(), createElementBlock("
|
|
385
|
+
return openBlock(), createElementBlock("code", {
|
|
265
386
|
ref: "element",
|
|
266
387
|
contenteditable: __props.readonly || __props.disabled ? "false" : "plaintext-only",
|
|
267
388
|
role: "textbox",
|
package/dist/components/Input/components/InputActions.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -40,7 +40,7 @@ var InputActions_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ d
|
|
|
40
40
|
return (_ctx, _cache) => {
|
|
41
41
|
return __props.loading || _ctx.$slots.default || __props.textSecure || __props.allowCopy || (__props.allowPaste || __props.allowClear || __props.allowDropFile) && !__props.disabled && !__props.readonly ? (openBlock(), createElementBlock("div", {
|
|
42
42
|
key: 0,
|
|
43
|
-
class: normalizeClass(["
|
|
43
|
+
class: normalizeClass(["flex", { "flex-col": __props.textarea }]),
|
|
44
44
|
onMousedown: _cache[4] || (_cache[4] = withModifiers(() => {}, ["prevent", "stop"]))
|
|
45
45
|
}, [
|
|
46
46
|
__props.allowClear && !__props.readonly ? (openBlock(), createBlock(InputActionsButton_default, {
|
package/dist/components/Input/components/InputActionsButton.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -36,7 +36,7 @@ var InputActionsButton_vue_vue_type_script_setup_true_lang_default = /* @__PURE_
|
|
|
36
36
|
"cursor-not-allowed": __props.disabled,
|
|
37
37
|
"h-[calc(var(--w-input-height,2.75rem)-2px)]": __props.top,
|
|
38
38
|
"h-full": !__props.top
|
|
39
|
-
}, "text-description relative flex w-[calc(var(--w-input-height,2.75rem)-2px)] select-none items-center justify-center bg-[--w-input-bg,inherit]"]),
|
|
39
|
+
}, "text-description relative flex w-[calc(var(--w-input-height,2.75rem)-2px)] select-none items-center justify-center rounded-[--w-input-rounded,0.75rem] bg-[--w-input-bg,inherit]"]),
|
|
40
40
|
"aria-label": __props.label ?? __props.tooltipText,
|
|
41
41
|
"aria-disabled": __props.disabled,
|
|
42
42
|
"aria-pressed": __props.pressed,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/Input/models/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/Input/models/utils.ts"],"names":[],"mappings":"AAmEA,MAAM,MAAM,WAAW,GAAG;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAC,CAAA;AAEtD,eAAO,MAAM,cAAc,GAAI,QAAQ,OAAO,GAAG,IAAI,GAAG,SAAS,EAAE,YAAY,MAAM,EAAE,UAAU,MAAM,GAAG,SAAS,SAelH,CAAA;AA8ED,eAAO,MAAM,cAAc,GAAI,QAAQ,OAAO,GAAG,IAAI,GAAG,SAAS,KAAG,WAUnE,CAAA"}
|
|
@@ -1,30 +1,73 @@
|
|
|
1
1
|
//#region src/components/Input/models/utils.ts
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
var collectLines = (parent) => {
|
|
3
|
+
const out = [];
|
|
4
|
+
for (const child of Array.from(parent.children)) if (child instanceof HTMLElement && child.classList.contains("line")) out.push(child);
|
|
5
|
+
return out;
|
|
6
|
+
};
|
|
7
|
+
var findInLine = (line, offsetInLine) => {
|
|
8
|
+
const walker = document.createTreeWalker(line, NodeFilter.SHOW_TEXT, null);
|
|
9
|
+
let node;
|
|
10
|
+
let remaining = offsetInLine;
|
|
11
|
+
let lastEditable = null;
|
|
7
12
|
while (node = walker.nextNode()) {
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
13
|
+
const text = node;
|
|
14
|
+
const len = text.nodeValue?.length ?? 0;
|
|
15
|
+
const editable = text.parentElement?.contentEditable !== "false";
|
|
16
|
+
if (editable && remaining <= len) return {
|
|
17
|
+
node: text,
|
|
18
|
+
offset: Math.max(remaining, 0)
|
|
12
19
|
};
|
|
13
|
-
|
|
20
|
+
if (editable) lastEditable = text;
|
|
21
|
+
remaining -= len;
|
|
14
22
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
node: last,
|
|
19
|
-
offset: last.nodeValue?.length ?? 0
|
|
23
|
+
if (lastEditable) return {
|
|
24
|
+
node: lastEditable,
|
|
25
|
+
offset: lastEditable.nodeValue?.length ?? 0
|
|
20
26
|
};
|
|
21
|
-
|
|
22
|
-
|
|
27
|
+
let container = line;
|
|
28
|
+
while (container.firstElementChild && container.firstElementChild.tagName !== "BR" && container.firstElementChild.contentEditable !== "false") container = container.firstElementChild;
|
|
23
29
|
return {
|
|
24
|
-
node:
|
|
30
|
+
node: container,
|
|
25
31
|
offset: 0
|
|
26
32
|
};
|
|
27
33
|
};
|
|
34
|
+
var getNodeOffset = (parent, index) => {
|
|
35
|
+
if (!parent || index === void 0) return void 0;
|
|
36
|
+
if (!parent.firstChild) parent.appendChild(document.createTextNode(""));
|
|
37
|
+
const lines = collectLines(parent);
|
|
38
|
+
if (lines.length === 0) {
|
|
39
|
+
const walker = document.createTreeWalker(parent, NodeFilter.SHOW_TEXT, null);
|
|
40
|
+
let node, offset = index;
|
|
41
|
+
while (node = walker.nextNode()) {
|
|
42
|
+
const len = node.nodeValue?.length ?? 0;
|
|
43
|
+
if (offset <= len && node.parentElement?.contentEditable !== "false") return {
|
|
44
|
+
node,
|
|
45
|
+
offset: Math.max(offset, 0)
|
|
46
|
+
};
|
|
47
|
+
offset -= len;
|
|
48
|
+
}
|
|
49
|
+
const last = parent.lastChild;
|
|
50
|
+
if (!last) return void 0;
|
|
51
|
+
if (last.nodeType === Node.TEXT_NODE) return {
|
|
52
|
+
node: last,
|
|
53
|
+
offset: last.nodeValue?.length ?? 0
|
|
54
|
+
};
|
|
55
|
+
const textNode = document.createTextNode("");
|
|
56
|
+
parent.appendChild(textNode);
|
|
57
|
+
return {
|
|
58
|
+
node: textNode,
|
|
59
|
+
offset: 0
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
let remaining = index;
|
|
63
|
+
for (let i = 0; i < lines.length; i++) {
|
|
64
|
+
const line = lines[i];
|
|
65
|
+
const lineLen = (line.textContent ?? "").length;
|
|
66
|
+
if (remaining <= lineLen || i === lines.length - 1) return findInLine(line, Math.max(remaining, 0));
|
|
67
|
+
remaining -= lineLen + 1;
|
|
68
|
+
}
|
|
69
|
+
return findInLine(lines[lines.length - 1], remaining);
|
|
70
|
+
};
|
|
28
71
|
var setCaretOffset = (parent, indexStart, indexEnd) => {
|
|
29
72
|
const start = getNodeOffset(parent, indexStart);
|
|
30
73
|
if (start === void 0) return;
|
|
@@ -37,17 +80,57 @@ var setCaretOffset = (parent, indexStart, indexEnd) => {
|
|
|
37
80
|
selection?.removeAllRanges();
|
|
38
81
|
selection?.addRange(range);
|
|
39
82
|
};
|
|
83
|
+
var offsetWithinLine = (line, targetNode, targetOffset, isStart) => {
|
|
84
|
+
if (line === targetNode) {
|
|
85
|
+
let sum = 0;
|
|
86
|
+
for (let i = 0; i < targetOffset && i < line.childNodes.length; i++) sum += line.childNodes[i]?.textContent?.length ?? 0;
|
|
87
|
+
return sum;
|
|
88
|
+
}
|
|
89
|
+
let result = null;
|
|
90
|
+
let cumulative = 0;
|
|
91
|
+
const visit = (node) => {
|
|
92
|
+
if (result !== null) return;
|
|
93
|
+
for (const child of Array.from(node.childNodes)) {
|
|
94
|
+
if (result !== null) return;
|
|
95
|
+
if (child === targetNode) {
|
|
96
|
+
if (child.nodeType === Node.TEXT_NODE) if (child.parentElement?.contentEditable === "false") result = cumulative + (isStart ? 0 : child.nodeValue?.length ?? 0);
|
|
97
|
+
else result = cumulative + targetOffset;
|
|
98
|
+
else {
|
|
99
|
+
let sum = 0;
|
|
100
|
+
for (let i = 0; i < targetOffset && i < child.childNodes.length; i++) sum += child.childNodes[i]?.textContent?.length ?? 0;
|
|
101
|
+
result = cumulative + sum;
|
|
102
|
+
}
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
if (child instanceof Element && child.contains(targetNode)) visit(child);
|
|
106
|
+
else cumulative += child.textContent?.length ?? 0;
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
visit(line);
|
|
110
|
+
return result !== null ? result : cumulative;
|
|
111
|
+
};
|
|
40
112
|
var getOffsetFromNode = (parent, targetNode, targetOffset, isStart) => {
|
|
41
113
|
if (!parent.firstChild) parent.appendChild(document.createTextNode(""));
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
114
|
+
const lines = collectLines(parent);
|
|
115
|
+
if (lines.length === 0) {
|
|
116
|
+
const walker = document.createTreeWalker(parent, NodeFilter.SHOW_TEXT, null);
|
|
117
|
+
let node, offset = 0;
|
|
118
|
+
while (node = walker.nextNode()) {
|
|
119
|
+
if (node.parentElement?.contentEditable === "false") {
|
|
120
|
+
if (isStart && node === targetNode) return { offset };
|
|
121
|
+
} else if (node === targetNode) return { offset: offset + targetOffset };
|
|
122
|
+
offset += node.nodeValue?.length ?? 0;
|
|
123
|
+
}
|
|
124
|
+
return { offset };
|
|
125
|
+
}
|
|
126
|
+
let baseOffset = 0;
|
|
127
|
+
for (let i = 0; i < lines.length; i++) {
|
|
128
|
+
const line = lines[i];
|
|
129
|
+
if (line === targetNode || line.contains(targetNode)) return { offset: baseOffset + offsetWithinLine(line, targetNode, targetOffset, isStart) };
|
|
130
|
+
baseOffset += (line.textContent ?? "").length;
|
|
131
|
+
if (i < lines.length - 1) baseOffset += 1;
|
|
49
132
|
}
|
|
50
|
-
return { offset };
|
|
133
|
+
return { offset: baseOffset };
|
|
51
134
|
};
|
|
52
135
|
var getCaretOffset = (parent) => {
|
|
53
136
|
if (!parent) return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,iCAAiC,CAAA;AACtE,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAA;AACpD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,KAAK,CAAA;AAElC,MAAM,WAAW,UAAU,CAAC,IAAI,SAAS,SAAS,CAAE,SAAQ,IAAI,CAAC,iBAAiB,EAAE,YAAY,CAAC;IAC/F,UAAU,CAAC,EAAE,CAAC,IAAI,SAAS,QAAQ,GAAG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AAE,CAAC,EAAE,MAAM,CAAA;CAAC,GAAG,MAAM,CAAA"}
|
|
@@ -162,7 +162,7 @@ var getFieldStylesFixed = (fields, fieldConfigMap) => {
|
|
|
162
162
|
return styles;
|
|
163
163
|
};
|
|
164
164
|
var getFieldWidthSumStyles = (fieldConfigMap) => {
|
|
165
|
-
return "calc(" + Object.keys(fieldConfigMap).filter((key) => fieldConfigMap[key]?.visible).map((label) => `var(${getFieldVariable("width", label)})`).join(" + ") + ")";
|
|
165
|
+
return "calc(" + Object.keys(fieldConfigMap).filter((key) => fieldConfigMap[key]?.visible).map((label) => `var(${getFieldVariable("width", label)}, 0px)`).join(" + ") + ")";
|
|
166
166
|
};
|
|
167
167
|
//#endregion
|
|
168
168
|
export { filterFields, forEachField, getFieldStylesFixed, getFieldStylesWidth, getFieldVariable, getFieldWidthSumStyles, getFirstFieldLabel, listModeIconMap, listModeLabelMap, listModeList, sortFields, useListConfig };
|
package/package.json
CHANGED
package/tailwind-base/index.ts
CHANGED
|
@@ -35,6 +35,8 @@ const pluginDefault = plugin(function ({matchUtilities, addVariant, addUtilities
|
|
|
35
35
|
matchUtilities(
|
|
36
36
|
{
|
|
37
37
|
'stop-color': (value) => ({'stop-color': value}),
|
|
38
|
+
'scrollbar-bar-color': value => ({'--scrollbar-bar-color': value, 'scrollbar-color': 'var(--scrollbar-bar-color) var(--scrollbar-gutter-color)'}),
|
|
39
|
+
'scrollbar-gutter-color': value => ({'--scrollbar-gutter-color': value, 'scrollbar-color': 'var(--scrollbar-bar-color) var(--scrollbar-gutter-color)'}),
|
|
38
40
|
},
|
|
39
41
|
{values: flattenColorPalette(theme('colors'))},
|
|
40
42
|
)
|
|
@@ -60,9 +62,7 @@ const pluginDefault = plugin(function ({matchUtilities, addVariant, addUtilities
|
|
|
60
62
|
'border-radius': 'inherit',
|
|
61
63
|
},
|
|
62
64
|
'.no-scrollbar': {
|
|
63
|
-
'
|
|
64
|
-
display: 'none',
|
|
65
|
-
},
|
|
65
|
+
'scrollbar-width': 'none',
|
|
66
66
|
},
|
|
67
67
|
'.overflow-y-overlay': {
|
|
68
68
|
'@supports (overflow: overlay)': {
|
|
@@ -80,10 +80,12 @@ const pluginDefault = plugin(function ({addBase, theme, config}) {
|
|
|
80
80
|
'transform-origin': 'top left',
|
|
81
81
|
'background-size': '7px 7px',
|
|
82
82
|
'background-position': 'top',
|
|
83
|
-
'background-image': 'linear-gradient(135deg, currentColor 10%, transparent 10%, transparent 50%, currentColor 50%, currentColor 60%, transparent 60%, transparent 100%)',
|
|
84
83
|
color: theme('colors.gray.300'),
|
|
84
|
+
'--resizer-bg': theme('colors.default'),
|
|
85
|
+
'background-image': 'linear-gradient(135deg, currentColor 10%, var(--resizer-bg) 10%, var(--resizer-bg) 50%, currentColor 50%, currentColor 60%, var(--resizer-bg) 60%, var(--resizer-bg) 100%)',
|
|
85
86
|
[config('darkMode')[1][0]]: {
|
|
86
87
|
color: theme('colors.gray.700'),
|
|
88
|
+
'--resizer-bg': theme('colors.default-dark'),
|
|
87
89
|
},
|
|
88
90
|
},
|
|
89
91
|
'*:focus-visible': {
|