x-next 1.6.0 → 1.8.0

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.
Files changed (166) hide show
  1. package/AI_USAGE.md +182 -4
  2. package/CHANGELOG.md +74 -0
  3. package/dist/_hooks/use-chart-size.d.ts +25 -0
  4. package/dist/_utils/chart/index.d.ts +6 -0
  5. package/dist/_utils/chart/padding.d.ts +15 -0
  6. package/dist/_utils/chart/path.d.ts +34 -0
  7. package/dist/_utils/chart/scale.d.ts +55 -0
  8. package/dist/components/_components/chart/ChartAxis.d.ts +85 -0
  9. package/dist/components/_components/chart/ChartLegend.d.ts +26 -0
  10. package/dist/components/_components/chart/ChartTooltip.d.ts +76 -0
  11. package/dist/components/_components/chart/colors.d.ts +10 -0
  12. package/dist/components/_components/chart/interface.d.ts +38 -0
  13. package/dist/components/bar-chart/BarChart.d.ts +278 -0
  14. package/dist/components/bar-chart/helpers/layout.d.ts +55 -0
  15. package/dist/components/bar-chart/index.d.ts +600 -0
  16. package/dist/components/bar-chart/interface.d.ts +74 -0
  17. package/dist/components/bar-chart/props.d.ts +145 -0
  18. package/dist/components/date-picker/DatePicker.vue.d.ts +3 -3
  19. package/dist/components/date-picker/index.d.ts +6 -6
  20. package/dist/components/draggable/Draggable.d.ts +1 -1
  21. package/dist/components/draggable/index.d.ts +2 -2
  22. package/dist/components/drawer/index.d.ts +6 -6
  23. package/dist/components/drawer/src/Drawer.vue.d.ts +3 -3
  24. package/dist/components/dropdown/Dropdown.vue.d.ts +4 -4
  25. package/dist/components/dropdown/DropdownButton.vue.d.ts +5 -5
  26. package/dist/components/dropdown/DropdownSubmenu.vue.d.ts +4 -4
  27. package/dist/components/dropdown/index.d.ts +29 -29
  28. package/dist/components/form/FormItem.vue.d.ts +12 -12
  29. package/dist/components/form/form-item-label.vue.d.ts +3 -3
  30. package/dist/components/form/index.d.ts +24 -24
  31. package/dist/components/form-select/Select.d.ts +3 -3
  32. package/dist/components/form-select/index.d.ts +6 -6
  33. package/dist/components/form-slider/Slider.vue.d.ts +3 -3
  34. package/dist/components/form-slider/index.d.ts +6 -6
  35. package/dist/components/form-slider/slider-button.vue.d.ts +3 -3
  36. package/dist/components/grid/Row.vue.d.ts +3 -3
  37. package/dist/components/grid/index.d.ts +9 -9
  38. package/dist/components/heatmap/Heatmap.d.ts +10 -0
  39. package/dist/components/heatmap/index.d.ts +30 -0
  40. package/dist/components/image/Image.vue.d.ts +125 -17
  41. package/dist/components/image/ImagePreview.vue.d.ts +97 -7
  42. package/dist/components/image/ImagePreviewAction.d.ts +3 -3
  43. package/dist/components/image/ImagePreviewGroup.vue.d.ts +100 -7
  44. package/dist/components/image/hooks/use-image-drag.d.ts +2 -2
  45. package/dist/components/image/index.d.ts +712 -124
  46. package/dist/components/image/interface.d.ts +9 -1
  47. package/dist/components/image/preview-toolbar.vue.d.ts +3 -3
  48. package/dist/components/index.d.ts +4 -0
  49. package/dist/components/line-chart/LineChart.d.ts +295 -0
  50. package/dist/components/line-chart/helpers/layout.d.ts +74 -0
  51. package/dist/components/line-chart/index.d.ts +614 -0
  52. package/dist/components/line-chart/interface.d.ts +76 -0
  53. package/dist/components/line-chart/props.d.ts +173 -0
  54. package/dist/components/menu/sub-menu-pop.vue.d.ts +3 -3
  55. package/dist/components/pagination/page-options.vue.d.ts +6 -6
  56. package/dist/components/pie-chart/PieChart.d.ts +219 -0
  57. package/dist/components/pie-chart/index.d.ts +470 -0
  58. package/dist/components/pie-chart/interface.d.ts +58 -0
  59. package/dist/components/pie-chart/props.d.ts +107 -0
  60. package/dist/components/popconfirm/src/popup.vue.d.ts +3 -3
  61. package/dist/components/popover/Popover.d.ts +1 -1
  62. package/dist/components/popover/index.d.ts +3 -3
  63. package/dist/components/popup/Popup.d.ts +1 -1
  64. package/dist/components/popup/index.d.ts +3 -3
  65. package/dist/components/space/Space.d.ts +1 -1
  66. package/dist/components/space/index.d.ts +3 -3
  67. package/dist/components/tabs/Tabs.d.ts +1 -1
  68. package/dist/components/tabs/index.d.ts +3 -3
  69. package/dist/components/time-picker/TimePicker.vue.d.ts +3 -3
  70. package/dist/components/time-picker/index.d.ts +6 -6
  71. package/dist/components/tooltip/Tooltip.vue.d.ts +1 -1
  72. package/dist/components/tooltip/index.d.ts +3 -3
  73. package/dist/components/trend-chart/components/TrendChart.d.ts +19 -96
  74. package/dist/components/trend-chart/index.d.ts +33 -187
  75. package/dist/components/trend-chart/props.d.ts +9 -78
  76. package/dist/components/trend-chart/themes.d.ts +0 -1
  77. package/dist/components/trigger/Trigger.d.ts +1 -1
  78. package/dist/components/trigger/index.d.ts +3 -3
  79. package/dist/components/upload/Upload.d.ts +372 -0
  80. package/dist/components/upload/context.d.ts +28 -0
  81. package/dist/components/upload/index.d.ts +656 -0
  82. package/dist/components/upload/interface.d.ts +110 -0
  83. package/dist/components/upload/props.d.ts +321 -0
  84. package/dist/components/upload/upload-list-item.d.ts +15 -0
  85. package/dist/components/upload/upload-list.d.ts +11 -0
  86. package/dist/components/upload/upload-picture-item.d.ts +20 -0
  87. package/dist/components/upload/upload-trigger.d.ts +8 -0
  88. package/dist/components/upload/utils.d.ts +48 -0
  89. package/dist/es/_hooks/use-chart-size.js +25 -0
  90. package/dist/es/_styles/palette-aliases.js +7 -4
  91. package/dist/es/_utils/chart/padding.js +22 -0
  92. package/dist/es/_utils/chart/path.js +69 -0
  93. package/dist/es/_utils/chart/scale.js +77 -0
  94. package/dist/es/components/_components/chart/ChartAxis.js +79 -0
  95. package/dist/es/components/_components/chart/ChartLegend.js +53 -0
  96. package/dist/es/components/_components/chart/ChartTooltip.js +64 -0
  97. package/dist/es/components/_components/chart/colors.js +12 -0
  98. package/dist/es/components/bar-chart/BarChart.js +470 -0
  99. package/dist/es/components/bar-chart/helpers/layout.js +53 -0
  100. package/dist/es/components/bar-chart/index.js +8 -0
  101. package/dist/es/components/bar-chart/props.js +148 -0
  102. package/dist/es/components/heatmap/Heatmap.js +244 -169
  103. package/dist/es/components/image/Image.vue.js +55 -45
  104. package/dist/es/components/image/Image.vue2.js +113 -92
  105. package/dist/es/components/image/ImagePreview.vue.js +66 -53
  106. package/dist/es/components/image/ImagePreview.vue2.js +219 -171
  107. package/dist/es/components/image/ImagePreviewAction.js +12 -15
  108. package/dist/es/components/image/ImagePreviewGroup.vue.js +21 -20
  109. package/dist/es/components/image/ImagePreviewGroup.vue2.js +45 -39
  110. package/dist/es/components/image/hooks/use-image-drag.js +16 -14
  111. package/dist/es/components/index.js +136 -128
  112. package/dist/es/components/line-chart/LineChart.js +532 -0
  113. package/dist/es/components/line-chart/helpers/layout.js +80 -0
  114. package/dist/es/components/line-chart/index.js +8 -0
  115. package/dist/es/components/line-chart/props.js +178 -0
  116. package/dist/es/components/pie-chart/PieChart.js +397 -0
  117. package/dist/es/components/pie-chart/index.js +8 -0
  118. package/dist/es/components/pie-chart/props.js +104 -0
  119. package/dist/es/components/trend-chart/components/TrendChart.js +143 -183
  120. package/dist/es/components/trend-chart/components/trend-chart-curve.js +85 -81
  121. package/dist/es/components/trend-chart/props.js +28 -74
  122. package/dist/es/components/trend-chart/themes.js +30 -31
  123. package/dist/es/components/upload/Upload.js +420 -0
  124. package/dist/es/components/upload/context.js +4 -0
  125. package/dist/es/components/upload/index.js +8 -0
  126. package/dist/es/components/upload/props.js +321 -0
  127. package/dist/es/components/upload/upload-list-item.js +138 -0
  128. package/dist/es/components/upload/upload-list.js +48 -0
  129. package/dist/es/components/upload/upload-picture-item.js +109 -0
  130. package/dist/es/components/upload/upload-trigger.js +89 -0
  131. package/dist/es/components/upload/utils.js +195 -0
  132. package/dist/es/icons/_self/upload-icons.js +103 -0
  133. package/dist/es/index.js +197 -189
  134. package/dist/es/locale/en-US.js +30 -1
  135. package/dist/es/locale/zh-CN.js +30 -1
  136. package/dist/es/style.css +1 -1
  137. package/dist/icons/_self/upload-icons.d.ts +523 -0
  138. package/dist/index.cjs +4 -4
  139. package/dist/index.umd.js +4 -4
  140. package/dist/locale/interface.d.ts +45 -0
  141. package/dist/style/bar-chart.css +1 -0
  142. package/dist/style/bar-chart.js +2 -0
  143. package/dist/style/base.css +1 -1
  144. package/dist/style/heatmap.css +1 -1
  145. package/dist/style/image.css +1 -1
  146. package/dist/style/line-chart.css +1 -0
  147. package/dist/style/line-chart.js +2 -0
  148. package/dist/style/pie-chart.css +1 -0
  149. package/dist/style/pie-chart.js +2 -0
  150. package/dist/style/upload.css +1 -0
  151. package/dist/style/upload.js +2 -0
  152. package/dist/style.css +1 -1
  153. package/dist/types.d.ts +4 -0
  154. package/package.json +1 -1
  155. package/volar.d.ts +4 -0
  156. package/dist/components/trend-chart/components/trend-chart-grid.d.ts +0 -55
  157. package/dist/components/trend-chart/components/trend-chart-labels.d.ts +0 -26
  158. package/dist/components/trend-chart/helpers/genPath.d.ts +0 -8
  159. package/dist/components/trend-chart/helpers/getPadding.d.ts +0 -8
  160. package/dist/components/trend-chart/helpers/validatePadding.d.ts +0 -2
  161. package/dist/es/_hooks/use-popup-overflow-hidden.js +0 -29
  162. package/dist/es/components/trend-chart/components/trend-chart-grid.js +0 -62
  163. package/dist/es/components/trend-chart/components/trend-chart-labels.js +0 -75
  164. package/dist/es/components/trend-chart/helpers/genPath.js +0 -22
  165. package/dist/es/components/trend-chart/helpers/getPadding.js +0 -21
  166. package/dist/es/components/trend-chart/helpers/validatePadding.js +0 -7
package/dist/types.d.ts CHANGED
@@ -88,6 +88,10 @@ declare module 'vue' {
88
88
  XConfigProvider: (typeof import('x-next'))['ConfigProvider'];
89
89
  XColorPicker: (typeof import('x-next'))['ColorPicker'];
90
90
  XHeatmap: (typeof import('x-next'))['Heatmap'];
91
+ XUpload: (typeof import('x-next'))['Upload'];
92
+ XBarChart: (typeof import('x-next'))['BarChart'];
93
+ XLineChart: (typeof import('x-next'))['LineChart'];
94
+ XPieChart: (typeof import('x-next'))['PieChart'];
91
95
  }
92
96
  }
93
97
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "x-next",
3
- "version": "1.6.0",
3
+ "version": "1.8.0",
4
4
  "private": false,
5
5
  "description": "A Vue 3 and TypeScript component library for enterprise applications.",
6
6
  "keywords": [
package/volar.d.ts CHANGED
@@ -89,6 +89,10 @@ declare module 'vue' {
89
89
  XConfigProvider: (typeof import('x-next'))['ConfigProvider']
90
90
  XColorPicker: (typeof import('x-next'))['ColorPicker']
91
91
  XHeatmap: (typeof import('x-next'))['Heatmap']
92
+ XUpload: (typeof import('x-next'))['Upload']
93
+ XBarChart: (typeof import('x-next'))['BarChart']
94
+ XLineChart: (typeof import('x-next'))['LineChart']
95
+ XPieChart: (typeof import('x-next'))['PieChart']
92
96
  }
93
97
  }
94
98
  export {}
@@ -1,55 +0,0 @@
1
- import { VNode } from 'vue';
2
- declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
3
- boundary: {
4
- required: boolean;
5
- type: import('vue').PropType<import('../props').Boundary>;
6
- default: () => void;
7
- };
8
- verticalLines: {
9
- default: boolean;
10
- type: BooleanConstructor;
11
- };
12
- verticalLinesNumber: {
13
- default: number;
14
- type: NumberConstructor;
15
- };
16
- horizontalLines: {
17
- default: boolean;
18
- type: BooleanConstructor;
19
- };
20
- horizontalLinesNumber: {
21
- default: number;
22
- type: NumberConstructor;
23
- };
24
- }>, () => VNode<import('vue').RendererNode, import('vue').RendererElement, {
25
- [key: string]: any;
26
- }> | null, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
27
- boundary: {
28
- required: boolean;
29
- type: import('vue').PropType<import('../props').Boundary>;
30
- default: () => void;
31
- };
32
- verticalLines: {
33
- default: boolean;
34
- type: BooleanConstructor;
35
- };
36
- verticalLinesNumber: {
37
- default: number;
38
- type: NumberConstructor;
39
- };
40
- horizontalLines: {
41
- default: boolean;
42
- type: BooleanConstructor;
43
- };
44
- horizontalLinesNumber: {
45
- default: number;
46
- type: NumberConstructor;
47
- };
48
- }>> & Readonly<{}>, {
49
- boundary: import('../props').Boundary;
50
- verticalLines: boolean;
51
- verticalLinesNumber: number;
52
- horizontalLines: boolean;
53
- horizontalLinesNumber: number;
54
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
55
- export default _default;
@@ -1,26 +0,0 @@
1
- import { VNode } from 'vue';
2
- declare const _default: import('vue').DefineComponent<{
3
- boundary: import('../props').Boundary;
4
- yLabelsTextFormatter: Function;
5
- color?: import('../../../_props/css').CSSColor | undefined;
6
- fontSize?: number | undefined;
7
- minValue?: number | undefined;
8
- maxValue?: number | undefined;
9
- xLabels?: unknown[] | undefined;
10
- yLabels?: number | undefined;
11
- }, () => VNode<import('vue').RendererNode, import('vue').RendererElement, {
12
- [key: string]: any;
13
- }>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
14
- boundary: import('../props').Boundary;
15
- yLabelsTextFormatter: Function;
16
- color?: import('../../../_props/css').CSSColor | undefined;
17
- fontSize?: number | undefined;
18
- minValue?: number | undefined;
19
- maxValue?: number | undefined;
20
- xLabels?: unknown[] | undefined;
21
- yLabels?: number | undefined;
22
- }> & Readonly<{}>, {
23
- boundary: import('../props').Boundary;
24
- yLabelsTextFormatter: Function;
25
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
26
- export default _default;
@@ -1,8 +0,0 @@
1
- import { Point } from '../props';
2
- declare const _default: (points: Point[], smooth: boolean, { maxY }: {
3
- maxY: any;
4
- }) => {
5
- linePath: string;
6
- fillPath: string;
7
- };
8
- export default _default;
@@ -1,8 +0,0 @@
1
- import { Padding } from '../props';
2
- /**
3
- * 获取padding
4
- *
5
- * 支持 CSS 简写风格的 1-4 个值字符串(如 '5 10'),也支持单个非负数字。
6
- */
7
- declare const _default: (padding: string | number) => Padding;
8
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: (padding: string) => boolean;
2
- export default _default;
@@ -1,29 +0,0 @@
1
- import { toRefs as s, watchEffect as u } from "vue";
2
- function h(a) {
3
- const { container: t, hidden: d } = s(a);
4
- let n = !1, l = {};
5
- const c = (e) => e.tagName === "BODY" ? window.innerWidth - (document.body.clientWidth || document.documentElement.clientWidth) : e.offsetWidth - e.clientWidth, r = () => {
6
- if (t.value && t.value.style.overflow !== "hidden") {
7
- const e = t.value.style;
8
- n = !0;
9
- const o = c(t.value);
10
- o && (l.width = e.width, t.value.style.width = `calc(${t.value.style.width || "100%"} - ${o}px)`), l.overflow = e.overflow, t.value.style.overflow = "hidden";
11
- }
12
- }, i = () => {
13
- if (t.value && n) {
14
- const e = l;
15
- Object.keys(e).forEach((o) => {
16
- t.value.style[o] = e[o];
17
- });
18
- }
19
- n = !1, l = {};
20
- };
21
- return u((e) => {
22
- d.value ? r() : i(), e(() => {
23
- i();
24
- });
25
- }), [i, r];
26
- }
27
- export {
28
- h as default
29
- };
@@ -1,62 +0,0 @@
1
- import { defineComponent as b, computed as u, h as i } from "vue";
2
- import { getComponentPrefix as h } from "../../../_utils/config.js";
3
- import { trendChartGridProps as y } from "../props.js";
4
- import { TrendChartAxisColor as m } from "../themes.js";
5
- const N = b({
6
- name: h("TrendChartGrid"),
7
- props: y,
8
- setup(n) {
9
- const c = (e) => {
10
- const t = n.verticalLinesNumber > 1 ? (n.boundary.maxX - n.boundary.minX) / (n.verticalLinesNumber - 1) : 0, r = n.boundary.minX + t * (e - 1), a = n.boundary.minY, o = n.boundary.maxY;
11
- return {
12
- x1: r,
13
- x2: r,
14
- y1: a,
15
- y2: o,
16
- style: { stroke: m }
17
- };
18
- }, d = (e) => {
19
- const t = n.horizontalLinesNumber > 1 ? (n.boundary.maxY - n.boundary.minY) / (n.horizontalLinesNumber - 1) : 0, r = n.boundary.maxY - t * (e - 1), a = n.boundary.minX, o = n.boundary.maxX;
20
- return {
21
- x1: a,
22
- x2: o,
23
- y1: r,
24
- y2: r,
25
- style: { stroke: m }
26
- };
27
- }, l = u(() => {
28
- if (n.verticalLines && n.verticalLinesNumber > 0) {
29
- const e = [];
30
- for (let t = 1; t <= n.verticalLinesNumber; t++)
31
- e.push(
32
- i("line", {
33
- class: "line",
34
- ...c(t)
35
- })
36
- );
37
- return i("g", { class: "vertical" }, e);
38
- }
39
- return null;
40
- }), s = u(() => {
41
- if (n.horizontalLines && n.horizontalLinesNumber > 0) {
42
- const e = [];
43
- for (let t = 1; t <= n.horizontalLinesNumber; t++)
44
- e.push(
45
- i("line", {
46
- class: "line",
47
- ...d(t)
48
- })
49
- );
50
- return i("g", { class: "horizontal" }, e);
51
- }
52
- return null;
53
- });
54
- return () => {
55
- const e = [];
56
- return l.value && e.push(l.value), s.value && e.push(s.value), e.length === 0 ? null : i("g", null, e);
57
- };
58
- }
59
- });
60
- export {
61
- N as default
62
- };
@@ -1,75 +0,0 @@
1
- import { defineComponent as h, computed as l, h as t } from "vue";
2
- import { getComponentPrefix as v } from "../../../_utils/config.js";
3
- import { trendChartLabelsProps as Y } from "../props.js";
4
- import { TrendChartAxisColor as d } from "../themes.js";
5
- const S = h({
6
- name: v("TrendChartLabels"),
7
- props: Y,
8
- setup(e) {
9
- const u = l(() => {
10
- if (e.fontSize)
11
- return e.fontSize;
12
- const a = e.boundary.maxY - e.boundary.minY;
13
- return a >= 100 ? 12 : a >= 60 ? 11 : 10;
14
- }), c = l(() => e.color ?? "var(--x-color-text-secondary)"), b = l(() => ({
15
- fill: c.value,
16
- fontSize: `${u.value}px`
17
- })), x = (a) => {
18
- var y;
19
- const n = ((y = e.xLabels) == null ? void 0 : y.length) ?? 0, r = n > 1 ? (e.boundary.maxX - e.boundary.minX) / (n - 1) : 0, o = n > 1 ? e.boundary.minX + r * a : e.boundary.minX + (e.boundary.maxX - e.boundary.minX) / 2, s = e.boundary.maxY;
20
- return { transform: `translate(${o}, ${s})` };
21
- }, f = (a) => {
22
- const n = e.yLabels ?? 0, r = n > 1 ? (e.boundary.maxY - e.boundary.minY) / (n - 1) : 0, o = e.boundary.minX, s = n > 1 ? e.boundary.maxY - r * a : e.boundary.minY + (e.boundary.maxY - e.boundary.minY) / 2;
23
- return { transform: `translate(${o}, ${s})` };
24
- }, L = (a) => {
25
- const n = e.yLabels ?? 0;
26
- return n <= 1 ? e.minValue : e.minValue + (e.maxValue - e.minValue) / (n - 1) * a;
27
- }, m = l(() => e.xLabels && e.xLabels.length ? t(
28
- "g",
29
- { class: "x-labels" },
30
- e.xLabels.map(
31
- (a, n) => t("g", { class: "label", ...x(n) }, [
32
- t(
33
- "text",
34
- {
35
- dy: u.value + 5,
36
- "text-anchor": "middle",
37
- style: b.value
38
- },
39
- a
40
- ),
41
- t("line", { style: { stroke: d }, y2: 5 })
42
- ])
43
- )
44
- ) : null), i = l(() => {
45
- if (e.yLabels && e.yLabels > 0) {
46
- const a = [];
47
- for (let n = 0; n < e.yLabels; n++)
48
- a.push(
49
- t("g", { class: "label", ...f(n) }, [
50
- t(
51
- "text",
52
- {
53
- dx: -10,
54
- dy: u.value / 4,
55
- "text-anchor": "end",
56
- style: b.value
57
- },
58
- e.yLabelsTextFormatter(L(n))
59
- ),
60
- t("line", { style: { stroke: d }, x1: 0, x2: -5 })
61
- ])
62
- );
63
- return t("g", { class: "y-labels" }, a);
64
- }
65
- return null;
66
- });
67
- return () => {
68
- const a = [];
69
- return m.value && a.push(m.value), i.value && a.push(i.value), t("g", a);
70
- };
71
- }
72
- });
73
- export {
74
- S as default
75
- };
@@ -1,22 +0,0 @@
1
- const P = (e, n, { maxY: $ }) => {
2
- if (!e.length)
3
- return { linePath: "", fillPath: "" };
4
- if (e.length === 1) {
5
- const [t] = e;
6
- return { linePath: `M ${t.x},${t.y}`, fillPath: "" };
7
- }
8
- const l = e.shift(), a = e[e.length - 1], c = (e[0].x - l.x) / 2;
9
- let h = `M ${l.x},${l.y}`;
10
- e.forEach((t, x) => {
11
- if (!n) h += ` L${t.x},${t.y}`;
12
- else {
13
- const r = e[x - 1] || l;
14
- h += ` C ${c + r.x},${r.y} ${c + r.x},${t.y} ${t.x},${t.y}`;
15
- }
16
- });
17
- let f = h;
18
- return a.y !== $ && (f += ` L${a.x},${$}`), l.y !== $ && (f += ` L${l.x},${$}`), f += " Z", { linePath: h, fillPath: f };
19
- };
20
- export {
21
- P as default
22
- };
@@ -1,21 +0,0 @@
1
- const l = (o) => {
2
- const t = (typeof o == "number" ? `${o}` : o).split(" ").filter((r) => r !== "").map((r) => Number(r));
3
- let e = {};
4
- switch (t.length) {
5
- case 4:
6
- e = { top: t[0], right: t[1], bottom: t[2], left: t[3] };
7
- break;
8
- case 3:
9
- e = { top: t[0], right: t[1], bottom: t[2], left: t[1] };
10
- break;
11
- case 2:
12
- e = { top: t[0], right: t[1], bottom: t[0], left: t[1] };
13
- break;
14
- default:
15
- e = { top: t[0], right: t[0], bottom: t[0], left: t[0] };
16
- }
17
- return e;
18
- };
19
- export {
20
- l as default
21
- };
@@ -1,7 +0,0 @@
1
- const a = (n) => {
2
- const r = n.split(" ").filter((e) => e !== ""), t = r.map((e) => Number(e));
3
- return t.length < 1 || t.length > 4 ? !1 : r.every((e) => /^\d+(\.\d+)?$/.test(e)) && t.every((e) => e >= 0);
4
- };
5
- export {
6
- a as default
7
- };