@milaboratories/uikit 2.2.45 → 2.2.47
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 +12 -0
- package/dist/pl-uikit.js +7729 -5295
- package/dist/pl-uikit.umd.cjs +12 -8
- package/dist/src/components/PlChartHistogram/PlChartHistogram.vue.d.ts +6 -0
- package/dist/src/components/PlChartHistogram/createGridlines.d.ts +3 -0
- package/dist/src/components/PlChartHistogram/createLabels.d.ts +3 -0
- package/dist/src/components/PlChartHistogram/createSvgContainer.d.ts +3 -0
- package/dist/src/components/PlChartHistogram/drawBins.d.ts +2 -0
- package/dist/src/components/PlChartHistogram/drawThreshold.d.ts +2 -0
- package/dist/src/components/PlChartHistogram/histogram.d.ts +4 -0
- package/dist/src/components/PlChartHistogram/index.d.ts +1 -0
- package/dist/src/components/PlChartHistogram/logspace.d.ts +1 -0
- package/dist/src/components/PlChartHistogram/normalizeBins.d.ts +2 -0
- package/dist/src/components/PlChartHistogram/scales.spec.d.ts +1 -0
- package/dist/src/components/PlChartHistogram/types.d.ts +58 -0
- package/dist/src/components/PlDialogModal/PlDialogModal.vue.d.ts +10 -0
- package/dist/src/components/PlDropdownMultiRef/PlDropdownMultiRef.vue.d.ts +1 -0
- package/dist/src/composition/useComponentProp.d.ts +33 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/types.d.ts +2 -1
- package/dist/style.css +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +4 -2
- package/src/colors/__tests__/colors.spec.ts +0 -2
- package/src/components/PlChartHistogram/PlChartHistogram.vue +90 -0
- package/src/components/PlChartHistogram/createGridlines.ts +42 -0
- package/src/components/PlChartHistogram/createLabels.ts +32 -0
- package/src/components/PlChartHistogram/createSvgContainer.ts +23 -0
- package/src/components/PlChartHistogram/drawBins.ts +55 -0
- package/src/components/PlChartHistogram/drawThreshold.ts +19 -0
- package/src/components/PlChartHistogram/histogram.ts +136 -0
- package/src/components/PlChartHistogram/index.ts +1 -0
- package/src/components/PlChartHistogram/logspace.ts +13 -0
- package/src/components/PlChartHistogram/normalizeBins.ts +19 -0
- package/src/components/PlChartHistogram/scales.spec.ts +10 -0
- package/src/components/PlChartHistogram/types.ts +66 -0
- package/src/components/PlDialogModal/PlDialogModal.vue +41 -2
- package/src/components/PlDropdownMulti/PlDropdownMulti.vue +1 -2
- package/src/components/PlDropdownMultiRef/PlDropdownMultiRef.vue +1 -0
- package/src/components/PlDropdownMultiRef/__tests__/PlDropdownMultiRef.spec.ts +1 -3
- package/src/components/PlProgressCell/PlProgressCell.vue +0 -2
- package/src/composition/useComponentProp.ts +36 -0
- package/src/helpers/index.ts +1 -1
- package/src/index.ts +2 -0
- package/src/types.ts +3 -1
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { PlChartHistogramSettings } from './types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
settings: PlChartHistogramSettings;
|
|
4
|
+
};
|
|
5
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import * as d3 from 'd3';
|
|
2
|
+
import type { ChartOptions, Scales } from './types';
|
|
3
|
+
export declare function createGridlines(svg: d3.Selection<SVGGElement, unknown, null, undefined>, options: ChartOptions, scales: Scales, xTicks: (d: d3.Axis<d3.NumberValue>) => d3.Axis<d3.NumberValue>): void;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { AnyBin, ChartOptions } from './types';
|
|
2
|
+
export declare function createHistogramLinear(el: HTMLElement, options: ChartOptions, data: number[]): void;
|
|
3
|
+
export declare function createHistogramLog(el: HTMLElement, options: ChartOptions, data: number[]): void;
|
|
4
|
+
export declare function createHistogramFromBins(el: HTMLElement, options: ChartOptions, _bins: AnyBin[]): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as PlChartHistogram } from './PlChartHistogram.vue';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function logspace(startExp: number, stopExp: number, num?: number, base?: number): number[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export type Margin = {
|
|
2
|
+
top: number;
|
|
3
|
+
right: number;
|
|
4
|
+
bottom: number;
|
|
5
|
+
left: number;
|
|
6
|
+
};
|
|
7
|
+
export type ChartOptions = {
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
margin: Margin;
|
|
11
|
+
nBins?: number;
|
|
12
|
+
yAxisLabel?: string;
|
|
13
|
+
xAxisLabel?: string;
|
|
14
|
+
threshold?: number;
|
|
15
|
+
compact?: boolean;
|
|
16
|
+
};
|
|
17
|
+
export type Scales = {
|
|
18
|
+
x: d3.ScaleSymLog<number, number, never> | d3.ScaleLinear<number, number>;
|
|
19
|
+
y: d3.ScaleLinear<number, number, never>;
|
|
20
|
+
};
|
|
21
|
+
export type SVG = d3.Selection<SVGGElement, unknown, null, undefined>;
|
|
22
|
+
export type CustomBin = {
|
|
23
|
+
from: number;
|
|
24
|
+
to: number;
|
|
25
|
+
weight: number;
|
|
26
|
+
};
|
|
27
|
+
export type BinLike = {
|
|
28
|
+
x0: number;
|
|
29
|
+
x1: number;
|
|
30
|
+
length: number;
|
|
31
|
+
};
|
|
32
|
+
export type AnyBin = CustomBin | BinLike;
|
|
33
|
+
/**
|
|
34
|
+
* Common case: array of numbers
|
|
35
|
+
*/
|
|
36
|
+
export type PlChartHistogramBasicSettings = {
|
|
37
|
+
type: 'basic';
|
|
38
|
+
threshold?: number;
|
|
39
|
+
numbers: number[];
|
|
40
|
+
log?: boolean;
|
|
41
|
+
nBins?: number;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* For precalculated bins on log x scale
|
|
45
|
+
*/
|
|
46
|
+
export type PlChartHistogramLogBinsSettings = {
|
|
47
|
+
type: 'log-bins';
|
|
48
|
+
threshold?: number;
|
|
49
|
+
bins: AnyBin[];
|
|
50
|
+
};
|
|
51
|
+
export type PlChartHistogramSettings = (PlChartHistogramBasicSettings | PlChartHistogramLogBinsSettings) & {
|
|
52
|
+
title?: string;
|
|
53
|
+
yAxisLabel?: string;
|
|
54
|
+
xAxisLabel?: string;
|
|
55
|
+
totalWidth?: number;
|
|
56
|
+
totalHeight?: number;
|
|
57
|
+
compact?: boolean;
|
|
58
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import './pl-dialog-modal.scss';
|
|
2
|
+
import type { Size } from '../../types';
|
|
2
3
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
3
4
|
/**
|
|
4
5
|
* Determines whether the modal is open
|
|
@@ -40,6 +41,10 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
40
41
|
* If `true`, the modal window closes when clicking outside the modal area (default: `true`)
|
|
41
42
|
*/
|
|
42
43
|
closeOnOutsideClick?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Predefined size (standard small | medium | large). Takes precedence over (min|max)(width|height) properties. Not defined by default.
|
|
46
|
+
*/
|
|
47
|
+
size?: Size | undefined;
|
|
43
48
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
44
49
|
"update:modelValue": (...args: any[]) => void;
|
|
45
50
|
}, string, import("vue").PublicProps, Readonly<{
|
|
@@ -83,9 +88,14 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
83
88
|
* If `true`, the modal window closes when clicking outside the modal area (default: `true`)
|
|
84
89
|
*/
|
|
85
90
|
closeOnOutsideClick?: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Predefined size (standard small | medium | large). Takes precedence over (min|max)(width|height) properties. Not defined by default.
|
|
93
|
+
*/
|
|
94
|
+
size?: Size | undefined;
|
|
86
95
|
}> & Readonly<{
|
|
87
96
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
88
97
|
}>, {
|
|
98
|
+
size: Size;
|
|
89
99
|
height: string;
|
|
90
100
|
width: string;
|
|
91
101
|
maxHeight: string;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { InferComponentProps } from '../types';
|
|
2
|
+
import { type Component, type ComputedRef } from 'vue';
|
|
3
|
+
/**
|
|
4
|
+
* A utility function that creates a reactive computed property
|
|
5
|
+
* based on a specific prop of a Vue component.
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* @template C - The Vue component type.
|
|
9
|
+
* @template P - The prop name.
|
|
10
|
+
*
|
|
11
|
+
* @param cb - A factory function that returns the value of the prop from the inferred component props.
|
|
12
|
+
*
|
|
13
|
+
* @returns A `ComputedRef` of the specified prop
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* import { ref, defineComponent } from 'vue';
|
|
18
|
+
* import { useComponentProp } from '@platforma-sdk/ui-vue';
|
|
19
|
+
*
|
|
20
|
+
* const MyComponent = defineComponent({
|
|
21
|
+
* props: {
|
|
22
|
+
* myProp: {
|
|
23
|
+
* type: String,
|
|
24
|
+
* required: true
|
|
25
|
+
* }
|
|
26
|
+
* }
|
|
27
|
+
* });
|
|
28
|
+
*
|
|
29
|
+
* const propValue = useComponentProp<typeof MyComponent, 'myProp'>(() => 'example');
|
|
30
|
+
* console.log(propValue.value); // Outputs: 'example'
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare function useComponentProp<C extends Component, P extends keyof InferComponentProps<C>>(cb: () => InferComponentProps<C>[P]): ComputedRef<InferComponentProps<C>[P]>;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -55,6 +55,7 @@ export * from './components/PlMaskIcon24';
|
|
|
55
55
|
export * from './components/PlIcon16';
|
|
56
56
|
export * from './components/PlIcon24';
|
|
57
57
|
export * from './components/PlChartStackedBar';
|
|
58
|
+
export * from './components/PlChartHistogram';
|
|
58
59
|
export * from './colors';
|
|
59
60
|
import DropdownListItem from './components/DropdownListItem.vue';
|
|
60
61
|
import ContextProvider from './components/ContextProvider.vue';
|
|
@@ -79,6 +80,7 @@ export { useInterval } from './composition/useInterval';
|
|
|
79
80
|
export { useFormState } from './composition/useFormState';
|
|
80
81
|
export { useQuery } from './composition/useQuery.ts';
|
|
81
82
|
export { useDraggable } from './composition/useDraggable';
|
|
83
|
+
export { useComponentProp } from './composition/useComponentProp';
|
|
82
84
|
/**
|
|
83
85
|
* Utils/Partials
|
|
84
86
|
*/
|
package/dist/src/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ImportFileHandle, Platforma, StorageHandle, PlRef as ModelRef } from '@platforma-sdk/model';
|
|
2
|
-
import type { Ref, ComputedRef } from 'vue';
|
|
2
|
+
import type { Ref, ComputedRef, Component } from 'vue';
|
|
3
3
|
import { maskIcons16 } from './generated/icons-16';
|
|
4
4
|
import { maskIcons24 } from './generated/icons-24';
|
|
5
5
|
export type Size = 'small' | 'medium' | 'large';
|
|
@@ -56,6 +56,7 @@ export type ImportedFiles = {
|
|
|
56
56
|
storageHandle?: StorageHandle;
|
|
57
57
|
files: ImportFileHandle[];
|
|
58
58
|
};
|
|
59
|
+
export type InferComponentProps<C extends Component> = C extends Component<infer P> ? P : never;
|
|
59
60
|
declare global {
|
|
60
61
|
const platforma: Platforma | undefined;
|
|
61
62
|
interface Window {
|