@cck-ui/core 0.10.0 → 0.11.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.
- package/cjs/components/splitter/grip-icon.cjs +66 -0
- package/cjs/components/splitter/grip-icon.cjs.map +1 -0
- package/cjs/components/splitter/index.cjs +18 -0
- package/cjs/components/splitter/index.cjs.map +1 -0
- package/cjs/components/splitter/splitter-pane/splitter-pane.cjs +411 -0
- package/cjs/components/splitter/splitter-pane/splitter-pane.cjs.map +1 -0
- package/cjs/components/splitter/splitter.cjs +620 -0
- package/cjs/components/splitter/splitter.cjs.map +1 -0
- package/cjs/components/splitter/splitter.context.cjs +17 -0
- package/cjs/components/splitter/splitter.context.cjs.map +1 -0
- package/cjs/components/splitter/splitter.module.cjs +12 -0
- package/cjs/components/splitter/splitter.module.cjs.map +1 -0
- package/cjs/components/splitter/splitter.utils.cjs +12 -0
- package/cjs/components/splitter/splitter.utils.cjs.map +1 -0
- package/cjs/index.cjs +10 -6
- package/cjs/index.cjs.map +1 -1
- package/esm/components/splitter/grip-icon.mjs +66 -0
- package/esm/components/splitter/grip-icon.mjs.map +1 -0
- package/esm/components/splitter/index.mjs +16 -0
- package/esm/components/splitter/index.mjs.map +1 -0
- package/esm/components/splitter/splitter-pane/splitter-pane.mjs +411 -0
- package/esm/components/splitter/splitter-pane/splitter-pane.mjs.map +1 -0
- package/esm/components/splitter/splitter.context.mjs +16 -0
- package/esm/components/splitter/splitter.context.mjs.map +1 -0
- package/esm/components/splitter/splitter.mjs +620 -0
- package/esm/components/splitter/splitter.mjs.map +1 -0
- package/esm/components/splitter/splitter.module.mjs +12 -0
- package/esm/components/splitter/splitter.module.mjs.map +1 -0
- package/esm/components/splitter/splitter.utils.mjs +13 -0
- package/esm/components/splitter/splitter.utils.mjs.map +1 -0
- package/esm/index.mjs +3 -1
- package/esm/index.mjs.map +1 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/splitter/index.d.ts +11 -0
- package/lib/components/splitter/splitter-pane/splitter-pane.types.d.ts +47 -0
- package/lib/components/splitter/splitter.context.d.ts +13 -0
- package/lib/components/splitter/splitter.types.d.ts +77 -0
- package/lib/components/splitter/splitter.utils.d.ts +6 -0
- package/package.json +1 -1
- package/styles/splitter.css +76 -0
- package/styles/splitter.layer.css +77 -0
- package/styles.css +77 -0
- package/styles.layer.css +77 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"splitter.utils.cjs","names":["createVarsResolver","rem","getThemeColor"],"sources":["../../../src/components/splitter/splitter.utils.ts"],"sourcesContent":["import { createVarsResolver, getThemeColor, rem } from '../../core'\nimport { SplitterFactory } from './splitter.types'\n\nexport const varsResolver = createVarsResolver<SplitterFactory>(\n (theme, { lineSize, handleColor }) => ({\n root: {\n '--splitter-line-size': rem(lineSize),\n '--splitter-handle-color': handleColor ? getThemeColor(handleColor, theme) : undefined,\n },\n })\n)\n"],"mappings":";;;;AAGA,MAAa,4FAAeA,CAAAA,CAAAA,oBACzB,OAAO,EAAE,UAAU,mBAAmB,EACrC,MAAM;CACJ,wBAAwBC,YAAAA,IAAI,QAAQ;CACpC,2BAA2B,cAAcC,wBAAAA,cAAc,aAAa,KAAK,IAAI,KAAA;AAC/E,EACF,EACF"}
|
package/cjs/index.cjs
CHANGED
|
@@ -67,8 +67,9 @@ const require_index$10 = require("./components/grid/index.cjs");
|
|
|
67
67
|
const require_index$11 = require("./components/group/index.cjs");
|
|
68
68
|
const require_index$12 = require("./components/simple-grid/index.cjs");
|
|
69
69
|
const require_index$13 = require("./components/space/index.cjs");
|
|
70
|
-
const require_index$14 = require("./components/
|
|
71
|
-
const require_index$15 = require("./components/
|
|
70
|
+
const require_index$14 = require("./components/splitter/index.cjs");
|
|
71
|
+
const require_index$15 = require("./components/stack/index.cjs");
|
|
72
|
+
const require_index$16 = require("./components/text/index.cjs");
|
|
72
73
|
let _vue_shared = require("@vue/shared");
|
|
73
74
|
//#region packages/@cck-ui/core/src/index.ts
|
|
74
75
|
const INSTALLED_KEY = Symbol("INSTALLED_KEY");
|
|
@@ -87,8 +88,9 @@ const components = [
|
|
|
87
88
|
require_index$5.CLoader,
|
|
88
89
|
require_index$12.CSimpleGrid,
|
|
89
90
|
require_index$13.CSpace,
|
|
90
|
-
require_index$14.
|
|
91
|
-
require_index$15.
|
|
91
|
+
require_index$14.CSplitter,
|
|
92
|
+
require_index$15.CStack,
|
|
93
|
+
require_index$16.CText,
|
|
92
94
|
require_index$6.CTransition,
|
|
93
95
|
require_index$4.UnstyledButton
|
|
94
96
|
];
|
|
@@ -116,8 +118,10 @@ exports.CLoader = require_index$5.CLoader;
|
|
|
116
118
|
exports.CONFIG_KEY = require_config_provider_types.CONFIG_KEY;
|
|
117
119
|
exports.CSimpleGrid = require_index$12.CSimpleGrid;
|
|
118
120
|
exports.CSpace = require_index$13.CSpace;
|
|
119
|
-
exports.
|
|
120
|
-
exports.
|
|
121
|
+
exports.CSplitter = require_index$14.CSplitter;
|
|
122
|
+
exports.CSplitterPane = require_index$14.CSplitterPane;
|
|
123
|
+
exports.CStack = require_index$15.CStack;
|
|
124
|
+
exports.CText = require_index$16.CText;
|
|
121
125
|
exports.CTransition = require_index$6.CTransition;
|
|
122
126
|
exports.CckConfigProvider = require_index$1.CckConfigProvider;
|
|
123
127
|
exports.CckUI = CckUI;
|
package/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["CckConfigProvider","CBox","CAspectRatio","CButton","CButtonGroup","CButtonGroupSection","CCenter","CCol","CContainer","CGrid","CGroup","CLoader","CSimpleGrid","CSpace","CStack","CText","CTransition","UnstyledButton"],"sources":["../src/index.ts"],"sourcesContent":["import type { App, Plugin } from 'vue'\nimport {\n CAspectRatio,\n CButton,\n CButtonGroup,\n CButtonGroupSection,\n CCenter,\n CCol,\n CContainer,\n CGrid,\n CGroup,\n CLoader,\n CSimpleGrid,\n CSpace,\n CStack,\n CText,\n CTransition,\n UnstyledButton,\n} from './components'\nimport { CckConfigProvider, CBox } from './core'\n\nconst INSTALLED_KEY = Symbol('INSTALLED_KEY')\n\nconst components = [\n CckConfigProvider,\n CBox,\n CAspectRatio,\n CButton,\n CButtonGroup,\n CButtonGroupSection,\n CCenter,\n CCol,\n CContainer,\n CGrid,\n CGroup,\n CLoader,\n CSimpleGrid,\n CSpace,\n CStack,\n CText,\n CTransition,\n UnstyledButton,\n]\n\nconst CckUI: Plugin = {\n install(app: App) {\n if ((app as any)[INSTALLED_KEY]) {\n return\n }\n ;(app as any)[INSTALLED_KEY] = true\n components.forEach((c) => {\n if (c.name) {\n app.component(c.name, c)\n }\n })\n },\n}\n\nexport default CckUI\nexport { CckUI }\n\nexport * from './components'\nexport * from './core'\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["CckConfigProvider","CBox","CAspectRatio","CButton","CButtonGroup","CButtonGroupSection","CCenter","CCol","CContainer","CGrid","CGroup","CLoader","CSimpleGrid","CSpace","CSplitter","CStack","CText","CTransition","UnstyledButton"],"sources":["../src/index.ts"],"sourcesContent":["import type { App, Plugin } from 'vue'\nimport {\n CAspectRatio,\n CButton,\n CButtonGroup,\n CButtonGroupSection,\n CCenter,\n CCol,\n CContainer,\n CGrid,\n CGroup,\n CLoader,\n CSimpleGrid,\n CSpace,\n CSplitter,\n CStack,\n CText,\n CTransition,\n UnstyledButton,\n} from './components'\nimport { CckConfigProvider, CBox } from './core'\n\nconst INSTALLED_KEY = Symbol('INSTALLED_KEY')\n\nconst components = [\n CckConfigProvider,\n CBox,\n CAspectRatio,\n CButton,\n CButtonGroup,\n CButtonGroupSection,\n CCenter,\n CCol,\n CContainer,\n CGrid,\n CGroup,\n CLoader,\n CSimpleGrid,\n CSpace,\n CSplitter,\n CStack,\n CText,\n CTransition,\n UnstyledButton,\n]\n\nconst CckUI: Plugin = {\n install(app: App) {\n if ((app as any)[INSTALLED_KEY]) {\n return\n }\n ;(app as any)[INSTALLED_KEY] = true\n components.forEach((c) => {\n if (c.name) {\n app.component(c.name, c)\n }\n })\n },\n}\n\nexport default CckUI\nexport { CckUI }\n\nexport * from './components'\nexport * from './core'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,MAAM,gBAAgB,OAAO,eAAe;AAE5C,MAAM,aAAa;CACjBA,gBAAAA;CACAC,gBAAAA;CACAC,gBAAAA;CACAC,gBAAAA;CACAC,gBAAAA;CACAC,gBAAAA;CACAC,gBAAAA;CACAC,iBAAAA;CACAC,gBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,gBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,iBAAAA;CACAC,gBAAAA;CACAC,gBAAAA;AACF;AAEA,MAAM,QAAgB,EACpB,QAAQ,KAAU;CAChB,IAAK,IAAY,gBACf;CAED,IAAa,iBAAiB;CAC/B,WAAW,SAAS,MAAM;EACxB,IAAI,EAAE,MACJ,IAAI,UAAU,EAAE,MAAM,CAAC;CAE3B,CAAC;AACH,EACF"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import export_helper_default from "../../_virtual/_/plugin-vue/export-helper.mjs";
|
|
3
|
+
import { Fragment, computed, createElementBlock, defineComponent, mergeProps, openBlock, renderList } from "vue";
|
|
4
|
+
//#region packages/@cck-ui/core/src/components/splitter/grip-icon.vue
|
|
5
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
6
|
+
name: "GripIcon",
|
|
7
|
+
__name: "grip-icon",
|
|
8
|
+
props: { orientation: {
|
|
9
|
+
type: String,
|
|
10
|
+
required: false
|
|
11
|
+
} },
|
|
12
|
+
setup(__props, { expose: __expose }) {
|
|
13
|
+
__expose();
|
|
14
|
+
const props = __props;
|
|
15
|
+
const __returned__ = {
|
|
16
|
+
props,
|
|
17
|
+
paths: computed(() => {
|
|
18
|
+
if (props.orientation === "horizontal") return [
|
|
19
|
+
"M4 9a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",
|
|
20
|
+
"M4 15a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",
|
|
21
|
+
"M11 9a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",
|
|
22
|
+
"M11 15a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",
|
|
23
|
+
"M18 9a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",
|
|
24
|
+
"M18 15a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"
|
|
25
|
+
];
|
|
26
|
+
return [
|
|
27
|
+
"M8 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",
|
|
28
|
+
"M8 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",
|
|
29
|
+
"M8 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",
|
|
30
|
+
"M14 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",
|
|
31
|
+
"M14 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",
|
|
32
|
+
"M14 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"
|
|
33
|
+
];
|
|
34
|
+
})
|
|
35
|
+
};
|
|
36
|
+
Object.defineProperty(__returned__, "__isScriptSetup", {
|
|
37
|
+
enumerable: false,
|
|
38
|
+
value: true
|
|
39
|
+
});
|
|
40
|
+
return __returned__;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
const _hoisted_1 = ["d"];
|
|
44
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
45
|
+
return openBlock(), createElementBlock("svg", mergeProps({
|
|
46
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
47
|
+
width: "24",
|
|
48
|
+
height: "24",
|
|
49
|
+
viewBox: "0 0 24 24",
|
|
50
|
+
fill: "none",
|
|
51
|
+
stroke: "currentColor",
|
|
52
|
+
"stroke-width": "2",
|
|
53
|
+
"stroke-linecap": "round",
|
|
54
|
+
"stroke-linejoin": "round"
|
|
55
|
+
}, _ctx.$attrs), [(openBlock(true), createElementBlock(Fragment, null, renderList($setup.paths, (d, i) => {
|
|
56
|
+
return openBlock(), createElementBlock("path", {
|
|
57
|
+
key: i,
|
|
58
|
+
d
|
|
59
|
+
}, null, 8, _hoisted_1);
|
|
60
|
+
}), 128))], 16);
|
|
61
|
+
}
|
|
62
|
+
var grip_icon_default = /*#__PURE__*/ export_helper_default(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/cck-ui/cck-ui/packages/@cck-ui/core/src/components/splitter/grip-icon.vue"]]);
|
|
63
|
+
//#endregion
|
|
64
|
+
export { grip_icon_default as default };
|
|
65
|
+
|
|
66
|
+
//# sourceMappingURL=grip-icon.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grip-icon.mjs","names":[],"sources":["../../../src/components/splitter/grip-icon.vue"],"sourcesContent":["<template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n v-bind=\"$attrs\"\n >\n <path v-for=\"(d, i) in paths\" :key=\"i\" :d=\"d\" />\n </svg>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue'\n\ndefineOptions({\n name: 'GripIcon',\n})\n\nconst props = defineProps<{\n orientation?: 'vertical' | 'horizontal'\n}>()\n\nconst paths = computed(() => {\n if (props.orientation === 'horizontal') {\n return [\n 'M4 9a1 1 0 1 0 2 0a1 1 0 1 0 -2 0',\n 'M4 15a1 1 0 1 0 2 0a1 1 0 1 0 -2 0',\n 'M11 9a1 1 0 1 0 2 0a1 1 0 1 0 -2 0',\n 'M11 15a1 1 0 1 0 2 0a1 1 0 1 0 -2 0',\n 'M18 9a1 1 0 1 0 2 0a1 1 0 1 0 -2 0',\n 'M18 15a1 1 0 1 0 2 0a1 1 0 1 0 -2 0',\n ]\n }\n return [\n 'M8 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0',\n 'M8 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0',\n 'M8 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0',\n 'M14 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0',\n 'M14 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0',\n 'M14 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0',\n ]\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;EAwBA,MAAM,QAAQ;;;UAIA,eAAe;IAC3B,IAAI,MAAM,gBAAgB,cACxB,OAAO;KACL;KACA;KACA;KACA;KACA;KACA;IACF;IAEF,OAAO;KACL;KACA;KACA;KACA;KACA;KACA;IACF;GACF,CAAA;;;;;;;;;;;qBA9CE,mBAaM,OAbN,WAaM;EAZJ,OAAM;EACN,OAAM;EACN,QAAO;EACP,SAAQ;EACR,MAAK;EACL,QAAO;EACP,gBAAa;EACb,kBAAe;EACf,mBAAgB;IACR,KAAA,MAAM,GAAA,EAAA,UAAA,IAAA,GAEd,mBAAgD,UAAA,MAAA,WAAzB,OAAA,QAAT,GAAG,MAAC;sBAAlB,mBAAgD,QAAA;GAAjB,KAAK;GAAO"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { withInstall } from "../../core/utils/vue/install.mjs";
|
|
3
|
+
import { withClasses, withExtend, withPropsFactory, withVarsResolver } from "../../core/utils/vue/statics.mjs";
|
|
4
|
+
import splitter_module_default from "./splitter.module.mjs";
|
|
5
|
+
import { varsResolver } from "./splitter.utils.mjs";
|
|
6
|
+
import splitter_pane_default from "./splitter-pane/splitter-pane.mjs";
|
|
7
|
+
import splitter_default from "./splitter.mjs";
|
|
8
|
+
//#region packages/@cck-ui/core/src/components/splitter/index.ts
|
|
9
|
+
const SplitterPaneWithStatic = withPropsFactory(withExtend(withClasses(splitter_pane_default, splitter_module_default)));
|
|
10
|
+
const SplitterWithStatic = withPropsFactory(withExtend(withVarsResolver(withClasses(splitter_default, splitter_module_default), varsResolver)));
|
|
11
|
+
const CSplitterPane = withInstall(SplitterPaneWithStatic);
|
|
12
|
+
const CSplitter = withInstall(SplitterWithStatic, { CSplitterPane });
|
|
13
|
+
//#endregion
|
|
14
|
+
export { CSplitter, CSplitter as default, CSplitterPane };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["SplitterPane","classes","Splitter"],"sources":["../../../src/components/splitter/index.ts"],"sourcesContent":["import {\n SFCWithInstallAndClasses,\n withClasses,\n withExtend,\n withInstall,\n withPropsFactory,\n withVarsResolver,\n} from '../../core'\nimport Splitter from './splitter.vue'\nimport SplitterPane from './splitter-pane/splitter-pane.vue'\nimport classes from './splitter.module.css'\nimport { varsResolver } from './splitter.utils'\n\nconst SplitterPaneWithStatic = withPropsFactory(withExtend(withClasses(SplitterPane, classes)))\nconst SplitterWithStatic = withPropsFactory(\n withExtend(withVarsResolver(withClasses(Splitter, classes), varsResolver))\n)\n\nexport const CSplitterPane: SFCWithInstallAndClasses<typeof SplitterPane, typeof classes> =\n withInstall(SplitterPaneWithStatic)\nexport const CSplitter: SFCWithInstallAndClasses<typeof Splitter, typeof classes> & {\n CSplitterPane: typeof CSplitterPane\n} = withInstall(SplitterWithStatic, { CSplitterPane })\n\nexport default CSplitter\n\nexport * from './splitter-pane/splitter-pane.types'\nexport * from './splitter.types'\n"],"mappings":";;;;;;;;AAaA,MAAM,yBAAyB,iBAAiB,WAAW,YAAYA,uBAAcC,uBAAO,CAAC,CAAC;AAC9F,MAAM,qBAAqB,iBACzB,WAAW,iBAAiB,YAAYC,kBAAUD,uBAAO,GAAG,YAAY,CAAC,CAC3E;AAEA,MAAa,gBACX,YAAY,sBAAsB;AACpC,MAAa,YAET,YAAY,oBAAoB,EAAE,cAAc,CAAC"}
|
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import export_helper_default from "../../../_virtual/_/plugin-vue/export-helper.mjs";
|
|
3
|
+
import { useComponentProps } from "../../../core/config-provider/use-component-props/use-component-props.mjs";
|
|
4
|
+
import { CBox } from "../../../core/box/index.mjs";
|
|
5
|
+
import { useSplitterContext } from "../splitter.context.mjs";
|
|
6
|
+
import { computed, createBlock, defineComponent, mergeProps, openBlock, ref, renderSlot, useAttrs, withCtx } from "vue";
|
|
7
|
+
//#region packages/@cck-ui/core/src/components/splitter/splitter-pane/splitter-pane.vue
|
|
8
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
9
|
+
name: "CSplitterPane",
|
|
10
|
+
__name: "splitter-pane",
|
|
11
|
+
props: {
|
|
12
|
+
defaultSize: {
|
|
13
|
+
type: null,
|
|
14
|
+
required: true
|
|
15
|
+
},
|
|
16
|
+
min: {
|
|
17
|
+
type: null,
|
|
18
|
+
required: false
|
|
19
|
+
},
|
|
20
|
+
max: {
|
|
21
|
+
type: null,
|
|
22
|
+
required: false
|
|
23
|
+
},
|
|
24
|
+
collapsible: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
required: false
|
|
27
|
+
},
|
|
28
|
+
collapseThreshold: {
|
|
29
|
+
type: null,
|
|
30
|
+
required: false
|
|
31
|
+
},
|
|
32
|
+
__index: {
|
|
33
|
+
type: Number,
|
|
34
|
+
required: false
|
|
35
|
+
},
|
|
36
|
+
className: {
|
|
37
|
+
type: String,
|
|
38
|
+
required: false
|
|
39
|
+
},
|
|
40
|
+
style: {
|
|
41
|
+
type: [
|
|
42
|
+
Object,
|
|
43
|
+
Function,
|
|
44
|
+
Array
|
|
45
|
+
],
|
|
46
|
+
required: false,
|
|
47
|
+
skipCheck: true
|
|
48
|
+
},
|
|
49
|
+
__vars: {
|
|
50
|
+
type: null,
|
|
51
|
+
required: false
|
|
52
|
+
},
|
|
53
|
+
__size: {
|
|
54
|
+
type: String,
|
|
55
|
+
required: false
|
|
56
|
+
},
|
|
57
|
+
hiddenFrom: {
|
|
58
|
+
type: null,
|
|
59
|
+
required: false
|
|
60
|
+
},
|
|
61
|
+
visibleFrom: {
|
|
62
|
+
type: null,
|
|
63
|
+
required: false
|
|
64
|
+
},
|
|
65
|
+
lightHidden: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
required: false
|
|
68
|
+
},
|
|
69
|
+
darkHidden: {
|
|
70
|
+
type: Boolean,
|
|
71
|
+
required: false
|
|
72
|
+
},
|
|
73
|
+
mod: {
|
|
74
|
+
type: [
|
|
75
|
+
Object,
|
|
76
|
+
String,
|
|
77
|
+
Array
|
|
78
|
+
],
|
|
79
|
+
required: false
|
|
80
|
+
},
|
|
81
|
+
m: {
|
|
82
|
+
type: null,
|
|
83
|
+
required: false
|
|
84
|
+
},
|
|
85
|
+
my: {
|
|
86
|
+
type: null,
|
|
87
|
+
required: false
|
|
88
|
+
},
|
|
89
|
+
mx: {
|
|
90
|
+
type: null,
|
|
91
|
+
required: false
|
|
92
|
+
},
|
|
93
|
+
mt: {
|
|
94
|
+
type: null,
|
|
95
|
+
required: false
|
|
96
|
+
},
|
|
97
|
+
mb: {
|
|
98
|
+
type: null,
|
|
99
|
+
required: false
|
|
100
|
+
},
|
|
101
|
+
ms: {
|
|
102
|
+
type: null,
|
|
103
|
+
required: false
|
|
104
|
+
},
|
|
105
|
+
me: {
|
|
106
|
+
type: null,
|
|
107
|
+
required: false
|
|
108
|
+
},
|
|
109
|
+
mis: {
|
|
110
|
+
type: null,
|
|
111
|
+
required: false
|
|
112
|
+
},
|
|
113
|
+
mie: {
|
|
114
|
+
type: null,
|
|
115
|
+
required: false
|
|
116
|
+
},
|
|
117
|
+
ml: {
|
|
118
|
+
type: null,
|
|
119
|
+
required: false
|
|
120
|
+
},
|
|
121
|
+
mr: {
|
|
122
|
+
type: null,
|
|
123
|
+
required: false
|
|
124
|
+
},
|
|
125
|
+
p: {
|
|
126
|
+
type: null,
|
|
127
|
+
required: false
|
|
128
|
+
},
|
|
129
|
+
py: {
|
|
130
|
+
type: null,
|
|
131
|
+
required: false
|
|
132
|
+
},
|
|
133
|
+
px: {
|
|
134
|
+
type: null,
|
|
135
|
+
required: false
|
|
136
|
+
},
|
|
137
|
+
pt: {
|
|
138
|
+
type: null,
|
|
139
|
+
required: false
|
|
140
|
+
},
|
|
141
|
+
pb: {
|
|
142
|
+
type: null,
|
|
143
|
+
required: false
|
|
144
|
+
},
|
|
145
|
+
ps: {
|
|
146
|
+
type: null,
|
|
147
|
+
required: false
|
|
148
|
+
},
|
|
149
|
+
pe: {
|
|
150
|
+
type: null,
|
|
151
|
+
required: false
|
|
152
|
+
},
|
|
153
|
+
pis: {
|
|
154
|
+
type: null,
|
|
155
|
+
required: false
|
|
156
|
+
},
|
|
157
|
+
pie: {
|
|
158
|
+
type: null,
|
|
159
|
+
required: false
|
|
160
|
+
},
|
|
161
|
+
pl: {
|
|
162
|
+
type: null,
|
|
163
|
+
required: false
|
|
164
|
+
},
|
|
165
|
+
pr: {
|
|
166
|
+
type: null,
|
|
167
|
+
required: false
|
|
168
|
+
},
|
|
169
|
+
bd: {
|
|
170
|
+
type: null,
|
|
171
|
+
required: false
|
|
172
|
+
},
|
|
173
|
+
bdrs: {
|
|
174
|
+
type: null,
|
|
175
|
+
required: false
|
|
176
|
+
},
|
|
177
|
+
bg: {
|
|
178
|
+
type: null,
|
|
179
|
+
required: false
|
|
180
|
+
},
|
|
181
|
+
c: {
|
|
182
|
+
type: null,
|
|
183
|
+
required: false
|
|
184
|
+
},
|
|
185
|
+
opacity: {
|
|
186
|
+
type: [
|
|
187
|
+
String,
|
|
188
|
+
Object,
|
|
189
|
+
Number
|
|
190
|
+
],
|
|
191
|
+
required: false
|
|
192
|
+
},
|
|
193
|
+
ff: {
|
|
194
|
+
type: [String, Object],
|
|
195
|
+
required: false
|
|
196
|
+
},
|
|
197
|
+
fz: {
|
|
198
|
+
type: null,
|
|
199
|
+
required: false
|
|
200
|
+
},
|
|
201
|
+
fw: {
|
|
202
|
+
type: null,
|
|
203
|
+
required: false
|
|
204
|
+
},
|
|
205
|
+
lts: {
|
|
206
|
+
type: null,
|
|
207
|
+
required: false
|
|
208
|
+
},
|
|
209
|
+
ta: {
|
|
210
|
+
type: [String, Object],
|
|
211
|
+
required: false
|
|
212
|
+
},
|
|
213
|
+
lh: {
|
|
214
|
+
type: null,
|
|
215
|
+
required: false
|
|
216
|
+
},
|
|
217
|
+
fs: {
|
|
218
|
+
type: null,
|
|
219
|
+
required: false
|
|
220
|
+
},
|
|
221
|
+
tt: {
|
|
222
|
+
type: [String, Object],
|
|
223
|
+
required: false
|
|
224
|
+
},
|
|
225
|
+
td: {
|
|
226
|
+
type: null,
|
|
227
|
+
required: false
|
|
228
|
+
},
|
|
229
|
+
w: {
|
|
230
|
+
type: null,
|
|
231
|
+
required: false
|
|
232
|
+
},
|
|
233
|
+
miw: {
|
|
234
|
+
type: null,
|
|
235
|
+
required: false
|
|
236
|
+
},
|
|
237
|
+
maw: {
|
|
238
|
+
type: null,
|
|
239
|
+
required: false
|
|
240
|
+
},
|
|
241
|
+
h: {
|
|
242
|
+
type: null,
|
|
243
|
+
required: false
|
|
244
|
+
},
|
|
245
|
+
mih: {
|
|
246
|
+
type: null,
|
|
247
|
+
required: false
|
|
248
|
+
},
|
|
249
|
+
mah: {
|
|
250
|
+
type: null,
|
|
251
|
+
required: false
|
|
252
|
+
},
|
|
253
|
+
bgsz: {
|
|
254
|
+
type: null,
|
|
255
|
+
required: false
|
|
256
|
+
},
|
|
257
|
+
bgp: {
|
|
258
|
+
type: null,
|
|
259
|
+
required: false
|
|
260
|
+
},
|
|
261
|
+
bgr: {
|
|
262
|
+
type: null,
|
|
263
|
+
required: false
|
|
264
|
+
},
|
|
265
|
+
bga: {
|
|
266
|
+
type: null,
|
|
267
|
+
required: false
|
|
268
|
+
},
|
|
269
|
+
pos: {
|
|
270
|
+
type: [String, Object],
|
|
271
|
+
required: false
|
|
272
|
+
},
|
|
273
|
+
top: {
|
|
274
|
+
type: null,
|
|
275
|
+
required: false
|
|
276
|
+
},
|
|
277
|
+
left: {
|
|
278
|
+
type: null,
|
|
279
|
+
required: false
|
|
280
|
+
},
|
|
281
|
+
bottom: {
|
|
282
|
+
type: null,
|
|
283
|
+
required: false
|
|
284
|
+
},
|
|
285
|
+
right: {
|
|
286
|
+
type: null,
|
|
287
|
+
required: false
|
|
288
|
+
},
|
|
289
|
+
inset: {
|
|
290
|
+
type: null,
|
|
291
|
+
required: false
|
|
292
|
+
},
|
|
293
|
+
display: {
|
|
294
|
+
type: null,
|
|
295
|
+
required: false
|
|
296
|
+
},
|
|
297
|
+
flex: {
|
|
298
|
+
type: null,
|
|
299
|
+
required: false
|
|
300
|
+
},
|
|
301
|
+
variant: {
|
|
302
|
+
type: null,
|
|
303
|
+
required: false
|
|
304
|
+
},
|
|
305
|
+
classNames: {
|
|
306
|
+
type: null,
|
|
307
|
+
required: false
|
|
308
|
+
},
|
|
309
|
+
styles: {
|
|
310
|
+
type: null,
|
|
311
|
+
required: false
|
|
312
|
+
},
|
|
313
|
+
vars: {
|
|
314
|
+
type: Function,
|
|
315
|
+
required: false
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
setup(__props, { expose: __expose }) {
|
|
319
|
+
const _root = ref(null);
|
|
320
|
+
const attrs = useAttrs();
|
|
321
|
+
const rawProps = __props;
|
|
322
|
+
const props = useComponentProps({
|
|
323
|
+
component: "CSplitterPane",
|
|
324
|
+
defaultProps: {},
|
|
325
|
+
props: rawProps
|
|
326
|
+
});
|
|
327
|
+
const knownProps = [
|
|
328
|
+
"className",
|
|
329
|
+
"classNames",
|
|
330
|
+
"style",
|
|
331
|
+
"styles",
|
|
332
|
+
"vars",
|
|
333
|
+
"defaultSize",
|
|
334
|
+
"min",
|
|
335
|
+
"max",
|
|
336
|
+
"collapsible",
|
|
337
|
+
"collapseThreshold",
|
|
338
|
+
"__index",
|
|
339
|
+
"mod"
|
|
340
|
+
];
|
|
341
|
+
const modList = computed(() => [{ collapsed: isCollapsed || void 0 }]);
|
|
342
|
+
const ctx = useSplitterContext();
|
|
343
|
+
const index = props.value.__index ?? 0;
|
|
344
|
+
const isCollapsed = computed(() => {
|
|
345
|
+
return ctx.collapsed.value[index] ?? false;
|
|
346
|
+
});
|
|
347
|
+
const sizeStyle = computed(() => ctx.getPaneStyle(index));
|
|
348
|
+
const rootAttrs = computed(() => {
|
|
349
|
+
const style = [sizeStyle.value, props.value.style];
|
|
350
|
+
const result = ctx.getStyles("pane", {
|
|
351
|
+
className: props.value.className,
|
|
352
|
+
classNames: props.value.classNames,
|
|
353
|
+
style,
|
|
354
|
+
styles: props.value.styles,
|
|
355
|
+
props: props.value
|
|
356
|
+
});
|
|
357
|
+
const { style: _, ...restAttrs } = attrs;
|
|
358
|
+
return {
|
|
359
|
+
...result,
|
|
360
|
+
...restAttrs
|
|
361
|
+
};
|
|
362
|
+
});
|
|
363
|
+
const mergedAttrs = computed(() => {
|
|
364
|
+
const others = {};
|
|
365
|
+
const propsValue = props.value;
|
|
366
|
+
for (const key in propsValue) if (!knownProps.includes(key)) others[key] = propsValue[key];
|
|
367
|
+
const userMod = props.value.mod;
|
|
368
|
+
const mergedMod = [...Array.isArray(userMod) ? userMod : [userMod].filter(Boolean), ...modList.value || []];
|
|
369
|
+
return {
|
|
370
|
+
...others,
|
|
371
|
+
mod: mergedMod,
|
|
372
|
+
...rootAttrs.value,
|
|
373
|
+
style: rootAttrs.value.style ?? void 0
|
|
374
|
+
};
|
|
375
|
+
});
|
|
376
|
+
__expose({ root: computed(() => _root.value?.root ?? null) });
|
|
377
|
+
const __returned__ = {
|
|
378
|
+
_root,
|
|
379
|
+
attrs,
|
|
380
|
+
rawProps,
|
|
381
|
+
props,
|
|
382
|
+
knownProps,
|
|
383
|
+
modList,
|
|
384
|
+
ctx,
|
|
385
|
+
index,
|
|
386
|
+
isCollapsed,
|
|
387
|
+
sizeStyle,
|
|
388
|
+
rootAttrs,
|
|
389
|
+
mergedAttrs,
|
|
390
|
+
get CBox() {
|
|
391
|
+
return CBox;
|
|
392
|
+
}
|
|
393
|
+
};
|
|
394
|
+
Object.defineProperty(__returned__, "__isScriptSetup", {
|
|
395
|
+
enumerable: false,
|
|
396
|
+
value: true
|
|
397
|
+
});
|
|
398
|
+
return __returned__;
|
|
399
|
+
}
|
|
400
|
+
});
|
|
401
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
402
|
+
return openBlock(), createBlock($setup["CBox"], mergeProps({ ref: "_root" }, $setup.mergedAttrs), {
|
|
403
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
404
|
+
_: 3
|
|
405
|
+
}, 16);
|
|
406
|
+
}
|
|
407
|
+
var splitter_pane_default = /*#__PURE__*/ export_helper_default(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/cck-ui/cck-ui/packages/@cck-ui/core/src/components/splitter/splitter-pane/splitter-pane.vue"]]);
|
|
408
|
+
//#endregion
|
|
409
|
+
export { splitter_pane_default as default };
|
|
410
|
+
|
|
411
|
+
//# sourceMappingURL=splitter-pane.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"splitter-pane.mjs","names":[],"sources":["../../../../src/components/splitter/splitter-pane/splitter-pane.vue"],"sourcesContent":["<template>\n <c-box ref=\"_root\" v-bind=\"mergedAttrs\">\n <slot />\n </c-box>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs } from 'vue'\nimport { SplitterPaneProps } from './splitter-pane.types'\nimport { CBox, useComponentProps } from '../../../core'\nimport { useSplitterContext } from '../splitter.context'\n\ndefineOptions({\n name: 'CSplitterPane',\n})\n\nconst _root = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\nconst rawProps = defineProps<SplitterPaneProps>()\n\nconst props = useComponentProps({\n component: 'CSplitterPane',\n defaultProps: {},\n props: rawProps,\n})\n\nconst knownProps = [\n 'className',\n 'classNames',\n 'style',\n 'styles',\n 'vars',\n 'defaultSize',\n 'min',\n 'max',\n 'collapsible',\n 'collapseThreshold',\n '__index',\n 'mod',\n]\n\nconst modList = computed(() => [\n {\n collapsed: isCollapsed || undefined,\n },\n])\n\nconst ctx = useSplitterContext()\nconst index = props.value.__index ?? 0\nconst isCollapsed = computed(() => {\n const collapsed = ctx.collapsed.value\n return collapsed[index] ?? false\n})\n\nconst sizeStyle = computed(() => ctx.getPaneStyle(index))\n\nconst rootAttrs = computed(() => {\n const style = [sizeStyle.value, props.value.style]\n const result = ctx.getStyles('pane', {\n className: props.value.className,\n classNames: props.value.classNames,\n style,\n styles: props.value.styles,\n props: props.value,\n })\n const { style: _, ...restAttrs } = attrs\n return {\n ...result,\n ...restAttrs,\n }\n})\n\nconst mergedAttrs = computed(() => {\n const others: Record<string, any> = {}\n const propsValue = props.value\n for (const key in propsValue) {\n if (!knownProps.includes(key)) {\n others[key] = propsValue[key as keyof typeof propsValue]\n }\n }\n const userMod = props.value.mod\n const mergedMod = [\n ...(Array.isArray(userMod) ? userMod : [userMod].filter(Boolean)),\n ...(modList.value || []),\n ]\n return {\n ...others,\n mod: mergedMod,\n ...rootAttrs.value,\n style: rootAttrs.value.style ?? undefined,\n }\n})\n\ndefineExpose({\n root: computed(() => _root.value?.root ?? null),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBA,MAAM,QAAQ,IAAsC,IAAI;EAExD,MAAM,QAAQ,SAAS;EACvB,MAAM,WAAW;EAEjB,MAAM,QAAQ,kBAAkB;GAC9B,WAAW;GACX,cAAc,CAAC;GACf,OAAO;EACT,CAAC;EAED,MAAM,aAAa;GACjB;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;EAEA,MAAM,UAAU,eAAe,CAC7B,EACE,WAAW,eAAe,KAAA,EAC5B,CACF,CAAC;EAED,MAAM,MAAM,mBAAmB;EAC/B,MAAM,QAAQ,MAAM,MAAM,WAAW;EACrC,MAAM,cAAc,eAAe;GAEjC,OADkB,IAAI,UAAU,MACf,UAAU;EAC7B,CAAC;EAED,MAAM,YAAY,eAAe,IAAI,aAAa,KAAK,CAAC;EAExD,MAAM,YAAY,eAAe;GAC/B,MAAM,QAAQ,CAAC,UAAU,OAAO,MAAM,MAAM,KAAK;GACjD,MAAM,SAAS,IAAI,UAAU,QAAQ;IACnC,WAAW,MAAM,MAAM;IACvB,YAAY,MAAM,MAAM;IACxB;IACA,QAAQ,MAAM,MAAM;IACpB,OAAO,MAAM;GACf,CAAC;GACD,MAAM,EAAE,OAAO,GAAG,GAAG,cAAc;GACnC,OAAO;IACL,GAAG;IACH,GAAG;GACL;EACF,CAAC;EAED,MAAM,cAAc,eAAe;GACjC,MAAM,SAA8B,CAAC;GACrC,MAAM,aAAa,MAAM;GACzB,KAAK,MAAM,OAAO,YAChB,IAAI,CAAC,WAAW,SAAS,GAAG,GAC1B,OAAO,OAAO,WAAW;GAG7B,MAAM,UAAU,MAAM,MAAM;GAC5B,MAAM,YAAY,CAChB,GAAI,MAAM,QAAQ,OAAO,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC,OAAO,OAAO,GAC/D,GAAI,QAAQ,SAAS,CAAC,CACxB;GACA,OAAO;IACL,GAAG;IACH,KAAK;IACL,GAAG,UAAU;IACb,OAAO,UAAU,MAAM,SAAS,KAAA;GAClC;EACF,CAAC;EAED,SAAa,EACX,MAAM,eAAe,MAAM,OAAO,QAAQ,IAAI,EAChD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;qBA/FC,YAEQ,OAAA,SAFR,WAEQ,EAFD,KAAI,QAAO,GAAS,OAAA,WAAW,GAAA;yBAC5B,CAAR,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { inject, provide } from "vue";
|
|
3
|
+
//#region packages/@cck-ui/core/src/components/splitter/splitter.context.ts
|
|
4
|
+
const SPLITTER_CONTEXT_KEY = Symbol("SplitterContext");
|
|
5
|
+
function provideSplitterContext(value) {
|
|
6
|
+
provide(SPLITTER_CONTEXT_KEY, value);
|
|
7
|
+
}
|
|
8
|
+
function useSplitterContext() {
|
|
9
|
+
const ctx = inject(SPLITTER_CONTEXT_KEY);
|
|
10
|
+
if (!ctx) throw new Error("Splitter component was not found in the tree");
|
|
11
|
+
return ctx;
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { provideSplitterContext, useSplitterContext };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=splitter.context.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"splitter.context.mjs","names":[],"sources":["../../../src/components/splitter/splitter.context.ts"],"sourcesContent":["import type { SplitterPaneSize } from '@cck-ui/hooks'\nimport type { GetStylesApi } from '../../core'\nimport type { SplitterFactory } from './splitter.types'\nimport { ComputedRef, inject, InjectionKey, provide } from 'vue'\n\nexport interface SplitterContextValue {\n getStyles: GetStylesApi<SplitterFactory>\n sizes: ComputedRef<SplitterPaneSize[]>\n collapsed: ComputedRef<boolean[]>\n orientation: ComputedRef<'horizontal' | 'vertical'>\n getPaneStyle: (index: number) => Record<string, any>\n}\n\nconst SPLITTER_CONTEXT_KEY: InjectionKey<SplitterContextValue> = Symbol('SplitterContext')\n\nexport function provideSplitterContext(value: SplitterContextValue) {\n provide(SPLITTER_CONTEXT_KEY, value)\n}\n\nexport function useSplitterContext() {\n const ctx = inject(SPLITTER_CONTEXT_KEY)\n if (!ctx) {\n throw new Error('Splitter component was not found in the tree')\n }\n return ctx\n}\n"],"mappings":";;;AAaA,MAAM,uBAA2D,OAAO,iBAAiB;AAEzF,SAAgB,uBAAuB,OAA6B;CAClE,QAAQ,sBAAsB,KAAK;AACrC;AAEA,SAAgB,qBAAqB;CACnC,MAAM,MAAM,OAAO,oBAAoB;CACvC,IAAI,CAAC,KACH,MAAM,IAAI,MAAM,8CAA8C;CAEhE,OAAO;AACT"}
|