Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Button and Affix meta to yunti-ui #8

Merged
merged 6 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 126 additions & 0 deletions packages/yunti-ui-lowcode-materials/lowcode/Affix/meta.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
import { IPublicTypeComponentMetadata } from '@alilc/lowcode-types';

import { COMMON_CONFIGURE_PROPS } from '../utils';
import { AffixSnippets } from './snippets';

const AffixMetaInfo: IPublicTypeComponentMetadata = {
componentName: 'Affix',
title: 'Affix',
docUrl: '',
screenshot: '',
devMode: 'proCode',
npm: {
package: '@yuntijs/ui-lowcode-materials',
version: '{{version}}',
exportName: 'Affix',
destructuring: true,
subName: '',
},
configure: {
props: [
...COMMON_CONFIGURE_PROPS,
{
title: {
label: {
'type': 'i18n',
'en-US': 'offsetTop',
'zh-CN': '่ท็ฆป็ช—ๅฃ้กถ้ƒจ่พพๅˆฐๆŒ‡ๅฎšๅ็งป้‡ๅŽ่งฆๅ‘ ',
},
tip: 'offsetTop | Triggered when the specified offset is reached from the top of the window',
},
name: 'offsetTop',
description: 'Triggered when the specified offset is reached from the top of the window',
setter: {
componentName: 'NumberSetter',
isRequired: false,
initialValue: 0,
},
},
{
title: {
label: {
'type': 'i18n',
'en-US': 'offsetBottom',
'zh-CN': '่ท็ฆป็ช—ๅฃๅบ•้ƒจ่พพๅˆฐๆŒ‡ๅฎšๅ็งป้‡ๅŽ่งฆๅ‘',
},
tip: 'offsetBottom | Triggered when the specified offset is reached from the bottom of the window',
},
name: 'offsetBottom',
description: 'Triggered when the specified offset is reached from the bottom of the window',
setter: {
componentName: 'NumberSetter',
isRequired: false,
initialValue: 0,
},
},
{
title: {
label: {
'type': 'i18n',
'en-US': 'target',
'zh-CN': '็›‘ๅฌๅ…ถๆปšๅŠจไบ‹ไปถ็š„ๅ…ƒ็ด ',
},
tip: 'target | Set the element that Affix needs to listen to its scroll event, the value is a function that returns the corresponding DOM element',
},
name: 'target',
description:
'Set the element that Affix needs to listen to its scroll event, the value is a function that returns the corresponding DOM element',
setter: {
componentName: 'FunctionSetter',
isRequired: false,
},
},
{
title: {
label: {
'type': 'i18n',
'en-US': 'prefixCls',
'zh-CN': 'prefixCls',
},
},
name: 'prefixCls',
setter: {
componentName: 'StringSetter',
isRequired: false,
initialValue: '',
},
},
{
title: {
label: {
'type': 'i18n',
'en-US': 'rootClassName',
'zh-CN': 'rootClassName',
},
},
name: 'rootClassName',
setter: {
componentName: 'StringSetter',
isRequired: false,
initialValue: '',
},
},
],
supports: {
loop: true,
condition: true,
style: true,
className: true,
events: [
{
name: 'onChange',
description: 'ๅ›บๅฎš็Šถๆ€ๆ”นๅ˜ๆ—ถ่งฆๅ‘็š„ๅ›ž่ฐƒๅ‡ฝๆ•ฐ',
template:
"onChange(affixed, ${extParams}){\n// ๅ›บๅฎš็Šถๆ€ๆ”นๅ˜ๆ—ถ่งฆๅ‘็š„ๅ›ž่ฐƒๅ‡ฝๆ•ฐ \nconsole.log('onChange', affixed);}",
},
],
},
component: {},
},
category: 'ๅ…ถไป–',
};

export const AffixMeta = {
...AffixMetaInfo,
snippets: AffixSnippets,
};
24 changes: 24 additions & 0 deletions packages/yunti-ui-lowcode-materials/lowcode/Affix/snippets.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { IPublicTypeSnippet } from '@alilc/lowcode-types';

export const AffixSnippets: IPublicTypeSnippet[] = [
{
title: 'ๅ›บ้’‰(Affix)',
screenshot: '',
schema: {
componentName: 'Affix',
props: {
__component_name: 'Affix',
offsetTop: 120,
children: [
{
componentName: 'Button',
props: {
__component_name: 'Button',
children: 'Affix Top',
},
},
],
},
},
},
];
Loading
Loading