@milaboratories/uikit 2.3.29 → 2.4.1
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/.turbo/turbo-build.log +26 -26
- package/.turbo/turbo-type-check.log +1 -1
- package/CHANGELOG.md +17 -0
- package/dist/components/DataTable/TableComponent.vue.js +1 -1
- package/dist/components/PlAccordion/{ExpandTransition.vue2.js → ExpandTransition.vue.js} +1 -1
- package/dist/components/PlAccordion/ExpandTransition.vue.js.map +1 -0
- package/dist/components/PlAccordion/ExpandTransition.vue3.js +1 -1
- package/dist/components/PlAccordion/PlAccordionSection.vue2.js +1 -1
- package/dist/components/PlAutocomplete/PlAutocomplete.vue.js +1 -1
- package/dist/components/PlDropdown/PlDropdown.vue.d.ts +6 -7
- package/dist/components/PlDropdown/PlDropdown.vue.d.ts.map +1 -1
- package/dist/components/PlDropdown/PlDropdown.vue.js +78 -75
- package/dist/components/PlDropdown/PlDropdown.vue.js.map +1 -1
- package/dist/components/PlDropdownLegacy/PlDropdownLegacy.vue.js +1 -1
- package/dist/components/PlDropdownLine/PlDropdownLine.vue.d.ts.map +1 -1
- package/dist/components/PlDropdownLine/PlDropdownLine.vue.js +100 -96
- package/dist/components/PlDropdownLine/PlDropdownLine.vue.js.map +1 -1
- package/dist/components/PlDropdownMulti/PlDropdownMulti.vue.js +1 -1
- package/dist/components/PlDropdownRef/PlDropdownRef.vue.d.ts +68 -123
- package/dist/components/PlDropdownRef/PlDropdownRef.vue.d.ts.map +1 -1
- package/dist/components/PlDropdownRef/PlDropdownRef.vue.js +23 -21
- package/dist/components/PlDropdownRef/PlDropdownRef.vue.js.map +1 -1
- package/dist/components/PlFileInput/PlFileInput.vue.js +11 -11
- package/dist/components/PlSlideModal/PlPureSlideModal.vue.js +1 -1
- package/dist/components/PlTextArea/PlTextArea.vue.js +1 -1
- package/dist/components/PlTextField/PlTextField.vue.js +1 -1
- package/dist/generated/components/svg/images/{SvgRequired.vue2.js → SvgRequired.vue.js} +1 -1
- package/dist/generated/components/svg/images/SvgRequired.vue.js.map +1 -0
- package/dist/lib/model/common/dist/index.js +182 -159
- package/dist/lib/model/common/dist/index.js.map +1 -1
- package/dist/sdk/model/dist/index.js +334 -322
- package/dist/sdk/model/dist/index.js.map +1 -1
- package/dist/utils/DropdownOverlay/DropdownOverlay.vue.d.ts.map +1 -1
- package/dist/utils/DropdownOverlay/DropdownOverlay.vue.js +19 -17
- package/dist/utils/DropdownOverlay/DropdownOverlay.vue.js.map +1 -1
- package/package.json +3 -3
- package/src/components/PlDropdown/PlDropdown.vue +9 -13
- package/src/components/PlDropdown/pl-dropdown.scss +6 -11
- package/src/components/PlDropdownLine/PlDropdownLine.vue +10 -1
- package/src/components/PlDropdownRef/PlDropdownRef.vue +16 -14
- package/src/utils/DropdownOverlay/DropdownOverlay.vue +7 -1
- package/dist/components/PlAccordion/ExpandTransition.vue2.js.map +0 -1
- package/dist/generated/components/svg/images/SvgRequired.vue2.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownOverlay.vue.d.ts","sourceRoot":"","sources":["../../../src/utils/DropdownOverlay/DropdownOverlay.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DropdownOverlay.vue.d.ts","sourceRoot":"","sources":["../../../src/utils/DropdownOverlay/DropdownOverlay.vue"],"names":[],"mappings":"AA8FA,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,WAAW,GAAG,SAAS,CAAC;IAC9B,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAuEF,iBAAS,cAAc;WA2CT,OAAO,IAA6B;;;;YAZrB,GAAG;;;;;;EAiB/B;AAUD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;OASnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAQpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useElementPosition as
|
|
1
|
+
import { defineComponent as g, reactive as c, toRef as h, ref as u, watch as w, createBlock as v, openBlock as x, Teleport as y, createElementVNode as R, mergeProps as C, withModifiers as H, renderSlot as b } from "vue";
|
|
2
|
+
import { useElementPosition as k } from "../../composition/usePosition.js";
|
|
3
3
|
import { scrollIntoView as B } from "../../helpers/dom.js";
|
|
4
|
-
import { tapIf as
|
|
5
|
-
const
|
|
4
|
+
import { tapIf as E } from "../../lib/util/helpers/dist/index.js";
|
|
5
|
+
const q = /* @__PURE__ */ g({
|
|
6
6
|
__name: "DropdownOverlay",
|
|
7
7
|
props: {
|
|
8
8
|
root: {},
|
|
9
9
|
gap: {}
|
|
10
10
|
},
|
|
11
|
-
setup(f, { expose:
|
|
12
|
-
const r = f, i =
|
|
11
|
+
setup(f, { expose: d }) {
|
|
12
|
+
const r = f, i = c({
|
|
13
13
|
optionsHeight: 0
|
|
14
|
-
}), o =
|
|
14
|
+
}), o = c({
|
|
15
15
|
top: "0px",
|
|
16
16
|
left: "0px",
|
|
17
17
|
width: "0px"
|
|
18
|
-
}),
|
|
19
|
-
return
|
|
18
|
+
}), a = h(r, "root"), n = u();
|
|
19
|
+
return d({
|
|
20
20
|
scrollIntoActive: () => {
|
|
21
21
|
const t = n.value;
|
|
22
|
-
t &&
|
|
22
|
+
t && E(t.querySelector(".hovered-item"), (e) => {
|
|
23
23
|
B(t, e);
|
|
24
24
|
});
|
|
25
25
|
},
|
|
@@ -29,23 +29,25 @@ const $ = /* @__PURE__ */ h({
|
|
|
29
29
|
const e = t.getBoundingClientRect();
|
|
30
30
|
i.optionsHeight = e.height, window.dispatchEvent(new CustomEvent("adjust"));
|
|
31
31
|
});
|
|
32
|
-
}),
|
|
33
|
-
const e = document.body.getBoundingClientRect(), s = t.top - e.top, m = t.left - e.left, p = r.gap ?? 0,
|
|
34
|
-
|
|
32
|
+
}), k(a, (t) => {
|
|
33
|
+
const e = document.body.getBoundingClientRect(), s = t.top - e.top, m = t.left - e.left, p = r.gap ?? 0, l = s + t.height + p;
|
|
34
|
+
l + i.optionsHeight > t.clientHeight ? o.top = s - i.optionsHeight - p + "px" : o.top = l + "px", o.left = m + "px", o.width = t.width + "px";
|
|
35
35
|
}), (t, e) => (x(), v(y, { to: "body" }, [
|
|
36
|
-
R("div",
|
|
36
|
+
R("div", C({
|
|
37
37
|
ref_key: "listRef",
|
|
38
38
|
ref: n
|
|
39
39
|
}, t.$attrs, {
|
|
40
40
|
style: o,
|
|
41
|
-
tabindex: "-1"
|
|
41
|
+
tabindex: "-1",
|
|
42
|
+
onClick: e[0] || (e[0] = H(() => {
|
|
43
|
+
}, ["stop"]))
|
|
42
44
|
}), [
|
|
43
|
-
|
|
45
|
+
b(t.$slots, "default", { ref: "list" })
|
|
44
46
|
], 16)
|
|
45
47
|
]));
|
|
46
48
|
}
|
|
47
49
|
});
|
|
48
50
|
export {
|
|
49
|
-
|
|
51
|
+
q as default
|
|
50
52
|
};
|
|
51
53
|
//# sourceMappingURL=DropdownOverlay.vue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownOverlay.vue.js","sources":["../../../src/utils/DropdownOverlay/DropdownOverlay.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { useElementPosition } from '../../composition/usePosition';\nimport { scrollIntoView } from '../../helpers/dom';\nimport { tapIf } from '@milaboratories/helpers';\nimport { reactive, ref, toRef, watch } from 'vue';\n\nconst props = defineProps<{\n root: HTMLElement | undefined; // element to \"track\"\n gap?: number; // additional gap between overlay and \"root\" component\n}>();\n\nconst data = reactive({\n optionsHeight: 0,\n});\n\nconst optionsStyle = reactive({\n top: '0px',\n left: '0px',\n width: '0px',\n});\n\nconst rootRef = toRef(props, 'root');\n\nconst listRef = ref<HTMLElement>();\n\nconst scrollIntoActive = () => {\n const $list = listRef.value;\n\n if (!$list) {\n return;\n }\n\n tapIf($list.querySelector('.hovered-item') as HTMLElement, (opt) => {\n scrollIntoView($list, opt);\n });\n};\n\ndefineExpose({\n scrollIntoActive,\n listRef,\n});\n\nwatch(listRef, (el) => {\n if (el) {\n requestAnimationFrame(() => {\n const rect = el.getBoundingClientRect();\n data.optionsHeight = rect.height;\n window.dispatchEvent(new CustomEvent('adjust'));\n });\n }\n});\n\nuseElementPosition(rootRef, (pos) => {\n const bodyRect = document.body.getBoundingClientRect();\n\n const top = pos.top - bodyRect.top;\n\n const left = pos.left - bodyRect.left;\n\n const gap = props.gap ?? 0;\n\n const downTopOffset = top + pos.height + gap;\n\n if (downTopOffset + data.optionsHeight > pos.clientHeight) {\n optionsStyle.top = top - data.optionsHeight - gap + 'px';\n } else {\n optionsStyle.top = downTopOffset + 'px';\n }\n\n optionsStyle.left = left + 'px';\n optionsStyle.width = pos.width + 'px';\n});\n</script>\n\n<template>\n <Teleport to=\"body\">\n <div
|
|
1
|
+
{"version":3,"file":"DropdownOverlay.vue.js","sources":["../../../src/utils/DropdownOverlay/DropdownOverlay.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { useElementPosition } from '../../composition/usePosition';\nimport { scrollIntoView } from '../../helpers/dom';\nimport { tapIf } from '@milaboratories/helpers';\nimport { reactive, ref, toRef, watch } from 'vue';\n\nconst props = defineProps<{\n root: HTMLElement | undefined; // element to \"track\"\n gap?: number; // additional gap between overlay and \"root\" component\n}>();\n\nconst data = reactive({\n optionsHeight: 0,\n});\n\nconst optionsStyle = reactive({\n top: '0px',\n left: '0px',\n width: '0px',\n});\n\nconst rootRef = toRef(props, 'root');\n\nconst listRef = ref<HTMLElement>();\n\nconst scrollIntoActive = () => {\n const $list = listRef.value;\n\n if (!$list) {\n return;\n }\n\n tapIf($list.querySelector('.hovered-item') as HTMLElement, (opt) => {\n scrollIntoView($list, opt);\n });\n};\n\ndefineExpose({\n scrollIntoActive,\n listRef,\n});\n\nwatch(listRef, (el) => {\n if (el) {\n requestAnimationFrame(() => {\n const rect = el.getBoundingClientRect();\n data.optionsHeight = rect.height;\n window.dispatchEvent(new CustomEvent('adjust'));\n });\n }\n});\n\nuseElementPosition(rootRef, (pos) => {\n const bodyRect = document.body.getBoundingClientRect();\n\n const top = pos.top - bodyRect.top;\n\n const left = pos.left - bodyRect.left;\n\n const gap = props.gap ?? 0;\n\n const downTopOffset = top + pos.height + gap;\n\n if (downTopOffset + data.optionsHeight > pos.clientHeight) {\n optionsStyle.top = top - data.optionsHeight - gap + 'px';\n } else {\n optionsStyle.top = downTopOffset + 'px';\n }\n\n optionsStyle.left = left + 'px';\n optionsStyle.width = pos.width + 'px';\n});\n</script>\n\n<template>\n <Teleport to=\"body\">\n <div\n ref=\"listRef\"\n v-bind=\"$attrs\"\n :style=\"optionsStyle\"\n tabindex=\"-1\"\n @click.stop\n >\n <slot ref=\"list\" />\n </div>\n </Teleport>\n</template>\n"],"names":["props","__props","data","reactive","optionsStyle","rootRef","toRef","listRef","ref","__expose","$list","tapIf","opt","scrollIntoView","watch","el","rect","useElementPosition","pos","bodyRect","top","left","gap","downTopOffset"],"mappings":";;;;;;;;;;;AAMA,UAAMA,IAAQC,GAKRC,IAAOC,EAAS;AAAA,MACpB,eAAe;AAAA,IAAA,CAChB,GAEKC,IAAeD,EAAS;AAAA,MAC5B,KAAK;AAAA,MACL,MAAM;AAAA,MACN,OAAO;AAAA,IAAA,CACR,GAEKE,IAAUC,EAAMN,GAAO,MAAM,GAE7BO,IAAUC,EAAiB;AAcpB,WAAAC,EAAA;AAAA,MACX,kBAbuB,MAAM;AAC7B,cAAMC,IAAQH,EAAQ;AAEtB,QAAKG,KAILC,EAAMD,EAAM,cAAc,eAAe,GAAkB,CAACE,MAAQ;AAClE,UAAAC,EAAeH,GAAOE,CAAG;AAAA,QAAA,CAC1B;AAAA,MACH;AAAA,MAIE,SAAAL;AAAA,IAAA,CACD,GAEKO,EAAAP,GAAS,CAACQ,MAAO;AACrB,MAAIA,KACF,sBAAsB,MAAM;AACpB,cAAAC,IAAOD,EAAG,sBAAsB;AACtC,QAAAb,EAAK,gBAAgBc,EAAK,QAC1B,OAAO,cAAc,IAAI,YAAY,QAAQ,CAAC;AAAA,MAAA,CAC/C;AAAA,IACH,CACD,GAEkBC,EAAAZ,GAAS,CAACa,MAAQ;AAC7B,YAAAC,IAAW,SAAS,KAAK,sBAAsB,GAE/CC,IAAMF,EAAI,MAAMC,EAAS,KAEzBE,IAAOH,EAAI,OAAOC,EAAS,MAE3BG,IAAMtB,EAAM,OAAO,GAEnBuB,IAAgBH,IAAMF,EAAI,SAASI;AAEzC,MAAIC,IAAgBrB,EAAK,gBAAgBgB,EAAI,eAC3Cd,EAAa,MAAMgB,IAAMlB,EAAK,gBAAgBoB,IAAM,OAEpDlB,EAAa,MAAMmB,IAAgB,MAGrCnB,EAAa,OAAOiB,IAAO,MACdjB,EAAA,QAAQc,EAAI,QAAQ;AAAA,IAAA,CAClC;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milaboratories/uikit",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"d3-selection": "^3.0.0",
|
|
31
31
|
"d3-axis": "^3.0.0",
|
|
32
32
|
"resize-observer-polyfill": "^1.5.1",
|
|
33
|
-
"@platforma-sdk/model": "^1.42.
|
|
33
|
+
"@platforma-sdk/model": "^1.42.15",
|
|
34
34
|
"@milaboratories/helpers": "^1.6.19"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"vue-tsc": "^2.2.10",
|
|
42
42
|
"yarpm": "^1.2.0",
|
|
43
43
|
"svgo": "^3.3.2",
|
|
44
|
-
"@milaboratories/ts-configs": "1.0.5",
|
|
45
44
|
"@milaboratories/eslint-config": "^1.0.4",
|
|
45
|
+
"@milaboratories/ts-configs": "1.0.5",
|
|
46
46
|
"@milaboratories/build-configs": "1.0.5"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
@@ -14,12 +14,12 @@ import { tap } from '../../helpers/functions';
|
|
|
14
14
|
import { PlTooltip } from '../PlTooltip';
|
|
15
15
|
import DoubleContour from '../../utils/DoubleContour.vue';
|
|
16
16
|
import { useLabelNotch } from '../../utils/useLabelNotch';
|
|
17
|
-
import type { ListOption, ListOptionNormalized } from '../../types';
|
|
17
|
+
import type { ListOption, ListOptionNormalized, MaskIconName16, MaskIconName24 } from '../../types';
|
|
18
18
|
import { deepEqual } from '../../helpers/objects';
|
|
19
19
|
import LongText from '../LongText.vue';
|
|
20
20
|
import { normalizeListOptions } from '../../helpers/utils';
|
|
21
21
|
import { PlIcon16 } from '../PlIcon16';
|
|
22
|
-
import {
|
|
22
|
+
import { PlIcon24 } from '../PlIcon24';
|
|
23
23
|
import SvgRequired from '../../generated/components/svg/images/SvgRequired.vue';
|
|
24
24
|
import { getErrorMessage } from '../../helpers/error.ts';
|
|
25
25
|
import OptionList from './OptionList.vue';
|
|
@@ -78,11 +78,11 @@ const props = withDefaults(
|
|
|
78
78
|
/**
|
|
79
79
|
* Custom icon (16px) class for the dropdown arrow (optional)
|
|
80
80
|
*/
|
|
81
|
-
arrowIcon?:
|
|
81
|
+
arrowIcon?: MaskIconName16;
|
|
82
82
|
/**
|
|
83
83
|
* Custom icon (24px) class for the dropdown arrow (optional)
|
|
84
84
|
*/
|
|
85
|
-
arrowIconLarge?:
|
|
85
|
+
arrowIconLarge?: MaskIconName24;
|
|
86
86
|
/**
|
|
87
87
|
* Option list item size
|
|
88
88
|
*/
|
|
@@ -104,10 +104,6 @@ const props = withDefaults(
|
|
|
104
104
|
},
|
|
105
105
|
);
|
|
106
106
|
|
|
107
|
-
const slots = defineSlots<{
|
|
108
|
-
[key: string]: unknown;
|
|
109
|
-
}>();
|
|
110
|
-
|
|
111
107
|
const rootRef = ref<HTMLElement | undefined>();
|
|
112
108
|
const input = ref<HTMLInputElement | undefined>();
|
|
113
109
|
|
|
@@ -342,20 +338,20 @@ watchPostEffect(() => {
|
|
|
342
338
|
</div>
|
|
343
339
|
|
|
344
340
|
<div class="pl-dropdown__controls">
|
|
345
|
-
<
|
|
341
|
+
<PlIcon24 v-if="isLoadingOptions" name="loading" />
|
|
346
342
|
<PlIcon16 v-if="clearable && hasValue" class="clear" name="delete-clear" @click.stop="clear" />
|
|
347
343
|
<slot name="append" />
|
|
348
344
|
<div class="pl-dropdown__arrow-wrapper" @click.stop="toggleOpen">
|
|
349
|
-
<
|
|
350
|
-
<
|
|
351
|
-
<
|
|
345
|
+
<PlIcon24 v-if="arrowIconLarge" :name="arrowIconLarge" class="arrow-icon" />
|
|
346
|
+
<PlIcon16 v-else-if="arrowIcon" :name="arrowIcon" class="arrow-icon" />
|
|
347
|
+
<PlIcon16 v-else name="chevron-down" class="arrow-icon arrow-icon-default" />
|
|
352
348
|
</div>
|
|
353
349
|
</div>
|
|
354
350
|
</div>
|
|
355
351
|
<label v-if="label">
|
|
356
352
|
<SvgRequired v-if="required" />
|
|
357
353
|
<span>{{ label }}</span>
|
|
358
|
-
<PlTooltip v-if="slots.tooltip" class="info" position="top">
|
|
354
|
+
<PlTooltip v-if="$slots.tooltip" class="info" position="top">
|
|
359
355
|
<template #tooltip>
|
|
360
356
|
<slot name="tooltip" />
|
|
361
357
|
</template>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@use
|
|
1
|
+
@use '../../assets/mixins.scss' as *;
|
|
2
2
|
|
|
3
3
|
.pl-dropdown__options {
|
|
4
4
|
--option-hover-bg: var(--btn-sec-hover-grey);
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
@include abs-center-y();
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
>span {
|
|
44
|
+
> span {
|
|
45
45
|
display: block;
|
|
46
46
|
overflow: hidden;
|
|
47
47
|
white-space: nowrap;
|
|
@@ -187,10 +187,8 @@
|
|
|
187
187
|
gap: 6px;
|
|
188
188
|
margin-left: auto;
|
|
189
189
|
|
|
190
|
-
|
|
191
190
|
.mask-16,
|
|
192
191
|
.mask-24 {
|
|
193
|
-
--icon-color: var(--control-mask-fill);
|
|
194
192
|
cursor: pointer;
|
|
195
193
|
}
|
|
196
194
|
|
|
@@ -214,11 +212,9 @@
|
|
|
214
212
|
.arrow-icon {
|
|
215
213
|
cursor: pointer;
|
|
216
214
|
|
|
217
|
-
// Default "arrow" icon (16x16)
|
|
215
|
+
// Default "arrow" icon (16x16)
|
|
218
216
|
&.arrow-icon-default {
|
|
219
|
-
transition: transform .2s;
|
|
220
|
-
background-color: var(--control-mask-fill);
|
|
221
|
-
@include mask(url('../../assets/images/16_chevron-down.svg'), 16px);
|
|
217
|
+
transition: transform 0.2s;
|
|
222
218
|
}
|
|
223
219
|
}
|
|
224
220
|
|
|
@@ -239,7 +235,6 @@
|
|
|
239
235
|
|
|
240
236
|
.arrow-icon {
|
|
241
237
|
&.arrow-icon-default {
|
|
242
|
-
background-color: var(--control-mask-fill);
|
|
243
238
|
transform: rotate(-180deg);
|
|
244
239
|
}
|
|
245
240
|
}
|
|
@@ -268,7 +263,7 @@
|
|
|
268
263
|
|
|
269
264
|
&.disabled {
|
|
270
265
|
--contour-color: var(--color-dis-01);
|
|
271
|
-
--
|
|
266
|
+
--icon-color: var(--color-dis-01);
|
|
272
267
|
--label-color: var(--color-dis-01);
|
|
273
268
|
cursor: not-allowed;
|
|
274
269
|
pointer-events: none;
|
|
@@ -278,4 +273,4 @@
|
|
|
278
273
|
color: var(--dis-01);
|
|
279
274
|
}
|
|
280
275
|
}
|
|
281
|
-
}
|
|
276
|
+
}
|
|
@@ -273,7 +273,15 @@ useElementPosition(container, (pos) => {
|
|
|
273
273
|
<div v-show="canShowClearBtn" class="pl-line-dropdown__icon-clear" @click="clearModel" />
|
|
274
274
|
</div>
|
|
275
275
|
<Teleport v-if="data.isOpen" to="body">
|
|
276
|
-
<div
|
|
276
|
+
<div
|
|
277
|
+
v-if="props.mode === 'list'"
|
|
278
|
+
ref="list"
|
|
279
|
+
:style="optionsStyle"
|
|
280
|
+
tabindex="-1"
|
|
281
|
+
class="pl-line-dropdown__items"
|
|
282
|
+
@focusout="onFocusOut"
|
|
283
|
+
@click.stop
|
|
284
|
+
>
|
|
277
285
|
<template v-for="(item, index) in options" :key="index">
|
|
278
286
|
<slot
|
|
279
287
|
name="item"
|
|
@@ -305,6 +313,7 @@ useElementPosition(container, (pos) => {
|
|
|
305
313
|
tabindex="-1"
|
|
306
314
|
class="pl-line-dropdown__items-tabs"
|
|
307
315
|
@focusout="onFocusOut"
|
|
316
|
+
@click.stop
|
|
308
317
|
>
|
|
309
318
|
<template v-for="(item, index) in options" :key="index">
|
|
310
319
|
<slot name="item" :item="item" :is-selected="isItemSelected(item)" :is-hovered="data.activeOption == index" @click.stop="selectItem(item)">
|
|
@@ -7,10 +7,10 @@ export default {
|
|
|
7
7
|
};
|
|
8
8
|
</script>
|
|
9
9
|
|
|
10
|
-
<script lang="ts" setup>
|
|
11
|
-
import type { ModelRef, RefOption } from '../../types';
|
|
12
|
-
import { PlDropdown } from '../PlDropdown';
|
|
10
|
+
<script lang="ts" setup generic="M = ModelRef">
|
|
13
11
|
import { computed, useSlots } from 'vue';
|
|
12
|
+
import type { ListOption, ModelRef, RefOption } from '../../types';
|
|
13
|
+
import { PlDropdown } from '../PlDropdown';
|
|
14
14
|
|
|
15
15
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16
16
|
const slots: any = useSlots();
|
|
@@ -19,7 +19,7 @@ defineEmits<{
|
|
|
19
19
|
/**
|
|
20
20
|
* Emitted when the model value is updated.
|
|
21
21
|
*/
|
|
22
|
-
(e: 'update:modelValue', value:
|
|
22
|
+
(e: 'update:modelValue', value: M | undefined): void;
|
|
23
23
|
}>();
|
|
24
24
|
|
|
25
25
|
const props = withDefaults(
|
|
@@ -27,7 +27,7 @@ const props = withDefaults(
|
|
|
27
27
|
/**
|
|
28
28
|
* The current selected ref of the dropdown.
|
|
29
29
|
*/
|
|
30
|
-
modelValue:
|
|
30
|
+
modelValue: M | undefined;
|
|
31
31
|
/**
|
|
32
32
|
* The label text for the dropdown field (optional)
|
|
33
33
|
*/
|
|
@@ -35,7 +35,7 @@ const props = withDefaults(
|
|
|
35
35
|
/**
|
|
36
36
|
* List of available ref options for the dropdown
|
|
37
37
|
*/
|
|
38
|
-
options?: Readonly<RefOption[]>;
|
|
38
|
+
options?: Readonly<RefOption[] | ListOption<M>[]>;
|
|
39
39
|
/**
|
|
40
40
|
* A helper text displayed below the dropdown when there are no errors (optional).
|
|
41
41
|
*/
|
|
@@ -85,14 +85,16 @@ const props = withDefaults(
|
|
|
85
85
|
);
|
|
86
86
|
|
|
87
87
|
const options = computed(() =>
|
|
88
|
-
props.options?.map((opt) =>
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
88
|
+
props.options?.map((opt) =>
|
|
89
|
+
'ref' in opt
|
|
90
|
+
? {
|
|
91
|
+
label: opt.label,
|
|
92
|
+
value: opt.ref,
|
|
93
|
+
group: opt.group,
|
|
94
|
+
} as ListOption<M>
|
|
95
|
+
: opt,
|
|
96
|
+
),
|
|
93
97
|
);
|
|
94
|
-
|
|
95
|
-
const arrowIcon = computed(() => (props.disabled ? 'icon-link-disabled' : 'icon-link'));
|
|
96
98
|
</script>
|
|
97
99
|
|
|
98
100
|
<template>
|
|
@@ -100,7 +102,7 @@ const arrowIcon = computed(() => (props.disabled ? 'icon-link-disabled' : 'icon-
|
|
|
100
102
|
v-bind="props"
|
|
101
103
|
:options="options"
|
|
102
104
|
:loading-options-helper="loadingOptionsHelper"
|
|
103
|
-
:arrow-icon-large="
|
|
105
|
+
:arrow-icon-large="disabled ? 'link-disabled' : 'link'"
|
|
104
106
|
@update:model-value="$emit('update:modelValue', $event)"
|
|
105
107
|
>
|
|
106
108
|
<template v-if="slots.tooltip" #tooltip>
|
|
@@ -74,7 +74,13 @@ useElementPosition(rootRef, (pos) => {
|
|
|
74
74
|
|
|
75
75
|
<template>
|
|
76
76
|
<Teleport to="body">
|
|
77
|
-
<div
|
|
77
|
+
<div
|
|
78
|
+
ref="listRef"
|
|
79
|
+
v-bind="$attrs"
|
|
80
|
+
:style="optionsStyle"
|
|
81
|
+
tabindex="-1"
|
|
82
|
+
@click.stop
|
|
83
|
+
>
|
|
78
84
|
<slot ref="list" />
|
|
79
85
|
</div>
|
|
80
86
|
</Teleport>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ExpandTransition.vue2.js","sources":["../../../src/components/PlAccordion/ExpandTransition.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nconst onStart = (el: Element) => {\n el.classList.add('expand-collapse-fix');\n (el as HTMLElement).style.setProperty('--component-height', el.scrollHeight + 'px');\n};\n\nconst onAfter = (el: Element) => {\n (el as HTMLElement).style.removeProperty('--component-height');\n el.classList.remove('expand-collapse-fix');\n};\n</script>\n\n<template>\n <Transition name=\"expand-collapse\" @enter=\"onStart\" @leave=\"onStart\" @after-enter=\"onAfter\" @after-leave=\"onAfter\">\n <slot/>\n </Transition>\n</template>\n\n<style>\n.expand-collapse-fix {\n overflow: hidden;\n}\n\n.expand-collapse-enter-active,\n.expand-collapse-leave-active {\n transition:\n height 0.2s ease-in-out,\n opacity 0.2s ease-in-out;\n height: var(--component-height);\n}\n\n.expand-collapse-enter-from,\n.expand-collapse-leave-to {\n opacity: 0.5;\n height: 0;\n}\n</style>\n"],"names":["onStart","el","onAfter"],"mappings":";;;;AACM,UAAAA,IAAU,CAACC,MAAgB;AAC5B,MAAAA,EAAA,UAAU,IAAI,qBAAqB,GACrCA,EAAmB,MAAM,YAAY,sBAAsBA,EAAG,eAAe,IAAI;AAAA,IACpF,GAEMC,IAAU,CAACD,MAAgB;AAC9B,MAAAA,EAAmB,MAAM,eAAe,oBAAoB,GAC1DA,EAAA,UAAU,OAAO,qBAAqB;AAAA,IAC3C;;;;;;;;;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SvgRequired.vue2.js","sources":["../../../../../src/generated/components/svg/images/SvgRequired.vue"],"sourcesContent":["<!-- ⚠️ AUTOGENERATED. DO NOT EDIT. -->\n<script lang=\"ts\">\nimport '../svg-styles.css';\nexport default { name: 'SvgRequired' };\n</script>\n\n<template>\n <div class=\"svg-icon SvgRequired\" style=\"width: 5px; height: 12px\" />\n</template>\n\n<style>\n .SvgRequired { background-image: url(\"data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%225%22%20height%3D%2212%22%20viewBox%3D%220%200%205%2012%22%20fill%3D%22none%22%3E%3Cpath%20d%3D%22M1.51685%204.8L2.5%203.34159L3.47612%204.8L4.39607%204.12743L3.31461%202.7469L5%202.25133L4.64888%201.16106L3.00562%201.77699L3.06882%200H1.93118L1.99438%201.77699L0.351124%201.16106L0%202.25133L1.68539%202.7469L0.59691%204.12743L1.51685%204.8Z%22%20fill%3D%22%23F1222F%22%2F%3E%3C%2Fsvg%3E\"); }\n</style>\n"],"names":["_hoisted_1"],"mappings":";;;;AAOoC,MAAAA,IAAA;AAAA,EAAA,OAAA;AAAA;;;;;;"}
|