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

Dev calendar up #228

Open
wants to merge 256 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
256 commits
Select commit Hold shift + click to select a range
c7eee92
* popover: refactor global click for popovers.
catouse Jul 29, 2024
d9235f4
* popover: refactor hideOthers.
catouse Jul 29, 2024
afa03f1
* tooltip: refactor global click with popover.
catouse Jul 29, 2024
ed1e222
* dropdown: refactor global click with popover.
catouse Jul 29, 2024
8c3b932
* contextmenu: remove unused code.
catouse Jul 29, 2024
20365e3
* contextmenu: change dev example.
catouse Jul 29, 2024
568eb27
* list: init checks on load lazy items.
catouse Jul 29, 2024
bb2633c
* dtable: optimize UI for sorting cols by dnd.
catouse Jul 29, 2024
c53cb62
* dtable: change default speed of auto scrolling.
catouse Jul 29, 2024
f36ae92
* dtable: limit fixed left width for resizing cols.
catouse Jul 29, 2024
9679723
* dtable: support for resizing last col in left section.
catouse Jul 29, 2024
3d84515
* list: change list dev example.
catouse Jul 30, 2024
e41c2cb
* dtable: refactor.
catouse Aug 2, 2024
2185492
* stable: add requireAfter property to plugin.
catouse Aug 2, 2024
f0e4806
* dtable: ensure that nested load after sortable.
catouse Aug 2, 2024
c972bdf
* dtable: remove unused canSortTo callback from sortable plugin.
catouse Aug 2, 2024
6976e82
* dtable: refactor sorting rows in nested plugin.
catouse Aug 2, 2024
72c2169
* dtable: fix ignoreNextClick not work.
catouse Aug 2, 2024
4bed039
* core: fix js error in firefox.
catouse Aug 5, 2024
566943c
* popover: support for setting footer to popover panel.
catouse Aug 5, 2024
f0dd9fe
* popover: add minWidth and minHeight props to popover.
catouse Aug 5, 2024
eaf8fea
* popover: add new prop elementShowClass to custom class in trigger …
catouse Aug 5, 2024
3d1134c
* dtable: support for reseting state for resize plugin and sortable …
catouse Aug 5, 2024
5b294c4
* dtable: fix sorting col not work.
catouse Aug 5, 2024
94acc25
* list: remove option nestedTrigger from nested list.
catouse Aug 5, 2024
6ac6edd
* list: add option "expandChildrenOnCheck".
catouse Aug 5, 2024
975c233
* list: add param "reset" to onToggle callback.
catouse Aug 5, 2024
975b479
* list: skip to check item whithout any checkbox.
catouse Aug 5, 2024
6305940
* menu: add new option "nestedTrigger" for expand nested list on mou…
catouse Aug 6, 2024
ac73ebc
* menu: support for showing independent searchbox in nested menu.
catouse Aug 6, 2024
2f6e350
* menu: optimize style of header and footer in nested menu.
catouse Aug 6, 2024
126948d
* menu: change dev example.
catouse Aug 6, 2024
1e6f183
* dropdown: fix search-menu bg in dropdown nested menu.
catouse Aug 6, 2024
a0c59d6
* dropdown: support for showing independent searchbox in nested menu.
catouse Aug 6, 2024
8167536
* dropdown: preserve dropdown nested menu position on searchbox focus.
catouse Aug 6, 2024
bc70ebb
* search-box: register searchbox component.
catouse Aug 7, 2024
b906848
* docs: change doc nav.
catouse Aug 7, 2024
3961c82
* popover: update nav options from element on open again.
catouse Aug 7, 2024
db5dcc0
* dtable: prevent to select text on dragging for sorting.
catouse Aug 7, 2024
de1dce1
* dtable: fix sortable orders.
catouse Aug 7, 2024
f87ce1b
* dtable: fix sorting nested rows.
catouse Aug 7, 2024
d9d3cbc
* dtable: prevent to call callback when orders not change.
catouse Aug 8, 2024
b86d61f
* popover: update options on show from hover trigger.
catouse Aug 8, 2024
c9db102
* core: store data on occur error.
catouse Aug 8, 2024
a9c6d75
* dtable: refactor private fields in dtable class.
catouse Aug 8, 2024
46f4b8d
* dtable: check plugins state after each render.
catouse Aug 9, 2024
17014b8
* utilities: add bg-opacity-25 helper.
catouse Aug 9, 2024
2e6dfc5
* dtable: fix col resizing not work with fixedLeftWidth.
catouse Aug 9, 2024
f5f9fcf
* kanban: fix links editor not show.
catouse Aug 9, 2024
8adc347
* popover: fix dismiss button not work in inherit class.
catouse Aug 10, 2024
1332565
* dtable: fix group plugin not work.
catouse Aug 12, 2024
bc65c78
* list: prevent to toggle on click form controls.
catouse Aug 13, 2024
11ed426
* form: fix horz form style.
catouse Aug 14, 2024
48779a0
* list: fix modifier class no-nested-items never work.
catouse Aug 14, 2024
3b86532
* list: fix checkOnClick not work as expected.
catouse Aug 15, 2024
6f51c71
* datetime-picker: fix setValue not work as expected in datetime pic…
catouse Aug 15, 2024
fc4ca50
* picker: fix search param when no search keys.
catouse Aug 16, 2024
9c0f800
* list: fix toggleIcons not work with icon name.
catouse Aug 16, 2024
9d97d61
* menu: add headerClass and footerClass to searchMenu.
catouse Aug 16, 2024
50d31e8
* core: return false when element is null on check detached state.
catouse Aug 19, 2024
8a536a7
* dropdown: add getter to get dropdown instance from dropdown menu.
catouse Aug 19, 2024
98a0aa8
* core: prevent to append root when src path starts with protocol.
catouse Aug 21, 2024
7754892
* popover: add option to limit popover show inside screen.
catouse Aug 21, 2024
10c26be
* popover: add trigger and target getter.
catouse Aug 21, 2024
6b5df38
* popover: prevent to layout on popover is hidden or destroyed.
catouse Aug 21, 2024
002f16b
* core: support for setting callback args to parseSize helper.
catouse Aug 22, 2024
c9d49a6
* form: fix form-group size in horz form.
catouse Aug 22, 2024
b9b04a8
* popover: add onLayout callback to popover.
catouse Aug 22, 2024
5a65133
* popover: support for setting minWidth and minHeight to popover.
catouse Aug 22, 2024
645fceb
* datetime-picker: support for setting time forcely.
catouse Aug 22, 2024
6c4d9d6
* datetime-picker: support for setting date forcely.
catouse Aug 22, 2024
4ea4ccf
* sidebar: fix preserve collapse state not work in sidebar.
catouse Aug 23, 2024
4869b8a
* sidebar: fix animation work on dragging.
catouse Aug 23, 2024
7eca974
* picker: support for getting picker instance from picker menu.
catouse Aug 23, 2024
c5393f7
* picker: set relativeTarget to menu in picker menu.
catouse Aug 23, 2024
195685e
* picker: set relativeTarget to footer toolbar.
catouse Aug 23, 2024
0cdbfce
* tree: refactor state type.
catouse Aug 27, 2024
5332f85
* menu: fix super render execute twice times in menu.
catouse Aug 27, 2024
c2df596
* list: fix beforeRenderItem not call in nested list.
catouse Aug 27, 2024
84aa7c8
* list: fix beforeRender not work.
catouse Aug 27, 2024
5198417
* common-list: add getItems option to common list.
catouse Aug 27, 2024
d6e1d66
* list: inherit getItems property.
catouse Aug 27, 2024
d09a36b
* dtable: fix style not work.
catouse Aug 27, 2024
d9836b2
* core: add computed helper to create instance.
catouse Aug 28, 2024
8ab746a
* core: refactor.
catouse Aug 28, 2024
1fd3db7
* core: add depends method to reset dependencies for computed.
catouse Aug 28, 2024
bfd1f48
* core: refactor size helpers types.
catouse Aug 28, 2024
5fb86a4
* tree: refactor search tree types.
catouse Aug 29, 2024
f3d475a
* dtable: refactor types.
catouse Aug 29, 2024
f0cd19e
* picker: refactor picker options type.
catouse Aug 29, 2024
a987504
* picker: add caretClass option to picker.
catouse Aug 29, 2024
1eb9054
* list: use rendered item on handle click event.
catouse Aug 30, 2024
724feba
* menu: clip title in menu item.
catouse Aug 30, 2024
cd3b5a3
* tree: fix default inner component type not work in search tree.
catouse Aug 30, 2024
ac45b26
* utilities: add css helpers to change display on hover.
catouse Aug 30, 2024
dce069c
* popover: fix popover cause page layout changes on show.
catouse Aug 30, 2024
d9990bb
* core: refactor.
catouse Aug 30, 2024
031477d
* modal: show loading indicator on loading iframe modal.
catouse Aug 30, 2024
e9c75cf
* core: support for formatting fetching url on fetch data.
catouse Aug 31, 2024
9998568
* core: add this argument to fetcher callback.
catouse Aug 31, 2024
8d6b3b4
* core: add ajaxGetter param to fetchData helper.
catouse Sep 2, 2024
1ff3e84
* core: fix isDiff not work as expected.
catouse Sep 2, 2024
7e18af4
* core: skip to check inner on computed value.
catouse Sep 2, 2024
e1ea833
* core: remove computed helper.
catouse Sep 3, 2024
f1b56b1
* core: export preact signals lib.
catouse Sep 3, 2024
4952eec
* core: add signals version of HElment.
catouse Sep 3, 2024
54bc8a8
* core: fix isDiff not work as expected.
catouse Sep 3, 2024
aa12a9c
* core: fix state proxy not work.
catouse Sep 4, 2024
3cf7d7e
* core: refactor.
catouse Sep 4, 2024
e0d7f0c
+ core: add commands helper.
catouse Sep 4, 2024
f07e267
* core: support for setting command executers on bind.
catouse Sep 4, 2024
5695c6a
* core: export command callback type.
catouse Sep 4, 2024
075acc2
* core: refactor types.
catouse Sep 4, 2024
89b6842
* core: refactor command execute callback.
catouse Sep 4, 2024
330ccb0
* core: improve commands helper.
catouse Sep 5, 2024
e44ffe7
+ core: add helper method to load es module.
catouse Sep 5, 2024
b3d77dd
* utilities: add helper class hover:opacity-0.
catouse Sep 6, 2024
713bb47
* core: fix the problem of failure to load the library for the secon…
catouse Sep 9, 2024
e234aa5
* proj: add nanoid to workspace dependencies.
catouse Sep 9, 2024
2393825
* picker: support for setting empty value to false to skip check emp…
catouse Sep 10, 2024
2bb3f23
* dtable: fix animation frame timer not cancel in dtable.
catouse Sep 10, 2024
f1e4d19
* dtable: fix rowHeight may has not value.
catouse Sep 10, 2024
17d98ed
* core: support for setting options from $options.
catouse Sep 10, 2024
67fe66b
* core: refactor.
catouse Sep 12, 2024
9ef7abf
* core: fix typo.
catouse Sep 12, 2024
5ed6746
* dtable: fix plugin sort-type not work with plugin sort.
catouse Sep 12, 2024
b8b2e0b
* modal: add show and hide callback to modal.
catouse Sep 12, 2024
37da5e0
* modal: refactor.
catouse Sep 12, 2024
8952dd1
* modal: auto focus element with attribute [autofocus] after modal s…
catouse Sep 12, 2024
673ead3
* modal: add ref option to Modal.open for getting modal instance.
catouse Sep 12, 2024
c3b35e5
* modal: add Modal.prompt helper for getting input value conveniently.
catouse Sep 12, 2024
085ef01
* messager: refactor MessageItem to class component.
catouse Sep 12, 2024
d635386
* messager: refactor.
catouse Sep 12, 2024
8441be5
* messager: fix error on reset options.
catouse Sep 12, 2024
6aa43a7
* messager: refactor.
catouse Sep 12, 2024
088ca31
* core: support for setting global beforeSend callbacks to ajax.
catouse Sep 12, 2024
7251d4d
* proj: change ts config.
catouse Sep 12, 2024
4e01473
* button: support for setting icon class.
catouse Sep 12, 2024
239187e
* list: support for setting icon class.
catouse Sep 12, 2024
84dfef5
* dtable: fix dtable update unexpectedly before destroy.
catouse Sep 12, 2024
a5524e4
* dtable: change default option "sort" to false of dtable plugin "so…
catouse Sep 13, 2024
a9b4575
* datetime-picker: fix time option size in pop panel.
catouse Sep 13, 2024
0672823
* core: export build mode to const BUILD_MODE.
catouse Sep 14, 2024
bbb170a
* dtable: fix render error when col title is invalid jsx element.
catouse Sep 14, 2024
a75fd3e
* dtable: check result type on render it as cell content.
catouse Sep 14, 2024
e843902
* dtable: add componentDidCatch to dtable component.
catouse Sep 14, 2024
19f3ebc
* modal: support for setting placeholder in Prompt modal.
catouse Sep 19, 2024
44fd8f0
* list: add item-actions class to actions toolbar in list item.
catouse Sep 19, 2024
a250b09
* list: add hoverItemActions option for showing actions on hover.
catouse Sep 19, 2024
0da4e7b
* btn-group: change BtnGroupOptions type.
catouse Sep 20, 2024
2d20f4f
* button: support for setting text class to button.
catouse Sep 20, 2024
e0d1bde
* menu: support for setting search prop with function.
catouse Sep 24, 2024
9006746
* utilities: add hover utilities for changing scale.
catouse Sep 27, 2024
18ef165
* proj: remove unused pnpm workspaces config from package.json.
catouse Sep 27, 2024
fce09ba
* core: skip to call method when there is no instance on call $.fn.c…
catouse Sep 27, 2024
9140598
* list: fix hoverItemActions not work with nested list.
catouse Sep 27, 2024
c6f3bad
* menu: support for showing tip on exceed items count limit.
catouse Sep 27, 2024
4223581
* picker: add exceedLimitHint to picker.
catouse Sep 27, 2024
a709b7d
* list: refactor.
catouse Sep 29, 2024
33b9e8a
Calendar组件初始化
LingYe-007 Jul 16, 2024
76fbe41
日历头部状态逻辑
LingYe-007 Jul 16, 2024
060be6b
Calendar计算日期
LingYe-007 Jul 16, 2024
4ed8919
日历内容初始化
LingYe-007 Jul 17, 2024
c6d253d
日历事件数据处理
LingYe-007 Jul 17, 2024
ba9c1e9
dragFix
LingYe-007 Aug 20, 2024
0e26925
color && locale
LingYe-007 Aug 21, 2024
f8d2947
color && locale
LingYe-007 Aug 21, 2024
a7d282d
mapSetKey-fix
LingYe-007 Aug 23, 2024
c6c4c06
date Key Change
LingYe-007 Aug 23, 2024
33761fc
onDrag
LingYe-007 Aug 27, 2024
c8a5e25
onDrag
LingYe-007 Aug 27, 2024
fd22c4f
siderBar
LingYe-007 Aug 31, 2024
df6cfce
calendar_dev_compelete
LingYe-007 Sep 5, 2024
0579362
CSS-Update
LingYe-007 Sep 5, 2024
e4a7880
compelete
LingYe-007 Sep 11, 2024
576d24d
docs_dev
LingYe-007 Sep 29, 2024
d6cbe1c
yaml-fix
LingYe-007 Sep 30, 2024
974673f
Merge branch 'dev' into dev_calendar_up
LingYe-007 Sep 30, 2024
44c0a64
* utilities: add new animation utility "highlight".
catouse Sep 30, 2024
fd9e9ae
+ helpers: add deepCall helper to call method inside object.
catouse Oct 8, 2024
b053081
* core: optimize global commands mode.
catouse Oct 8, 2024
dd027cf
* core: support for setting proxy on find command element.
catouse Oct 8, 2024
9be163d
* popover: set command proxy to popover element.
catouse Oct 8, 2024
93ba49a
* core: support for setting command callbacks map with scope name.
catouse Oct 8, 2024
4072b03
* core: support for using commands in HElement.
catouse Oct 8, 2024
f7c95cc
* core: change type of CommandContext object.
catouse Oct 10, 2024
0a5fd91
* core: fix commands not work as expected.
catouse Oct 10, 2024
77ca52d
* button: support for setting command attribute to button.
catouse Oct 10, 2024
3281262
* helpers: set default this with current object of deepGet.
catouse Oct 10, 2024
1ddc0c1
* popover: fix element show class not remove after popover hided.
catouse Oct 10, 2024
5a3386e
* list: support for setting command attribute to listitem.
catouse Oct 10, 2024
385d90f
* core: support for execute command from HElement with only command …
catouse Oct 10, 2024
cc69723
* core: fix commands context not work as expected.
catouse Oct 13, 2024
33d73d8
* core: refactor.
catouse Oct 13, 2024
b5d6277
* dropdown: refactor.
catouse Oct 13, 2024
e06a348
* dtable: add rowConverter to convert rows from user.
catouse Oct 13, 2024
b4ac7cf
* dtable: refactor toolbar settings.
catouse Oct 13, 2024
321bd70
* popover: fix commands proxy not work from popovers.
catouse Oct 13, 2024
ae88a53
* tooltip: keep line break in tooltips.
catouse Oct 13, 2024
4ce5c90
* datetime-picker: add callback to set date allowed to select.
catouse Oct 13, 2024
ab5a6b0
* datetime-picker: rename isDateAllowed to isAllowDate.
catouse Oct 13, 2024
a5f3af6
* core: refactor types.
catouse Oct 14, 2024
89a3a6c
* datetime-picker: refactor.
catouse Oct 14, 2024
796fcd5
* pager: add callbacks to listen click event of pager buttons.
catouse Oct 14, 2024
afadc30
* tooltip: fix line wrap not work in tooltip without content.
catouse Oct 14, 2024
52bdf77
* dtable: support for using pager as local pager to filter data rows.
catouse Oct 16, 2024
9663203
* dtable: export pager plugin.
catouse Oct 16, 2024
8c2c3c7
* utilities: add css helper hover:shadow-lg.
catouse Oct 16, 2024
4ad69ee
* sortable: fix canSortTo not work in nested list in sortable tree.
catouse Oct 16, 2024
e344afb
* datetime-picker: support for setting hint on check date allowable.
catouse Oct 16, 2024
d3ec426
* pager: refactor pager state and change callbacks.
catouse Oct 16, 2024
93f43bf
* dtable: refactor pager callbacks.
catouse Oct 16, 2024
6bd5522
* core: refactor changeState in component with signals.
catouse Oct 18, 2024
121ef55
* core: support for calling custom commands from props manually.
catouse Oct 18, 2024
0138f77
* dtable: fix hide col clickable when it is disabled.
catouse Oct 18, 2024
e508881
* pager: add useState props to use state in pager.
catouse Oct 18, 2024
e4a4eca
* picker: scroll into active item in picker menu.
catouse Oct 18, 2024
f95170a
* dtable: fix picker options in dtable.
catouse Oct 18, 2024
b73d409
* dtable: refactor mousemove plugin.
catouse Oct 18, 2024
efec255
* dtable: refactor.
catouse Oct 21, 2024
3942d60
* core: add isShallowDiff helper.
catouse Oct 22, 2024
e8bd5c1
* dtable: fix dtable component with signal cause perf issue for sorti…
catouse Oct 22, 2024
9f9d92b
* core: fix format url not work object setting.
catouse Oct 29, 2024
87aa26f
* dtable: fix dtable not update as expected.
catouse Oct 29, 2024
e37202e
* core: remove unused helper.
catouse Oct 29, 2024
e41ddef
* pager: fix pager not update on mounted when using state.
catouse Oct 29, 2024
248f3e0
* picker: fix remote items fetcher not work object setting.
catouse Oct 29, 2024
ae9ea1d
+ core: add LazyContent component.
catouse Oct 29, 2024
89511e7
* core: support for using lazy content in CustomContent.
catouse Oct 29, 2024
2a9d358
* core: add fetcherThis and fetcherArgs to LazyConetnt.
catouse Oct 29, 2024
5a99de2
* core: refactor types.
catouse Oct 29, 2024
c6f2713
feat:calendar styles Fix
LingYe-007 Oct 31, 2024
435bc77
* core: fix undefined and null being strings.
YonLJ Oct 31, 2024
583cc89
*feat:样式修改
LingYe-007 Oct 31, 2024
2e0f710
*feat:样式修改
LingYe-007 Oct 31, 2024
83d59e8
feat:样式
LingYe-007 Oct 31, 2024
aa5dcab
feat:package Clear push
LingYe-007 Oct 31, 2024
f4f188e
Merge branch 'dev' into dev_calendar_up
catouse Oct 31, 2024
fb6ec8b
Merge pull request #227 from LingYe-007/dev_calendar_up
catouse Oct 31, 2024
7155dfe
* core: add more options to lazy content.
catouse Oct 31, 2024
6129fdf
* proj: fix merge conflict.
catouse Oct 31, 2024
8aa647e
- calendar: remove conflict style.
catouse Oct 31, 2024
bc7288d
* calendar: change lib state to wip.
catouse Nov 1, 2024
70bcd1f
* core: support for reloading lazy content by trigger a event.
catouse Nov 1, 2024
6e24823
* core: add life cycle methods to base component.
catouse Nov 1, 2024
bbb4d67
feat:样式修复重新改正
LingYe-007 Nov 3, 2024
4d56c16
Merge branch 'dev_calendar_up' of https://github.com/LingYe-007/zui i…
LingYe-007 Nov 3, 2024
ce35fd2
* core: refactor executeCommand method in HElement.
catouse Nov 3, 2024
fb4d509
feat:样式修改和事件移动bug
LingYe-007 Nov 3, 2024
83c269f
Merge branch 'dev' of https://github.com/easysoft/zui into dev
LingYe-007 Nov 3, 2024
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
7 changes: 7 additions & 0 deletions dev/zui-dev/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "zui-dev",
"description": "ZUI dev helpers",
"version": "0.0.1",
"type": "module",
"main": "src/main.ts"
}
26 changes: 26 additions & 0 deletions dev/zui-dev/src/dev.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
export type PageLoadListener = () => void;
export type PageUpdateListener = () => void;

export function onPageLoad(listener: PageLoadListener) {
const isLoaded = document.getElementById('libPage')?.classList.contains('is-loaded');
if (isLoaded) {
listener();
} else {
document.addEventListener('dev-page-load', listener);
}
}

export function onPageUpdate(listener: PageUpdateListener) {
onPageLoad(listener);
document.addEventListener('dev-page-update', listener);
}

Object.assign(globalThis, {
onPageLoad,
onPageUpdate,
});

declare global {
function onPageLoad(listener: PageLoadListener): void;
function onPageUpdate(listener: PageUpdateListener): void;
}
1 change: 1 addition & 0 deletions dev/zui-dev/src/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './dev';
2 changes: 1 addition & 1 deletion docs/_/.vitepress/theme-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const extLibs = [...zuiLib.reduce((set, lib) => {

function createNav() {
return [
{text: '指引', link: '/guide/start/', activeMatch: '/guide/'},
{text: '文档', link: '/guide/start/', activeMatch: '/guide/'},
{text: 'CSS 工具类', link: '/utilities/skin/utilities/solid', activeMatch: '/utilities/'},
{text: '组件', link: '/lib/components/button/', activeMatch: '/lib/'},
{text: 'ZUI1', link: 'https://openzui.com/1/'},
Expand Down
2 changes: 1 addition & 1 deletion lib/btn-group/src/types/btn-group-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type {CommonListProps, Item} from '@zui/common-list';
import type {BtnGroupItem} from './btn-group-item';

export interface BtnGroupOptions<T extends Item = BtnGroupItem> extends CommonListProps<T> {
size?: 'xs' | 'sm' | 'lg' | 'xl';
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
type?: string;
btnType?: string;
btnProps?: Partial<ButtonProps>;
Expand Down
13 changes: 8 additions & 5 deletions lib/button/src/component/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ export class Button<P extends ButtonProps = ButtonProps> extends HElement<P> {
}

protected _getChildren(props: RenderableProps<P>) {
const {loading, loadingIcon, loadingText, icon, text, children, trailingIcon, caret} = props;
const {loading, loadingIcon, loadingText, icon, iconClass, text, textClass, children, trailingIcon, trailingIconClass, caret} = props;
return [
loading ? <Icon icon={loadingIcon || 'icon-spinner-snake'} className="spin" /> : <Icon icon={icon} />,
this._isEmptyText ? null : <span className="text">{loading ? loadingText : text}</span>,
loading ? <Icon icon={loadingIcon || 'icon-spinner-snake'} className="spin" /> : <Icon icon={icon} className={iconClass} />,
this._isEmptyText ? null : <span className={classes('text', textClass)}>{loading ? loadingText : text}</span>,
loading ? null : children,
loading ? null : <Icon icon={trailingIcon} />,
loading ? null : <Icon icon={trailingIcon} className={trailingIconClass} />,
loading ? null : caret ? <span className={typeof caret === 'string' ? `caret-${caret}` : 'caret'} /> : null,
];
}
Expand All @@ -43,7 +43,7 @@ export class Button<P extends ButtonProps = ButtonProps> extends HElement<P> {

protected _getProps(props: RenderableProps<P>) {
const component = this._getComponent(props);
const {url, target, disabled, btnType = 'button', hint} = props;
const {url, target, disabled, btnType = 'button', hint, command} = props;
const asLink = component === 'a';
const componentProps: Record<string, unknown> = {
...super._getProps(props),
Expand All @@ -67,6 +67,9 @@ export class Button<P extends ButtonProps = ButtonProps> extends HElement<P> {
if (target !== undefined) {
componentProps[asLink ? 'target' : 'data-target'] = target;
}
if (command) {
componentProps['zui-command'] = command;
}
}
return componentProps;
}
Expand Down
8 changes: 6 additions & 2 deletions lib/button/src/types/button-props.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type {ComponentChildren, JSX} from 'preact';
import type {IconType, HElementProps} from '@zui/core';
import type {JSX, ComponentChildren} from 'preact';
import type {IconType, HElementProps, ClassNameLike} from '@zui/core';

export interface ButtonProps extends HElementProps {
type?: string; // primary, secondary ...
Expand All @@ -12,12 +12,16 @@ export interface ButtonProps extends HElementProps {
rounded?: boolean | string;
active?: boolean;
icon?: IconType;
iconClass?: ClassNameLike;
text?: ComponentChildren;
textClass?: ClassNameLike;
square?: boolean;
trailingIcon?: IconType;
trailingIconClass?: ClassNameLike;
caret?: 'up' | 'down' | 'left' | 'right' | boolean;
hint?: string;
loading?: boolean;
loadingIcon?: IconType;
loadingText?: string;
command?: string;
}
59 changes: 59 additions & 0 deletions lib/calendar/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Calendar 日历

用于展示和管理事件的日历组件。它允许用户查看日期、添加特定日期的事件来安排日程。提供可配置的事件与日历集。

## 基本使用

使用HTML标签 `<div>` 作为容器来实现日历组件,可使用zui-create-calendar、new zui.Calendar()等指令来配置日历组件。

## 默认样式

<div class="calendar-normal"></div>

## 自定义事件与事件集

<!-- 日历集和事件在日历中都可以进行自定义配置, 日历集和事件id都需要唯一,否则会导致日历显示异常。
事件与事件集的配置项如下: -->
事件是在日历中添加的具体事件,可自定义事件的颜色、文字、日期、拖拽回调函数、点击回调函数等。事件集是一组事件的集合与事件唯一关联。事件、事件集id都需要唯一。任意一个事件可进行拖拽来修改事件时间,并会触发回调函数。左侧日历集可决定属于该日日历集的事件是否显示。
<div class='calendar-event'></div>

## 可配置项

### 日历:
| 参数 | 类型 | 作用 |
|----------------------|:------------------------------------------------------:|------------------------------------------|
| `date` | Date | 当前日期 |
| `calendarEvents` | CalendarEvent[] | 当前的日历事件数组 |
| `calendarEventGroups`| CalendarEventGroup[] | 当前的事件组数组 |
| `mode` | 'day' \| 'week' \| 'year' | 日历的显示模式 |
| `showCalendarGroup` | boolean | 是否显示日历事件组 |
| `shrinkFreeWeekend` | boolean | 是否压缩空闲周末 |
| `onDateClick` | (date: Date) => void | 日期点击时的回调函数 |
| `onDragChange` | (newState: DraggableState, oldState: DraggableState) => void | 拖动状态变化时的回调函数 |
| `onEventClick` | (e: CalendarEvent) => void | 事件点击时的回调函数 |
| `maxVisibleEvents` | number | 每个日期最大可见事件数量 |
|


### 事件属性:
calendarEvent:

| 参数 | 类型 | 作用 |
| ------------- |:-------------:| ----- |
| `id` | string | 事件的唯一标识符 |
| `title` | string | 事件的标题 |
| `calendarEventGroup` | string | 事件所属的事件组ID |
| `date` | Date | 事件的日期 |
| `description` | string | 事件的描述(可选) |

### 事件集:
CalendarEventGroups:

| 参数 | 类型 | 作用 |
| ------------- |:-------------:| ----- |
| `id` | string | 事件组的唯一标识符 |
| `title` | string | 事件组的标题(可选) |
| `color` | string | 事件组的颜色(可选) |
| `checked` | boolean | 事件组是否被选中(可选) |


121 changes: 121 additions & 0 deletions lib/calendar/dev.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
import 'preact/debug';
import 'zui-dev';
import {Calendar} from './src/main';

onPageLoad(() => {
const calendarNormal = new Calendar('.calendar-normal', {});
const calendarEvent = new Calendar('.calendar-event', {
maxVisibleEvents:2,
shrinkFreeWeekend:true,
calendarEvents:[{
id: '1',
title: '观看天花板',
calendarEventGroup: '1',
date:new Date(2024, 10, 25, 9, 29, 12, 34),
description: '观看天花板',
},
{
id: '2',
title: '和绿巨人睡觉',
calendarEventGroup: '2',
date:new Date(2024, 10, 26, 7, 12, 47),
description: '和绿巨人睡觉',
},
{
id: '3',
title: '和路人乙捶打',
calendarEventGroup: '3',
date:new Date(2024, 10, 27, 7, 30, 30),
description: '和路人乙捶打',
},
{
id: '4',
title: '自言自语',
calendarEventGroup: '4',
date:new Date(2024, 10, 28, 1, 58, 30),
description: '自言自语',
},
{
id: '5',
title: '观望天花板',
calendarEventGroup: '5',
date:new Date(2024, 10, 29, 7, 30, 30),
description: '观望天花板',
},
{
id: '6',
title: 'event3',
calendarEventGroup: '1',
date:new Date(2024, 11, 9),
description: '你好呀',
},
],
calendarEventGroups:[{
id: '1',
title: 'event set 1',
color: '#f39988'}, {
id: '2',
title: 'event set 2',
color: '#d4a785'}, {id: '3', title: 'event set 3', color: '#29bcd2'},
{id: '4', title: 'event set 4', color: '#7ec67e'},
{id: '5', title: 'event set 5', color: '#f1bd73'}]});
const calendar = new Calendar('.calendar', {
maxVisibleEvents:2,
shrinkFreeWeekend:true,
calendarEvents:[{
id: '1',
title: '观看天花板',
calendarEventGroup: '1',
date:new Date(2024, 8, 25, 9, 29),
description: '观看天花板',
},
{
id: '2',
title: '和绿巨人睡觉',
calendarEventGroup: '2',
date:new Date(2024, 8, 26, 7, 12, 47),
description: '和绿巨人睡觉',
},
{
id: '3',
title: '和路人乙捶打',
calendarEventGroup: '3',
date:new Date(2024, 8, 27, 7, 30, 30),
description: '和路人乙捶打',
},
{
id: '4',
title: '自言自语',
calendarEventGroup: '4',
date:new Date(2024, 8, 28, 1, 58, 30),
description: '自言自语',
},
{
id: '5',
title: '观望天花板',
calendarEventGroup: '5',
date:new Date(2024, 8, 29, 7, 30, 30),
description: '观望天花板',
},
{
id: '6',
title: 'event3',
calendarEventGroup: '1',
date:new Date(2024, 7, 9),
description: '你好呀',
},
],
calendarEventGroups:[{
id: '1',
title: 'event set 1',
color: '#f39988'}, {
id: '2',
title: 'event set 2',
color: '#d4a785'}, {id: '3', title: 'event set 3', color: '#29bcd2'},
{id: '4', title: 'event set 4', color: '#7ec67e'},
{id: '5', title: 'event set 5', color: '#f1bd73'}]});

console.log('> calendar-normal instance created', calendarNormal);
console.log('> calendar-event instance created', calendarEvent);
console.log('> calendar instance created', calendar);
});
59 changes: 59 additions & 0 deletions lib/calendar/docs/lib/components/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Calendar 日历

用于展示和管理事件的日历组件。它允许用户查看日期、添加特定日期的事件来安排日程。提供可配置的事件与日历集。

## 基本使用

使用HTML标签 `<div>` 作为容器来实现日历组件,可使用zui-create-calendar、new zui.Calendar()等指令来配置日历组件。

## 默认样式

<div class="calendar-normal"></div>

## 自定义事件与事件集

<!-- 日历集和事件在日历中都可以进行自定义配置, 日历集和事件id都需要唯一,否则会导致日历显示异常。
事件与事件集的配置项如下: -->
事件是在日历中添加的具体事件,可自定义事件的颜色、文字、日期、拖拽回调函数、点击回调函数等。事件集是一组事件的集合与事件唯一关联。事件、事件集id都需要唯一。任意一个事件可进行拖拽来修改事件时间,并会触发回调函数。左侧日历集可决定属于该日日历集的事件是否显示。
<div class='calendar-event'></div>

## 可配置项

### 日历:
| 参数 | 类型 | 作用 |
|----------------------|:------------------------------------------------------:|------------------------------------------|
| `date` | Date | 当前日期 |
| `calendarEvents` | CalendarEvent[] | 当前的日历事件数组 |
| `calendarEventGroups`| CalendarEventGroup[] | 当前的事件组数组 |
| `mode` | 'day' \| 'week' \| 'year' | 日历的显示模式 |
| `showCalendarGroup` | boolean | 是否显示日历事件组 |
| `shrinkFreeWeekend` | boolean | 是否压缩空闲周末 |
| `onDateClick` | (date: Date) => void | 日期点击时的回调函数 |
| `onDragChange` | (newState: DraggableState, oldState: DraggableState) => void | 拖动状态变化时的回调函数 |
| `onEventClick` | (e: CalendarEvent) => void | 事件点击时的回调函数 |
| `maxVisibleEvents` | number | 每个日期最大可见事件数量 |
|


### 事件属性:
calendarEvent:

| 参数 | 类型 | 作用 |
| ------------- |:-------------:| ----- |
| `id` | string | 事件的唯一标识符 |
| `title` | string | 事件的标题 |
| `calendarEventGroup` | string | 事件所属的事件组ID |
| `date` | Date | 事件的日期 |
| `description` | string | 事件的描述(可选) |

### 事件集:
CalendarEventGroups:

| 参数 | 类型 | 作用 |
| ------------- |:-------------:| ----- |
| `id` | string | 事件组的唯一标识符 |
| `title` | string | 事件组的标题(可选) |
| `color` | string | 事件组的颜色(可选) |
| `checked` | boolean | 事件组是否被选中(可选) |


38 changes: 38 additions & 0 deletions lib/calendar/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "@zui/calendar",
"description": "ZUI Calendar",
"version": "0.0.1",
"keywords": [
"js",
"cs",
"zui:component"
],
"main": "src/main.ts",
"module": "src/main.ts",
"browser": "src/main.ts",
"dependencies": {
"@zui/core": "workspace:^0.0.1",
"@zui/helpers": "workspace:^0.0.1"
},
"files": [
"./src/**/*"
],
"devDependencies": {
"zui-dev": "workspace:^0.0.1"
},
"zui": {
"type": "component",
"displayName": "日历",
"notReady": true,
"wip": true,
"contributes": {
"css": [
"class",
"var"
],
"js": [
"component"
]
}
}
}
Loading