@cck-ui/core 0.20.0 → 0.20.2
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/action-icon/action-icon-group/action-icon-group.cjs +9 -6
- package/cjs/components/action-icon/action-icon-group/action-icon-group.cjs.map +1 -1
- package/cjs/components/action-icon/action-icon-group-section/action-icon-group-section.cjs +10 -8
- package/cjs/components/action-icon/action-icon-group-section/action-icon-group-section.cjs.map +1 -1
- package/cjs/components/action-icon/action-icon.cjs +9 -6
- package/cjs/components/action-icon/action-icon.cjs.map +1 -1
- package/cjs/components/alert/alert.cjs +9 -6
- package/cjs/components/alert/alert.cjs.map +1 -1
- package/cjs/components/aspect-ratio/aspect-ratio.cjs +9 -6
- package/cjs/components/aspect-ratio/aspect-ratio.cjs.map +1 -1
- package/cjs/components/button/button-group/button-group.cjs +9 -6
- package/cjs/components/button/button-group/button-group.cjs.map +1 -1
- package/cjs/components/button/button-group-section/button-group-section.cjs +9 -6
- package/cjs/components/button/button-group-section/button-group-section.cjs.map +1 -1
- package/cjs/components/button/button.cjs +9 -6
- package/cjs/components/button/button.cjs.map +1 -1
- package/cjs/components/center/center.cjs +9 -6
- package/cjs/components/center/center.cjs.map +1 -1
- package/cjs/components/close-button/close-button.cjs +9 -6
- package/cjs/components/close-button/close-button.cjs.map +1 -1
- package/cjs/components/container/container.cjs +9 -6
- package/cjs/components/container/container.cjs.map +1 -1
- package/cjs/components/empty-state/empty-state.cjs +9 -6
- package/cjs/components/empty-state/empty-state.cjs.map +1 -1
- package/cjs/components/flex/flex.cjs +9 -6
- package/cjs/components/flex/flex.cjs.map +1 -1
- package/cjs/components/grid/grid.cjs +9 -6
- package/cjs/components/grid/grid.cjs.map +1 -1
- package/cjs/components/group/group.cjs +9 -6
- package/cjs/components/group/group.cjs.map +1 -1
- package/cjs/components/image/image.cjs +9 -6
- package/cjs/components/image/image.cjs.map +1 -1
- package/cjs/components/loader/loader.cjs +9 -6
- package/cjs/components/loader/loader.cjs.map +1 -1
- package/cjs/components/paper/paper.cjs +9 -6
- package/cjs/components/paper/paper.cjs.map +1 -1
- package/cjs/components/semi-circle-progress/semi-circle-progress.cjs +9 -6
- package/cjs/components/semi-circle-progress/semi-circle-progress.cjs.map +1 -1
- package/cjs/components/simple-grid/simple-grid.cjs +9 -6
- package/cjs/components/simple-grid/simple-grid.cjs.map +1 -1
- package/cjs/components/skeleton/skeleton.cjs +10 -6
- package/cjs/components/skeleton/skeleton.cjs.map +1 -1
- package/cjs/components/space/space.cjs +9 -6
- package/cjs/components/space/space.cjs.map +1 -1
- package/cjs/components/splitter/splitter.cjs +9 -6
- package/cjs/components/splitter/splitter.cjs.map +1 -1
- package/cjs/components/stack/stack.cjs +9 -6
- package/cjs/components/stack/stack.cjs.map +1 -1
- package/cjs/components/text/text.cjs +9 -6
- package/cjs/components/text/text.cjs.map +1 -1
- package/cjs/components/unstyled-button/unstyled-button.cjs +9 -6
- package/cjs/components/unstyled-button/unstyled-button.cjs.map +1 -1
- package/cjs/core/styles-api/use-styles/use-styles.cjs +77 -70
- package/cjs/core/styles-api/use-styles/use-styles.cjs.map +1 -1
- package/cjs/core/styles-api/use-styles/use-transformed-styles.cjs +7 -4
- package/cjs/core/styles-api/use-styles/use-transformed-styles.cjs.map +1 -1
- package/esm/components/action-icon/action-icon-group/action-icon-group.mjs +9 -6
- package/esm/components/action-icon/action-icon-group/action-icon-group.mjs.map +1 -1
- package/esm/components/action-icon/action-icon-group-section/action-icon-group-section.mjs +10 -8
- package/esm/components/action-icon/action-icon-group-section/action-icon-group-section.mjs.map +1 -1
- package/esm/components/action-icon/action-icon.mjs +9 -6
- package/esm/components/action-icon/action-icon.mjs.map +1 -1
- package/esm/components/alert/alert.mjs +9 -6
- package/esm/components/alert/alert.mjs.map +1 -1
- package/esm/components/aspect-ratio/aspect-ratio.mjs +9 -6
- package/esm/components/aspect-ratio/aspect-ratio.mjs.map +1 -1
- package/esm/components/button/button-group/button-group.mjs +9 -6
- package/esm/components/button/button-group/button-group.mjs.map +1 -1
- package/esm/components/button/button-group-section/button-group-section.mjs +9 -6
- package/esm/components/button/button-group-section/button-group-section.mjs.map +1 -1
- package/esm/components/button/button.mjs +9 -6
- package/esm/components/button/button.mjs.map +1 -1
- package/esm/components/center/center.mjs +9 -6
- package/esm/components/center/center.mjs.map +1 -1
- package/esm/components/close-button/close-button.mjs +9 -6
- package/esm/components/close-button/close-button.mjs.map +1 -1
- package/esm/components/container/container.mjs +9 -6
- package/esm/components/container/container.mjs.map +1 -1
- package/esm/components/empty-state/empty-state.mjs +9 -6
- package/esm/components/empty-state/empty-state.mjs.map +1 -1
- package/esm/components/flex/flex.mjs +9 -6
- package/esm/components/flex/flex.mjs.map +1 -1
- package/esm/components/grid/grid.mjs +9 -6
- package/esm/components/grid/grid.mjs.map +1 -1
- package/esm/components/group/group.mjs +9 -6
- package/esm/components/group/group.mjs.map +1 -1
- package/esm/components/image/image.mjs +9 -6
- package/esm/components/image/image.mjs.map +1 -1
- package/esm/components/loader/loader.mjs +9 -6
- package/esm/components/loader/loader.mjs.map +1 -1
- package/esm/components/paper/paper.mjs +9 -6
- package/esm/components/paper/paper.mjs.map +1 -1
- package/esm/components/semi-circle-progress/semi-circle-progress.mjs +9 -6
- package/esm/components/semi-circle-progress/semi-circle-progress.mjs.map +1 -1
- package/esm/components/simple-grid/simple-grid.mjs +9 -6
- package/esm/components/simple-grid/simple-grid.mjs.map +1 -1
- package/esm/components/skeleton/skeleton.mjs +10 -6
- package/esm/components/skeleton/skeleton.mjs.map +1 -1
- package/esm/components/space/space.mjs +9 -6
- package/esm/components/space/space.mjs.map +1 -1
- package/esm/components/splitter/splitter.mjs +9 -6
- package/esm/components/splitter/splitter.mjs.map +1 -1
- package/esm/components/stack/stack.mjs +9 -6
- package/esm/components/stack/stack.mjs.map +1 -1
- package/esm/components/text/text.mjs +9 -6
- package/esm/components/text/text.mjs.map +1 -1
- package/esm/components/unstyled-button/unstyled-button.mjs +9 -6
- package/esm/components/unstyled-button/unstyled-button.mjs.map +1 -1
- package/esm/core/styles-api/use-styles/use-styles.mjs +77 -70
- package/esm/core/styles-api/use-styles/use-styles.mjs.map +1 -1
- package/esm/core/styles-api/use-styles/use-transformed-styles.mjs +7 -4
- package/esm/core/styles-api/use-styles/use-transformed-styles.mjs.map +1 -1
- package/lib/core/styles-api/use-styles/use-styles.d.ts +5 -4
- package/package.json +1 -1
|
@@ -338,15 +338,17 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
338
338
|
"autoContrast",
|
|
339
339
|
"attributes"
|
|
340
340
|
];
|
|
341
|
+
const styleProps = computed(() => ({
|
|
342
|
+
...props.value,
|
|
343
|
+
...attrs,
|
|
344
|
+
style: attrs.style ?? props.value.style
|
|
345
|
+
}));
|
|
341
346
|
const getStyles = useStyles({
|
|
342
347
|
name: "ButtonGroupSection",
|
|
343
|
-
props:
|
|
344
|
-
...props.value,
|
|
345
|
-
...attrs
|
|
346
|
-
},
|
|
348
|
+
props: styleProps,
|
|
347
349
|
classes: button_module_default,
|
|
348
|
-
className: props.value.className,
|
|
349
|
-
style: props.value.style,
|
|
350
|
+
className: () => props.value.className,
|
|
351
|
+
style: () => props.value.style,
|
|
350
352
|
classNames: props.value.classNames,
|
|
351
353
|
styles: props.value.styles,
|
|
352
354
|
unstyled: props.value.unstyled,
|
|
@@ -377,6 +379,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
377
379
|
rawProps,
|
|
378
380
|
props,
|
|
379
381
|
knownProps,
|
|
382
|
+
styleProps,
|
|
380
383
|
getStyles,
|
|
381
384
|
sectionAttrs,
|
|
382
385
|
mergedAttrs,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-group-section.mjs","names":[],"sources":["../../../../src/components/button/button-group-section/button-group-section.vue"],"sourcesContent":["<template>\n <c-box ref=\"_section\" v-bind=\"mergedAttrs\">\n <slot />\n </c-box>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs } from 'vue'\nimport { CBox, useComponentProps, useStyles } from '../../../core'\nimport type {\n ButtonGroupSectionFactory,\n ButtonGroupSectionProps,\n} from './button-group-section.types'\nimport classes from '../button.module.css'\nimport { varsResolver } from './button-group-section.utils'\n\ndefineOptions({\n name: 'CButtonGroupSection',\n})\n\nconst _section = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<ButtonGroupSectionProps>()\n\nconst props = useComponentProps({\n component: 'CButtonGroupSection',\n defaultProps: {\n variant: 'default',\n },\n props: rawProps,\n})\n\nconst knownProps = [\n 'className',\n 'style',\n 'classNames',\n 'styles',\n 'unstyled',\n 'vars',\n 'gradient',\n 'radius',\n 'autoContrast',\n 'attributes',\n]\n\nconst getStyles = useStyles<ButtonGroupSectionFactory>({\n name: 'ButtonGroupSection',\n props:
|
|
1
|
+
{"version":3,"file":"button-group-section.mjs","names":[],"sources":["../../../../src/components/button/button-group-section/button-group-section.vue"],"sourcesContent":["<template>\n <c-box ref=\"_section\" v-bind=\"mergedAttrs\">\n <slot />\n </c-box>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs } from 'vue'\nimport { CBox, CStyleProp, useComponentProps, useStyles } from '../../../core'\nimport type {\n ButtonGroupSectionFactory,\n ButtonGroupSectionProps,\n} from './button-group-section.types'\nimport classes from '../button.module.css'\nimport { varsResolver } from './button-group-section.utils'\n\ndefineOptions({\n name: 'CButtonGroupSection',\n})\n\nconst _section = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<ButtonGroupSectionProps>()\n\nconst props = useComponentProps({\n component: 'CButtonGroupSection',\n defaultProps: {\n variant: 'default',\n },\n props: rawProps,\n})\n\nconst knownProps = [\n 'className',\n 'style',\n 'classNames',\n 'styles',\n 'unstyled',\n 'vars',\n 'gradient',\n 'radius',\n 'autoContrast',\n 'attributes',\n]\n\nconst styleProps = computed(() => ({\n ...props.value,\n ...attrs,\n style: (attrs.style ?? props.value.style) as CStyleProp,\n}))\n\nconst getStyles = useStyles<ButtonGroupSectionFactory>({\n name: 'ButtonGroupSection',\n props: styleProps,\n classes,\n className: () => props.value.className,\n style: () => props.value.style,\n classNames: props.value.classNames,\n styles: props.value.styles,\n unstyled: props.value.unstyled,\n attributes: props.value.attributes,\n vars: props.value.vars,\n varsResolver,\n rootSelector: 'groupSection',\n})\n\nconst sectionAttrs = computed(() => getStyles('groupSection'))\nconst mergedAttrs = computed(() => {\n const others: Record<string, any> = {}\n const propsValue = props.value\n Object.keys(propsValue).forEach((key) => {\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 = [...(Array.isArray(userMod) ? userMod : [userMod].filter(Boolean))]\n return { ...others, mod: mergedMod, ...sectionAttrs.value }\n})\n\ndefineExpose({\n section: computed(() => _section.value?.root ?? null),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoBA,MAAM,WAAW,IAAsC,IAAI;EAE3D,MAAM,QAAQ,SAAS;EAEvB,MAAM,WAAW;EAEjB,MAAM,QAAQ,kBAAkB;GAC9B,WAAW;GACX,cAAc,EACZ,SAAS,UACX;GACA,OAAO;EACT,CAAC;EAED,MAAM,aAAa;GACjB;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;EAEA,MAAM,aAAa,gBAAgB;GACjC,GAAG,MAAM;GACT,GAAG;GACH,OAAQ,MAAM,SAAS,MAAM,MAAM;EACrC,EAAE;EAEF,MAAM,YAAY,UAAqC;GACrD,MAAM;GACN,OAAO;GACP,SAAA;GACA,iBAAiB,MAAM,MAAM;GAC7B,aAAa,MAAM,MAAM;GACzB,YAAY,MAAM,MAAM;GACxB,QAAQ,MAAM,MAAM;GACpB,UAAU,MAAM,MAAM;GACtB,YAAY,MAAM,MAAM;GACxB,MAAM,MAAM,MAAM;GAClB;GACA,cAAc;EAChB,CAAC;EAED,MAAM,eAAe,eAAe,UAAU,cAAc,CAAC;EAC7D,MAAM,cAAc,eAAe;GACjC,MAAM,SAA8B,CAAC;GACrC,MAAM,aAAa,MAAM;GACzB,OAAO,KAAK,UAAU,CAAC,CAAC,SAAS,QAAQ;IACvC,IAAI,CAAC,WAAW,SAAS,GAAG,GAC1B,OAAO,OAAO,WAAW;GAE7B,CAAC;GACD,MAAM,UAAU,MAAM,MAAM;GAC5B,MAAM,YAAY,CAAC,GAAI,MAAM,QAAQ,OAAO,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC,OAAO,OAAO,CAAE;GACpF,OAAO;IAAE,GAAG;IAAQ,KAAK;IAAW,GAAG,aAAa;GAAM;EAC5D,CAAC;EAED,SAAa,EACX,SAAS,eAAe,SAAS,OAAO,QAAQ,IAAI,EACtD,CAAC;;;;;;;;;;;;;;;;;;;;;;;qBAnFC,YAEQ,OAAA,SAFR,WAEQ,EAFD,KAAI,WAAU,GAAS,OAAA,WAAW,GAAA;yBAC/B,CAAR,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA"}
|
|
@@ -404,15 +404,17 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
404
404
|
"mod",
|
|
405
405
|
"attributes"
|
|
406
406
|
];
|
|
407
|
+
const styleProps = computed(() => ({
|
|
408
|
+
...props.value,
|
|
409
|
+
...attrs,
|
|
410
|
+
style: attrs.style ?? props.value.style
|
|
411
|
+
}));
|
|
407
412
|
const getStyles = useStyles({
|
|
408
413
|
name: "Button",
|
|
409
|
-
props:
|
|
410
|
-
...props.value,
|
|
411
|
-
...attrs
|
|
412
|
-
},
|
|
414
|
+
props: styleProps,
|
|
413
415
|
classes: button_module_default,
|
|
414
|
-
className: props.value.className,
|
|
415
|
-
style: props.value.style,
|
|
416
|
+
className: () => props.value.className,
|
|
417
|
+
style: () => props.value.style,
|
|
416
418
|
classNames: props.value.classNames,
|
|
417
419
|
styles: props.value.styles,
|
|
418
420
|
unstyled: props.value.unstyled,
|
|
@@ -462,6 +464,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
462
464
|
rawProps,
|
|
463
465
|
props,
|
|
464
466
|
knownProps,
|
|
467
|
+
styleProps,
|
|
465
468
|
getStyles,
|
|
466
469
|
modList,
|
|
467
470
|
rootAttrs,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.mjs","names":[],"sources":["../../../src/components/button/button.vue"],"sourcesContent":["<template>\n <unstyled-button\n ref=\"_root\"\n v-bind=\"mergedRootAttrs\"\n :disabled=\"disabled || loading\"\n :unstyled=\"unstyled\"\n >\n <c-transition\n v-if=\"typeof props.loading === 'boolean'\"\n :mounted=\"props.loading\"\n :transition=\"loaderTransition\"\n :duration=\"150\"\n >\n <template #default=\"{ styles }\">\n <c-box\n ref=\"_inner\"\n tag=\"span\"\n v-bind=\"getStyles('loader', { style: styles })\"\n aria-hidden=\"true\"\n >\n <c-loader\n color=\"var(--button-color)\"\n size=\"calc(var(--button-height) / 1.8)\"\n v-bind=\"props.loaderProps\"\n ></c-loader>\n </c-box>\n </template>\n </c-transition>\n\n <c-box tag=\"span\" v-bind=\"innerAttrs\">\n <c-box\n v-if=\"$slots['left-section']\"\n v-bind=\"sectionAttrs\"\n tag=\"span\"\n :mod=\"{ position: 'left' }\"\n >\n <slot name=\"left-section\"></slot>\n </c-box>\n <c-box v-else-if=\"leftSection\" v-bind=\"sectionAttrs\" tag=\"span\" :mod=\"{ position: 'left' }\">\n <!-- TODO -->\n <component :is=\"leftSection\" />\n </c-box>\n <c-box ref=\"_label\" v-bind=\"labelAttrs\" tag=\"span\" :mod=\"{ loading }\">\n <slot />\n </c-box>\n <c-box\n v-if=\"$slots['right-section']\"\n v-bind=\"sectionAttrs\"\n tag=\"span\"\n :mod=\"{ position: 'right' }\"\n >\n <slot name=\"right-section\"></slot>\n </c-box>\n <c-box v-else-if=\"rightSection\" v-bind=\"sectionAttrs\" tag=\"span\" :mod=\"{ position: 'right' }\">\n <!-- TODO -->\n <component :is=\"rightSection\" />\n </c-box>\n </c-box>\n </unstyled-button>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs, useSlots } from 'vue'\nimport { CBox, rem, useComponentProps, useStyles } from '../../core'\nimport { UnstyledButton } from '../unstyled-button'\nimport { ButtonFactory, type ButtonProps } from './button.types'\nimport { varsResolver } from './button.utils'\nimport classes from './button.module.css'\nimport { CLoader } from '../loader'\nimport { CTransition, CckTransition } from '../transition'\n\ndefineOptions({\n name: 'CButton',\n})\n\ndefineSlots<{\n 'left-section': any\n 'right-section': any\n default: any\n}>()\n\nconst _root = ref<InstanceType<typeof UnstyledButton> | null>(null)\nconst _inner = ref<HTMLSpanElement | null>(null)\nconst _label = ref<HTMLSpanElement | null>(null)\n\nconst attrs = useAttrs()\nconst slots = useSlots()\n\nconst hasLeftSlot = computed(() => !!slots['left-section'])\nconst hasRightSlot = computed(() => !!slots['right-section'])\n\nconst loaderTransition: CckTransition = {\n in: { opacity: 1, transform: `translate(-50%, calc(-50% + ${rem(1)}))` },\n out: { opacity: 0, transform: 'translate(-50%, -200%)' },\n common: { transformOrigin: 'center' },\n transitionProperty: 'transform, opacity',\n}\n\nconst rawProps = defineProps<ButtonProps>()\n\nconst props = useComponentProps({\n component: 'CButton',\n defaultProps: {},\n props: rawProps,\n})\n\nconst knownProps = [\n 'style',\n 'vars',\n 'className',\n 'color',\n 'disabled',\n 'leftSection',\n 'rightSection',\n 'fullWidth',\n 'radius',\n 'loading',\n 'loaderProps',\n 'gradient',\n 'classNames',\n 'styles',\n 'unstyled',\n 'dataDisabled',\n 'autoContrast',\n 'mod',\n 'attributes',\n]\n\nconst getStyles = useStyles<ButtonFactory>({\n name: 'Button',\n props:
|
|
1
|
+
{"version":3,"file":"button.mjs","names":[],"sources":["../../../src/components/button/button.vue"],"sourcesContent":["<template>\n <unstyled-button\n ref=\"_root\"\n v-bind=\"mergedRootAttrs\"\n :disabled=\"disabled || loading\"\n :unstyled=\"unstyled\"\n >\n <c-transition\n v-if=\"typeof props.loading === 'boolean'\"\n :mounted=\"props.loading\"\n :transition=\"loaderTransition\"\n :duration=\"150\"\n >\n <template #default=\"{ styles }\">\n <c-box\n ref=\"_inner\"\n tag=\"span\"\n v-bind=\"getStyles('loader', { style: styles })\"\n aria-hidden=\"true\"\n >\n <c-loader\n color=\"var(--button-color)\"\n size=\"calc(var(--button-height) / 1.8)\"\n v-bind=\"props.loaderProps\"\n ></c-loader>\n </c-box>\n </template>\n </c-transition>\n\n <c-box tag=\"span\" v-bind=\"innerAttrs\">\n <c-box\n v-if=\"$slots['left-section']\"\n v-bind=\"sectionAttrs\"\n tag=\"span\"\n :mod=\"{ position: 'left' }\"\n >\n <slot name=\"left-section\"></slot>\n </c-box>\n <c-box v-else-if=\"leftSection\" v-bind=\"sectionAttrs\" tag=\"span\" :mod=\"{ position: 'left' }\">\n <!-- TODO -->\n <component :is=\"leftSection\" />\n </c-box>\n <c-box ref=\"_label\" v-bind=\"labelAttrs\" tag=\"span\" :mod=\"{ loading }\">\n <slot />\n </c-box>\n <c-box\n v-if=\"$slots['right-section']\"\n v-bind=\"sectionAttrs\"\n tag=\"span\"\n :mod=\"{ position: 'right' }\"\n >\n <slot name=\"right-section\"></slot>\n </c-box>\n <c-box v-else-if=\"rightSection\" v-bind=\"sectionAttrs\" tag=\"span\" :mod=\"{ position: 'right' }\">\n <!-- TODO -->\n <component :is=\"rightSection\" />\n </c-box>\n </c-box>\n </unstyled-button>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs, useSlots } from 'vue'\nimport { CBox, CStyleProp, rem, useComponentProps, useStyles } from '../../core'\nimport { UnstyledButton } from '../unstyled-button'\nimport { ButtonFactory, type ButtonProps } from './button.types'\nimport { varsResolver } from './button.utils'\nimport classes from './button.module.css'\nimport { CLoader } from '../loader'\nimport { CTransition, CckTransition } from '../transition'\n\ndefineOptions({\n name: 'CButton',\n})\n\ndefineSlots<{\n 'left-section': any\n 'right-section': any\n default: any\n}>()\n\nconst _root = ref<InstanceType<typeof UnstyledButton> | null>(null)\nconst _inner = ref<HTMLSpanElement | null>(null)\nconst _label = ref<HTMLSpanElement | null>(null)\n\nconst attrs = useAttrs()\nconst slots = useSlots()\n\nconst hasLeftSlot = computed(() => !!slots['left-section'])\nconst hasRightSlot = computed(() => !!slots['right-section'])\n\nconst loaderTransition: CckTransition = {\n in: { opacity: 1, transform: `translate(-50%, calc(-50% + ${rem(1)}))` },\n out: { opacity: 0, transform: 'translate(-50%, -200%)' },\n common: { transformOrigin: 'center' },\n transitionProperty: 'transform, opacity',\n}\n\nconst rawProps = defineProps<ButtonProps>()\n\nconst props = useComponentProps({\n component: 'CButton',\n defaultProps: {},\n props: rawProps,\n})\n\nconst knownProps = [\n 'style',\n 'vars',\n 'className',\n 'color',\n 'disabled',\n 'leftSection',\n 'rightSection',\n 'fullWidth',\n 'radius',\n 'loading',\n 'loaderProps',\n 'gradient',\n 'classNames',\n 'styles',\n 'unstyled',\n 'dataDisabled',\n 'autoContrast',\n 'mod',\n 'attributes',\n]\n\nconst styleProps = computed(() => ({\n ...props.value,\n ...attrs,\n style: (attrs.style ?? props.value.style) as CStyleProp,\n}))\n\nconst getStyles = useStyles<ButtonFactory>({\n name: 'Button',\n props: styleProps,\n classes,\n className: () => props.value.className,\n style: () => props.value.style,\n classNames: props.value.classNames,\n styles: props.value.styles,\n unstyled: props.value.unstyled,\n attributes: props.value.attributes,\n vars: props.value.vars,\n varsResolver,\n})\n\nconst modList = computed(() => [\n {\n disabled: props.value.disabled || props.value.dataDisabled,\n },\n { loading: props.value.loading },\n { block: props.value.fullWidth },\n { 'with-left-section': hasLeftSlot.value || !!props.value.leftSection },\n { 'with-right-section': hasRightSlot.value || !!props.value.rightSection },\n])\n\nconst rootAttrs = computed(() =>\n getStyles('root', {\n active: !props.value.disabled && !props.value.loading && !props.value.dataDisabled,\n })\n)\nconst mergedRootAttrs = computed(() => {\n const others: Record<string, any> = {}\n const propsValue = props.value\n Object.keys(propsValue).forEach((key) => {\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 { ...others, mod: mergedMod, ...rootAttrs.value }\n})\n\nconst innerAttrs = computed(() => getStyles('inner'))\nconst sectionAttrs = computed(() => getStyles('section'))\nconst labelAttrs = computed(() => getStyles('label'))\n\ndefineExpose({\n root: computed(() => _root.value?.root ?? null),\n inner: _inner.value,\n label: _label.value,\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiFA,MAAM,QAAQ,IAAgD,IAAI;EAClE,MAAM,SAAS,IAA4B,IAAI;EAC/C,M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C,wBAAhB,OAAA,YAAY,CAAA,EAAA,CAAA"}
|
|
@@ -324,15 +324,17 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
324
324
|
"mod",
|
|
325
325
|
"attributes"
|
|
326
326
|
];
|
|
327
|
+
const styleProps = computed(() => ({
|
|
328
|
+
...props.value,
|
|
329
|
+
...attrs,
|
|
330
|
+
style: attrs.style ?? props.value.style
|
|
331
|
+
}));
|
|
327
332
|
const getStyles = useStyles({
|
|
328
333
|
name: "Center",
|
|
329
|
-
props:
|
|
330
|
-
...props.value,
|
|
331
|
-
...attrs
|
|
332
|
-
},
|
|
334
|
+
props: styleProps,
|
|
333
335
|
classes: center_module_default,
|
|
334
|
-
className: props.value.className,
|
|
335
|
-
style: props.value.style,
|
|
336
|
+
className: () => props.value.className,
|
|
337
|
+
style: () => props.value.style,
|
|
336
338
|
classNames: props.value.classNames,
|
|
337
339
|
styles: props.value.styles,
|
|
338
340
|
unstyled: props.value.unstyled,
|
|
@@ -362,6 +364,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
362
364
|
rawProps,
|
|
363
365
|
props,
|
|
364
366
|
knownProps,
|
|
367
|
+
styleProps,
|
|
365
368
|
getStyles,
|
|
366
369
|
modList,
|
|
367
370
|
rootAttrs,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"center.mjs","names":[],"sources":["../../../src/components/center/center.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 { CenterFactory, CenterProps } from './center.types'\nimport { CBox, useComponentProps, useStyles } from '../../core'\nimport classes from './center.module.css'\n\ndefineOptions({\n name: 'CCenter',\n})\n\nconst _root = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<CenterProps>()\n\nconst props = useComponentProps({\n component: 'CCenter',\n defaultProps: {},\n props: rawProps,\n})\n\nconst knownProps = [\n 'classNames',\n 'className',\n 'style',\n 'styles',\n 'unstyled',\n 'vars',\n 'inline',\n 'mod',\n 'attributes',\n]\n\nconst getStyles = useStyles<CenterFactory>({\n name: 'Center',\n props:
|
|
1
|
+
{"version":3,"file":"center.mjs","names":[],"sources":["../../../src/components/center/center.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 { CenterFactory, CenterProps } from './center.types'\nimport { CBox, CStyleProp, useComponentProps, useStyles } from '../../core'\nimport classes from './center.module.css'\n\ndefineOptions({\n name: 'CCenter',\n})\n\nconst _root = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<CenterProps>()\n\nconst props = useComponentProps({\n component: 'CCenter',\n defaultProps: {},\n props: rawProps,\n})\n\nconst knownProps = [\n 'classNames',\n 'className',\n 'style',\n 'styles',\n 'unstyled',\n 'vars',\n 'inline',\n 'mod',\n 'attributes',\n]\n\nconst styleProps = computed(() => ({\n ...props.value,\n ...attrs,\n style: (attrs.style ?? props.value.style) as CStyleProp,\n}))\n\nconst getStyles = useStyles<CenterFactory>({\n name: 'Center',\n props: styleProps,\n classes,\n className: () => props.value.className,\n style: () => props.value.style,\n classNames: props.value.classNames,\n styles: props.value.styles,\n unstyled: props.value.unstyled,\n attributes: props.value.attributes,\n vars: props.value.vars,\n})\n\nconst modList = computed(() => [{ inline: props.value.inline }])\n\nconst rootAttrs = computed(() => getStyles('root'))\n\nconst mergedAttrs = computed(() => {\n const others: Record<string, any> = {}\n const propsValue = props.value\n Object.keys(propsValue).forEach((key) => {\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 { ...others, mod: mergedMod, ...rootAttrs.value }\n})\n\ndefineExpose({\n root: computed(() => _root.value?.root ?? null),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBA,MAAM,QAAQ,IAAsC,IAAI;EAExD,MAAM,QAAQ,SAAS;EAEvB,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;EACF;EAEA,MAAM,aAAa,gBAAgB;GACjC,GAAG,MAAM;GACT,GAAG;GACH,OAAQ,MAAM,SAAS,MAAM,MAAM;EACrC,EAAE;EAEF,MAAM,YAAY,UAAyB;GACzC,MAAM;GACN,OAAO;GACP,SAAA;GACA,iBAAiB,MAAM,MAAM;GAC7B,aAAa,MAAM,MAAM;GACzB,YAAY,MAAM,MAAM;GACxB,QAAQ,MAAM,MAAM;GACpB,UAAU,MAAM,MAAM;GACtB,YAAY,MAAM,MAAM;GACxB,MAAM,MAAM,MAAM;EACpB,CAAC;EAED,MAAM,UAAU,eAAe,CAAC,EAAE,QAAQ,MAAM,MAAM,OAAO,CAAC,CAAC;EAE/D,MAAM,YAAY,eAAe,UAAU,MAAM,CAAC;EAElD,MAAM,cAAc,eAAe;GACjC,MAAM,SAA8B,CAAC;GACrC,MAAM,aAAa,MAAM;GACzB,OAAO,KAAK,UAAU,CAAC,CAAC,SAAS,QAAQ;IACvC,IAAI,CAAC,WAAW,SAAS,GAAG,GAC1B,OAAO,OAAO,WAAW;GAE7B,CAAC;GACD,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;IAAE,GAAG;IAAQ,KAAK;IAAW,GAAG,UAAU;GAAM;EACzD,CAAC;EAED,SAAa,EACX,MAAM,eAAe,MAAM,OAAO,QAAQ,IAAI,EAChD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;qBAhFC,YAEQ,OAAA,SAFR,WAEQ,EAFD,KAAI,QAAO,GAAS,OAAA,WAAW,GAAA;yBAC5B,CAAR,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA"}
|
|
@@ -356,16 +356,18 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
356
356
|
"attributes",
|
|
357
357
|
"__staticSelector"
|
|
358
358
|
];
|
|
359
|
+
const styleProps = computed(() => ({
|
|
360
|
+
...props.value,
|
|
361
|
+
...attrs,
|
|
362
|
+
style: attrs.style ?? props.value.style
|
|
363
|
+
}));
|
|
359
364
|
const getStyles = useStyles({
|
|
360
365
|
name: props.value.__staticSelector || "CloseButton",
|
|
361
|
-
props:
|
|
362
|
-
...props.value,
|
|
363
|
-
...attrs
|
|
364
|
-
},
|
|
366
|
+
props: styleProps,
|
|
365
367
|
classes: close_button_module_default,
|
|
366
|
-
className: props.value.className,
|
|
368
|
+
className: () => props.value.className,
|
|
367
369
|
classNames: props.value.classNames,
|
|
368
|
-
style: props.value.style,
|
|
370
|
+
style: () => props.value.style,
|
|
369
371
|
styles: props.value.styles,
|
|
370
372
|
unstyled: props.value.unstyled,
|
|
371
373
|
attributes: props.value.attributes,
|
|
@@ -397,6 +399,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
397
399
|
defaultProps,
|
|
398
400
|
props,
|
|
399
401
|
knownProps,
|
|
402
|
+
styleProps,
|
|
400
403
|
getStyles,
|
|
401
404
|
modList,
|
|
402
405
|
rootAttrs,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"close-button.mjs","names":[],"sources":["../../../src/components/close-button/close-button.vue"],"sourcesContent":["<template>\n <unstyled-button\n ref=\"_root\"\n v-bind=\"mergedAttrs\"\n :disabled=\"props.disabled || props.dataDisabled\"\n :unstyled=\"props.unstyled\"\n :variant=\"props.variant\"\n >\n <slot name=\"icon\">\n <close-icon></close-icon>\n </slot>\n <slot />\n </unstyled-button>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs } from 'vue'\nimport { CloseButtonFactory, CloseButtonProps } from './close-button.types'\nimport UnstyledButton from '../unstyled-button'\nimport CloseIcon from './close-icon.vue'\nimport classes from './close-button.module.css'\nimport { useComponentProps, useStyles } from '../../core'\nimport { varsResolver } from './close-button.utils'\n\ndefineOptions({\n name: 'CCloseButton',\n})\n\ndefineSlots<{\n icon: any\n default: any\n}>()\n\nconst _root = ref<InstanceType<typeof UnstyledButton> | null>(null)\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<CloseButtonProps>()\n\nconst defaultProps = {\n variant: 'subtle',\n} satisfies Partial<CloseButtonProps>\n\nconst props = useComponentProps({\n component: 'CCloseButton',\n defaultProps,\n props: rawProps,\n})\n\nconst knownProps = [\n 'iconSize',\n 'vars',\n 'radius',\n 'className',\n 'classNames',\n 'style',\n 'styles',\n 'unstyled',\n 'dataDisabled',\n 'disabled',\n 'variant',\n 'mod',\n 'attributes',\n '__staticSelector',\n]\n\nconst getStyles = useStyles<CloseButtonFactory>({\n name: props.value.__staticSelector || 'CloseButton',\n props:
|
|
1
|
+
{"version":3,"file":"close-button.mjs","names":[],"sources":["../../../src/components/close-button/close-button.vue"],"sourcesContent":["<template>\n <unstyled-button\n ref=\"_root\"\n v-bind=\"mergedAttrs\"\n :disabled=\"props.disabled || props.dataDisabled\"\n :unstyled=\"props.unstyled\"\n :variant=\"props.variant\"\n >\n <slot name=\"icon\">\n <close-icon></close-icon>\n </slot>\n <slot />\n </unstyled-button>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs } from 'vue'\nimport { CloseButtonFactory, CloseButtonProps } from './close-button.types'\nimport UnstyledButton from '../unstyled-button'\nimport CloseIcon from './close-icon.vue'\nimport classes from './close-button.module.css'\nimport { CStyleProp, useComponentProps, useStyles } from '../../core'\nimport { varsResolver } from './close-button.utils'\n\ndefineOptions({\n name: 'CCloseButton',\n})\n\ndefineSlots<{\n icon: any\n default: any\n}>()\n\nconst _root = ref<InstanceType<typeof UnstyledButton> | null>(null)\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<CloseButtonProps>()\n\nconst defaultProps = {\n variant: 'subtle',\n} satisfies Partial<CloseButtonProps>\n\nconst props = useComponentProps({\n component: 'CCloseButton',\n defaultProps,\n props: rawProps,\n})\n\nconst knownProps = [\n 'iconSize',\n 'vars',\n 'radius',\n 'className',\n 'classNames',\n 'style',\n 'styles',\n 'unstyled',\n 'dataDisabled',\n 'disabled',\n 'variant',\n 'mod',\n 'attributes',\n '__staticSelector',\n]\n\nconst styleProps = computed(() => ({\n ...props.value,\n ...attrs,\n style: (attrs.style ?? props.value.style) as CStyleProp,\n}))\n\nconst getStyles = useStyles<CloseButtonFactory>({\n name: props.value.__staticSelector || 'CloseButton',\n props: styleProps,\n classes,\n className: () => props.value.className,\n classNames: props.value.classNames,\n style: () => props.value.style,\n styles: props.value.styles,\n unstyled: props.value.unstyled,\n attributes: props.value.attributes,\n vars: props.value.vars,\n varsResolver,\n})\n\nconst modList = computed(() => [\n {\n disabled: props.value.disabled || props.value.dataDisabled,\n },\n])\n\nconst rootAttrs = computed(() =>\n getStyles('root', {\n variant: props.value.variant,\n active: !props.value.disabled && !props.value.dataDisabled,\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 { ...others, mod: mergedMod, ...rootAttrs.value }\n})\n\ndefineExpose({\n root: computed(() => _root.value?.root ?? null),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiCA,MAAM,QAAQ,IAAgD,IAAI;EAElE,MAAM,QAAQ,SAAS;EAEvB,MAAM,WAAW;EAEjB,MAAM,eAAe,EACnB,SAAS,SACX;EAEA,MAAM,QAAQ,kBAAkB;GAC9B,WAAW;GACX;GACA,OAAO;EACT,CAAC;EAED,MAAM,aAAa;GACjB;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;EAEA,MAAM,aAAa,gBAAgB;GACjC,GAAG,MAAM;GACT,GAAG;GACH,OAAQ,MAAM,SAAS,MAAM,MAAM;EACrC,EAAE;EAEF,MAAM,YAAY,UAA8B;GAC9C,MAAM,MAAM,MAAM,oBAAoB;GACtC,OAAO;GACP,SAAA;GACA,iBAAiB,MAAM,MAAM;GAC7B,YAAY,MAAM,MAAM;GACxB,aAAa,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
|
|
341
341
|
];
|
|
342
|
+
const styleProps = computed(() => ({
|
|
343
|
+
...props.value,
|
|
344
|
+
...attrs,
|
|
345
|
+
style: attrs.style ?? props.value.style
|
|
346
|
+
}));
|
|
342
347
|
const modList = computed(() => [{
|
|
343
348
|
fluid: props.value.fluid,
|
|
344
349
|
strategy: props.value.strategy
|
|
345
350
|
}]);
|
|
346
351
|
const getStyles = useStyles({
|
|
347
352
|
name: "Container",
|
|
348
|
-
props:
|
|
349
|
-
...props.value,
|
|
350
|
-
...attrs
|
|
351
|
-
},
|
|
353
|
+
props: styleProps,
|
|
352
354
|
classes: container_module_default,
|
|
353
|
-
className: props.value.className,
|
|
354
|
-
style: props.value.style,
|
|
355
|
+
className: () => props.value.className,
|
|
356
|
+
style: () => props.value.style,
|
|
355
357
|
classNames: props.value.classNames,
|
|
356
358
|
styles: props.value.styles,
|
|
357
359
|
unstyled: props.value.unstyled,
|
|
@@ -380,6 +382,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
380
382
|
defaultProps,
|
|
381
383
|
props,
|
|
382
384
|
knownProps,
|
|
385
|
+
styleProps,
|
|
383
386
|
modList,
|
|
384
387
|
getStyles,
|
|
385
388
|
rootAttrs,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container.mjs","names":[],"sources":["../../../src/components/container/container.vue"],"sourcesContent":["<template>\n <c-box ref=\"_root\" v-bind=\"mergedRootAttrs\">\n <slot />\n </c-box>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs } from 'vue'\nimport { CBox, useComponentProps, useStyles } from '../../core'\nimport { ContainerFactory, ContainerProps } from './container.types'\nimport { varsResolver } from './container.utils'\nimport classes from './container.module.css'\n\ndefineOptions({\n name: 'CContainer',\n})\n\nconst _root = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<ContainerProps>()\n\nconst defaultProps = {\n strategy: 'block',\n} satisfies Partial<ContainerProps>\n\nconst props = useComponentProps({\n component: 'CContainer',\n defaultProps,\n props: rawProps,\n})\n\nconst knownProps = [\n 'classNames',\n 'className',\n 'style',\n 'styles',\n 'unstyled',\n 'vars',\n 'fluid',\n 'mod',\n 'attributes',\n 'strategy',\n]\n\nconst modList = computed(() => [{ fluid: props.value.fluid, strategy: props.value.strategy }])\n\nconst getStyles = useStyles<ContainerFactory>({\n name: 'Container',\n props:
|
|
1
|
+
{"version":3,"file":"container.mjs","names":[],"sources":["../../../src/components/container/container.vue"],"sourcesContent":["<template>\n <c-box ref=\"_root\" v-bind=\"mergedRootAttrs\">\n <slot />\n </c-box>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs } from 'vue'\nimport { CBox, CStyleProp, useComponentProps, useStyles } from '../../core'\nimport { ContainerFactory, ContainerProps } from './container.types'\nimport { varsResolver } from './container.utils'\nimport classes from './container.module.css'\n\ndefineOptions({\n name: 'CContainer',\n})\n\nconst _root = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<ContainerProps>()\n\nconst defaultProps = {\n strategy: 'block',\n} satisfies Partial<ContainerProps>\n\nconst props = useComponentProps({\n component: 'CContainer',\n defaultProps,\n props: rawProps,\n})\n\nconst knownProps = [\n 'classNames',\n 'className',\n 'style',\n 'styles',\n 'unstyled',\n 'vars',\n 'fluid',\n 'mod',\n 'attributes',\n 'strategy',\n]\n\nconst styleProps = computed(() => ({\n ...props.value,\n ...attrs,\n style: (attrs.style ?? props.value.style) as CStyleProp,\n}))\n\nconst modList = computed(() => [{ fluid: props.value.fluid, strategy: props.value.strategy }])\n\nconst getStyles = useStyles<ContainerFactory>({\n name: 'Container',\n props: styleProps,\n classes,\n className: () => props.value.className,\n style: () => props.value.style,\n classNames: props.value.classNames,\n styles: props.value.styles,\n unstyled: props.value.unstyled,\n attributes: props.value.attributes,\n vars: props.value.vars,\n varsResolver,\n})\n\nconst rootAttrs = computed(() => getStyles('root'))\n\nconst mergedRootAttrs = 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 { ...others, mod: mergedMod, ...rootAttrs.value }\n})\n\ndefineExpose({\n root: computed(() => _root.value?.root ?? null),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBA,MAAM,QAAQ,IAAsC,IAAI;EAExD,MAAM,QAAQ,SAAS;EAEvB,MAAM,WAAW;EAEjB,MAAM,eAAe,EACnB,UAAU,QACZ;EAEA,MAAM,QAAQ,kBAAkB;GAC9B,WAAW;GACX;GACA,OAAO;EACT,CAAC;EAED,MAAM,aAAa;GACjB;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;EAEA,MAAM,aAAa,gBAAgB;GACjC,GAAG,MAAM;GACT,GAAG;GACH,OAAQ,MAAM,SAAS,MAAM,MAAM;EACrC,EAAE;EAEF,MAAM,UAAU,eAAe,CAAC;GAAE,OAAO,MAAM,MAAM;GAAO,UAAU,MAAM,MAAM;EAAS,CAAC,CAAC;EAE7F,MAAM,YAAY,UAA4B;GAC5C,MAAM;GACN,OAAO;GACP,SAAA;GACA,iBAAiB,MAAM,MAAM;GAC7B,aAAa,MAAM,MAAM;GACzB,YAAY,MAAM,MAAM;GACxB,QAAQ,MAAM,MAAM;GACpB,UAAU,MAAM,MAAM;GACtB,YAAY,MAAM,MAAM;GACxB,MAAM,MAAM,MAAM;GAClB;EACF,CAAC;EAED,MAAM,YAAY,eAAe,UAAU,MAAM,CAAC;EAElD,MAAM,kBAAkB,eAAe;GACrC,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;IAAE,GAAG;IAAQ,KAAK;IAAW,GAAG,UAAU;GAAM;EACzD,CAAC;EAED,SAAa,EACX,MAAM,eAAe,MAAM,OAAO,QAAQ,IAAI,EAChD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;qBAvFC,YAEQ,OAAA,SAFR,WAEQ,EAFD,KAAI,QAAO,GAAS,OAAA,eAAe,GAAA;yBAChC,CAAR,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA"}
|
|
@@ -356,15 +356,17 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
356
356
|
"attributes"
|
|
357
357
|
];
|
|
358
358
|
const modList = computed(() => [{ align: props.value.align }]);
|
|
359
|
+
const styleProps = computed(() => ({
|
|
360
|
+
...props.value,
|
|
361
|
+
...attrs,
|
|
362
|
+
style: attrs.style ?? props.value.style
|
|
363
|
+
}));
|
|
359
364
|
const getStyles = useStyles({
|
|
360
365
|
name: "EmptyState",
|
|
361
366
|
classes: empty_state_module_default,
|
|
362
|
-
props:
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
},
|
|
366
|
-
className: props.value.className,
|
|
367
|
-
style: props.value.style,
|
|
367
|
+
props: styleProps,
|
|
368
|
+
className: () => props.value.className,
|
|
369
|
+
style: () => props.value.style,
|
|
368
370
|
classNames: props.value.classNames,
|
|
369
371
|
styles: props.value.styles,
|
|
370
372
|
unstyled: props.value.unstyled,
|
|
@@ -404,6 +406,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
404
406
|
props,
|
|
405
407
|
knownProps,
|
|
406
408
|
modList,
|
|
409
|
+
styleProps,
|
|
407
410
|
getStyles,
|
|
408
411
|
withIndicatorBackground,
|
|
409
412
|
hasBodyContent,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"empty-state.mjs","names":[],"sources":["../../../src/components/empty-state/empty-state.vue"],"sourcesContent":["<template>\n <c-box ref=\"_root\" v-bind=\"mergedRootAttrs\" :variant=\"props.variant\">\n <empty-state-indicator v-if=\"$slots.icon\">\n <slot name=\"icon\" />\n </empty-state-indicator>\n <c-box v-if=\"hasBodyContent\" v-bind=\"bodyAttrs\">\n <empty-state-title v-if=\"$slots.title\" :order=\"props.order\">\n <slot name=\"title\" />\n </empty-state-title>\n <empty-state-description v-if=\"$slots.description\">\n <slot name=\"description\" />\n </empty-state-description>\n <slot />\n <empty-state-actions v-if=\"$slots.actions\">\n <slot name=\"actions\" />\n </empty-state-actions>\n </c-box>\n </c-box>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs, useSlots } from 'vue'\nimport { CBox, useComponentProps, useStyles } from '../../core'\nimport { EmptyStateFactory, EmptyStateProps } from './empty-state.types'\nimport classes from './empty-state.module.css'\nimport { varsResolver } from './empty-state.utils'\nimport { provideEmptyStateContext } from './empty-state.context'\nimport EmptyStateActions from './empty-state-actions/empty-state-actions.vue'\nimport EmptyStateDescription from './empty-state-description/empty-state-description.vue'\nimport EmptyStateIndicator from './empty-state-indicator/empty-state-indicator.vue'\nimport EmptyStateTitle from './empty-state-title/empty-state-title.vue'\n\ndefineOptions({\n name: 'CEmptyState',\n})\n\ndefineSlots<{\n actions: any\n default: any\n description: any\n icon: any\n title: any\n}>()\n\nconst _root = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\nconst slots = useSlots()\n\nconst rawProps = defineProps<EmptyStateProps>()\n\nconst defaultProps = {\n size: 'md',\n align: 'center',\n} satisfies Partial<EmptyStateProps>\n\nconst props = useComponentProps({\n component: 'CEmptyState',\n defaultProps,\n props: rawProps,\n})\n\nconst knownProps = [\n 'classNames',\n 'className',\n 'style',\n 'styles',\n 'unstyled',\n 'vars',\n 'align',\n 'variant',\n 'color',\n 'order',\n 'withIndicatorBackground',\n 'mod',\n 'attributes',\n]\n\nconst modList = computed(() => [\n {\n align: props.value.align,\n },\n])\n\nconst getStyles = useStyles<EmptyStateFactory>({\n name: 'EmptyState',\n classes,\n props:
|
|
1
|
+
{"version":3,"file":"empty-state.mjs","names":[],"sources":["../../../src/components/empty-state/empty-state.vue"],"sourcesContent":["<template>\n <c-box ref=\"_root\" v-bind=\"mergedRootAttrs\" :variant=\"props.variant\">\n <empty-state-indicator v-if=\"$slots.icon\">\n <slot name=\"icon\" />\n </empty-state-indicator>\n <c-box v-if=\"hasBodyContent\" v-bind=\"bodyAttrs\">\n <empty-state-title v-if=\"$slots.title\" :order=\"props.order\">\n <slot name=\"title\" />\n </empty-state-title>\n <empty-state-description v-if=\"$slots.description\">\n <slot name=\"description\" />\n </empty-state-description>\n <slot />\n <empty-state-actions v-if=\"$slots.actions\">\n <slot name=\"actions\" />\n </empty-state-actions>\n </c-box>\n </c-box>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs, useSlots } from 'vue'\nimport { CBox, CStyleProp, useComponentProps, useStyles } from '../../core'\nimport { EmptyStateFactory, EmptyStateProps } from './empty-state.types'\nimport classes from './empty-state.module.css'\nimport { varsResolver } from './empty-state.utils'\nimport { provideEmptyStateContext } from './empty-state.context'\nimport EmptyStateActions from './empty-state-actions/empty-state-actions.vue'\nimport EmptyStateDescription from './empty-state-description/empty-state-description.vue'\nimport EmptyStateIndicator from './empty-state-indicator/empty-state-indicator.vue'\nimport EmptyStateTitle from './empty-state-title/empty-state-title.vue'\n\ndefineOptions({\n name: 'CEmptyState',\n})\n\ndefineSlots<{\n actions: any\n default: any\n description: any\n icon: any\n title: any\n}>()\n\nconst _root = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\nconst slots = useSlots()\n\nconst rawProps = defineProps<EmptyStateProps>()\n\nconst defaultProps = {\n size: 'md',\n align: 'center',\n} satisfies Partial<EmptyStateProps>\n\nconst props = useComponentProps({\n component: 'CEmptyState',\n defaultProps,\n props: rawProps,\n})\n\nconst knownProps = [\n 'classNames',\n 'className',\n 'style',\n 'styles',\n 'unstyled',\n 'vars',\n 'align',\n 'variant',\n 'color',\n 'order',\n 'withIndicatorBackground',\n 'mod',\n 'attributes',\n]\n\nconst modList = computed(() => [\n {\n align: props.value.align,\n },\n])\n\nconst styleProps = computed(() => ({\n ...props.value,\n ...attrs,\n style: (attrs.style ?? props.value.style) as CStyleProp,\n}))\n\nconst getStyles = useStyles<EmptyStateFactory>({\n name: 'EmptyState',\n classes,\n props: styleProps,\n className: () => props.value.className,\n style: () => props.value.style,\n classNames: props.value.classNames,\n styles: props.value.styles,\n unstyled: props.value.unstyled,\n attributes: props.value.attributes,\n vars: props.value.vars,\n varsResolver,\n})\n\nconst withIndicatorBackground = computed(\n () => props.value.withIndicatorBackground || !!props.value.variant\n)\n\nprovideEmptyStateContext({\n getStyles,\n withIndicatorBackground,\n})\n\nconst hasBodyContent = computed(() => {\n return !!(slots.actions || slots.default || slots.description || slots.title)\n})\n\nconst rootAttrs = computed(() => getStyles('root', { variant: props.value.variant }))\nconst bodyAttrs = computed(() => getStyles('body'))\n\nconst mergedRootAttrs = 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 { ...others, mod: mergedMod, ...rootAttrs.value }\n})\n\ndefineExpose({\n root: computed(() => _root.value?.root ?? null),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4CA,MAAM,QAAQ,IAAsC,IAAI;EAExD,MAAM,QAAQ,SAAS;EACvB,MAAM,QAAQ,SAAS;EAEvB,MAAM,WAAW;EAEjB,MAAM,eAAe;GACnB,MAAM;GACN,OAAO;EACT;EAEA,MAAM,QAAQ,kBAAkB;GAC9B,WAAW;GACX;GACA,OAAO;EACT,CAAC;EAED,MAAM,aAAa;GACjB;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;EAEA,MAAM,UAAU,eAAe,CAC7B,EACE,OAAO,MAAM,MAAM,MACrB,CACF,CAAC;EAED,MAAM,aAAa,gBAAgB;GACjC,GAAG,MAAM;GACT,GAAG;GACH,OAAQ,MAAM,SAAS,MAAM,MAAM;EACrC,EAAE;EAEF,MAAM,YAAY,UAA6B;GAC7C,MAAM;GACN,SAAA;GACA,OAAO;GACP,iBAAiB,MAAM,MAAM;GAC7B,aAAa,MAAM,MAAM;GACzB,YAAY,MAAM,MAAM;GACxB,QAAQ,MAAM,MAAM;GACpB,UAAU,MAA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WAAA,EAAA,KAAA,EAAA,GAX6B,OAAA,SAAS,CAAA,GAAA;0BAGxB;IAFK,KAAA,OAAO,SAAA,UAAA,GAAhC,YAEoB,OAAA,oBAAA;;KAFoB,OAAO,OAAA,MAAM;;4BAC9B,CAArB,WAAqB,KAAA,QAAA,OAAA,CAAA,CAAA;;;IAEQ,KAAA,OAAO,eAAA,UAAA,GAAtC,YAE0B,OAAA,0BAAA,EAAA,KAAA,EAAA,GAAA;4BADG,CAA3B,WAA2B,KAAA,QAAA,aAAA,CAAA,CAAA;;;IAE7B,WAAQ,KAAA,QAAA,SAAA;IACmB,KAAA,OAAO,WAAA,UAAA,GAAlC,YAEsB,OAAA,sBAAA,EAAA,KAAA,EAAA,GAAA;4BADG,CAAvB,WAAuB,KAAA,QAAA,SAAA,CAAA,CAAA"}
|
|
@@ -361,15 +361,17 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
361
361
|
"direction",
|
|
362
362
|
"attributes"
|
|
363
363
|
];
|
|
364
|
+
const styleProps = computed(() => ({
|
|
365
|
+
...props.value,
|
|
366
|
+
...attrs,
|
|
367
|
+
style: attrs.style ?? props.value.style
|
|
368
|
+
}));
|
|
364
369
|
const getStyles = useStyles({
|
|
365
370
|
name: "Flex",
|
|
366
371
|
classes: flex_module_default,
|
|
367
|
-
props:
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
},
|
|
371
|
-
className: props.value.className,
|
|
372
|
-
style: props.value.style,
|
|
372
|
+
props: styleProps,
|
|
373
|
+
className: () => props.value.className,
|
|
374
|
+
style: () => props.value.style,
|
|
373
375
|
classNames: props.value.classNames,
|
|
374
376
|
styles: props.value.styles,
|
|
375
377
|
unstyled: props.value.unstyled,
|
|
@@ -443,6 +445,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
443
445
|
rawProps,
|
|
444
446
|
props,
|
|
445
447
|
knownProps,
|
|
448
|
+
styleProps,
|
|
446
449
|
getStyles,
|
|
447
450
|
theme,
|
|
448
451
|
randomClassName,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flex.mjs","names":[],"sources":["../../../src/components/flex/flex.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, onUnmounted, ref, useAttrs, watchEffect } from 'vue'\nimport {\n CBox,\n filterProps,\n hashStyleProps,\n parseStyleProps,\n responsiveStyleManager,\n stylesToString,\n useCckTheme,\n useComponentProps,\n useRandomClassName,\n useStyles,\n} from '../../core'\nimport classes from './flex.module.css'\nimport { FlexFactory, FlexProps } from './flex.types'\nimport { FLEX_STYLE_PROPS_DATA } from './flex-props'\n\ndefineOptions({\n name: 'CFlex',\n})\n\nconst _root = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<FlexProps>()\n\nconst props = useComponentProps({\n component: 'CFlex',\n defaultProps: {},\n props: rawProps,\n})\n\nconst knownProps = [\n 'classNames',\n 'className',\n 'style',\n 'styles',\n 'unstyled',\n 'vars',\n 'gap',\n 'rowGap',\n 'columnGap',\n 'align',\n 'justify',\n 'wrap',\n 'direction',\n 'attributes',\n]\n\nconst getStyles = useStyles<FlexFactory>({\n name: 'Flex',\n classes,\n props:
|
|
1
|
+
{"version":3,"file":"flex.mjs","names":[],"sources":["../../../src/components/flex/flex.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, onUnmounted, ref, useAttrs, watchEffect } from 'vue'\nimport {\n CBox,\n CStyleProp,\n filterProps,\n hashStyleProps,\n parseStyleProps,\n responsiveStyleManager,\n stylesToString,\n useCckTheme,\n useComponentProps,\n useRandomClassName,\n useStyles,\n} from '../../core'\nimport classes from './flex.module.css'\nimport { FlexFactory, FlexProps } from './flex.types'\nimport { FLEX_STYLE_PROPS_DATA } from './flex-props'\n\ndefineOptions({\n name: 'CFlex',\n})\n\nconst _root = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<FlexProps>()\n\nconst props = useComponentProps({\n component: 'CFlex',\n defaultProps: {},\n props: rawProps,\n})\n\nconst knownProps = [\n 'classNames',\n 'className',\n 'style',\n 'styles',\n 'unstyled',\n 'vars',\n 'gap',\n 'rowGap',\n 'columnGap',\n 'align',\n 'justify',\n 'wrap',\n 'direction',\n 'attributes',\n]\n\nconst styleProps = computed(() => ({\n ...props.value,\n ...attrs,\n style: (attrs.style ?? props.value.style) as CStyleProp,\n}))\n\nconst getStyles = useStyles<FlexFactory>({\n name: 'Flex',\n classes,\n props: styleProps,\n className: () => props.value.className,\n style: () => props.value.style,\n classNames: props.value.classNames,\n styles: props.value.styles,\n unstyled: props.value.unstyled,\n attributes: props.value.attributes,\n vars: props.value.vars,\n})\n\nconst theme = useCckTheme()\nconst randomClassName = useRandomClassName()\n\nconst parsedStyleProps = parseStyleProps({\n styleProps: {\n gap: props.value.gap,\n rowGap: props.value.rowGap,\n columnGap: props.value.columnGap,\n align: props.value.align,\n justify: props.value.justify,\n wrap: props.value.wrap,\n direction: props.value.direction,\n },\n theme: theme.value,\n data: FLEX_STYLE_PROPS_DATA,\n})\n\nconst responsiveClassName = parsedStyleProps.hasResponsiveStyles\n ? hashStyleProps(parsedStyleProps.styles, parsedStyleProps.media)\n : randomClassName\n\nconst rootAttrs = computed(() => getStyles('root', { className: responsiveClassName }))\n\nconst mergedStyle = computed(() => {\n const rootStyle = rootAttrs.value.style || {}\n const inlineStyles = filterProps(parsedStyleProps.inlineStyles)\n return { ...rootStyle, ...inlineStyles }\n})\n\nconst mergedAttrs = computed(() => {\n const others: Record<string, any> = {}\n const propsValue = props.value\n Object.keys(propsValue).forEach((key) => {\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 = [...(Array.isArray(userMod) ? userMod : [userMod].filter(Boolean))]\n return {\n ...others,\n mod: mergedMod,\n ...rootAttrs.value,\n style: mergedStyle.value,\n }\n})\n\nconst queryStyles = {\n styles: parsedStyleProps.styles,\n media: parsedStyleProps.media,\n selector: responsiveClassName,\n}\n\nconst queryStylesString = stylesToString(queryStyles)\n\nconst currentStyleKey = ref<string | null>(null)\nwatchEffect(() => {\n if (queryStylesString) {\n const newKey = responsiveStyleManager.register(queryStylesString)\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\ndefineExpose({\n root: computed(() => _root.value?.root ?? null),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6BA,MAAM,QAAQ,IAAsC,IAAI;EAExD,MAAM,QAAQ,SAAS;EAEvB,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;GACA;GACA;EAC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QAAQ,OAAO,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC,OAAO,OAAO,CAAE;GACpF,OAAO;IACL,GAAG;IACH,KAAK;IACL,GAAG,UAAU;IACb,OAAO,YAAY;GACrB;EACF,CAAC;EAED,MAAM,cAAc;GAClB,QAAQ,iBAAiB;GACzB,OAAO,iBAAiB;GACxB,UAAU;EACZ;EAEA,MAAM,oBAAoB,eAAe,WAAW;EAEpD,MAAM,kBAAkB,IAAmB,IAAI;EAC/C,kBAAkB;GAChB,IAAI,mBAAmB;IACrB,MAAM,SAAS,uBAAuB,SAAS,iBAAiB;IAChE,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;EAED,SAAa,EACX,MAAM,eAAe,MAAM,OAAO,QAAQ,IAAI,EAChD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAxJC,YAEQ,OAAA,SAFR,WAEQ,EAFD,KAAI,QAAO,GAAS,OAAA,WAAW,GAAA;yBAC5B,CAAR,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA"}
|
|
@@ -378,15 +378,17 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
378
378
|
"type",
|
|
379
379
|
"attributes"
|
|
380
380
|
];
|
|
381
|
+
const styleProps = computed(() => ({
|
|
382
|
+
...props.value,
|
|
383
|
+
...attrs,
|
|
384
|
+
style: attrs.style ?? props.value.style
|
|
385
|
+
}));
|
|
381
386
|
const getStyles = useStyles({
|
|
382
387
|
name: "Grid",
|
|
383
388
|
classes: grid_module_default,
|
|
384
|
-
props:
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
},
|
|
388
|
-
className: props.value.className,
|
|
389
|
-
style: props.value.style,
|
|
389
|
+
props: styleProps,
|
|
390
|
+
className: () => props.value.className,
|
|
391
|
+
style: () => props.value.style,
|
|
390
392
|
classNames: props.value.classNames,
|
|
391
393
|
styles: props.value.styles,
|
|
392
394
|
unstyled: props.value.unstyled,
|
|
@@ -470,6 +472,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
470
472
|
rawProps,
|
|
471
473
|
props,
|
|
472
474
|
knownProps,
|
|
475
|
+
styleProps,
|
|
473
476
|
getStyles,
|
|
474
477
|
responsiveClassname,
|
|
475
478
|
rootAttrs,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grid.mjs","names":[],"sources":["../../../src/components/grid/grid.vue"],"sourcesContent":["<template>\n <c-box ref=\"_container\" v-if=\"type === 'container' && breakpoints\" v-bind=\"containerAttrs\">\n <c-box ref=\"_root\" v-bind=\"mergedRootAttrs\">\n <c-box ref=\"_inner\" v-bind=\"innerAttrs\">\n <slot />\n </c-box>\n </c-box>\n </c-box>\n <template v-else>\n <c-box ref=\"_root\" v-bind=\"mergedRootAttrs\">\n <c-box ref=\"_inner\" v-bind=\"innerAttrs\">\n <slot />\n </c-box>\n </c-box>\n </template>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, onUnmounted, provide, ref, useAttrs, watchEffect } from 'vue'\nimport {\n CBox,\n isNumberLike,\n responsiveStyleManager,\n useComponentProps,\n useRandomClassName,\n useStyles,\n} from '../../core'\nimport { useGridCustomStyle } from './grid-custom'\nimport { DEFAULT_COLUMNS, GRID_CONTEXT_KEY } from './grid.constants'\nimport { GridContextValue } from './grid.context'\nimport type { GridFactory, GridProps } from './grid.types'\nimport classes from './grid.module.css'\nimport { varsResolver } from './grid.utils'\n\ndefineOptions({\n name: 'CGrid',\n})\n\nconst _container = ref<InstanceType<typeof CBox> | null>(null)\nconst _root = ref<InstanceType<typeof CBox> | null>(null)\nconst _inner = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<GridProps>()\n\nconst props = useComponentProps({\n component: 'CGrid',\n defaultProps: {\n columns: DEFAULT_COLUMNS,\n gap: 'md',\n },\n props: rawProps,\n})\n\nconst knownProps = [\n 'classNames',\n 'className',\n 'style',\n 'styles',\n 'unstyled',\n 'vars',\n 'grow',\n 'gap',\n 'rowGap',\n 'columnGap',\n 'columns',\n 'align',\n 'justify',\n 'breakpoints',\n 'type',\n 'attributes',\n]\n\nconst getStyles = useStyles<GridFactory>({\n name: 'Grid',\n classes,\n props:
|
|
1
|
+
{"version":3,"file":"grid.mjs","names":[],"sources":["../../../src/components/grid/grid.vue"],"sourcesContent":["<template>\n <c-box ref=\"_container\" v-if=\"type === 'container' && breakpoints\" v-bind=\"containerAttrs\">\n <c-box ref=\"_root\" v-bind=\"mergedRootAttrs\">\n <c-box ref=\"_inner\" v-bind=\"innerAttrs\">\n <slot />\n </c-box>\n </c-box>\n </c-box>\n <template v-else>\n <c-box ref=\"_root\" v-bind=\"mergedRootAttrs\">\n <c-box ref=\"_inner\" v-bind=\"innerAttrs\">\n <slot />\n </c-box>\n </c-box>\n </template>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, onUnmounted, provide, ref, useAttrs, watchEffect } from 'vue'\nimport {\n CBox,\n CStyleProp,\n isNumberLike,\n responsiveStyleManager,\n useComponentProps,\n useRandomClassName,\n useStyles,\n} from '../../core'\nimport { useGridCustomStyle } from './grid-custom'\nimport { DEFAULT_COLUMNS, GRID_CONTEXT_KEY } from './grid.constants'\nimport { GridContextValue } from './grid.context'\nimport type { GridFactory, GridProps } from './grid.types'\nimport classes from './grid.module.css'\nimport { varsResolver } from './grid.utils'\n\ndefineOptions({\n name: 'CGrid',\n})\n\nconst _container = ref<InstanceType<typeof CBox> | null>(null)\nconst _root = ref<InstanceType<typeof CBox> | null>(null)\nconst _inner = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\n\nconst rawProps = defineProps<GridProps>()\n\nconst props = useComponentProps({\n component: 'CGrid',\n defaultProps: {\n columns: DEFAULT_COLUMNS,\n gap: 'md',\n },\n props: rawProps,\n})\n\nconst knownProps = [\n 'classNames',\n 'className',\n 'style',\n 'styles',\n 'unstyled',\n 'vars',\n 'grow',\n 'gap',\n 'rowGap',\n 'columnGap',\n 'columns',\n 'align',\n 'justify',\n 'breakpoints',\n 'type',\n 'attributes',\n]\n\nconst styleProps = computed(() => ({\n ...props.value,\n ...attrs,\n style: (attrs.style ?? props.value.style) as CStyleProp,\n}))\n\nconst getStyles = useStyles<GridFactory>({\n name: 'Grid',\n classes,\n props: styleProps,\n className: () => props.value.className,\n style: () => props.value.style,\n classNames: props.value.classNames,\n styles: props.value.styles,\n unstyled: props.value.unstyled,\n attributes: props.value.attributes,\n vars: props.value.vars,\n varsResolver,\n})\n\nconst responsiveClassname = useRandomClassName()\n\nconst rootAttrs = computed(() => getStyles('root', { className: responsiveClassname }))\n\nconst mergedRootAttrs = computed(() => {\n const others: Record<string, any> = {}\n const propsValue = props.value\n Object.keys(propsValue).forEach((key) => {\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 = [...(Array.isArray(userMod) ? userMod : [userMod].filter(Boolean))]\n return { ...others, mod: mergedMod, ...rootAttrs.value }\n})\n\nconst innerAttrs = computed(() => getStyles('inner'))\n\nconst containerAttrs = computed(() => getStyles('container'))\n\nconst gridStyle = useGridCustomStyle({\n selector: responsiveClassname,\n ...props.value,\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\nconst _breakpoints = computed(() => props.value.breakpoints)\nconst _columns = computed(() => {\n if (!isNumberLike(props.value.columns)) {\n console.warn(\n `[C-Grid] columns should be number or number-like string, got ${props.value.columns}. Fallback to default columns ${DEFAULT_COLUMNS}.`\n )\n return DEFAULT_COLUMNS\n }\n\n return Number(props.value.columns)\n})\nconst _grow = computed(() => props.value.grow)\nconst _type = computed(() => props.value.type)\n\nconst context: GridContextValue = {\n getStyles,\n get breakpoints() {\n return _breakpoints.value\n },\n get columns() {\n return _columns.value\n },\n get grow() {\n return _grow.value\n },\n get type() {\n return _type.value\n },\n}\n\nprovide(GRID_CONTEXT_KEY, context)\n\ndefineExpose({\n container: computed(() => _container.value?.root ?? null),\n root: computed(() => _root.value?.root ?? null),\n inner: computed(() => _inner.value?.root ?? null),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuCA,MAAM,aAAa,IAAsC,IAAI;EAC7D,MAAM,QAAQ,IAAsC,IAAI;EACxD,MAAM,SAAS,IAAsC,IAAI;EAEzD,MAAM,QAAQ,SAAS;EAEvB,MAAM,WAAW;EAEjB,MAAM,QAAQ,kBAAkB;GAC9B,WAAW;GACX,cAAc;IACZ,SAAA;IAC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KAAI,QAAO,GAAS,OAAA,eAAe,GAAA;0BAGhC,CAFR,YAEQ,OAAA,SAFR,WAEQ,EAFD,KAAI,SAAQ,GAAS,OAAA,UAAU,GAAA;2BAC5B,CAAR,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA;;;;;;yBAKZ,YAIQ,OAAA,SAJR,WAIQ;;EAJD,KAAI;IAAgB,OAAA,eAAe,GAAA;yBAGhC,CAFR,YAEQ,OAAA,SAFR,WAEQ,EAFD,KAAI,SAAQ,GAAS,OAAA,UAAU,GAAA;0BAC5B,CAAR,WAAQ,KAAA,QAAA,SAAA,CAAA,CAAA"}
|
|
@@ -366,15 +366,17 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
366
366
|
const resolvedGap = getSpacing(props.value.gap);
|
|
367
367
|
const childWidth = `calc(${100 / childrenCount}% - (${resolvedGap} - ${resolvedGap} / ${childrenCount}))`;
|
|
368
368
|
const stylesCtx = { childWidth };
|
|
369
|
+
const styleProps = computed(() => ({
|
|
370
|
+
...props.value,
|
|
371
|
+
...attrs,
|
|
372
|
+
style: attrs.style ?? props.value.style
|
|
373
|
+
}));
|
|
369
374
|
const getStyles = useStyles({
|
|
370
375
|
name: "Group",
|
|
371
|
-
props:
|
|
372
|
-
...props.value,
|
|
373
|
-
...attrs
|
|
374
|
-
},
|
|
376
|
+
props: styleProps,
|
|
375
377
|
stylesCtx,
|
|
376
|
-
className: props.value.className,
|
|
377
|
-
style: props.value.style,
|
|
378
|
+
className: () => props.value.className,
|
|
379
|
+
style: () => props.value.style,
|
|
378
380
|
classes: group_module_default,
|
|
379
381
|
classNames: props.value.classNames,
|
|
380
382
|
styles: props.value.styles,
|
|
@@ -412,6 +414,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
412
414
|
resolvedGap,
|
|
413
415
|
childWidth,
|
|
414
416
|
stylesCtx,
|
|
417
|
+
styleProps,
|
|
415
418
|
getStyles,
|
|
416
419
|
modList,
|
|
417
420
|
rootAttrs,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group.mjs","names":[],"sources":["../../../src/components/group/group.vue"],"sourcesContent":["<template>\n <c-box ref=\"_root\" v-bind=\"mergedAttrs\" :size=\"__size\" :variant=\"variant\">\n <!-- TODO: filter falsy children -->\n <!-- <component v-for=\"(node, index) in filteredChildren\" :key=\"node.key || index\" :is=\"node\" /> -->\n <slot />\n </c-box>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs, useSlots } from 'vue'\nimport type { GroupFactory, GroupProps, GroupStylesCtx } from './group.types'\nimport { filterFalsyChildren } from './filter-falsy-children/filter-falsy-children'\nimport { getSpacing, useStyles, CBox, useComponentProps } from '../../core'\nimport classes from './group.module.css'\nimport { varsResolver } from './group.utils'\n\ndefineOptions({\n name: 'CGroup',\n})\n\nconst _root = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\nconst slots = useSlots()\n\nconst rawProps = defineProps<GroupProps>()\n\nconst props = useComponentProps({\n component: 'CGroup',\n defaultProps: {\n preventGrowOverflow: true,\n gap: 'md',\n align: 'center',\n justify: 'flex-start',\n wrap: 'wrap',\n },\n props: rawProps,\n})\n\nconst knownProps = [\n 'classNames',\n 'className',\n 'style',\n 'styles',\n 'unstyled',\n 'gap',\n 'align',\n 'justify',\n 'wrap',\n 'grow',\n 'preventGrowOverflow',\n 'vars',\n 'variant',\n '__size',\n 'mod',\n 'attributes',\n]\n\nconst filteredChildren = filterFalsyChildren(slots.default?.())\nconst childrenCount = filteredChildren.length\nconst resolvedGap = getSpacing(props.value.gap)\nconst childWidth = `calc(${100 / childrenCount}% - (${resolvedGap} - ${resolvedGap} / ${childrenCount}))`\n\nconst stylesCtx: GroupStylesCtx = { childWidth }\n\nconst getStyles = useStyles<GroupFactory>({\n name: 'Group',\n props:
|
|
1
|
+
{"version":3,"file":"group.mjs","names":[],"sources":["../../../src/components/group/group.vue"],"sourcesContent":["<template>\n <c-box ref=\"_root\" v-bind=\"mergedAttrs\" :size=\"__size\" :variant=\"variant\">\n <!-- TODO: filter falsy children -->\n <!-- <component v-for=\"(node, index) in filteredChildren\" :key=\"node.key || index\" :is=\"node\" /> -->\n <slot />\n </c-box>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, useAttrs, useSlots } from 'vue'\nimport type { GroupFactory, GroupProps, GroupStylesCtx } from './group.types'\nimport { filterFalsyChildren } from './filter-falsy-children/filter-falsy-children'\nimport { getSpacing, useStyles, CBox, useComponentProps, CStyleProp } from '../../core'\nimport classes from './group.module.css'\nimport { varsResolver } from './group.utils'\n\ndefineOptions({\n name: 'CGroup',\n})\n\nconst _root = ref<InstanceType<typeof CBox> | null>(null)\n\nconst attrs = useAttrs()\nconst slots = useSlots()\n\nconst rawProps = defineProps<GroupProps>()\n\nconst props = useComponentProps({\n component: 'CGroup',\n defaultProps: {\n preventGrowOverflow: true,\n gap: 'md',\n align: 'center',\n justify: 'flex-start',\n wrap: 'wrap',\n },\n props: rawProps,\n})\n\nconst knownProps = [\n 'classNames',\n 'className',\n 'style',\n 'styles',\n 'unstyled',\n 'gap',\n 'align',\n 'justify',\n 'wrap',\n 'grow',\n 'preventGrowOverflow',\n 'vars',\n 'variant',\n '__size',\n 'mod',\n 'attributes',\n]\n\nconst filteredChildren = filterFalsyChildren(slots.default?.())\nconst childrenCount = filteredChildren.length\nconst resolvedGap = getSpacing(props.value.gap)\nconst childWidth = `calc(${100 / childrenCount}% - (${resolvedGap} - ${resolvedGap} / ${childrenCount}))`\n\nconst stylesCtx: GroupStylesCtx = { childWidth }\n\nconst styleProps = computed(() => ({\n ...props.value,\n ...attrs,\n style: (attrs.style ?? props.value.style) as CStyleProp,\n}))\n\nconst getStyles = useStyles<GroupFactory>({\n name: 'Group',\n props: styleProps,\n stylesCtx,\n className: () => props.value.className,\n style: () => props.value.style,\n classes,\n classNames: props.value.classNames,\n styles: props.value.styles,\n unstyled: props.value.unstyled,\n attributes: props.value.attributes,\n vars: props.value.vars,\n varsResolver,\n})\n\nconst modList = computed(() => [{ grow: props.value.grow }])\n\nconst rootAttrs = computed(() => getStyles('root'))\n\nconst mergedAttrs = computed(() => {\n const others: Record<string, any> = {}\n const propsValue = props.value\n Object.keys(propsValue).forEach((key) => {\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 { ...others, mod: mergedMod, ...rootAttrs.value }\n})\n\ndefineExpose({\n root: computed(() => _root.value?.root ?? null),\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoBA,MAAM,QAAQ,IAAsC,IAAI;EAExD,MAAM,QAAQ,SAAS;EACvB,MAAM,QAAQ,SAAS;EAEvB,MAAM,WAAW;EAEjB,MAAM,QAAQ,kBAAkB;GAC9B,WAAW;GACX,cAAc;IACZ,qBAAqB;IACrB,KAAK;IACL,OAAO;IACP,SAAS;IACT,MAAM;GACR;GACA,OAAO;EACT,CAAC;EAED,MAAM,aAAa;GACjB;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;EAEA,MAAM,mBAAmB,oBAAoB,MAAM,UAAU,CAAC;EAC9D,MAAM,gBAAgB,iBAAiB;EACvC,MAAM,cAAc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S,SAAS,OAAA;;yBAC3B;GAApC,mBAAA,+BAAA;GACA,mBAAA,qGAAA;GACA,WAAQ,KAAA,QAAA,SAAA"}
|
|
@@ -342,16 +342,18 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
342
342
|
"mod",
|
|
343
343
|
"attributes"
|
|
344
344
|
];
|
|
345
|
+
const styleProps = computed(() => ({
|
|
346
|
+
...props.value,
|
|
347
|
+
...attrs,
|
|
348
|
+
style: attrs.style ?? props.value.style
|
|
349
|
+
}));
|
|
345
350
|
const getStyles = useStyles({
|
|
346
351
|
name: "Image",
|
|
347
352
|
classes: image_module_default,
|
|
348
|
-
props:
|
|
349
|
-
|
|
350
|
-
...attrs
|
|
351
|
-
},
|
|
352
|
-
className: props.value.className,
|
|
353
|
+
props: styleProps,
|
|
354
|
+
className: () => props.value.className,
|
|
353
355
|
classNames: props.value.classNames,
|
|
354
|
-
style: props.value.style,
|
|
356
|
+
style: () => props.value.style,
|
|
355
357
|
styles: props.value.styles,
|
|
356
358
|
unstyled: props.value.unstyled,
|
|
357
359
|
attributes: props.value.attributes,
|
|
@@ -395,6 +397,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
395
397
|
rawProps,
|
|
396
398
|
props,
|
|
397
399
|
knownProps,
|
|
400
|
+
styleProps,
|
|
398
401
|
getStyles,
|
|
399
402
|
hasError,
|
|
400
403
|
currentSrc,
|