@milaboratories/uikit 2.6.0 → 2.6.2
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 +43 -43
- package/.turbo/turbo-type-check.log +1 -1
- package/CHANGELOG.md +14 -0
- package/dist/components/DataTable/TableComponent.vue.js +4 -2
- package/dist/components/DataTable/TableComponent.vue.js.map +1 -1
- package/dist/components/PlAutocomplete/PlAutocomplete.vue.d.ts +4 -0
- package/dist/components/PlAutocomplete/PlAutocomplete.vue.js +74 -68
- package/dist/components/PlAutocomplete/PlAutocomplete.vue.js.map +1 -1
- package/dist/components/PlAutocompleteMulti/PlAutocompleteMulti.vue.d.ts +4 -0
- package/dist/components/PlAutocompleteMulti/PlAutocompleteMulti.vue.js +52 -46
- package/dist/components/PlAutocompleteMulti/PlAutocompleteMulti.vue.js.map +1 -1
- package/dist/components/PlDropdown/PlDropdown.vue.d.ts +8 -0
- package/dist/components/PlDropdown/PlDropdown.vue.js +67 -60
- package/dist/components/PlDropdown/PlDropdown.vue.js.map +1 -1
- package/dist/components/PlDropdownLegacy/PlDropdownLegacy.vue.js +21 -19
- package/dist/components/PlDropdownLegacy/PlDropdownLegacy.vue.js.map +1 -1
- package/dist/components/PlDropdownMulti/PlDropdownMulti.vue.d.ts +4 -0
- package/dist/components/PlDropdownMulti/PlDropdownMulti.vue.js +47 -41
- package/dist/components/PlDropdownMulti/PlDropdownMulti.vue.js.map +1 -1
- package/dist/components/PlElementList/PlElementList.vue.d.ts +20 -0
- package/dist/components/PlElementList/PlElementList.vue2.js +180 -135
- package/dist/components/PlElementList/PlElementList.vue2.js.map +1 -1
- package/dist/components/PlElementList/PlElementListItem.vue.d.ts +20 -0
- package/dist/components/PlElementList/PlElementListItem.vue2.js +99 -74
- package/dist/components/PlElementList/PlElementListItem.vue2.js.map +1 -1
- package/dist/components/PlFileInput/PlFileInput.vue.js +24 -22
- package/dist/components/PlFileInput/PlFileInput.vue.js.map +1 -1
- package/dist/components/PlLogView/PlLogView.vue.js +24 -22
- package/dist/components/PlLogView/PlLogView.vue.js.map +1 -1
- package/dist/components/PlNumberField/PlNumberField.vue.d.ts +5 -0
- package/dist/components/PlNumberField/PlNumberField.vue.js +60 -54
- package/dist/components/PlNumberField/PlNumberField.vue.js.map +1 -1
- package/dist/components/PlSlideModal/PlPureSlideModal.vue.js +4 -2
- package/dist/components/PlSlideModal/PlPureSlideModal.vue.js.map +1 -1
- package/dist/components/PlSvg/PlSvg.vue2.js +15 -11
- package/dist/components/PlSvg/PlSvg.vue2.js.map +1 -1
- package/dist/components/PlTextArea/PlTextArea.vue.js +15 -13
- package/dist/components/PlTextArea/PlTextArea.vue.js.map +1 -1
- package/dist/components/PlTextField/PlTextField.vue.d.ts +4 -0
- package/dist/components/PlTextField/PlTextField.vue.js +45 -39
- package/dist/components/PlTextField/PlTextField.vue.js.map +1 -1
- package/dist/composition/filters/metadata.d.ts +205 -0
- package/dist/composition/filters/metadata.js +129 -19
- package/dist/composition/filters/metadata.js.map +1 -1
- package/dist/utils/DoubleContour.vue.d.ts +7 -1
- package/dist/utils/DoubleContour.vue.js +20 -13
- package/dist/utils/DoubleContour.vue.js.map +1 -1
- package/dist/utils/DoubleContour.vue2.js +19 -3
- package/dist/utils/DoubleContour.vue2.js.map +1 -1
- package/dist/utils/DoubleContour.vue3.js +7 -0
- package/dist/utils/DoubleContour.vue3.js.map +1 -0
- package/package.json +4 -4
- package/src/components/PlAutocomplete/PlAutocomplete.vue +6 -1
- package/src/components/PlAutocompleteMulti/PlAutocompleteMulti.vue +6 -1
- package/src/components/PlDropdown/PlDropdown.vue +12 -2
- package/src/components/PlDropdownMulti/PlDropdownMulti.vue +6 -1
- package/src/components/PlElementList/PlElementList.vue +40 -6
- package/src/components/PlElementList/PlElementListItem.vue +64 -47
- package/src/components/PlNumberField/PlNumberField.vue +4 -1
- package/src/components/PlSvg/PlSvg.vue +13 -10
- package/src/components/PlTextField/PlTextField.vue +7 -3
- package/src/composition/filters/metadata.ts +105 -0
- package/src/utils/DoubleContour.vue +68 -2
- package/dist/components/PlAccordion/ExpandTransition.vue.js +0 -27
- package/dist/components/PlAccordion/ExpandTransition.vue.js.map +0 -1
|
@@ -1,16 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { defineComponent as o, createElementBlock as t, openBlock as r, normalizeClass as n, createElementVNode as s, normalizeProps as a, guardReactiveProps as l, renderSlot as i } from "vue";
|
|
2
|
+
const u = {
|
|
3
|
+
inheritAttrs: !1
|
|
4
|
+
}, m = /* @__PURE__ */ o({
|
|
5
|
+
...u,
|
|
6
|
+
__name: "DoubleContour",
|
|
7
|
+
props: {
|
|
8
|
+
groupPosition: { default: void 0 }
|
|
9
|
+
},
|
|
10
|
+
setup(p) {
|
|
11
|
+
return (e, d) => (r(), t("div", {
|
|
12
|
+
class: n(["double-contour", { [e.groupPosition]: !0 }])
|
|
13
|
+
}, [
|
|
14
|
+
s("div", a(l(e.$attrs)), [
|
|
15
|
+
i(e.$slots, "default")
|
|
16
|
+
], 16)
|
|
17
|
+
], 2));
|
|
18
|
+
}
|
|
19
|
+
});
|
|
13
20
|
export {
|
|
14
|
-
|
|
21
|
+
m as default
|
|
15
22
|
};
|
|
16
23
|
//# sourceMappingURL=DoubleContour.vue.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DoubleContour.vue.js","sources":["../../src/utils/DoubleContour.vue"],"sourcesContent":["<script lang=\"ts\" setup
|
|
1
|
+
{"version":3,"file":"DoubleContour.vue.js","sources":["../../src/utils/DoubleContour.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nwithDefaults(defineProps<{\n groupPosition?: 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'middle';\n}>(), {\n groupPosition: undefined,\n});\n</script>\n\n<script lang=\"ts\">\n\nexport default {\n inheritAttrs: false,\n};\n</script>\n\n<template>\n <div class=\"double-contour\" :class=\"{ [groupPosition]: true }\">\n <div v-bind=\"$attrs\">\n <slot />\n </div>\n </div>\n</template>\n<style>\n.double-contour {\n &.top > div {\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n }\n}\n.double-contour {\n &.bottom > div {\n border-top-right-radius: 0;\n border-top-left-radius: 0;\n }\n}\n.double-contour {\n &.left > div {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n }\n}\n.double-contour {\n &.right > div {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n }\n}\n.double-contour {\n &.top-left > div{\n border-top-right-radius: 0;\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n }\n}\n.double-contour {\n &.top-right > div {\n border-bottom-right-radius: 0;\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n }\n}\n.double-contour {\n &.bottom-left > div {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n border-top-left-radius: 0;\n }\n}\n.double-contour {\n &.bottom-right > div {\n border-top-right-radius: 0;\n border-bottom-left-radius: 0;\n border-top-left-radius: 0;\n }\n}\n.double-contour {\n &.middle > div {\n border-radius: 0;\n }\n}\n</style>\n"],"names":["__default__"],"mappings":";AAUA,MAAAA,IAAe;AAAA,EACb,cAAc;AAChB;;;;;;;;;;;;;;;;"}
|
|
@@ -1,7 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
import { defineComponent as o, createElementBlock as t, openBlock as r, normalizeClass as n, createElementVNode as s, normalizeProps as a, guardReactiveProps as l, renderSlot as i } from "vue";
|
|
2
|
+
const u = {
|
|
2
3
|
inheritAttrs: !1
|
|
3
|
-
}
|
|
4
|
+
}, m = /* @__PURE__ */ o({
|
|
5
|
+
...u,
|
|
6
|
+
__name: "DoubleContour",
|
|
7
|
+
props: {
|
|
8
|
+
groupPosition: { default: void 0 }
|
|
9
|
+
},
|
|
10
|
+
setup(p) {
|
|
11
|
+
return (e, d) => (r(), t("div", {
|
|
12
|
+
class: n(["double-contour", { [e.groupPosition]: !0 }])
|
|
13
|
+
}, [
|
|
14
|
+
s("div", a(l(e.$attrs)), [
|
|
15
|
+
i(e.$slots, "default")
|
|
16
|
+
], 16)
|
|
17
|
+
], 2));
|
|
18
|
+
}
|
|
19
|
+
});
|
|
4
20
|
export {
|
|
5
|
-
|
|
21
|
+
m as default
|
|
6
22
|
};
|
|
7
23
|
//# sourceMappingURL=DoubleContour.vue2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DoubleContour.vue2.js","sources":["../../src/utils/DoubleContour.vue"],"sourcesContent":["<script lang=\"ts\" setup
|
|
1
|
+
{"version":3,"file":"DoubleContour.vue2.js","sources":["../../src/utils/DoubleContour.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nwithDefaults(defineProps<{\n groupPosition?: 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'middle';\n}>(), {\n groupPosition: undefined,\n});\n</script>\n\n<script lang=\"ts\">\n\nexport default {\n inheritAttrs: false,\n};\n</script>\n\n<template>\n <div class=\"double-contour\" :class=\"{ [groupPosition]: true }\">\n <div v-bind=\"$attrs\">\n <slot />\n </div>\n </div>\n</template>\n<style>\n.double-contour {\n &.top > div {\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n }\n}\n.double-contour {\n &.bottom > div {\n border-top-right-radius: 0;\n border-top-left-radius: 0;\n }\n}\n.double-contour {\n &.left > div {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n }\n}\n.double-contour {\n &.right > div {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n }\n}\n.double-contour {\n &.top-left > div{\n border-top-right-radius: 0;\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n }\n}\n.double-contour {\n &.top-right > div {\n border-bottom-right-radius: 0;\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n }\n}\n.double-contour {\n &.bottom-left > div {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n border-top-left-radius: 0;\n }\n}\n.double-contour {\n &.bottom-right > div {\n border-top-right-radius: 0;\n border-bottom-left-radius: 0;\n border-top-left-radius: 0;\n }\n}\n.double-contour {\n &.middle > div {\n border-radius: 0;\n }\n}\n</style>\n"],"names":["__default__"],"mappings":";AAUA,MAAAA,IAAe;AAAA,EACb,cAAc;AAChB;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode(".double-contour.top>div{border-bottom-right-radius:0;border-bottom-left-radius:0}.double-contour.bottom>div{border-top-right-radius:0;border-top-left-radius:0}.double-contour.left>div{border-top-right-radius:0;border-bottom-right-radius:0}.double-contour.right>div{border-top-left-radius:0;border-bottom-left-radius:0}.double-contour.top-left>div{border-top-right-radius:0;border-bottom-left-radius:0;border-bottom-right-radius:0}.double-contour.top-right>div{border-bottom-right-radius:0;border-top-left-radius:0;border-top-right-radius:0}.double-contour.bottom-left>div{border-top-right-radius:0;border-bottom-right-radius:0;border-top-left-radius:0}.double-contour.bottom-right>div{border-top-right-radius:0;border-bottom-left-radius:0;border-top-left-radius:0}.double-contour.middle>div{border-radius:0}")),document.head.appendChild(o)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
|
|
2
|
+
import o from "./DoubleContour.vue.js";
|
|
3
|
+
|
|
4
|
+
export {
|
|
5
|
+
o as default
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=DoubleContour.vue3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DoubleContour.vue3.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milaboratories/uikit",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"resize-observer-polyfill": "^1.5.1",
|
|
33
33
|
"canonicalize": "~2.1.0",
|
|
34
34
|
"@milaboratories/helpers": "1.12.0",
|
|
35
|
-
"@platforma-sdk/model": "1.45.
|
|
35
|
+
"@platforma-sdk/model": "1.45.35"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"jsdom": "^25.0.1",
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
"yarpm": "^1.2.0",
|
|
41
41
|
"svgo": "^3.3.2",
|
|
42
42
|
"typescript": "~5.6.3",
|
|
43
|
-
"@milaboratories/ts-
|
|
43
|
+
"@milaboratories/ts-configs": "1.0.6",
|
|
44
44
|
"@milaboratories/build-configs": "1.0.8",
|
|
45
45
|
"@milaboratories/eslint-config": "1.0.5",
|
|
46
|
-
"@milaboratories/ts-
|
|
46
|
+
"@milaboratories/ts-builder": "1.0.5"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
49
|
"dev": "ts-builder serve --target browser-lib --build-config ./build.browser-lib.config.js",
|
|
@@ -92,6 +92,10 @@ const props = withDefaults(
|
|
|
92
92
|
* Formatter for the selected value if its label is absent
|
|
93
93
|
*/
|
|
94
94
|
formatValue?: (value: M) => string;
|
|
95
|
+
/**
|
|
96
|
+
* Makes some of corners not rounded
|
|
97
|
+
* */
|
|
98
|
+
groupPosition?: 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'middle';
|
|
95
99
|
}>(),
|
|
96
100
|
{
|
|
97
101
|
modelSearch: undefined,
|
|
@@ -107,6 +111,7 @@ const props = withDefaults(
|
|
|
107
111
|
arrowIconLarge: undefined,
|
|
108
112
|
optionSize: 'small',
|
|
109
113
|
formatValue: (v: M) => String(v),
|
|
114
|
+
groupPosition: undefined,
|
|
110
115
|
},
|
|
111
116
|
);
|
|
112
117
|
|
|
@@ -397,7 +402,7 @@ watch(() => optionsRequest.loading || modelOptionRequest.loading, (loading) => {
|
|
|
397
402
|
/>
|
|
398
403
|
<div v-if="!renderedOptionsRef.length" class="nothing-found">Nothing found</div>
|
|
399
404
|
</DropdownOverlay>
|
|
400
|
-
<DoubleContour class="pl-autocomplete__contour" />
|
|
405
|
+
<DoubleContour class="pl-autocomplete__contour" :group-position="groupPosition" />
|
|
401
406
|
</div>
|
|
402
407
|
</div>
|
|
403
408
|
<div v-if="computedError" class="pl-autocomplete__error">{{ computedError }}</div>
|
|
@@ -119,6 +119,10 @@ const props = withDefaults(
|
|
|
119
119
|
* The text to display when no options are found.
|
|
120
120
|
*/
|
|
121
121
|
emptyOptionsText?: string;
|
|
122
|
+
/**
|
|
123
|
+
* Makes some of corners not rounded
|
|
124
|
+
* */
|
|
125
|
+
groupPosition?: 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'middle';
|
|
122
126
|
}>(),
|
|
123
127
|
{
|
|
124
128
|
modelValue: () => [],
|
|
@@ -131,6 +135,7 @@ const props = withDefaults(
|
|
|
131
135
|
debounce: 300,
|
|
132
136
|
emptyOptionsText: 'Nothing found',
|
|
133
137
|
sourceId: undefined,
|
|
138
|
+
groupPosition: undefined,
|
|
134
139
|
},
|
|
135
140
|
);
|
|
136
141
|
|
|
@@ -406,7 +411,7 @@ const computedError = computed(() => {
|
|
|
406
411
|
/>
|
|
407
412
|
<div v-if="!filteredOptionsRef.length && !isOptionsLoading" class="nothing-found">{{ emptyOptionsText }}</div>
|
|
408
413
|
</DropdownOverlay>
|
|
409
|
-
<DoubleContour class="pl-autocomplete-multi__contour" />
|
|
414
|
+
<DoubleContour class="pl-autocomplete-multi__contour" :group-position="groupPosition" />
|
|
410
415
|
</div>
|
|
411
416
|
</div>
|
|
412
417
|
<div v-if="computedError" class="pl-autocomplete-multi__error">{{ computedError }}</div>
|
|
@@ -60,6 +60,10 @@ const props = withDefaults(
|
|
|
60
60
|
* Error message displayed below the dropdown (optional)
|
|
61
61
|
*/
|
|
62
62
|
error?: unknown;
|
|
63
|
+
/**
|
|
64
|
+
* Shows red border even without an error message
|
|
65
|
+
*/
|
|
66
|
+
errorStatus?: boolean;
|
|
63
67
|
/**
|
|
64
68
|
* Placeholder text shown when no value is selected.
|
|
65
69
|
*/
|
|
@@ -88,12 +92,17 @@ const props = withDefaults(
|
|
|
88
92
|
* Option list item size
|
|
89
93
|
*/
|
|
90
94
|
optionSize?: 'small' | 'medium';
|
|
95
|
+
/**
|
|
96
|
+
* Makes some of corners not rounded
|
|
97
|
+
* */
|
|
98
|
+
groupPosition?: 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'middle';
|
|
91
99
|
}>(),
|
|
92
100
|
{
|
|
93
101
|
label: '',
|
|
94
102
|
helper: undefined,
|
|
95
103
|
loadingOptionsHelper: undefined,
|
|
96
104
|
error: undefined,
|
|
105
|
+
showErrorMessage: true,
|
|
97
106
|
placeholder: '...',
|
|
98
107
|
clearable: false,
|
|
99
108
|
required: false,
|
|
@@ -102,6 +111,7 @@ const props = withDefaults(
|
|
|
102
111
|
arrowIconLarge: undefined,
|
|
103
112
|
optionSize: 'small',
|
|
104
113
|
options: undefined,
|
|
114
|
+
groupPosition: undefined,
|
|
105
115
|
},
|
|
106
116
|
);
|
|
107
117
|
|
|
@@ -316,7 +326,7 @@ watchPostEffect(() => {
|
|
|
316
326
|
ref="rootRef"
|
|
317
327
|
:tabindex="tabindex"
|
|
318
328
|
class="pl-dropdown"
|
|
319
|
-
:class="{ open: data.open, error, disabled: isDisabled }"
|
|
329
|
+
:class="{ open: data.open, error: error || errorStatus, disabled: isDisabled }"
|
|
320
330
|
@keydown="handleKeydown"
|
|
321
331
|
@focusout="onFocusOut"
|
|
322
332
|
>
|
|
@@ -367,7 +377,7 @@ watchPostEffect(() => {
|
|
|
367
377
|
:option-size="optionSize"
|
|
368
378
|
:select-option="selectOptionWrapper"
|
|
369
379
|
/>
|
|
370
|
-
<DoubleContour class="pl-dropdown__contour" />
|
|
380
|
+
<DoubleContour class="pl-dropdown__contour" :group-position="groupPosition" />
|
|
371
381
|
</div>
|
|
372
382
|
</div>
|
|
373
383
|
<div v-if="computedError" class="pl-dropdown__error">{{ computedError }}</div>
|
|
@@ -66,6 +66,10 @@ const props = withDefaults(
|
|
|
66
66
|
* If `true`, the dropdown component is disabled and cannot be interacted with.
|
|
67
67
|
*/
|
|
68
68
|
disabled?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Makes some of corners not rounded
|
|
71
|
+
* */
|
|
72
|
+
groupPosition?: 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'middle';
|
|
69
73
|
}>(),
|
|
70
74
|
{
|
|
71
75
|
modelValue: () => [],
|
|
@@ -76,6 +80,7 @@ const props = withDefaults(
|
|
|
76
80
|
required: false,
|
|
77
81
|
disabled: false,
|
|
78
82
|
options: undefined,
|
|
83
|
+
groupPosition: undefined,
|
|
79
84
|
},
|
|
80
85
|
);
|
|
81
86
|
|
|
@@ -308,7 +313,7 @@ watchPostEffect(() => {
|
|
|
308
313
|
/>
|
|
309
314
|
<div v-if="!filteredOptionsRef.length" class="nothing-found">Nothing found</div>
|
|
310
315
|
</DropdownOverlay>
|
|
311
|
-
<DoubleContour class="pl-dropdown-multi__contour" />
|
|
316
|
+
<DoubleContour class="pl-dropdown-multi__contour" :group-position="groupPosition" />
|
|
312
317
|
</div>
|
|
313
318
|
</div>
|
|
314
319
|
<div v-if="error" class="pl-dropdown-multi__error">{{ getErrorMessage(error) }}</div>
|
|
@@ -14,6 +14,10 @@ const props = withDefaults(
|
|
|
14
14
|
getItemKey?: (item: T, index: number) => K;
|
|
15
15
|
|
|
16
16
|
itemClass?: string | string[] | ((item: T, index: number) => string | string[]);
|
|
17
|
+
itemClassTitle?: string | string[] | ((item: T, index: number) => string | string[]);
|
|
18
|
+
itemClassBefore?: string | string[] | ((item: T, index: number) => string | string[]);
|
|
19
|
+
itemClassAfter?: string | string[] | ((item: T, index: number) => string | string[]);
|
|
20
|
+
itemClassContent?: string | string[] | ((item: T, index: number) => string | string[]);
|
|
17
21
|
isActive?: (item: T, index: number) => boolean;
|
|
18
22
|
|
|
19
23
|
disableDragging?: boolean;
|
|
@@ -43,6 +47,10 @@ const props = withDefaults(
|
|
|
43
47
|
getItemKey: (item: T) => JSON.stringify(item) as K,
|
|
44
48
|
|
|
45
49
|
itemClass: undefined,
|
|
50
|
+
itemClassTitle: undefined,
|
|
51
|
+
itemClassContent: undefined,
|
|
52
|
+
itemClassBefore: undefined,
|
|
53
|
+
itemClassAfter: undefined,
|
|
46
54
|
isActive: undefined,
|
|
47
55
|
|
|
48
56
|
disableDragging: undefined,
|
|
@@ -78,6 +86,8 @@ const emits = defineEmits<{
|
|
|
78
86
|
const slots = defineSlots<{
|
|
79
87
|
['item-title']: (props: { item: T; index: number }) => unknown;
|
|
80
88
|
['item-content']?: (props: { item: T; index: number }) => unknown;
|
|
89
|
+
['item-before']?: (props: { item: T; index: number }) => unknown;
|
|
90
|
+
['item-after']?: (props: { item: T; index: number }) => unknown;
|
|
81
91
|
}>();
|
|
82
92
|
|
|
83
93
|
const dndSortingEnabled = computed((): boolean => {
|
|
@@ -237,12 +247,19 @@ function handleRemove(item: T, index: number) {
|
|
|
237
247
|
itemsRef.value.splice(index, 1);
|
|
238
248
|
}
|
|
239
249
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
250
|
+
function getClassFunction(propsItemClass: string | string[] | ((item: T, index: number) => string | string[]) | undefined): (item: T, index: number) => null | string | string[] {
|
|
251
|
+
return (item: T, index: number): null | string | string[] => {
|
|
252
|
+
if (typeof propsItemClass === 'function') {
|
|
253
|
+
return propsItemClass(item, index);
|
|
254
|
+
}
|
|
255
|
+
return propsItemClass ?? null;
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
const getItemClass = getClassFunction(props.itemClass);
|
|
259
|
+
const getItemClassTitle = getClassFunction(props.itemClassTitle);
|
|
260
|
+
const getItemClassContent = getClassFunction(props.itemClassContent);
|
|
261
|
+
const getItemClassBefore = getClassFunction(props.itemClassBefore);
|
|
262
|
+
const getItemClassAfter = getClassFunction(props.itemClassAfter);
|
|
246
263
|
|
|
247
264
|
</script>
|
|
248
265
|
|
|
@@ -252,6 +269,10 @@ const getItemClass = (item: T, index: number): null | string | string[] => {
|
|
|
252
269
|
<PlElementListItem
|
|
253
270
|
v-for="(pinnedItem, pinnedIndex) in pinnedItemsRef" :key="pinnedKeysRef[pinnedIndex]"
|
|
254
271
|
:class="[$style.item, getItemClass(pinnedItem, pinnedIndex)]"
|
|
272
|
+
:titleClass="getItemClassTitle(pinnedItem, pinnedIndex)"
|
|
273
|
+
:contentClass="getItemClassContent(pinnedItem, pinnedIndex)"
|
|
274
|
+
:beforeClass="getItemClassBefore(pinnedItem, pinnedIndex)"
|
|
275
|
+
:afterClass="getItemClassAfter(pinnedItem, pinnedIndex)"
|
|
255
276
|
|
|
256
277
|
:index="pinnedIndex"
|
|
257
278
|
:item="pinnedItem"
|
|
@@ -272,18 +293,28 @@ const getItemClass = (item: T, index: number): null | string | string[] => {
|
|
|
272
293
|
@pin="handlePin"
|
|
273
294
|
@expand="handleExpand"
|
|
274
295
|
>
|
|
296
|
+
<template v-if="slots['item-before']" #before="{ item, index }">
|
|
297
|
+
<slot :index="index" :item="item" name="item-before" />
|
|
298
|
+
</template>
|
|
275
299
|
<template #title="{ item, index }">
|
|
276
300
|
<slot :index="index" :item="item" name="item-title" />
|
|
277
301
|
</template>
|
|
278
302
|
<template v-if="slots['item-content']" #content="{ item, index }">
|
|
279
303
|
<slot :index="index" :item="item" name="item-content" />
|
|
280
304
|
</template>
|
|
305
|
+
<template v-if="slots['item-after']" #after="{ item, index }">
|
|
306
|
+
<slot :index="index" :item="item" name="item-after" />
|
|
307
|
+
</template>
|
|
281
308
|
</PlElementListItem>
|
|
282
309
|
</div>
|
|
283
310
|
<div v-if="hasUnpinnedItems" ref="unpinnedContainerRef" :class="$style.list">
|
|
284
311
|
<PlElementListItem
|
|
285
312
|
v-for="(unpinnedItem, unpinnedIndex) in unpinnedItemsRef" :key="unpinnedKeysRef[unpinnedIndex]"
|
|
286
313
|
:class="[$style.item, getItemClass(unpinnedItem, unpinnedIndex)]"
|
|
314
|
+
:titleClass="getItemClassTitle(unpinnedItem, unpinnedIndex)"
|
|
315
|
+
:contentClass="getItemClassContent(unpinnedItem, unpinnedIndex)"
|
|
316
|
+
:beforeClass="getItemClassBefore(unpinnedItem, unpinnedIndex)"
|
|
317
|
+
:afterClass="getItemClassAfter(unpinnedItem, unpinnedIndex)"
|
|
287
318
|
|
|
288
319
|
:index="unpinnedIndex + (pinnedItemsRef?.length ?? 0)"
|
|
289
320
|
:item="unpinnedItem"
|
|
@@ -310,6 +341,9 @@ const getItemClass = (item: T, index: number): null | string | string[] => {
|
|
|
310
341
|
<template v-if="slots['item-content']" #content="{ item, index }">
|
|
311
342
|
<slot :index="index" :item="item" name="item-content" />
|
|
312
343
|
</template>
|
|
344
|
+
<template v-if="slots['item-after']" #after="{ item, index }">
|
|
345
|
+
<slot :index="index" :item="item" name="item-after" />
|
|
346
|
+
</template>
|
|
313
347
|
</PlElementListItem>
|
|
314
348
|
</div>
|
|
315
349
|
</div>
|
|
@@ -16,13 +16,22 @@ const props = defineProps<{
|
|
|
16
16
|
isToggled: boolean;
|
|
17
17
|
isPinnable: boolean;
|
|
18
18
|
isPinned: boolean;
|
|
19
|
+
titleClass: string | string[] | null;
|
|
20
|
+
contentClass: string | string[] | null;
|
|
21
|
+
afterClass: string | string[] | null;
|
|
22
|
+
beforeClass: string | string[] | null;
|
|
19
23
|
}>();
|
|
24
|
+
defineOptions({ inheritAttrs: false });
|
|
20
25
|
|
|
21
26
|
const slots = defineSlots<{
|
|
22
27
|
title: (props: { item: T; index: number }) => unknown;
|
|
23
28
|
content?: (props: { item: T; index: number }) => unknown;
|
|
29
|
+
after?: (props: { item: T; index: number }) => unknown;
|
|
30
|
+
before?: (props: { item: T; index: number }) => unknown;
|
|
24
31
|
}>();
|
|
25
32
|
const hasContentSlot = computed(() => slots['content'] !== undefined);
|
|
33
|
+
const hasAfterSlot = computed(() => slots['after'] !== undefined);
|
|
34
|
+
const hasBeforeSlot = computed(() => slots['before'] !== undefined);
|
|
26
35
|
|
|
27
36
|
const emit = defineEmits<{
|
|
28
37
|
(e: 'expand', item: T, index: number): void;
|
|
@@ -33,65 +42,73 @@ const emit = defineEmits<{
|
|
|
33
42
|
</script>
|
|
34
43
|
|
|
35
44
|
<template>
|
|
36
|
-
<div
|
|
37
|
-
:class="
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
[$style.opened]: props.isExpanded,
|
|
41
|
-
[$style.disabled]: props.isToggled,
|
|
42
|
-
}]"
|
|
43
|
-
>
|
|
45
|
+
<div>
|
|
46
|
+
<div v-if="hasBeforeSlot" :class="beforeClass">
|
|
47
|
+
<slot name="before" :item="props.item" :index="props.index" />
|
|
48
|
+
</div>
|
|
44
49
|
<div
|
|
45
|
-
:class="[$style.
|
|
46
|
-
[$style.
|
|
50
|
+
:class="[$style.root, $attrs.class, {
|
|
51
|
+
[$style.active]: props.isActive,
|
|
52
|
+
[$style.pinned]: props.isPinned,
|
|
53
|
+
[$style.opened]: props.isExpanded,
|
|
54
|
+
[$style.disabled]: props.isToggled,
|
|
47
55
|
}]"
|
|
48
|
-
@click="isExpandable && emit('expand', props.item, props.index)"
|
|
49
56
|
>
|
|
50
57
|
<div
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
58
|
+
:class="[$style.head, titleClass, {
|
|
59
|
+
[$style.clickable]: hasContentSlot,
|
|
60
|
+
}]"
|
|
61
|
+
@click="isExpandable && emit('expand', props.item, props.index)"
|
|
54
62
|
>
|
|
55
|
-
<PlIcon16 name="drag-dots" />
|
|
56
|
-
</div>
|
|
57
|
-
<PlIcon16 v-if="isExpandable" :class="[$style.contentChevron, { [$style.opened]: props.isExpanded }]" name="chevron-down" />
|
|
58
|
-
|
|
59
|
-
<div :class="$style.title">
|
|
60
|
-
<slot name="title" :item="props.item" :index="props.index" />
|
|
61
|
-
</div>
|
|
62
|
-
|
|
63
|
-
<div :class="[$style.actions, $style.showOnHover]">
|
|
64
63
|
<div
|
|
65
|
-
v-if="props.
|
|
66
|
-
:class="[$style.action, $style.
|
|
67
|
-
|
|
64
|
+
v-if="props.showDragHandle"
|
|
65
|
+
:class="[$style.action, $style.draggable, { [$style.disable]: !props.isDraggable } ]"
|
|
66
|
+
:data-draggable="props.isDraggable"
|
|
68
67
|
>
|
|
69
|
-
<
|
|
68
|
+
<PlIcon16 name="drag-dots" />
|
|
70
69
|
</div>
|
|
71
|
-
<
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
[$style.activated]: props.isPinned,
|
|
76
|
-
}]"
|
|
77
|
-
@click.stop="emit('pin', props.item, props.index)"
|
|
78
|
-
>
|
|
79
|
-
<PlIcon24 name="pin" size="16" />
|
|
70
|
+
<PlIcon16 v-if="isExpandable" :class="[$style.contentChevron, { [$style.opened]: props.isExpanded }]" name="chevron-down" />
|
|
71
|
+
|
|
72
|
+
<div :class="$style.title">
|
|
73
|
+
<slot name="title" :item="props.item" :index="props.index" />
|
|
80
74
|
</div>
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
75
|
+
|
|
76
|
+
<div :class="[$style.actions, $style.showOnHover]">
|
|
77
|
+
<div
|
|
78
|
+
v-if="props.isToggable"
|
|
79
|
+
:class="[$style.action, $style.clickable, { [$style.disable]: !props.isToggable }]"
|
|
80
|
+
@click.stop="emit('toggle', props.item, props.index)"
|
|
81
|
+
>
|
|
82
|
+
<PlIcon24 :name="props.isToggled === true ? 'view-hide' : 'view-show'" size="16" />
|
|
83
|
+
</div>
|
|
84
|
+
<div
|
|
85
|
+
v-if="props.isPinnable"
|
|
86
|
+
:class="[$style.action, $style.clickable, {
|
|
87
|
+
[$style.disable]: !props.isPinnable,
|
|
88
|
+
[$style.activated]: props.isPinned,
|
|
89
|
+
}]"
|
|
90
|
+
@click.stop="emit('pin', props.item, props.index)"
|
|
91
|
+
>
|
|
92
|
+
<PlIcon24 name="pin" size="16" />
|
|
93
|
+
</div>
|
|
94
|
+
<div
|
|
95
|
+
v-if="props.isRemovable"
|
|
96
|
+
:class="[$style.action, $style.clickable]"
|
|
97
|
+
@click.stop="emit('remove', props.item, props.index)"
|
|
98
|
+
>
|
|
99
|
+
<PlIcon16 name="close" />
|
|
100
|
+
</div>
|
|
87
101
|
</div>
|
|
88
102
|
</div>
|
|
103
|
+
<div
|
|
104
|
+
v-if="hasContentSlot && props.isExpanded"
|
|
105
|
+
:class="[$style.body, contentClass, { [$style.disabled]: props.isToggled }]"
|
|
106
|
+
>
|
|
107
|
+
<slot name="content" :item="props.item" :index="props.index" />
|
|
108
|
+
</div>
|
|
89
109
|
</div>
|
|
90
|
-
<div
|
|
91
|
-
|
|
92
|
-
:class="[$style.body, { [$style.disabled]: props.isToggled }]"
|
|
93
|
-
>
|
|
94
|
-
<slot name="content" :item="props.item" :index="props.index" />
|
|
110
|
+
<div v-if="hasAfterSlot" :class="afterClass">
|
|
111
|
+
<slot name="after" :item="props.item" :index="props.index" />
|
|
95
112
|
</div>
|
|
96
113
|
</div>
|
|
97
114
|
</template>
|
|
@@ -47,6 +47,8 @@ const props = withDefaults(defineProps<{
|
|
|
47
47
|
errorMessage?: string;
|
|
48
48
|
/** Additional validity check for input value that must return an error text if failed */
|
|
49
49
|
validate?: (v: number) => string | undefined;
|
|
50
|
+
/** Makes some of corners not rounded */
|
|
51
|
+
groupPosition?: 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'middle';
|
|
50
52
|
}>(), {
|
|
51
53
|
step: 1,
|
|
52
54
|
label: undefined,
|
|
@@ -57,6 +59,7 @@ const props = withDefaults(defineProps<{
|
|
|
57
59
|
updateOnEnter: false,
|
|
58
60
|
errorMessage: undefined,
|
|
59
61
|
validate: undefined,
|
|
62
|
+
groupPosition: undefined,
|
|
60
63
|
});
|
|
61
64
|
|
|
62
65
|
const modelValue = defineModel<number | undefined>({ required: true });
|
|
@@ -239,7 +242,7 @@ const onMousedown = (ev: MouseEvent) => {
|
|
|
239
242
|
@keydown="handleKeyPress($event)"
|
|
240
243
|
>
|
|
241
244
|
<div class="pl-number-field__main-wrapper d-flex">
|
|
242
|
-
<DoubleContour class="pl-number-field__contour"/>
|
|
245
|
+
<DoubleContour class="pl-number-field__contour" :group-position="groupPosition"/>
|
|
243
246
|
<div
|
|
244
247
|
class="pl-number-field__wrapper flex-grow d-flex flex-align-center"
|
|
245
248
|
:class="{withoutArrows: !useIncrementButtons}"
|
|
@@ -18,20 +18,23 @@ const uri = computedAsync(async () => {
|
|
|
18
18
|
if (typeof props.name === 'string') return import(`../../assets/icons/icon-assets-min/${props.name}.svg?raw`).then((m) => m.default);
|
|
19
19
|
return undefined;
|
|
20
20
|
});
|
|
21
|
+
|
|
21
22
|
const svgMeta = computed(() => (uri.value == null ? undefined : registerSvg(uri.value, props.name)));
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
|
|
24
|
+
const toPx = (value: undefined | number | string) => {
|
|
25
|
+
if (typeof value === 'number') return `${value}px`;
|
|
26
|
+
if (typeof value === 'string') return value;
|
|
27
|
+
return;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const styleSize = computed(() => ({
|
|
31
|
+
'--svg-width': toPx(props.width ?? svgMeta.value?.defaultWidth),
|
|
32
|
+
'--svg-height': toPx(props.height ?? svgMeta.value?.defaultHeight),
|
|
33
|
+
}));
|
|
34
|
+
|
|
27
35
|
const styleColor = computed(() => getStyleColor('fill', props.color));
|
|
28
36
|
const styleStroke = computed(() => getStyleColor('stroke', props.stroke));
|
|
29
37
|
|
|
30
|
-
function getSize(propSize: undefined | number | string, svgSize: number): string {
|
|
31
|
-
if (propSize != null) return typeof propSize === 'string' ? propSize : `${propSize}px`;
|
|
32
|
-
return `${svgSize}px`;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
38
|
function getStyleColor(prop: 'fill' | 'stroke', color: undefined | string | string[]): undefined | string {
|
|
36
39
|
if (Array.isArray(color)) {
|
|
37
40
|
return color.reduce((acc, color, i) => acc + `--svg-${prop}-${i}: ${color};`, '');
|
|
@@ -16,7 +16,7 @@ import DoubleContour from '../../utils/DoubleContour.vue';
|
|
|
16
16
|
import { useLabelNotch } from '../../utils/useLabelNotch';
|
|
17
17
|
import { useValidation } from '../../utils/useValidation';
|
|
18
18
|
import { PlIcon16 } from '../PlIcon16';
|
|
19
|
-
import {
|
|
19
|
+
import { PlIcon24 } from '../PlIcon24';
|
|
20
20
|
import { PlSvg } from '../PlSvg';
|
|
21
21
|
import { PlTooltip } from '../PlTooltip';
|
|
22
22
|
import './pl-text-field.scss';
|
|
@@ -83,6 +83,10 @@ const props = defineProps<{
|
|
|
83
83
|
* The string specifies whether the field should be a password or not, value could be "password" or undefined.
|
|
84
84
|
*/
|
|
85
85
|
type?: 'password';
|
|
86
|
+
/**
|
|
87
|
+
* Makes some of corners not rounded
|
|
88
|
+
* */
|
|
89
|
+
groupPosition?: 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'middle';
|
|
86
90
|
}>();
|
|
87
91
|
|
|
88
92
|
const rootRef = ref<HTMLInputElement | undefined>(undefined);
|
|
@@ -214,10 +218,10 @@ useLabelNotch(rootRef);
|
|
|
214
218
|
/>
|
|
215
219
|
<div class="pl-text-field__append" @click="setFocusOnInput">
|
|
216
220
|
<PlIcon16 v-if="canShowClearable" class="pl-text-field__clearable" name="delete-clear" @click.stop="clear" />
|
|
217
|
-
<
|
|
221
|
+
<PlIcon24 v-if="type === 'password'" :name="passwordIcon" style="cursor: pointer" @click.stop="togglePasswordVisibility" />
|
|
218
222
|
<slot name="append" />
|
|
219
223
|
</div>
|
|
220
|
-
<DoubleContour class="pl-text-field__contour" />
|
|
224
|
+
<DoubleContour class="pl-text-field__contour" :group-position="groupPosition" />
|
|
221
225
|
</div>
|
|
222
226
|
<div v-if="hasErrors" class="pl-text-field__error">
|
|
223
227
|
{{ displayErrors.join(' ') }}
|