@milaboratories/uikit 2.2.13 → 2.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/pl-uikit.js +2043 -1943
- package/dist/pl-uikit.umd.cjs +6 -6
- package/dist/src/components/PlDropdownLine/PlDropdownLine.vue.d.ts +1 -1
- package/dist/src/components/PlDropdownRef/PlDropdownRef.vue.d.ts +1 -1
- package/dist/src/components/PlEditableTitle/PlEditableTitle.vue.d.ts +37 -0
- package/dist/src/components/PlEditableTitle/index.d.ts +1 -0
- package/dist/src/composition/useTransformedModel.d.ts +40 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/types.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/components/PlEditableTitle/PlEditableTitle.vue +88 -0
- package/src/components/PlEditableTitle/index.ts +1 -0
- package/src/components/PlEditableTitle/pl-editable-title.module.scss +77 -0
- package/src/composition/useTransformedModel.ts +80 -0
- package/src/index.ts +1 -0
- package/src/layout/PlBlockPage/PlBlockPage.vue +1 -1
- package/src/layout/PlBlockPage/pl-block-page.scss +5 -1
- package/src/types.ts +1 -1
|
@@ -48,9 +48,9 @@ declare const __VLS_component: import("vue").DefineComponent<{
|
|
|
48
48
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
49
49
|
}>, {
|
|
50
50
|
mode: "list" | "tabs";
|
|
51
|
-
clearable: boolean;
|
|
52
51
|
placeholder: string;
|
|
53
52
|
prefix: string;
|
|
53
|
+
clearable: boolean;
|
|
54
54
|
tabsContainerStyles: string | false | import("vue").CSSProperties | StyleValue[] | null;
|
|
55
55
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
56
56
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
@@ -111,8 +111,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
111
111
|
required: boolean;
|
|
112
112
|
disabled: boolean;
|
|
113
113
|
helper: string;
|
|
114
|
-
clearable: boolean;
|
|
115
114
|
placeholder: string;
|
|
115
|
+
clearable: boolean;
|
|
116
116
|
loadingOptionsHelper: string;
|
|
117
117
|
optionSize: "small" | "medium";
|
|
118
118
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
declare let __VLS_typeProps: {
|
|
2
|
+
/**
|
|
3
|
+
* Standard input placeholder
|
|
4
|
+
*/
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Any css `width` value (px, %), default is 80%
|
|
8
|
+
*/
|
|
9
|
+
maxWidth?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Fixed non-editable prefix
|
|
12
|
+
*/
|
|
13
|
+
prefix?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Max title length (default is 1000)
|
|
16
|
+
*/
|
|
17
|
+
maxLength?: number;
|
|
18
|
+
/**
|
|
19
|
+
* Min title length
|
|
20
|
+
*/
|
|
21
|
+
minLength?: number;
|
|
22
|
+
};
|
|
23
|
+
type __VLS_PublicProps = {
|
|
24
|
+
modelValue?: string;
|
|
25
|
+
} & typeof __VLS_typeProps;
|
|
26
|
+
declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
27
|
+
"update:modelValue": (modelValue: string) => any;
|
|
28
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
29
|
+
"onUpdate:modelValue"?: ((modelValue: string) => any) | undefined;
|
|
30
|
+
}>, {
|
|
31
|
+
placeholder: string;
|
|
32
|
+
maxWidth: string;
|
|
33
|
+
prefix: string;
|
|
34
|
+
maxLength: number;
|
|
35
|
+
minLength: number;
|
|
36
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
37
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as PlEditableTitle } from './PlEditableTitle.vue';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { Ref, UnwrapNestedRefs } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a reactive local model with optional transformation and validation logic.
|
|
4
|
+
*
|
|
5
|
+
* @template T The type of the model's value.
|
|
6
|
+
*
|
|
7
|
+
* @param model - A `Ref` representing the underlying value.
|
|
8
|
+
* @param options - Optional configuration for validation and parsing.
|
|
9
|
+
* @param options.update - A function that takes the transformed value and returns `true` if it should be applied to the model, or `false` to keep it in a cached state.
|
|
10
|
+
* @param options.parse - A function that takes the input value and returns a transformed value of type `T`. If omitted, the value is used as-is.
|
|
11
|
+
*
|
|
12
|
+
* @returns A reactive object with the following properties:
|
|
13
|
+
* - `value`: A computed property for getting and setting the model value.
|
|
14
|
+
* - `error`: A `Ref<string | undefined>` containing the last error message, if any.
|
|
15
|
+
* - `reset`: A method to clear the cached value and error state.
|
|
16
|
+
*
|
|
17
|
+
* ### Example
|
|
18
|
+
* ```ts
|
|
19
|
+
* import { ref } from 'vue';
|
|
20
|
+
* import { useTransformedModel } from './useTransformedModel';
|
|
21
|
+
*
|
|
22
|
+
* const model = ref<number>(42);
|
|
23
|
+
*
|
|
24
|
+
* const transformedModel = useTransformedModel(model, {
|
|
25
|
+
* parse: (value) => {
|
|
26
|
+
* const parsed = Number(value);
|
|
27
|
+
* if (!Number.isFinite(parsed)) throw new Error('Invalid number');
|
|
28
|
+
* return parsed;
|
|
29
|
+
* },
|
|
30
|
+
* update: (value) => value >= 0, // Only allow non-negative numbers
|
|
31
|
+
* });
|
|
32
|
+
*/
|
|
33
|
+
export declare function useTransformedModel<T>(model: Ref<T>, options: {
|
|
34
|
+
update?: (v: T) => boolean;
|
|
35
|
+
parse?: (v: unknown) => T;
|
|
36
|
+
}): UnwrapNestedRefs<{
|
|
37
|
+
value: T;
|
|
38
|
+
error?: string;
|
|
39
|
+
reset: () => void;
|
|
40
|
+
}>;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export * from './components/PlBtnSecondary';
|
|
|
21
21
|
export * from './components/PlBtnGhost';
|
|
22
22
|
export * from './components/PlBtnLink';
|
|
23
23
|
export * from './components/PlBtnGroup';
|
|
24
|
+
export * from './components/PlEditableTitle';
|
|
24
25
|
export * from './components/PlTextField';
|
|
25
26
|
export * from './components/PlTextArea';
|
|
26
27
|
export * from './components/PlDropdown';
|
package/dist/src/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ImportFileHandle, Platforma, StorageHandle,
|
|
1
|
+
import type { ImportFileHandle, Platforma, StorageHandle, PlRef as ModelRef } from '@platforma-sdk/model';
|
|
2
2
|
import type { Ref, ComputedRef } from 'vue';
|
|
3
3
|
import { maskIcons16 } from './generated/icons-16';
|
|
4
4
|
import { maskIcons24 } from './generated/icons-24';
|