@cck-ui/core 0.28.0 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/components/affix/affix.cjs +461 -0
- package/cjs/components/affix/affix.cjs.map +1 -0
- package/cjs/components/affix/affix.module.cjs +7 -0
- package/cjs/components/affix/affix.module.cjs.map +1 -0
- package/cjs/components/affix/affix.utils.cjs +14 -0
- package/cjs/components/affix/affix.utils.cjs.map +1 -0
- package/cjs/components/affix/index.cjs +14 -0
- package/cjs/components/affix/index.cjs.map +1 -0
- package/cjs/components/portal/portal.cjs +10 -3
- package/cjs/components/portal/portal.cjs.map +1 -1
- package/cjs/core/utils/get-default-z-index/get-default-z-index.cjs +16 -0
- package/cjs/core/utils/get-default-z-index/get-default-z-index.cjs.map +1 -0
- package/cjs/index.cjs +108 -103
- package/cjs/index.cjs.map +1 -1
- package/esm/components/affix/affix.mjs +459 -0
- package/esm/components/affix/affix.mjs.map +1 -0
- package/esm/components/affix/affix.module.mjs +7 -0
- package/esm/components/affix/affix.module.mjs.map +1 -0
- package/esm/components/affix/affix.utils.mjs +15 -0
- package/esm/components/affix/affix.utils.mjs.map +1 -0
- package/esm/components/affix/index.mjs +11 -0
- package/esm/components/affix/index.mjs.map +1 -0
- package/esm/components/portal/portal.mjs +11 -4
- package/esm/components/portal/portal.mjs.map +1 -1
- package/esm/core/utils/get-default-z-index/get-default-z-index.mjs +16 -0
- package/esm/core/utils/get-default-z-index/get-default-z-index.mjs.map +1 -0
- package/esm/index.mjs +5 -2
- package/esm/index.mjs.map +1 -1
- package/lib/components/affix/affix.types.d.ts +40 -0
- package/lib/components/affix/affix.utils.d.ts +6 -0
- package/lib/components/affix/index.d.ts +6 -0
- package/lib/components/index.d.ts +1 -0
- package/lib/components/portal/portal.types.d.ts +9 -0
- package/lib/core/utils/get-default-z-index/get-default-z-index.d.ts +9 -0
- package/lib/core/utils/index.d.ts +1 -0
- package/package.json +1 -1
- package/styles/affix.css +8 -0
- package/styles/affix.layer.css +9 -0
- package/styles.css +9 -0
- package/styles.layer.css +9 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Properties } from 'csstype';
|
|
2
|
+
import { BoxComponentProps, CSize, ElementProps, Factory, StylesApiProps } from '../../core';
|
|
3
|
+
import { PortalProps } from '../portal';
|
|
4
|
+
export type AffixStylesNames = 'root';
|
|
5
|
+
export type AffixCssVariables = {
|
|
6
|
+
root: '--affix-z-index' | '--affix-top' | '--affix-left' | '--affix-bottom' | '--affix-right';
|
|
7
|
+
};
|
|
8
|
+
export interface AffixPosition {
|
|
9
|
+
top?: CSize | (string & {}) | number;
|
|
10
|
+
left?: CSize | (string & {}) | number;
|
|
11
|
+
bottom?: CSize | (string & {}) | number;
|
|
12
|
+
right?: CSize | (string & {}) | number;
|
|
13
|
+
}
|
|
14
|
+
export interface AffixBaseProps {
|
|
15
|
+
/**
|
|
16
|
+
* Root element `z-index` property
|
|
17
|
+
* @default 200
|
|
18
|
+
*/
|
|
19
|
+
zIndex?: Properties['zIndex'];
|
|
20
|
+
/**
|
|
21
|
+
* Determines whether the component is rendered within `Portal`
|
|
22
|
+
* @default true
|
|
23
|
+
*/
|
|
24
|
+
withinPortal?: boolean;
|
|
25
|
+
/** Props passed down to the `Portal` component. Ignored when `withinPortal` is `false` */
|
|
26
|
+
portalProps?: PortalProps;
|
|
27
|
+
/**
|
|
28
|
+
* Affix position on screen
|
|
29
|
+
* @default { bottom: 0, right: 0 }
|
|
30
|
+
*/
|
|
31
|
+
position?: AffixPosition;
|
|
32
|
+
}
|
|
33
|
+
export interface AffixProps extends BoxComponentProps, AffixBaseProps, StylesApiProps<AffixFactory>, ElementProps<'div'> {
|
|
34
|
+
}
|
|
35
|
+
export type AffixFactory = Factory<{
|
|
36
|
+
props: AffixProps;
|
|
37
|
+
ref: HTMLDivElement;
|
|
38
|
+
stylesNames: AffixStylesNames;
|
|
39
|
+
vars: AffixCssVariables;
|
|
40
|
+
}>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { SFCWithInstallAndClasses } from '../../core';
|
|
2
|
+
import Affix from './affix.vue';
|
|
3
|
+
import classes from './affix.module.css';
|
|
4
|
+
export declare const CAffix: SFCWithInstallAndClasses<typeof Affix, typeof classes>;
|
|
5
|
+
export default CAffix;
|
|
6
|
+
export * from './affix.types';
|
|
@@ -8,6 +8,15 @@ export interface PortalProps {
|
|
|
8
8
|
* Note: If selector doesn't match any element, portal will not render
|
|
9
9
|
*/
|
|
10
10
|
target?: HTMLElement | string;
|
|
11
|
+
/**
|
|
12
|
+
* Determines whether children should be rendered inside Portal.
|
|
13
|
+
* When false, children are rendered as regular Vue children.
|
|
14
|
+
*
|
|
15
|
+
* Note: In test environment, Portal is always disabled regardless of this value.
|
|
16
|
+
*
|
|
17
|
+
* @default true
|
|
18
|
+
*/
|
|
19
|
+
disabled?: boolean;
|
|
11
20
|
/**
|
|
12
21
|
* When true and target is not specified, all Portal instances share a single
|
|
13
22
|
* container node appended to document.body. When false, each Portal creates
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare const elevations: {
|
|
2
|
+
readonly app: 100;
|
|
3
|
+
readonly modal: 200;
|
|
4
|
+
readonly popover: 300;
|
|
5
|
+
readonly overlay: 400;
|
|
6
|
+
readonly max: 9999;
|
|
7
|
+
};
|
|
8
|
+
export declare function getDefaultZIndex(level: keyof typeof elevations): 100 | 200 | 300 | 400 | 9999;
|
|
9
|
+
export {};
|
|
@@ -3,6 +3,7 @@ export { camelToKebabCase } from './camel-to-kebab-case/camel-to-kebab-case';
|
|
|
3
3
|
export { filterProps } from './filter-props/filter-props';
|
|
4
4
|
export { getBaseValue } from './get-base-value/get-base-value';
|
|
5
5
|
export { getBreakpointValue } from './get-breakpoint-value/get-breakpoint-value';
|
|
6
|
+
export { getDefaultZIndex } from './get-default-z-index/get-default-z-index';
|
|
6
7
|
export { getSize, getSpacing, getShadow, getRadius, getFontSize, getLineHeight, } from './get-size/get-size';
|
|
7
8
|
export { getSortedBreakpoints } from './get-sorted-breakpoints/get-sorted-breakpoints';
|
|
8
9
|
export { isNumberLike } from './is-number-like/is-number-like';
|
package/package.json
CHANGED
package/styles/affix.css
ADDED
package/styles.css
CHANGED
|
@@ -1181,6 +1181,15 @@ fieldset:disabled .c-active:active {
|
|
|
1181
1181
|
justify-content: center;
|
|
1182
1182
|
}
|
|
1183
1183
|
|
|
1184
|
+
.m_8b372bf {
|
|
1185
|
+
position: fixed;
|
|
1186
|
+
z-index: var(--affix-z-index);
|
|
1187
|
+
inset-inline-start: var(--affix-left);
|
|
1188
|
+
inset-inline-end: var(--affix-right);
|
|
1189
|
+
top: var(--affix-top);
|
|
1190
|
+
bottom: var(--affix-bottom);
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1184
1193
|
.m_efb192b3 {
|
|
1185
1194
|
--alert-radius: var(--c-radius-default);
|
|
1186
1195
|
--alert-bg: var(--c-primary-color-light);
|
package/styles.layer.css
CHANGED
|
@@ -1181,6 +1181,15 @@ fieldset:disabled .c-active:active {
|
|
|
1181
1181
|
justify-content: center;
|
|
1182
1182
|
}
|
|
1183
1183
|
|
|
1184
|
+
.m_8b372bf {
|
|
1185
|
+
position: fixed;
|
|
1186
|
+
z-index: var(--affix-z-index);
|
|
1187
|
+
inset-inline-start: var(--affix-left);
|
|
1188
|
+
inset-inline-end: var(--affix-right);
|
|
1189
|
+
top: var(--affix-top);
|
|
1190
|
+
bottom: var(--affix-bottom);
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1184
1193
|
.m_efb192b3 {
|
|
1185
1194
|
--alert-radius: var(--c-radius-default);
|
|
1186
1195
|
--alert-bg: var(--c-primary-color-light);
|