@cck-ui/core 0.2.0 → 0.3.3
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/button/button-group/button-group.cjs +1 -1
- package/cjs/components/button/button-group/button-group.cjs.map +1 -1
- package/cjs/components/button/button-group/use-button-group.cjs +2 -1
- package/cjs/components/button/button-group/use-button-group.cjs.map +1 -1
- package/cjs/components/button/button-group-section/button-group-section.cjs +1 -1
- package/cjs/components/button/button-group-section/button-group-section.cjs.map +1 -1
- package/cjs/components/button/button.cjs +99 -68
- package/cjs/components/button/button.cjs.map +1 -1
- package/cjs/components/button/button.module.cjs.map +1 -1
- package/cjs/components/grid/col/col-custom.cjs +2 -3
- package/cjs/components/grid/col/col-custom.cjs.map +1 -1
- package/cjs/components/grid/col/col.cjs +31 -23
- package/cjs/components/grid/col/col.cjs.map +1 -1
- package/cjs/components/grid/grid-custom.cjs +2 -3
- package/cjs/components/grid/grid-custom.cjs.map +1 -1
- package/cjs/components/grid/grid.cjs +50 -38
- package/cjs/components/grid/grid.cjs.map +1 -1
- package/cjs/components/group/group.cjs +1 -1
- package/cjs/components/group/group.cjs.map +1 -1
- package/cjs/components/loader/loader.cjs +44 -36
- package/cjs/components/loader/loader.cjs.map +1 -1
- package/cjs/components/loader/loaders/bars.cjs +1 -1
- package/cjs/components/loader/loaders/bars.cjs.map +1 -1
- package/cjs/components/loader/loaders/dots.cjs +1 -1
- package/cjs/components/loader/loaders/dots.cjs.map +1 -1
- package/cjs/components/loader/loaders/oval.cjs +1 -1
- package/cjs/components/loader/loaders/oval.cjs.map +1 -1
- package/cjs/components/simple-grid/simple-grid-custom.cjs +2 -3
- package/cjs/components/simple-grid/simple-grid-custom.cjs.map +1 -1
- package/cjs/components/simple-grid/simple-grid.cjs +35 -30
- package/cjs/components/simple-grid/simple-grid.cjs.map +1 -1
- package/cjs/components/text/text.cjs +50 -43
- package/cjs/components/text/text.cjs.map +1 -1
- package/cjs/components/text/text.module.cjs.map +1 -1
- package/cjs/components/transition/get-transition-props/get-transition-props.cjs +17 -0
- package/cjs/components/transition/get-transition-props/get-transition-props.cjs.map +1 -0
- package/cjs/components/transition/get-transition-styles/get-transition-styles.cjs +37 -0
- package/cjs/components/transition/get-transition-styles/get-transition-styles.cjs.map +1 -0
- package/cjs/components/transition/index.cjs +14 -0
- package/cjs/components/transition/index.cjs.map +1 -0
- package/cjs/components/transition/transition.cjs +140 -0
- package/cjs/components/transition/transition.cjs.map +1 -0
- package/cjs/components/transition/transitions.cjs +220 -0
- package/cjs/components/transition/transitions.cjs.map +1 -0
- package/cjs/components/transition/use-transition.cjs +84 -0
- package/cjs/components/transition/use-transition.cjs.map +1 -0
- package/cjs/components/unstyled-button/unstyled-button.cjs +32 -22
- package/cjs/components/unstyled-button/unstyled-button.cjs.map +1 -1
- package/cjs/core/box/box.cjs +40 -46
- package/cjs/core/box/box.cjs.map +1 -1
- package/cjs/core/box/get-box-mod/get-box-mod.cjs.map +1 -1
- package/cjs/core/box/style-props/parse-style-props/parse-style-props.cjs +1 -1
- package/cjs/core/box/style-props/parse-style-props/parse-style-props.cjs.map +1 -1
- package/cjs/core/config-provider/baseline.cjs +1 -0
- package/cjs/core/config-provider/cck-css-variables/default-css-variables-resolver.cjs +138 -0
- package/cjs/core/config-provider/cck-css-variables/default-css-variables-resolver.cjs.map +1 -0
- package/cjs/core/config-provider/cck-css-variables/get-css-color-variables.cjs +64 -0
- package/cjs/core/config-provider/cck-css-variables/get-css-color-variables.cjs.map +1 -0
- package/cjs/core/config-provider/cck-css-variables/virtual-color/virtual-color.cjs +39 -0
- package/cjs/core/config-provider/cck-css-variables/virtual-color/virtual-color.cjs.map +1 -0
- package/cjs/core/config-provider/color-functions/colors-tuple/colors-tuple.cjs +10 -0
- package/cjs/core/config-provider/color-functions/colors-tuple/colors-tuple.cjs.map +1 -0
- package/cjs/core/config-provider/color-functions/default-variant-colors-resolver/default-variant-colors-resolver.cjs +22 -0
- package/cjs/core/config-provider/color-functions/default-variant-colors-resolver/default-variant-colors-resolver.cjs.map +1 -1
- package/cjs/core/config-provider/color-functions/get-contrast-color/get-contrast-color.cjs +39 -0
- package/cjs/core/config-provider/color-functions/get-contrast-color/get-contrast-color.cjs.map +1 -0
- package/cjs/core/config-provider/color-functions/parse-theme-color/parse-theme-color.cjs.map +1 -1
- package/cjs/core/config-provider/color-scheme-managers/is-cck-color-scheme.cjs +9 -0
- package/cjs/core/config-provider/color-scheme-managers/is-cck-color-scheme.cjs.map +1 -0
- package/cjs/core/config-provider/color-scheme-managers/local-storage-manager.cjs +40 -0
- package/cjs/core/config-provider/color-scheme-managers/local-storage-manager.cjs.map +1 -0
- package/cjs/core/config-provider/config-provider.cjs +65 -11
- package/cjs/core/config-provider/config-provider.cjs.map +1 -1
- package/cjs/core/config-provider/config-provider.context.cjs +5 -0
- package/cjs/core/config-provider/config-provider.context.cjs.map +1 -1
- package/cjs/core/config-provider/config-provider.types.cjs +1 -1
- package/cjs/core/config-provider/config-provider.types.cjs.map +1 -1
- package/cjs/core/config-provider/create-theme/create-theme.cjs +8 -0
- package/cjs/core/config-provider/create-theme/create-theme.cjs.map +1 -0
- package/cjs/core/config-provider/default-css-variables.cjs +1 -0
- package/cjs/core/config-provider/global.cjs +1 -0
- package/cjs/core/config-provider/index.cjs +18 -2
- package/cjs/core/config-provider/index.cjs.map +1 -1
- package/cjs/core/config-provider/merge-cck-theme/merge-cck-theme.cjs +35 -0
- package/cjs/core/config-provider/merge-cck-theme/merge-cck-theme.cjs.map +1 -0
- package/cjs/core/config-provider/use-cck-color-scheme/use-cck-color-scheme.cjs +84 -0
- package/cjs/core/config-provider/use-cck-color-scheme/use-cck-color-scheme.cjs.map +1 -0
- package/cjs/core/config-provider/use-cck-color-scheme/use-provider-color-scheme.cjs +59 -0
- package/cjs/core/config-provider/use-cck-color-scheme/use-provider-color-scheme.cjs.map +1 -0
- package/cjs/core/config-provider/use-respect-reduce-motion/use-respect-reduce-motion.cjs +14 -0
- package/cjs/core/config-provider/use-respect-reduce-motion/use-respect-reduce-motion.cjs.map +1 -0
- package/cjs/core/styles-api/use-styles/use-styles.cjs +1 -4
- package/cjs/core/styles-api/use-styles/use-styles.cjs.map +1 -1
- package/cjs/index.cjs +39 -17
- package/esm/components/button/button-group/button-group.mjs +1 -1
- package/esm/components/button/button-group/button-group.mjs.map +1 -1
- package/esm/components/button/button-group/use-button-group.mjs +2 -1
- package/esm/components/button/button-group/use-button-group.mjs.map +1 -1
- package/esm/components/button/button-group-section/button-group-section.mjs +1 -1
- package/esm/components/button/button-group-section/button-group-section.mjs.map +1 -1
- package/esm/components/button/button.mjs +100 -69
- package/esm/components/button/button.mjs.map +1 -1
- package/esm/components/button/button.module.mjs.map +1 -1
- package/esm/components/grid/col/col-custom.mjs +3 -4
- package/esm/components/grid/col/col-custom.mjs.map +1 -1
- package/esm/components/grid/col/col.mjs +32 -24
- package/esm/components/grid/col/col.mjs.map +1 -1
- package/esm/components/grid/grid-custom.mjs +3 -4
- package/esm/components/grid/grid-custom.mjs.map +1 -1
- package/esm/components/grid/grid.mjs +51 -39
- package/esm/components/grid/grid.mjs.map +1 -1
- package/esm/components/group/group.mjs +1 -1
- package/esm/components/group/group.mjs.map +1 -1
- package/esm/components/loader/loader.mjs +43 -35
- package/esm/components/loader/loader.mjs.map +1 -1
- package/esm/components/loader/loaders/bars.mjs +1 -1
- package/esm/components/loader/loaders/bars.mjs.map +1 -1
- package/esm/components/loader/loaders/dots.mjs +1 -1
- package/esm/components/loader/loaders/dots.mjs.map +1 -1
- package/esm/components/loader/loaders/oval.mjs +1 -1
- package/esm/components/loader/loaders/oval.mjs.map +1 -1
- package/esm/components/simple-grid/simple-grid-custom.mjs +3 -4
- package/esm/components/simple-grid/simple-grid-custom.mjs.map +1 -1
- package/esm/components/simple-grid/simple-grid.mjs +35 -30
- package/esm/components/simple-grid/simple-grid.mjs.map +1 -1
- package/esm/components/text/text.mjs +50 -43
- package/esm/components/text/text.mjs.map +1 -1
- package/esm/components/text/text.module.mjs.map +1 -1
- package/esm/components/transition/get-transition-props/get-transition-props.mjs +17 -0
- package/esm/components/transition/get-transition-props/get-transition-props.mjs.map +1 -0
- package/esm/components/transition/get-transition-styles/get-transition-styles.mjs +37 -0
- package/esm/components/transition/get-transition-styles/get-transition-styles.mjs.map +1 -0
- package/esm/components/transition/index.mjs +11 -0
- package/esm/components/transition/index.mjs.map +1 -0
- package/esm/components/transition/transition.mjs +140 -0
- package/esm/components/transition/transition.mjs.map +1 -0
- package/esm/components/transition/transitions.mjs +220 -0
- package/esm/components/transition/transitions.mjs.map +1 -0
- package/esm/components/transition/use-transition.mjs +84 -0
- package/esm/components/transition/use-transition.mjs.map +1 -0
- package/esm/components/unstyled-button/unstyled-button.mjs +33 -23
- package/esm/components/unstyled-button/unstyled-button.mjs.map +1 -1
- package/esm/core/box/box.mjs +41 -47
- package/esm/core/box/box.mjs.map +1 -1
- package/esm/core/box/get-box-mod/get-box-mod.mjs.map +1 -1
- package/esm/core/box/style-props/parse-style-props/parse-style-props.mjs +1 -1
- package/esm/core/box/style-props/parse-style-props/parse-style-props.mjs.map +1 -1
- package/esm/core/config-provider/baseline.mjs +1 -0
- package/esm/core/config-provider/cck-css-variables/default-css-variables-resolver.mjs +138 -0
- package/esm/core/config-provider/cck-css-variables/default-css-variables-resolver.mjs.map +1 -0
- package/esm/core/config-provider/cck-css-variables/get-css-color-variables.mjs +64 -0
- package/esm/core/config-provider/cck-css-variables/get-css-color-variables.mjs.map +1 -0
- package/esm/core/config-provider/cck-css-variables/virtual-color/virtual-color.mjs +38 -0
- package/esm/core/config-provider/cck-css-variables/virtual-color/virtual-color.mjs.map +1 -0
- package/esm/core/config-provider/color-functions/colors-tuple/colors-tuple.mjs +10 -0
- package/esm/core/config-provider/color-functions/colors-tuple/colors-tuple.mjs.map +1 -0
- package/esm/core/config-provider/color-functions/default-variant-colors-resolver/default-variant-colors-resolver.mjs +22 -0
- package/esm/core/config-provider/color-functions/default-variant-colors-resolver/default-variant-colors-resolver.mjs.map +1 -1
- package/esm/core/config-provider/color-functions/get-contrast-color/get-contrast-color.mjs +37 -0
- package/esm/core/config-provider/color-functions/get-contrast-color/get-contrast-color.mjs.map +1 -0
- package/esm/core/config-provider/color-functions/parse-theme-color/parse-theme-color.mjs.map +1 -1
- package/esm/core/config-provider/color-scheme-managers/is-cck-color-scheme.mjs +9 -0
- package/esm/core/config-provider/color-scheme-managers/is-cck-color-scheme.mjs.map +1 -0
- package/esm/core/config-provider/color-scheme-managers/local-storage-manager.mjs +40 -0
- package/esm/core/config-provider/color-scheme-managers/local-storage-manager.mjs.map +1 -0
- package/esm/core/config-provider/config-provider.context.mjs +7 -3
- package/esm/core/config-provider/config-provider.context.mjs.map +1 -1
- package/esm/core/config-provider/config-provider.mjs +66 -12
- package/esm/core/config-provider/config-provider.mjs.map +1 -1
- package/esm/core/config-provider/config-provider.types.mjs +1 -1
- package/esm/core/config-provider/config-provider.types.mjs.map +1 -1
- package/esm/core/config-provider/create-theme/create-theme.mjs +8 -0
- package/esm/core/config-provider/create-theme/create-theme.mjs.map +1 -0
- package/esm/core/config-provider/default-css-variables.mjs +1 -0
- package/esm/core/config-provider/global.mjs +1 -0
- package/esm/core/config-provider/index.mjs +10 -3
- package/esm/core/config-provider/index.mjs.map +1 -1
- package/esm/core/config-provider/merge-cck-theme/merge-cck-theme.mjs +32 -0
- package/esm/core/config-provider/merge-cck-theme/merge-cck-theme.mjs.map +1 -0
- package/esm/core/config-provider/use-cck-color-scheme/use-cck-color-scheme.mjs +84 -0
- package/esm/core/config-provider/use-cck-color-scheme/use-cck-color-scheme.mjs.map +1 -0
- package/esm/core/config-provider/use-cck-color-scheme/use-provider-color-scheme.mjs +59 -0
- package/esm/core/config-provider/use-cck-color-scheme/use-provider-color-scheme.mjs.map +1 -0
- package/esm/core/config-provider/use-respect-reduce-motion/use-respect-reduce-motion.mjs +14 -0
- package/esm/core/config-provider/use-respect-reduce-motion/use-respect-reduce-motion.mjs.map +1 -0
- package/esm/core/styles-api/use-styles/use-styles.mjs +2 -5
- package/esm/core/styles-api/use-styles/use-styles.mjs.map +1 -1
- package/esm/index.mjs +13 -3
- package/lib/components/button/button.types.d.ts +1 -11
- package/lib/components/index.d.ts +1 -0
- package/lib/components/text/text.types.d.ts +1 -1
- package/lib/components/transition/get-transition-props/get-transition-props.d.ts +5 -0
- package/lib/components/transition/get-transition-styles/get-transition-styles.d.ts +17 -0
- package/lib/components/transition/index.d.ts +8 -0
- package/lib/components/transition/transition.types.d.ts +66 -0
- package/lib/components/transition/transitions.d.ts +10 -0
- package/lib/components/transition/use-transition.d.ts +20 -0
- package/lib/core/box/style-props/parse-style-props/parse-style-props.d.ts +1 -1
- package/lib/core/config-provider/cck-css-variables/index.d.ts +3 -0
- package/lib/core/config-provider/cck-css-variables/virtual-color/virtual-color.d.ts +1 -1
- package/lib/core/config-provider/color-functions/index.d.ts +2 -1
- package/lib/core/config-provider/color-functions/parse-theme-color/parse-theme-color.d.ts +1 -1
- package/lib/core/config-provider/color-scheme-managers/index.d.ts +4 -0
- package/lib/core/config-provider/color-scheme-managers/is-cck-color-scheme.d.ts +2 -0
- package/lib/core/config-provider/color-scheme-managers/local-storage-manager.d.ts +5 -0
- package/lib/core/config-provider/color-scheme-managers/types.d.ts +30 -0
- package/lib/core/config-provider/config-provider.context.d.ts +4 -3
- package/lib/core/config-provider/config-provider.types.d.ts +10 -4
- package/lib/core/config-provider/create-theme/create-theme.d.ts +2 -0
- package/lib/core/config-provider/index.d.ts +3 -0
- package/lib/core/config-provider/merge-cck-theme/index.d.ts +1 -0
- package/lib/core/config-provider/merge-cck-theme/merge-cck-theme.d.ts +5 -0
- package/lib/core/config-provider/use-cck-color-scheme/index.d.ts +2 -0
- package/lib/core/config-provider/use-cck-color-scheme/use-cck-color-scheme.d.ts +10 -0
- package/lib/core/config-provider/use-cck-color-scheme/use-provider-color-scheme.d.ts +15 -0
- package/lib/core/config-provider/use-respect-reduce-motion/use-respect-reduce-motion.d.ts +7 -0
- package/package.json +3 -1
- package/styles/button.css +5 -9
- package/styles/button.layer.css +5 -9
- package/styles/default-css-variables.css +30 -30
- package/styles/default-css-variables.layer.css +30 -30
- package/styles/text.css +10 -0
- package/styles/text.layer.css +10 -0
- package/styles.css +1482 -232
- package/styles.layer.css +1483 -233
|
@@ -334,7 +334,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
334
334
|
const _component_c_box = resolveComponent("c-box");
|
|
335
335
|
return openBlock(), createBlock(_component_c_box, mergeProps({ tag: "span" }, $setup.others, { class: $setup.loaderClass }), null, 16, ["class"]);
|
|
336
336
|
}
|
|
337
|
-
var oval_default = /*#__PURE__*/ export_helper_default(_sfc_main, [["render", _sfc_render], ["__file", "
|
|
337
|
+
var oval_default = /*#__PURE__*/ export_helper_default(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/cck-ui/cck-ui/packages/@cck-ui/core/src/components/loader/loaders/oval.vue"]]);
|
|
338
338
|
//#endregion
|
|
339
339
|
export { oval_default as default };
|
|
340
340
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oval.mjs","names":[],"sources":["../../../../src/components/loader/loaders/oval.vue"
|
|
1
|
+
{"version":3,"file":"oval.mjs","names":[],"sources":["../../../../src/components/loader/loaders/oval.vue"],"sourcesContent":["<template>\n <c-box tag=\"span\" v-bind=\"others\" :class=\"loaderClass\" />\n</template>\n\n<script setup lang=\"ts\">\nimport cx from 'clsx'\nimport type { LoaderProps } from '../loader.types'\nimport classes from '../loader.module.css'\n\nconst { className, attributes, ...others } = defineProps<LoaderProps>()\n\nconst loaderClass = cx(classes.ovalLoader, className)\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAS6C,qBAAA,SAAA,CAAA,aAAA,YAAA,CAAA;gBAEzB,GAAG,sBAAQ,YAAY,QAAA,SAAA;;;;;;;;;;;qBAVzC,YAAyD,kBAAzD,WAAyD,EAAlD,KAAI,OAAM,GAAS,OAAA,QAAM,EAAG,OAAO,OAAA,YAAW,CAAA,GAAA,MAAA,IAAA,CAAA,OAAA,CAAA"}
|
|
@@ -7,10 +7,9 @@ import { isNumberLike } from "../../core/utils/is-number-like/is-number-like.mjs
|
|
|
7
7
|
import { getSpacing } from "../../core/utils/get-size/get-size.mjs";
|
|
8
8
|
import { getSortedBreakpoints } from "../../core/utils/get-sorted-breakpoints/get-sorted-breakpoints.mjs";
|
|
9
9
|
import { keys } from "../../core/utils/keys/keys.mjs";
|
|
10
|
-
import {
|
|
11
|
-
import { DEFAULT_THEME } from "../../core/config-provider/default-theme.mjs";
|
|
10
|
+
import { useCckTheme } from "../../core/config-provider/config-provider.context.mjs";
|
|
12
11
|
import { stylesToString } from "../../core/responsive-style-manager/styles-to-string/styles-to-string.mjs";
|
|
13
|
-
import { computed
|
|
12
|
+
import { computed } from "vue";
|
|
14
13
|
//#region packages/@cck-ui/core/src/components/simple-grid/simple-grid-custom.ts
|
|
15
14
|
function getMinColWidthValue(value) {
|
|
16
15
|
if (value === void 0) return;
|
|
@@ -69,7 +68,7 @@ function getContainerStyle({ cols, minColWidth, spacing, verticalSpacing }) {
|
|
|
69
68
|
}
|
|
70
69
|
function useSimpleGridStyle(props) {
|
|
71
70
|
return computed(() => {
|
|
72
|
-
const theme =
|
|
71
|
+
const theme = useCckTheme().value;
|
|
73
72
|
const { autoFlow, autoRows, cols, minColWidth, selector, spacing, verticalSpacing } = props;
|
|
74
73
|
const _verticalSpacing = verticalSpacing === void 0 ? spacing : verticalSpacing;
|
|
75
74
|
const useAutoColumns = minColWidth !== void 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simple-grid-custom.mjs","names":[],"sources":["../../../src/components/simple-grid/simple-grid-custom.ts"],"sourcesContent":["import { computed
|
|
1
|
+
{"version":3,"file":"simple-grid-custom.mjs","names":[],"sources":["../../../src/components/simple-grid/simple-grid-custom.ts"],"sourcesContent":["import { computed } from 'vue'\nimport {\n CBreakpoint,\n CTheme,\n filterProps,\n getBaseValue,\n getSortedBreakpoints,\n getSpacing,\n isNumberLike,\n keys,\n px,\n rem,\n stylesToString,\n useCckTheme,\n} from '../../core'\nimport { SimpleGridProps } from './simple-grid.types'\n\ninterface SimpleGridVariablesProps extends SimpleGridProps {\n selector: string\n}\n\nfunction getMinColWidthValue(value: string | number | undefined): string | undefined {\n if (value === undefined) {\n return undefined\n }\n\n if (isNumberLike(value)) {\n return rem(value)\n }\n\n return value as string\n}\n\nfunction getBreakpoints(values: unknown) {\n if (typeof values === 'object' && values !== null) {\n return keys(values)\n }\n\n return []\n}\n\nfunction sortBreakpoints(breakpoints: string[]) {\n return breakpoints.sort((a, b) => (px(a) as number) - (px(b) as number))\n}\n\nfunction getUniqueBreakpoints({ cols, minColWidth, spacing, verticalSpacing }: SimpleGridProps) {\n const breakpoints = Array.from(\n new Set([\n ...getBreakpoints(spacing),\n ...getBreakpoints(verticalSpacing),\n ...(minColWidth !== undefined ? [] : getBreakpoints(cols)),\n ])\n )\n\n return sortBreakpoints(breakpoints)\n}\n\nfunction getMediaStyle(\n { cols, minColWidth, spacing, verticalSpacing }: SimpleGridVariablesProps,\n theme: CTheme\n) {\n const _verticalSpacing = verticalSpacing === undefined ? spacing : verticalSpacing\n const useAutoColumns = minColWidth !== undefined\n\n const queries = keys(theme.breakpoints).reduce<Record<string, Record<string, any>>>(\n (acc, breakpoint) => {\n if (!acc[breakpoint]) {\n acc[breakpoint] = {}\n }\n\n if (typeof spacing === 'object' && spacing[breakpoint] !== undefined) {\n acc[breakpoint]['--sg-spacing-x'] = getSpacing(spacing[breakpoint])\n }\n\n if (typeof _verticalSpacing === 'object' && _verticalSpacing[breakpoint] !== undefined) {\n acc[breakpoint]['--sg-spacing-y'] = getSpacing(_verticalSpacing[breakpoint])\n }\n\n if (!useAutoColumns && typeof cols === 'object' && cols[breakpoint] !== undefined) {\n acc[breakpoint]['--sg-cols'] = cols[breakpoint]\n }\n\n return acc\n },\n {}\n )\n\n const sortedBreakpoints = getSortedBreakpoints(keys(queries), theme.breakpoints).filter(\n (breakpoint) => keys(queries[breakpoint.value]).length > 0\n )\n\n const media = sortedBreakpoints.map((breakpoint) => ({\n query: `(min-width: ${theme.breakpoints[breakpoint.value as CBreakpoint]})`,\n styles: queries[breakpoint.value],\n }))\n\n return media\n}\n\nfunction getContainerStyle({ cols, minColWidth, spacing, verticalSpacing }: SimpleGridProps) {\n const _verticalSpacing = verticalSpacing === undefined ? spacing : verticalSpacing\n const useAutoColumns = minColWidth !== undefined\n\n const uniqueBreakpoints = getUniqueBreakpoints({\n cols,\n minColWidth,\n spacing,\n verticalSpacing,\n })\n\n const queries = uniqueBreakpoints.reduce<Record<string, Record<string, any>>>(\n (acc, breakpoint) => {\n if (!acc[breakpoint]) {\n acc[breakpoint] = {}\n }\n\n if (typeof spacing === 'object' && spacing[breakpoint] !== undefined) {\n acc[breakpoint]['--sg-spacing-x'] = getSpacing(spacing[breakpoint])\n }\n\n if (typeof _verticalSpacing === 'object' && _verticalSpacing[breakpoint] !== undefined) {\n acc[breakpoint]['--sg-spacing-y'] = getSpacing(_verticalSpacing[breakpoint])\n }\n\n if (!useAutoColumns && typeof cols === 'object' && cols[breakpoint] !== undefined) {\n acc[breakpoint]['--sg-cols'] = cols[breakpoint]\n }\n\n return acc\n },\n {}\n )\n\n const container = uniqueBreakpoints.map((breakpoint) => ({\n query: `simple-grid (min-width: ${breakpoint})`,\n styles: queries[breakpoint],\n }))\n\n return container\n}\n\nexport function useSimpleGridStyle(props: SimpleGridVariablesProps) {\n return computed(() => {\n const _theme = useCckTheme()\n const theme = _theme.value\n const { autoFlow, autoRows, cols, minColWidth, selector, spacing, verticalSpacing } = props\n const _verticalSpacing = verticalSpacing === undefined ? spacing : verticalSpacing\n const useAutoColumns = minColWidth !== undefined\n\n const autoColsAttr = useAutoColumns ? autoFlow || 'auto-fill' : undefined\n const attrs: Record<string, string | undefined> = {\n 'data-auto-cols': autoColsAttr,\n }\n\n const baseStyles: Record<string, string | undefined> = filterProps({\n '--sg-spacing-x': getSpacing(getBaseValue(spacing)),\n '--sg-spacing-y': getSpacing(getBaseValue(_verticalSpacing)),\n '--sg-auto-rows': autoRows,\n ...(useAutoColumns\n ? { '--sg-min-col-width': getMinColWidthValue(minColWidth) }\n : { '--sg-cols': getBaseValue(cols)?.toString() }),\n })\n\n const media = getMediaStyle(props, theme)\n const container = getContainerStyle(props)\n\n const queryStylesString = stylesToString({\n styles: baseStyles,\n media,\n container,\n selector,\n })\n\n return { attrs, queryStylesString }\n })\n}\n"],"mappings":";;;;;;;;;;;;;AAqBA,SAAS,oBAAoB,OAAwD;CACnF,IAAI,UAAU,KAAA,GACZ;CAGF,IAAI,aAAa,KAAK,GACpB,OAAO,IAAI,KAAK;CAGlB,OAAO;AACT;AAEA,SAAS,eAAe,QAAiB;CACvC,IAAI,OAAO,WAAW,YAAY,WAAW,MAC3C,OAAO,KAAK,MAAM;CAGpB,OAAO,CAAC;AACV;AAEA,SAAS,gBAAgB,aAAuB;CAC9C,OAAO,YAAY,MAAM,GAAG,MAAO,GAAG,CAAC,IAAgB,GAAG,CAAC,CAAY;AACzE;AAEA,SAAS,qBAAqB,EAAE,MAAM,aAAa,SAAS,mBAAoC;CAS9F,OAAO,gBARa,MAAM,qBACxB,IAAI,IAAI;EACN,GAAG,eAAe,OAAO;EACzB,GAAG,eAAe,eAAe;EACjC,GAAI,gBAAgB,KAAA,IAAY,CAAC,IAAI,eAAe,IAAI;CAC1D,CAAC,CAG8B,CAAC;AACpC;AAEA,SAAS,cACP,EAAE,MAAM,aAAa,SAAS,mBAC9B,OACA;CACA,MAAM,mBAAmB,oBAAoB,KAAA,IAAY,UAAU;CACnE,MAAM,iBAAiB,gBAAgB,KAAA;CAEvC,MAAM,UAAU,KAAK,MAAM,WAAW,CAAC,CAAC,QACrC,KAAK,eAAe;EACnB,IAAI,CAAC,IAAI,aACP,IAAI,cAAc,CAAC;EAGrB,IAAI,OAAO,YAAY,YAAY,QAAQ,gBAAgB,KAAA,GACzD,IAAI,WAAW,CAAC,oBAAoB,WAAW,QAAQ,WAAW;EAGpE,IAAI,OAAO,qBAAqB,YAAY,iBAAiB,gBAAgB,KAAA,GAC3E,IAAI,WAAW,CAAC,oBAAoB,WAAW,iBAAiB,WAAW;EAG7E,IAAI,CAAC,kBAAkB,OAAO,SAAS,YAAY,KAAK,gBAAgB,KAAA,GACtE,IAAI,WAAW,CAAC,eAAe,KAAK;EAGtC,OAAO;CACT,GACA,CAAC,CACH;CAWA,OAT0B,qBAAqB,KAAK,OAAO,GAAG,MAAM,WAAW,CAAC,CAAC,QAC9E,eAAe,KAAK,QAAQ,WAAW,MAAM,CAAC,CAAC,SAAS,CAG7B,CAAC,CAAC,KAAK,gBAAgB;EACnD,OAAO,eAAe,MAAM,YAAY,WAAW,OAAsB;EACzE,QAAQ,QAAQ,WAAW;CAC7B,EAEW;AACb;AAEA,SAAS,kBAAkB,EAAE,MAAM,aAAa,SAAS,mBAAoC;CAC3F,MAAM,mBAAmB,oBAAoB,KAAA,IAAY,UAAU;CACnE,MAAM,iBAAiB,gBAAgB,KAAA;CAEvC,MAAM,oBAAoB,qBAAqB;EAC7C;EACA;EACA;EACA;CACF,CAAC;CAED,MAAM,UAAU,kBAAkB,QAC/B,KAAK,eAAe;EACnB,IAAI,CAAC,IAAI,aACP,IAAI,cAAc,CAAC;EAGrB,IAAI,OAAO,YAAY,YAAY,QAAQ,gBAAgB,KAAA,GACzD,IAAI,WAAW,CAAC,oBAAoB,WAAW,QAAQ,WAAW;EAGpE,IAAI,OAAO,qBAAqB,YAAY,iBAAiB,gBAAgB,KAAA,GAC3E,IAAI,WAAW,CAAC,oBAAoB,WAAW,iBAAiB,WAAW;EAG7E,IAAI,CAAC,kBAAkB,OAAO,SAAS,YAAY,KAAK,gBAAgB,KAAA,GACtE,IAAI,WAAW,CAAC,eAAe,KAAK;EAGtC,OAAO;CACT,GACA,CAAC,CACH;CAOA,OALkB,kBAAkB,KAAK,gBAAgB;EACvD,OAAO,2BAA2B,WAAW;EAC7C,QAAQ,QAAQ;CAClB,EAEe;AACjB;AAEA,SAAgB,mBAAmB,OAAiC;CAClE,OAAO,eAAe;EAEpB,MAAM,QADS,YACI,CAAC,CAAC;EACrB,MAAM,EAAE,UAAU,UAAU,MAAM,aAAa,UAAU,SAAS,oBAAoB;EACtF,MAAM,mBAAmB,oBAAoB,KAAA,IAAY,UAAU;EACnE,MAAM,iBAAiB,gBAAgB,KAAA;EA0BvC,OAAO;GAAE,OAAA,EAtBP,kBAFmB,iBAAiB,YAAY,cAAc,KAAA,EAwBnD;GAAG,mBAPU,eAAe;IACvC,QAbqD,YAAY;KACjE,kBAAkB,WAAW,aAAa,OAAO,CAAC;KAClD,kBAAkB,WAAW,aAAa,gBAAgB,CAAC;KAC3D,kBAAkB;KAClB,GAAI,iBACA,EAAE,sBAAsB,oBAAoB,WAAW,EAAE,IACzD,EAAE,aAAa,aAAa,IAAI,CAAC,EAAE,SAAS,EAAE;IACpD,CAMmB;IACjB,OALY,cAAc,OAAO,KAK7B;IACJ,WALgB,kBAAkB,KAK1B;IACR;GACF,CAEgC;EAAE;CACpC,CAAC;AACH"}
|
|
@@ -336,26 +336,45 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
336
336
|
setup(__props, { expose: __expose }) {
|
|
337
337
|
__expose();
|
|
338
338
|
const props = __props;
|
|
339
|
-
const
|
|
339
|
+
const knownProps = [
|
|
340
|
+
"classNames",
|
|
341
|
+
"className",
|
|
342
|
+
"style",
|
|
343
|
+
"styles",
|
|
344
|
+
"unstyled",
|
|
345
|
+
"vars",
|
|
346
|
+
"cols",
|
|
347
|
+
"verticalSpacing",
|
|
348
|
+
"spacing",
|
|
349
|
+
"type",
|
|
350
|
+
"minColWidth",
|
|
351
|
+
"autoFlow",
|
|
352
|
+
"autoRows",
|
|
353
|
+
"attributes"
|
|
354
|
+
];
|
|
340
355
|
const getStyles = useStyles({
|
|
341
356
|
name: "SimpleGrid",
|
|
342
357
|
classes: simple_grid_module_default,
|
|
343
358
|
props,
|
|
344
|
-
className,
|
|
345
|
-
style,
|
|
346
|
-
classNames,
|
|
347
|
-
styles,
|
|
348
|
-
unstyled,
|
|
349
|
-
attributes,
|
|
350
|
-
vars
|
|
359
|
+
className: props.className,
|
|
360
|
+
style: props.style,
|
|
361
|
+
classNames: props.classNames,
|
|
362
|
+
styles: props.styles,
|
|
363
|
+
unstyled: props.unstyled,
|
|
364
|
+
attributes: props.attributes,
|
|
365
|
+
vars: props.vars
|
|
351
366
|
});
|
|
352
367
|
const responsiveClassname = useRandomClassName();
|
|
353
|
-
const autoColsAttr = minColWidth !== void 0 ? autoFlow || "auto-fill" : void 0;
|
|
368
|
+
const autoColsAttr = props.minColWidth !== void 0 ? props.autoFlow || "auto-fill" : void 0;
|
|
354
369
|
const rootAttrs = computed(() => getStyles("root", { className: responsiveClassname }));
|
|
355
|
-
const mergedRootAttrs = computed(() =>
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
370
|
+
const mergedRootAttrs = computed(() => {
|
|
371
|
+
const others = {};
|
|
372
|
+
for (const key in props) if (!knownProps.includes(key)) others[key] = props[key];
|
|
373
|
+
return {
|
|
374
|
+
...others,
|
|
375
|
+
...rootAttrs.value
|
|
376
|
+
};
|
|
377
|
+
});
|
|
359
378
|
const containerAttrs = computed(() => getStyles("container"));
|
|
360
379
|
const gridStyle = useSimpleGridStyle({
|
|
361
380
|
selector: responsiveClassname,
|
|
@@ -378,21 +397,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
378
397
|
});
|
|
379
398
|
const __returned__ = {
|
|
380
399
|
props,
|
|
381
|
-
|
|
382
|
-
className,
|
|
383
|
-
style,
|
|
384
|
-
styles,
|
|
385
|
-
unstyled,
|
|
386
|
-
vars,
|
|
387
|
-
cols,
|
|
388
|
-
verticalSpacing,
|
|
389
|
-
spacing,
|
|
390
|
-
type,
|
|
391
|
-
minColWidth,
|
|
392
|
-
autoFlow,
|
|
393
|
-
autoRows,
|
|
394
|
-
attributes,
|
|
395
|
-
others,
|
|
400
|
+
knownProps,
|
|
396
401
|
getStyles,
|
|
397
402
|
responsiveClassname,
|
|
398
403
|
autoColsAttr,
|
|
@@ -413,7 +418,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
413
418
|
}
|
|
414
419
|
});
|
|
415
420
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
416
|
-
return $
|
|
421
|
+
return $props.type === "container" ? (openBlock(), createBlock($setup["CBox"], normalizeProps(mergeProps({ key: 0 }, $setup.containerAttrs)), {
|
|
417
422
|
default: withCtx(() => [createVNode($setup["CBox"], mergeProps($setup.mergedRootAttrs, { "data-auto-cols": $setup.autoColsAttr }), {
|
|
418
423
|
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
419
424
|
_: 3
|
|
@@ -424,7 +429,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
424
429
|
_: 3
|
|
425
430
|
}, 16, ["data-auto-cols"]));
|
|
426
431
|
}
|
|
427
|
-
var simple_grid_default = /*#__PURE__*/ export_helper_default(_sfc_main, [["render", _sfc_render], ["__file", "
|
|
432
|
+
var simple_grid_default = /*#__PURE__*/ export_helper_default(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/cck-ui/cck-ui/packages/@cck-ui/core/src/components/simple-grid/simple-grid.vue"]]);
|
|
428
433
|
//#endregion
|
|
429
434
|
export { simple_grid_default as default };
|
|
430
435
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simple-grid.mjs","names":[],"sources":["../../../src/components/simple-grid/simple-grid.vue"
|
|
1
|
+
{"version":3,"file":"simple-grid.mjs","names":[],"sources":["../../../src/components/simple-grid/simple-grid.vue"],"sourcesContent":["<template>\n <c-box v-if=\"type === 'container'\" v-bind=\"containerAttrs\">\n <c-box v-bind=\"mergedRootAttrs\" :data-auto-cols=\"autoColsAttr\">\n <slot />\n </c-box>\n </c-box>\n <template v-else>\n <c-box v-bind=\"mergedRootAttrs\" :data-auto-cols=\"autoColsAttr\">\n <slot />\n </c-box>\n </template>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, onUnmounted, ref, watchEffect } from 'vue'\nimport { CBox, responsiveStyleManager, useRandomClassName, useStyles } from '../../core'\nimport type { SimpleGridFactory, SimpleGridProps } from './simple-grid.types'\nimport classes from './simple-grid.module.css'\nimport { useSimpleGridStyle } from './simple-grid-custom'\n\ndefineOptions({\n name: 'CSimpleGrid',\n})\n\nconst props = withDefaults(defineProps<SimpleGridProps>(), {\n cols: 1,\n spacing: 'md',\n type: 'media',\n})\n\nconst knownProps = [\n 'classNames',\n 'className',\n 'style',\n 'styles',\n 'unstyled',\n 'vars',\n 'cols',\n 'verticalSpacing',\n 'spacing',\n 'type',\n 'minColWidth',\n 'autoFlow',\n 'autoRows',\n 'attributes',\n]\n\nconst getStyles = useStyles<SimpleGridFactory>({\n name: 'SimpleGrid',\n classes,\n props,\n className: props.className,\n style: props.style,\n classNames: props.classNames,\n styles: props.styles,\n unstyled: props.unstyled,\n attributes: props.attributes,\n vars: props.vars,\n})\n\nconst responsiveClassname = useRandomClassName()\n\nconst autoColsAttr = props.minColWidth !== undefined ? props.autoFlow || 'auto-fill' : undefined\n\nconst rootAttrs = computed(() => getStyles('root', { className: responsiveClassname }))\nconst mergedRootAttrs = computed(() => {\n const others: Record<string, any> = {}\n for (const key in props) {\n if (!knownProps.includes(key)) {\n others[key] = props[key as keyof typeof props]\n }\n }\n return { ...others, ...rootAttrs.value }\n})\n\nconst containerAttrs = computed(() => getStyles('container'))\n\nconst gridStyle = useSimpleGridStyle({\n selector: responsiveClassname,\n ...props,\n})\n\nconst currentStyleKey = ref<string | null>(null)\nwatchEffect(() => {\n const cssText = gridStyle.value.queryStylesString\n if (cssText) {\n const newKey = responsiveStyleManager.register(cssText)\n if (currentStyleKey.value && currentStyleKey.value !== newKey) {\n responsiveStyleManager.unregister(currentStyleKey.value)\n }\n currentStyleKey.value = newKey\n } else if (currentStyleKey.value) {\n responsiveStyleManager.unregister(currentStyleKey.value)\n currentStyleKey.value = null\n }\n})\nonUnmounted(() => {\n if (currentStyleKey.value) {\n responsiveStyleManager.unregister(currentStyleKey.value)\n }\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwBA,MAAM,QAAQ;EAMd,MAAM,aAAa;GACjB;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;EAEA,MAAM,YAAY,UAA6B;GAC7C,MAAM;GACN,SAAA;GACA;GACA,WAAW,MAAM;GACjB,OAAO,MAAM;GACb,YAAY,MAAM;GAClB,QAAQ,MAAM;GACd,UAAU,MAAM;GAChB,YAAY,MAAM;GAClB,MAAM,MAAM;EACd,CAAC;EAED,MAAM,sBAAsB,mBAAmB;EAE/C,MAAM,eAAe,MAAM,gBAAgB,KAAA,IAAY,MAAM,YAAY,cAAc,KAAA;EAEvF,MAAM,YAAY,eAAe,UAAU,QAAQ,EAAE,WAAW,oBAAoB,CAAC,CAAC;EACtF,MAAM,kBAAkB,eAAe;GACrC,MAAM,SAA8B,CAAC;GACrC,KAAK,MAAM,OAAO,OAChB,IAAI,CAAC,WAAW,SAAS,GAAG,GAC1B,OAAO,OAAO,MAAM;GAGxB,OAAO;IAAE,GAAG;IAAQ,GAAG,UAAU;GAAM;EACzC,CAAC;EAED,MAAM,iBAAiB,eAAe,UAAU,WAAW,CAAC;EAE5D,MAAM,YAAY,mBAAmB;GACnC,UAAU;GACV,GAAG;EACL,CAAC;EAED,MAAM,kBAAkB,IAAmB,IAAI;EAC/C,kBAAkB;GAChB,MAAM,UAAU,UAAU,MAAM;GAChC,IAAI,SAAS;IACX,MAAM,SAAS,uBAAuB,SAAS,OAAO;IACtD,IAAI,gBAAgB,SAAS,gBAAgB,UAAU,QACrD,uBAAuB,WAAW,gBAAgB,KAAK;IAEzD,gBAAgB,QAAQ;GAC1B,OAAO,IAAI,gBAAgB,OAAO;IAChC,uBAAuB,WAAW,gBAAgB,KAAK;IACvD,gBAAgB,QAAQ;GAC1B;EACF,CAAC;EACD,kBAAkB;GAChB,IAAI,gBAAgB,OAClB,uBAAuB,WAAW,gBAAgB,KAAK;EAE3D,CAAC;;;;;;;;;;;;;;;;;;;;;;;;QAnGc,OAAA,SAAI,eAAA,UAAA,GAAjB,YAIQ,OAAA,SAAA,eAAA,WAAA,EAAA,KAAA,EAAA,GAJmC,OAAA,cAAc,CAAA,GAAA;yBAG/C,CAFR,YAEQ,OAAA,SAFR,WAEQ,OAFO,iBAAe,EAAG,kBAAgB,OAAA,aAAY,CAAA,GAAA;0BACnD,CAAR,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA;;;;yBAIV,YAEQ,OAAA,SAFR,WAEQ,EAAA,KAAA,EAAA,GAFO,OAAA,iBAAe,EAAG,kBAAgB,OAAA,aAAY,CAAA,GAAA;yBACnD,CAAR,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { getFontSize, getLineHeight } from "../../core/utils/get-size/get-size.mjs";
|
|
3
|
-
import export_helper_default from "../../_virtual/_/plugin-vue/export-helper.mjs";
|
|
4
3
|
import { getGradient } from "../../core/config-provider/color-functions/get-gradient/get-gradient.mjs";
|
|
4
|
+
import export_helper_default from "../../_virtual/_/plugin-vue/export-helper.mjs";
|
|
5
5
|
import { CBox } from "../../core/box/index.mjs";
|
|
6
6
|
import { createVarsResolver } from "../../core/styles-api/create-vars-resolver/create-vars-resolver.mjs";
|
|
7
7
|
import { useStyles } from "../../core/styles-api/use-styles/use-styles.mjs";
|
|
@@ -341,11 +341,36 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
341
341
|
setup(__props, { expose: __expose }) {
|
|
342
342
|
__expose();
|
|
343
343
|
const props = __props;
|
|
344
|
-
const { lineClamp, truncate, inline, inherit, gradient, span, textWrap, __staticSelector, vars, className, style, classNames, styles, unstyled, variant, mod, size, attributes, ...others } = props;
|
|
345
344
|
function getTextTruncate(truncate) {
|
|
346
345
|
if (truncate === "start") return "start";
|
|
347
346
|
if (truncate === "end" || truncate) return "end";
|
|
348
347
|
}
|
|
348
|
+
const knownProps = [
|
|
349
|
+
"lineClamp",
|
|
350
|
+
"truncate",
|
|
351
|
+
"inline",
|
|
352
|
+
"inherit",
|
|
353
|
+
"gradient",
|
|
354
|
+
"span",
|
|
355
|
+
"textWrap",
|
|
356
|
+
"__staticSelector",
|
|
357
|
+
"vars",
|
|
358
|
+
"className",
|
|
359
|
+
"style",
|
|
360
|
+
"classNames",
|
|
361
|
+
"styles",
|
|
362
|
+
"unstyled",
|
|
363
|
+
"variant",
|
|
364
|
+
"mod",
|
|
365
|
+
"size",
|
|
366
|
+
"attributes"
|
|
367
|
+
];
|
|
368
|
+
const modList = computed(() => [{
|
|
369
|
+
"data-truncate": getTextTruncate(props.truncate),
|
|
370
|
+
"data-line-clamp": typeof props.lineClamp === "number",
|
|
371
|
+
"data-inline": props.inline,
|
|
372
|
+
"data-inherit": props.inherit
|
|
373
|
+
}, props.mod]);
|
|
349
374
|
const varsResolver = createVarsResolver((theme, { gradient, lineClamp, size, textWrap, variant }) => ({ root: {
|
|
350
375
|
"--text-fz": getFontSize(size),
|
|
351
376
|
"--text-lh": getLineHeight(size),
|
|
@@ -354,48 +379,35 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
354
379
|
"--text-text-wrap": textWrap
|
|
355
380
|
} }));
|
|
356
381
|
const getStyles = useStyles({
|
|
357
|
-
name: ["Text", __staticSelector],
|
|
382
|
+
name: ["Text", props.__staticSelector],
|
|
358
383
|
props,
|
|
359
384
|
classes: text_module_default,
|
|
360
|
-
className,
|
|
361
|
-
style,
|
|
362
|
-
classNames,
|
|
363
|
-
styles,
|
|
364
|
-
unstyled,
|
|
365
|
-
attributes,
|
|
366
|
-
vars,
|
|
385
|
+
className: props.className,
|
|
386
|
+
style: props.style,
|
|
387
|
+
classNames: props.classNames,
|
|
388
|
+
styles: props.styles,
|
|
389
|
+
unstyled: props.unstyled,
|
|
390
|
+
attributes: props.attributes,
|
|
391
|
+
vars: props.vars,
|
|
367
392
|
varsResolver
|
|
368
393
|
});
|
|
369
394
|
const rootAttrs = computed(() => getStyles("root", { focusable: true }));
|
|
370
395
|
const __returned__ = {
|
|
371
396
|
props,
|
|
372
|
-
lineClamp,
|
|
373
|
-
truncate,
|
|
374
|
-
inline,
|
|
375
|
-
inherit,
|
|
376
|
-
gradient,
|
|
377
|
-
span,
|
|
378
|
-
textWrap,
|
|
379
|
-
__staticSelector,
|
|
380
|
-
vars,
|
|
381
|
-
className,
|
|
382
|
-
style,
|
|
383
|
-
classNames,
|
|
384
|
-
styles,
|
|
385
|
-
unstyled,
|
|
386
|
-
variant,
|
|
387
|
-
mod,
|
|
388
|
-
size,
|
|
389
|
-
attributes,
|
|
390
|
-
others,
|
|
391
397
|
getTextTruncate,
|
|
398
|
+
knownProps,
|
|
399
|
+
modList,
|
|
392
400
|
varsResolver,
|
|
393
401
|
getStyles,
|
|
394
402
|
rootAttrs,
|
|
395
|
-
mergedAttrs: computed(() =>
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
403
|
+
mergedAttrs: computed(() => {
|
|
404
|
+
const others = {};
|
|
405
|
+
for (const key in props) if (!knownProps.includes(key)) others[key] = props[key];
|
|
406
|
+
return {
|
|
407
|
+
...others,
|
|
408
|
+
...rootAttrs.value
|
|
409
|
+
};
|
|
410
|
+
}),
|
|
399
411
|
get CBox() {
|
|
400
412
|
return CBox;
|
|
401
413
|
}
|
|
@@ -409,15 +421,10 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
409
421
|
});
|
|
410
422
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
411
423
|
return openBlock(), createBlock($setup["CBox"], mergeProps($setup.mergedAttrs, {
|
|
412
|
-
mod:
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
"data-inherit": $setup.inherit
|
|
417
|
-
}, $setup.mod],
|
|
418
|
-
size: $setup.size,
|
|
419
|
-
tag: $setup.span ? "span" : "p",
|
|
420
|
-
variant: $setup.variant
|
|
424
|
+
mod: $setup.modList,
|
|
425
|
+
size: $setup.props.size,
|
|
426
|
+
tag: $setup.props.span ? "span" : "p",
|
|
427
|
+
variant: $setup.props.variant
|
|
421
428
|
}), {
|
|
422
429
|
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
423
430
|
_: 3
|
|
@@ -428,7 +435,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
428
435
|
"variant"
|
|
429
436
|
]);
|
|
430
437
|
}
|
|
431
|
-
var text_default = /*#__PURE__*/ export_helper_default(_sfc_main, [["render", _sfc_render], ["__file", "
|
|
438
|
+
var text_default = /*#__PURE__*/ export_helper_default(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/cck-ui/cck-ui/packages/@cck-ui/core/src/components/text/text.vue"]]);
|
|
432
439
|
//#endregion
|
|
433
440
|
export { text_default as default };
|
|
434
441
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.mjs","names":[],"sources":["../../../src/components/text/text.vue"
|
|
1
|
+
{"version":3,"file":"text.mjs","names":[],"sources":["../../../src/components/text/text.vue"],"sourcesContent":["<template>\n <c-box\n v-bind=\"mergedAttrs\"\n :mod=\"modList\"\n :size=\"props.size\"\n :tag=\"props.span ? 'span' : 'p'\"\n :variant=\"props.variant\"\n >\n <slot />\n </c-box>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport type { TextFactory, TextProps, TextTruncate } from './text.types.ts'\nimport classes from './text.module.css'\nimport {\n createVarsResolver,\n getFontSize,\n getGradient,\n getLineHeight,\n useStyles,\n CBox,\n} from '../../core'\n\ndefineOptions({\n name: 'CText',\n})\n\nconst props = defineProps<TextProps>()\n\nfunction getTextTruncate(truncate: TextTruncate | undefined) {\n if (truncate === 'start') {\n return 'start'\n }\n\n if (truncate === 'end' || truncate) {\n return 'end'\n }\n\n return undefined\n}\n\nconst knownProps = [\n 'lineClamp',\n 'truncate',\n 'inline',\n 'inherit',\n 'gradient',\n 'span',\n 'textWrap',\n '__staticSelector',\n 'vars',\n 'className',\n 'style',\n 'classNames',\n 'styles',\n 'unstyled',\n 'variant',\n 'mod',\n 'size',\n 'attributes',\n]\n\nconst modList = computed(() => [\n {\n 'data-truncate': getTextTruncate(props.truncate),\n 'data-line-clamp': typeof props.lineClamp === 'number',\n 'data-inline': props.inline,\n 'data-inherit': props.inherit,\n },\n props.mod,\n])\n\nconst varsResolver = createVarsResolver<TextFactory>(\n (theme, { gradient, lineClamp, size, textWrap, variant }) => ({\n root: {\n '--text-fz': getFontSize(size),\n '--text-lh': getLineHeight(size),\n '--text-gradient': variant === 'gradient' ? getGradient(gradient, theme) : undefined,\n '--text-line-clamp': typeof lineClamp === 'number' ? lineClamp.toString() : undefined,\n '--text-text-wrap': textWrap,\n },\n })\n)\n\nconst getStyles = useStyles<TextFactory>({\n name: ['Text', props.__staticSelector],\n props,\n classes,\n className: props.className,\n style: props.style,\n classNames: props.classNames,\n styles: props.styles,\n unstyled: props.unstyled,\n attributes: props.attributes,\n vars: props.vars,\n varsResolver,\n})\n\nconst rootAttrs = computed(() => getStyles('root', { focusable: true }))\n\nconst mergedAttrs = computed(() => {\n const others: Record<string, any> = {}\n for (const key in props) {\n if (!knownProps.includes(key)) {\n others[key] = props[key as keyof typeof props]\n }\n }\n return { ...others, ...rootAttrs.value }\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6BA,MAAM,QAAQ;EAEd,SAAS,gBAAgB,UAAoC;GAC3D,IAAI,aAAa,SACf,OAAO;GAGT,IAAI,aAAa,SAAS,UACxB,OAAO;EAIX;EAEA,MAAM,aAAa;GACjB;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;EAEA,MAAM,UAAU,eAAe,CAC7B;GACE,iBAAiB,gBAAgB,MAAM,QAAQ;GAC/C,mBAAmB,OAAO,MAAM,cAAc;GAC9C,eAAe,MAAM;GACrB,gBAAgB,MAAM;EACxB,GACA,MAAM,GACR,CAAC;EAED,MAAM,eAAe,oBAClB,OAAO,EAAE,UAAU,WAAW,MAAM,UAAU,eAAe,EAC5D,MAAM;GACJ,aAAa,YAAY,IAAI;GAC7B,aAAa,cAAc,IAAI;GAC/B,mBAAmB,YAAY,aAAa,YAAY,UAAU,KAAK,IAAI,KAAA;GAC3E,qBAAqB,OAAO,cAAc,WAAW,UAAU,SAAS,IAAI,KAAA;GAC5E,oBAAoB;EACtB,EACF,EACF;EAEA,MAAM,YAAY,UAAuB;GACvC,MAAM,CAAC,QAAQ,MAAM,gBAAgB;GACrC;GACA,SAAA;GACA,WAAW,MAAM;GACjB,OAAO,MAAM;GACb,YAAY,MAAM;GAClB,QAAQ,MAAM;GACd,UAAU,MAAM;GAChB,YAAY,MAAM;GAClB,MAAM,MAAM;GACZ;EACF,CAAC;EAED,MAAM,YAAY,eAAe,UAAU,QAAQ,EAAE,WAAW,KAAK,CAAC,CAAC;;;;;;;;;gBAEnD,eAAe;IACjC,MAAM,SAA8B,CAAC;IACrC,KAAK,MAAM,OAAO,OAChB,IAAI,CAAC,WAAW,SAAS,GAAG,GAC1B,OAAO,OAAO,MAAM;IAGxB,OAAO;KAAE,GAAG;KAAQ,GAAG,UAAU;IAAM;GACzC,CAAA;;;;;;;;;;;;;qBA7GE,YAQQ,OAAA,SARR,WAQQ,OAPE,aAAW;EAClB,KAAK,OAAA;EACL,MAAM,OAAA,MAAM;EACZ,KAAK,OAAA,MAAM,OAAI,SAAA;EACf,SAAS,OAAA,MAAM;;yBAER,CAAR,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.module.mjs","names":[],"sources":["../../../src/components/text/text.module.css"],"sourcesContent":[".root {\n -webkit-tap-highlight-color: transparent;\n text-decoration: none;\n font-size: var(--text-fz, var(--c-font-size-md));\n line-height: var(--text-lh, var(--c-line-height-md));\n font-weight: var(--c-font-weight-regular);\n text-wrap: var(--text-text-wrap, var(--c-text-wrap));\n margin: 0;\n padding: 0;\n\n &:where([data-truncate]) {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n &:where([data-variant='gradient']) {\n background-image: var(--text-gradient);\n -webkit-text-fill-color: transparent;\n -webkit-background-clip: text;\n background-clip: text;\n }\n\n &:where([data-line-clamp]) {\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: var(--text-line-clamp);\n -webkit-box-orient: vertical;\n }\n\n &:where([data-inherit]) {\n line-height: inherit;\n font-weight: inherit;\n font-size: inherit;\n }\n\n &:where([data-inline]) {\n line-height: 1;\n }\n}\n"],"mappings":";;AAAA,IAAA,sBAAe,EAAC,QAAO,aAAY"}
|
|
1
|
+
{"version":3,"file":"text.module.mjs","names":[],"sources":["../../../src/components/text/text.module.css"],"sourcesContent":[".root {\n -webkit-tap-highlight-color: transparent;\n text-decoration: none;\n font-size: var(--text-fz, var(--c-font-size-md));\n line-height: var(--text-lh, var(--c-line-height-md));\n font-weight: var(--c-font-weight-regular);\n text-wrap: var(--text-text-wrap, var(--c-text-wrap));\n margin: 0;\n padding: 0;\n\n &:where([data-truncate]) {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n &:where([data-truncate='start']) {\n direction: rtl;\n text-align: end;\n\n @mixin where-rtl {\n direction: ltr;\n text-align: start;\n }\n }\n\n &:where([data-variant='gradient']) {\n background-image: var(--text-gradient);\n -webkit-text-fill-color: transparent;\n -webkit-background-clip: text;\n background-clip: text;\n }\n\n &:where([data-line-clamp]) {\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: var(--text-line-clamp);\n -webkit-box-orient: vertical;\n }\n\n &:where([data-inherit]) {\n line-height: inherit;\n font-weight: inherit;\n font-size: inherit;\n }\n\n &:where([data-inline]) {\n line-height: 1;\n }\n}\n"],"mappings":";;AAAA,IAAA,sBAAe,EAAC,QAAO,aAAY"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region packages/@cck-ui/core/src/components/transition/get-transition-props/get-transition-props.ts
|
|
3
|
+
const defaultTransition = {
|
|
4
|
+
duration: 100,
|
|
5
|
+
transition: "fade"
|
|
6
|
+
};
|
|
7
|
+
function getTransitionProps(transitionProps, componentTransition) {
|
|
8
|
+
return {
|
|
9
|
+
...defaultTransition,
|
|
10
|
+
...componentTransition,
|
|
11
|
+
...transitionProps
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { getTransitionProps };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=get-transition-props.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-transition-props.mjs","names":[],"sources":["../../../../src/components/transition/get-transition-props/get-transition-props.ts"],"sourcesContent":["import type { SetRequired } from 'type-fest'\nimport type { TransitionOverride } from '../transition.types'\n\ntype MinimalTransitionOverride = SetRequired<TransitionOverride, 'duration' | 'transition'>\n\nconst defaultTransition: MinimalTransitionOverride = {\n duration: 100,\n transition: 'fade',\n}\n\nexport function getTransitionProps(\n transitionProps: TransitionOverride | undefined,\n componentTransition: TransitionOverride | undefined\n): MinimalTransitionOverride {\n return { ...defaultTransition, ...componentTransition, ...transitionProps }\n}\n"],"mappings":";;AAKA,MAAM,oBAA+C;CACnD,UAAU;CACV,YAAY;AACd;AAEA,SAAgB,mBACd,iBACA,qBAC2B;CAC3B,OAAO;EAAE,GAAG;EAAmB,GAAG;EAAqB,GAAG;CAAgB;AAC5E"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { transitions } from "../transitions.mjs";
|
|
3
|
+
//#region packages/@cck-ui/core/src/components/transition/get-transition-styles/get-transition-styles.ts
|
|
4
|
+
const transitionStatuses = {
|
|
5
|
+
entering: "in",
|
|
6
|
+
entered: "in",
|
|
7
|
+
exiting: "out",
|
|
8
|
+
exited: "out",
|
|
9
|
+
"pre-exiting": "out",
|
|
10
|
+
"pre-entering": "out"
|
|
11
|
+
};
|
|
12
|
+
function getTransitionStyles({ transition, state, duration, timingFunction }) {
|
|
13
|
+
const shared = {
|
|
14
|
+
WebkitBackfaceVisibility: "hidden",
|
|
15
|
+
transitionDuration: `${duration}ms`,
|
|
16
|
+
transitionTimingFunction: timingFunction
|
|
17
|
+
};
|
|
18
|
+
if (typeof transition === "string") {
|
|
19
|
+
if (!(transition in transitions)) return {};
|
|
20
|
+
return {
|
|
21
|
+
transitionProperty: transitions[transition].transitionProperty,
|
|
22
|
+
...shared,
|
|
23
|
+
...transitions[transition].common,
|
|
24
|
+
...transitions[transition][transitionStatuses[state]]
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
transitionProperty: transition.transitionProperty,
|
|
29
|
+
...shared,
|
|
30
|
+
...transition.common,
|
|
31
|
+
...transition[transitionStatuses[state]]
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
export { getTransitionStyles };
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=get-transition-styles.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-transition-styles.mjs","names":[],"sources":["../../../../src/components/transition/get-transition-styles/get-transition-styles.ts"],"sourcesContent":["import { Properties } from 'csstype'\nimport { CTransition, transitions } from '../transitions'\n\nconst transitionStatuses = {\n entering: 'in',\n entered: 'in',\n exiting: 'out',\n exited: 'out',\n 'pre-exiting': 'out',\n 'pre-entering': 'out',\n} as const\n\nexport function getTransitionStyles({\n transition,\n state,\n duration,\n timingFunction,\n}: {\n transition: CTransition\n state: keyof typeof transitionStatuses\n duration: number\n timingFunction: Properties['transitionTimingFunction']\n}): Properties {\n const shared: Properties = {\n WebkitBackfaceVisibility: 'hidden',\n transitionDuration: `${duration}ms`,\n transitionTimingFunction: timingFunction,\n }\n\n if (typeof transition === 'string') {\n if (!(transition in transitions)) {\n return {}\n }\n\n return {\n transitionProperty: transitions[transition].transitionProperty,\n ...shared,\n ...transitions[transition].common,\n ...transitions[transition][transitionStatuses[state]],\n }\n }\n\n return {\n transitionProperty: transition.transitionProperty,\n ...shared,\n ...transition.common,\n ...transition[transitionStatuses[state]],\n }\n}\n"],"mappings":";;;AAGA,MAAM,qBAAqB;CACzB,UAAU;CACV,SAAS;CACT,SAAS;CACT,QAAQ;CACR,eAAe;CACf,gBAAgB;AAClB;AAEA,SAAgB,oBAAoB,EAClC,YACA,OACA,UACA,kBAMa;CACb,MAAM,SAAqB;EACzB,0BAA0B;EAC1B,oBAAoB,GAAG,SAAS;EAChC,0BAA0B;CAC5B;CAEA,IAAI,OAAO,eAAe,UAAU;EAClC,IAAI,EAAE,cAAc,cAClB,OAAO,CAAC;EAGV,OAAO;GACL,oBAAoB,YAAY,WAAW,CAAC;GAC5C,GAAG;GACH,GAAG,YAAY,WAAW,CAAC;GAC3B,GAAG,YAAY,WAAW,CAAC,mBAAmB;EAChD;CACF;CAEA,OAAO;EACL,oBAAoB,WAAW;EAC/B,GAAG;EACH,GAAG,WAAW;EACd,GAAG,WAAW,mBAAmB;CACnC;AACF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { withInstall } from "../../core/utils/vue/install.mjs";
|
|
3
|
+
import { transitions } from "./transitions.mjs";
|
|
4
|
+
import transition_default from "./transition.mjs";
|
|
5
|
+
import { getTransitionProps } from "./get-transition-props/get-transition-props.mjs";
|
|
6
|
+
//#region packages/@cck-ui/core/src/components/transition/index.ts
|
|
7
|
+
const CTransition = withInstall(transition_default);
|
|
8
|
+
//#endregion
|
|
9
|
+
export { transitions as CCK_TRANSITIONS, CTransition, CTransition as default, getTransitionProps };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["Transition"],"sources":["../../../src/components/transition/index.ts"],"sourcesContent":["import { SFCWithInstall, withInstall } from '../../core'\nimport Transition from './transition.vue'\nexport { transitions as CCK_TRANSITIONS } from './transitions'\nexport type { CTransition as CckTransition } from './transitions'\nexport { getTransitionProps } from './get-transition-props/get-transition-props'\n\nexport const CTransition: SFCWithInstall<typeof Transition> = withInstall(Transition)\nexport default CTransition\n\nexport * from './transition.types'\n"],"mappings":";;;;;;AAMA,MAAa,cAAiD,YAAYA,kBAAU"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import export_helper_default from "../../_virtual/_/plugin-vue/export-helper.mjs";
|
|
3
|
+
import { useCckEnv } from "../../core/config-provider/config-provider.context.mjs";
|
|
4
|
+
import { useTransition } from "./use-transition.mjs";
|
|
5
|
+
import { getTransitionStyles } from "./get-transition-styles/get-transition-styles.mjs";
|
|
6
|
+
import { computed, createCommentVNode, defineComponent, renderSlot, toRef } from "vue";
|
|
7
|
+
//#region packages/@cck-ui/core/src/components/transition/transition.vue
|
|
8
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
9
|
+
name: "CTransition",
|
|
10
|
+
__name: "transition",
|
|
11
|
+
props: {
|
|
12
|
+
keepMounted: {
|
|
13
|
+
type: Boolean,
|
|
14
|
+
required: false
|
|
15
|
+
},
|
|
16
|
+
keepMountedMode: {
|
|
17
|
+
type: String,
|
|
18
|
+
required: false,
|
|
19
|
+
default: "activity"
|
|
20
|
+
},
|
|
21
|
+
transition: {
|
|
22
|
+
type: [String, Object],
|
|
23
|
+
required: false,
|
|
24
|
+
default: "fade"
|
|
25
|
+
},
|
|
26
|
+
duration: {
|
|
27
|
+
type: Number,
|
|
28
|
+
required: false,
|
|
29
|
+
default: 250
|
|
30
|
+
},
|
|
31
|
+
exitDuration: {
|
|
32
|
+
type: Number,
|
|
33
|
+
required: false
|
|
34
|
+
},
|
|
35
|
+
timingFunction: {
|
|
36
|
+
type: String,
|
|
37
|
+
required: false,
|
|
38
|
+
default: "ease"
|
|
39
|
+
},
|
|
40
|
+
mounted: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
required: true
|
|
43
|
+
},
|
|
44
|
+
onExited: {
|
|
45
|
+
type: Function,
|
|
46
|
+
required: false
|
|
47
|
+
},
|
|
48
|
+
onExit: {
|
|
49
|
+
type: Function,
|
|
50
|
+
required: false
|
|
51
|
+
},
|
|
52
|
+
onEnter: {
|
|
53
|
+
type: Function,
|
|
54
|
+
required: false
|
|
55
|
+
},
|
|
56
|
+
onEntered: {
|
|
57
|
+
type: Function,
|
|
58
|
+
required: false
|
|
59
|
+
},
|
|
60
|
+
enterDelay: {
|
|
61
|
+
type: Number,
|
|
62
|
+
required: false
|
|
63
|
+
},
|
|
64
|
+
exitDelay: {
|
|
65
|
+
type: Number,
|
|
66
|
+
required: false
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
setup(__props, { expose: __expose }) {
|
|
70
|
+
__expose();
|
|
71
|
+
const props = __props;
|
|
72
|
+
const env = useCckEnv();
|
|
73
|
+
const mountedRef = toRef(props, "mounted");
|
|
74
|
+
const { transitionDuration, transitionStatus, transitionTimingFunction } = useTransition({
|
|
75
|
+
mounted: mountedRef,
|
|
76
|
+
exitDuration: props.exitDuration ?? props.duration,
|
|
77
|
+
duration: props.duration,
|
|
78
|
+
timingFunction: props.timingFunction,
|
|
79
|
+
onEnter: props.onEnter,
|
|
80
|
+
onEntered: props.onEntered,
|
|
81
|
+
onExit: props.onExit,
|
|
82
|
+
onExited: props.onExited,
|
|
83
|
+
enterDelay: props.enterDelay,
|
|
84
|
+
exitDelay: props.exitDelay
|
|
85
|
+
});
|
|
86
|
+
const __returned__ = {
|
|
87
|
+
props,
|
|
88
|
+
env,
|
|
89
|
+
mountedRef,
|
|
90
|
+
transitionDuration,
|
|
91
|
+
transitionStatus,
|
|
92
|
+
transitionTimingFunction,
|
|
93
|
+
shouldRenderSlot: computed(() => {
|
|
94
|
+
if (props.keepMounted) return true;
|
|
95
|
+
return transitionStatus.value !== "exited";
|
|
96
|
+
}),
|
|
97
|
+
computedStyles: computed(() => {
|
|
98
|
+
if (env === "test") return props.mounted ? {} : props.keepMounted ? { display: "none" } : void 0;
|
|
99
|
+
const dur = transitionDuration.value;
|
|
100
|
+
const status = transitionStatus.value;
|
|
101
|
+
if (dur === 0) {
|
|
102
|
+
if (props.keepMounted) return props.mounted ? {} : { display: "none" };
|
|
103
|
+
return props.mounted ? {} : void 0;
|
|
104
|
+
}
|
|
105
|
+
const isExited = status === "exited";
|
|
106
|
+
if (props.keepMounted) {
|
|
107
|
+
if (isExited) return { display: "none" };
|
|
108
|
+
return getTransitionStyles({
|
|
109
|
+
transition: props.transition,
|
|
110
|
+
duration: dur,
|
|
111
|
+
state: status,
|
|
112
|
+
timingFunction: transitionTimingFunction
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
return isExited ? void 0 : getTransitionStyles({
|
|
116
|
+
transition: props.transition,
|
|
117
|
+
duration: dur,
|
|
118
|
+
state: status,
|
|
119
|
+
timingFunction: transitionTimingFunction
|
|
120
|
+
});
|
|
121
|
+
})
|
|
122
|
+
};
|
|
123
|
+
Object.defineProperty(__returned__, "__isScriptSetup", {
|
|
124
|
+
enumerable: false,
|
|
125
|
+
value: true
|
|
126
|
+
});
|
|
127
|
+
return __returned__;
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
131
|
+
return $setup.shouldRenderSlot ? renderSlot(_ctx.$slots, "default", {
|
|
132
|
+
key: 0,
|
|
133
|
+
styles: $setup.computedStyles
|
|
134
|
+
}) : createCommentVNode("v-if", true);
|
|
135
|
+
}
|
|
136
|
+
var transition_default = /*#__PURE__*/ export_helper_default(_sfc_main, [["render", _sfc_render], ["__file", "/home/runner/work/cck-ui/cck-ui/packages/@cck-ui/core/src/components/transition/transition.vue"]]);
|
|
137
|
+
//#endregion
|
|
138
|
+
export { transition_default as default };
|
|
139
|
+
|
|
140
|
+
//# sourceMappingURL=transition.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transition.mjs","names":[],"sources":["../../../src/components/transition/transition.vue"],"sourcesContent":["<template>\n <template v-if=\"shouldRenderSlot\">\n <slot :styles=\"computedStyles\" />\n </template>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, toRef } from 'vue'\nimport { useCckEnv } from '../../core'\nimport { TransitionProps } from './transition.types'\nimport { useTransition } from './use-transition'\nimport { getTransitionStyles } from './get-transition-styles/get-transition-styles'\n\ndefineOptions({\n name: 'CTransition',\n})\n\nconst props = withDefaults(defineProps<TransitionProps>(), {\n keepMountedMode: 'activity',\n transition: 'fade',\n duration: 250,\n timingFunction: 'ease',\n})\n\nconst env = useCckEnv()\n\nconst mountedRef = toRef(props, 'mounted')\n\nconst { transitionDuration, transitionStatus, transitionTimingFunction } = useTransition({\n mounted: mountedRef,\n exitDuration: props.exitDuration ?? props.duration,\n duration: props.duration,\n timingFunction: props.timingFunction,\n onEnter: props.onEnter,\n onEntered: props.onEntered,\n onExit: props.onExit,\n onExited: props.onExited,\n enterDelay: props.enterDelay,\n exitDelay: props.exitDelay,\n})\n\nconst shouldRenderSlot = computed(() => {\n if (props.keepMounted) {\n return true\n }\n const status = transitionStatus.value\n return status !== 'exited'\n})\n\nconst computedStyles = computed(() => {\n if (env === 'test') {\n return props.mounted ? {} : props.keepMounted ? { display: 'none' } : undefined\n }\n\n const dur = transitionDuration.value\n const status = transitionStatus.value\n\n if (dur === 0) {\n if (props.keepMounted) {\n return props.mounted ? {} : { display: 'none' }\n }\n return props.mounted ? {} : undefined\n }\n\n const isExited = status === 'exited'\n\n if (props.keepMounted) {\n if (isExited) {\n return { display: 'none' }\n }\n\n return getTransitionStyles({\n transition: props.transition,\n duration: dur,\n state: status,\n timingFunction: transitionTimingFunction,\n })\n }\n\n return isExited\n ? undefined\n : getTransitionStyles({\n transition: props.transition,\n duration: dur,\n state: status,\n timingFunction: transitionTimingFunction,\n })\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBA,MAAM,QAAQ;EAOd,MAAM,MAAM,UAAU;EAEtB,MAAM,aAAa,MAAM,OAAO,SAAS;EAEzC,MAAM,EAAE,oBAAoB,kBAAkB,6BAA6B,cAAc;GACvF,SAAS;GACT,cAAc,MAAM,gBAAgB,MAAM;GAC1C,UAAU,MAAM;GAChB,gBAAgB,MAAM;GACtB,SAAS,MAAM;GACf,WAAW,MAAM;GACjB,QAAQ,MAAM;GACd,UAAU,MAAM;GAChB,YAAY,MAAM;GAClB,WAAW,MAAM;EACnB,CAAC;;;;;;;;qBAEwB,eAAe;IACtC,IAAI,MAAM,aACR,OAAO;IAGT,OADe,iBAAiB,UACd;GACpB,CAAA;mBAEuB,eAAe;IACpC,IAAI,QAAQ,QACV,OAAO,MAAM,UAAU,CAAC,IAAI,MAAM,cAAc,EAAE,SAAS,OAAO,IAAI,KAAA;IAGxE,MAAM,MAAM,mBAAmB;IAC/B,MAAM,SAAS,iBAAiB;IAEhC,IAAI,QAAQ,GAAG;KACb,IAAI,MAAM,aACR,OAAO,MAAM,UAAU,CAAC,IAAI,EAAE,SAAS,OAAO;KAEhD,OAAO,MAAM,UAAU,CAAC,IAAI,KAAA;IAC9B;IAEA,MAAM,WAAW,WAAW;IAE5B,IAAI,MAAM,aAAa;KACrB,IAAI,UACF,OAAO,EAAE,SAAS,OAAO;KAG3B,OAAO,oBAAoB;MACzB,YAAY,MAAM;MAClB,UAAU;MACV,OAAO;MACP,gBAAgB;KAClB,CAAC;IACH;IAEA,OAAO,WACH,KAAA,IACA,oBAAoB;KAClB,YAAY,MAAM;KAClB,UAAU;KACV,OAAO;KACP,gBAAgB;IAClB,CAAC;GACP,CAAA;;;;;;;;;;QAtFkB,OAAA,mBACd,WAAiC,KAAA,QAAA,WAAA;;EAA1B,QAAQ,OAAA"}
|