@fibrae/semi-ui-svelte 0.1.1 → 0.3.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/dist/_base/create-context.js +0 -1
- package/dist/_base/css-animation.js +0 -1
- package/dist/_base/group-role.d.ts +0 -1
- package/dist/_base/group-role.js +0 -1
- package/dist/_base/slot-kind.d.ts +0 -1
- package/dist/_base/slot-kind.js +0 -1
- package/dist/_base/teleport.d.ts +0 -2
- package/dist/_base/teleport.js +0 -2
- package/dist/_base/use-click-outside.svelte.d.ts +2 -2
- package/dist/_base/use-click-outside.svelte.js +2 -2
- package/dist/_base/use-foundation.svelte.js +2 -5
- package/dist/_base/virtual-list.svelte +2 -3
- package/dist/_base/virtual-list.svelte.d.ts +0 -1
- package/dist/_sortable/interface.d.ts +0 -1
- package/dist/anchor/interface.d.ts +0 -3
- package/dist/anchor/link-item.svelte +0 -1
- package/dist/anchor/links.d.ts +0 -1
- package/dist/anchor/links.js +0 -1
- package/dist/audio-player/audio-player.svelte +0 -2
- package/dist/audio-player/audio-slider.svelte +0 -3
- package/dist/auto-complete/auto-complete.svelte +0 -5
- package/dist/auto-complete/interface.d.ts +0 -9
- package/dist/avatar/avatar-group-more.svelte +0 -1
- package/dist/avatar/avatar.svelte +0 -4
- package/dist/avatar/context.d.ts +0 -1
- package/dist/avatar/interface.d.ts +0 -4
- package/dist/backtop/backtop.svelte +0 -2
- package/dist/backtop/interface.d.ts +0 -1
- package/dist/badge/interface.d.ts +0 -1
- package/dist/banner/banner.svelte +1 -1
- package/dist/banner/interface.d.ts +1 -3
- package/dist/breadcrumb/breadcrumb-item.svelte +0 -1
- package/dist/breadcrumb/breadcrumb.svelte +0 -1
- package/dist/breadcrumb/interface.d.ts +0 -7
- package/dist/calendar/calendar.svelte +0 -1
- package/dist/calendar/day-calendar.svelte +0 -3
- package/dist/calendar/interface.d.ts +0 -8
- package/dist/calendar/month-calendar.svelte +0 -4
- package/dist/calendar/time-grid.svelte +0 -2
- package/dist/calendar/time-grid.svelte.d.ts +0 -1
- package/dist/calendar/use-today.svelte.d.ts +0 -1
- package/dist/calendar/use-today.svelte.js +0 -1
- package/dist/card/index.js +0 -1
- package/dist/card/interface.d.ts +0 -3
- package/dist/carousel/carousel.svelte +0 -4
- package/dist/carousel/interface.d.ts +0 -3
- package/dist/cascader/cascader.svelte +0 -6
- package/dist/cascader/interface.d.ts +0 -19
- package/dist/cascader/item.svelte +0 -4
- package/dist/cascader/item.svelte.d.ts +0 -4
- package/dist/checkbox/checkbox-group.svelte +0 -3
- package/dist/checkbox/checkbox.svelte +0 -4
- package/dist/checkbox/index.js +0 -1
- package/dist/checkbox/interface.d.ts +0 -1
- package/dist/code-highlight/interface.d.ts +0 -1
- package/dist/collapse/collapse.svelte +0 -2
- package/dist/collapse/index.js +0 -1
- package/dist/collapse/interface.d.ts +0 -2
- package/dist/collapse/panel.svelte +0 -1
- package/dist/collapsible/collapsible.svelte +0 -2
- package/dist/color-picker/alpha-slider.svelte +0 -1
- package/dist/color-picker/color-choose-area.svelte +0 -1
- package/dist/color-picker/color-slider.svelte +0 -1
- package/dist/color-picker/data-part.svelte +0 -1
- package/dist/cropper/cropper.svelte +0 -1
- package/dist/cropper/interface.d.ts +0 -6
- package/dist/date-picker/date-input.svelte +0 -4
- package/dist/date-picker/date-picker.svelte +0 -7
- package/dist/date-picker/inset-input.svelte +0 -1
- package/dist/date-picker/interface.d.ts +0 -7
- package/dist/date-picker/internal.d.ts +0 -7
- package/dist/date-picker/month.svelte +0 -1
- package/dist/date-picker/months-grid.svelte +0 -6
- package/dist/date-picker/navigation.svelte +0 -1
- package/dist/descriptions/interface.d.ts +0 -1
- package/dist/divider/divider.svelte +0 -1
- package/dist/divider/interface.d.ts +0 -4
- package/dist/drag-move/drag-move.js +0 -1
- package/dist/drag-move/interface.d.ts +0 -3
- package/dist/dropdown/context.d.ts +0 -6
- package/dist/dropdown/context.js +0 -1
- package/dist/dropdown/dropdown-item.svelte +0 -1
- package/dist/dropdown/dropdown.svelte +0 -7
- package/dist/dropdown/interface.d.ts +0 -4
- package/dist/empty/empty.svelte +0 -1
- package/dist/empty/interface.d.ts +0 -3
- package/dist/feedback/feedback-content.svelte +4 -4
- package/dist/feedback/feedback.svelte +0 -1
- package/dist/feedback/interface.d.ts +4 -12
- package/dist/float-button/float-button-action.svelte +0 -2
- package/dist/float-button/interface.d.ts +0 -2
- package/dist/form/array-field.svelte +0 -2
- package/dist/form/context.d.ts +0 -2
- package/dist/form/error-message.svelte +0 -1
- package/dist/form/field-grid.svelte +0 -2
- package/dist/form/field-grid.svelte.d.ts +0 -2
- package/dist/form/field-inner.svelte +9 -5
- package/dist/form/field-inner.svelte.d.ts +3 -1
- package/dist/form/field.svelte +9 -2
- package/dist/form/field.svelte.d.ts +6 -2
- package/dist/form/form-auto-complete.svelte +7 -1
- package/dist/form/form-auto-complete.svelte.d.ts +3 -1
- package/dist/form/form-cascader.svelte +7 -1
- package/dist/form/form-cascader.svelte.d.ts +3 -1
- package/dist/form/form-checkbox-group.svelte +7 -1
- package/dist/form/form-checkbox-group.svelte.d.ts +3 -1
- package/dist/form/form-checkbox.svelte +7 -1
- package/dist/form/form-checkbox.svelte.d.ts +3 -1
- package/dist/form/form-date-picker.svelte +7 -1
- package/dist/form/form-date-picker.svelte.d.ts +3 -1
- package/dist/form/form-input-number.svelte +7 -1
- package/dist/form/form-input-number.svelte.d.ts +3 -1
- package/dist/form/form-input.svelte +7 -1
- package/dist/form/form-input.svelte.d.ts +3 -1
- package/dist/form/form-pin-code.svelte +7 -1
- package/dist/form/form-pin-code.svelte.d.ts +3 -1
- package/dist/form/form-radio-group.svelte +7 -1
- package/dist/form/form-radio-group.svelte.d.ts +3 -1
- package/dist/form/form-radio.svelte +7 -1
- package/dist/form/form-radio.svelte.d.ts +3 -1
- package/dist/form/form-rating.svelte +7 -1
- package/dist/form/form-rating.svelte.d.ts +3 -1
- package/dist/form/form-select.svelte +7 -1
- package/dist/form/form-select.svelte.d.ts +3 -1
- package/dist/form/form-slider.svelte +7 -1
- package/dist/form/form-slider.svelte.d.ts +3 -1
- package/dist/form/form-switch.svelte +7 -1
- package/dist/form/form-switch.svelte.d.ts +3 -1
- package/dist/form/form-tag-input.svelte +7 -1
- package/dist/form/form-tag-input.svelte.d.ts +3 -1
- package/dist/form/form-text-area.svelte +7 -1
- package/dist/form/form-text-area.svelte.d.ts +3 -1
- package/dist/form/form-time-picker.svelte +7 -1
- package/dist/form/form-time-picker.svelte.d.ts +3 -1
- package/dist/form/form-transfer.svelte +7 -1
- package/dist/form/form-transfer.svelte.d.ts +3 -1
- package/dist/form/form-tree-select.svelte +7 -1
- package/dist/form/form-tree-select.svelte.d.ts +3 -1
- package/dist/form/form-upload.svelte +7 -1
- package/dist/form/form-upload.svelte.d.ts +3 -1
- package/dist/form/form.svelte +0 -1
- package/dist/form/hooks.d.ts +1 -2
- package/dist/form/hooks.js +1 -2
- package/dist/form/interface.d.ts +0 -7
- package/dist/form/utils.d.ts +0 -1
- package/dist/form/utils.js +0 -2
- package/dist/highlight/interface.d.ts +0 -1
- package/dist/hot-keys/interface.d.ts +0 -1
- package/dist/icon-button/icon-button.svelte +6 -2
- package/dist/image/context.d.ts +0 -1
- package/dist/image/footer.d.ts +0 -1
- package/dist/image/interface.d.ts +0 -8
- package/dist/image/preview-image.svelte +0 -3
- package/dist/image/preview-image.svelte.d.ts +0 -1
- package/dist/image/preview-inner.svelte +0 -3
- package/dist/image/preview-inner.svelte.d.ts +0 -1
- package/dist/input/context.d.ts +0 -1
- package/dist/input/input-group.svelte +8 -2
- package/dist/input/interface.d.ts +0 -3
- package/dist/input/textarea.svelte +0 -3
- package/dist/input-number/input-number.svelte +0 -2
- package/dist/input-number/interface.d.ts +0 -1
- package/dist/json-viewer/interface.d.ts +0 -4
- package/dist/json-viewer/json-viewer.svelte +0 -3
- package/dist/layout/interface.d.ts +0 -2
- package/dist/list/interface.d.ts +0 -2
- package/dist/lottie/interface.d.ts +1 -1
- package/dist/markdown-render/code-text.js +0 -1
- package/dist/markdown-render/components/code.svelte +0 -1
- package/dist/markdown-render/components/heading.svelte +0 -1
- package/dist/markdown-render/components/p.svelte +0 -1
- package/dist/markdown-render/components/table.svelte +0 -1
- package/dist/markdown-render/components/tree.d.ts +0 -4
- package/dist/markdown-render/components/tree.js +0 -2
- package/dist/markdown-render/interface.d.ts +0 -1
- package/dist/markdown-render/markdown-children.svelte +0 -2
- package/dist/markdown-render/markdown-render.svelte +0 -1
- package/dist/markdown-render/runtime.js +0 -1
- package/dist/modal/confirm-modal.svelte +0 -1
- package/dist/modal/confirm.svelte.d.ts +0 -1
- package/dist/modal/confirm.svelte.js +0 -1
- package/dist/modal/index.js +0 -1
- package/dist/modal/interface.d.ts +0 -6
- package/dist/modal/modal-content.svelte +0 -4
- package/dist/modal/modal.svelte +0 -1
- package/dist/modal/use-show-hide.svelte.d.ts +0 -2
- package/dist/modal/use-show-hide.svelte.js +0 -4
- package/dist/navigation/context.d.ts +0 -2
- package/dist/navigation/index.js +0 -1
- package/dist/navigation/interface.d.ts +1 -17
- package/dist/navigation/item-shell.svelte +0 -4
- package/dist/navigation/item-shell.svelte.d.ts +0 -3
- package/dist/navigation/nav-footer.svelte +0 -2
- package/dist/navigation/nav-items.svelte +0 -1
- package/dist/navigation/nav.svelte +2 -2
- package/dist/navigation/sub-nav.svelte +0 -5
- package/dist/navigation/wrapper-outlet.svelte +0 -1
- package/dist/notification/context.d.ts +0 -3
- package/dist/notification/interface.d.ts +0 -5
- package/dist/notification/notice-list.svelte +0 -2
- package/dist/notification/notice-list.svelte.d.ts +0 -1
- package/dist/notification/notice.svelte +0 -2
- package/dist/notification/notification-list.svelte +0 -1
- package/dist/notification/static-api.js +0 -1
- package/dist/overflow-list/interface.d.ts +0 -2
- package/dist/overflow-list/overflow-list.svelte +0 -2
- package/dist/pagination/interface.d.ts +0 -1
- package/dist/pagination/pagination.svelte +0 -2
- package/dist/pagination/step-button.svelte +0 -3
- package/dist/pagination/step-button.svelte.d.ts +0 -1
- package/dist/pincode/interface.d.ts +0 -1
- package/dist/pincode/pincode.svelte +4 -5
- package/dist/popconfirm/interface.d.ts +0 -1
- package/dist/popconfirm/popconfirm.svelte +0 -2
- package/dist/popover/interface.d.ts +0 -1
- package/dist/popover/popover.svelte +0 -1
- package/dist/radio/index.js +0 -1
- package/dist/radio/radio-group.svelte +2 -2
- package/dist/radio/radio.svelte +0 -1
- package/dist/rating/interface.d.ts +0 -2
- package/dist/rating/item.svelte +0 -1
- package/dist/rating/rating.svelte +0 -7
- package/dist/resizable/interface.d.ts +0 -2
- package/dist/resizable/resizable.svelte +0 -1
- package/dist/resizable/resize-group.svelte +30 -14
- package/dist/resizable/resize-handler.svelte +0 -1
- package/dist/resize-observer/observe-resize.d.ts +1 -5
- package/dist/resize-observer/observe-resize.js +1 -5
- package/dist/scroll-list/index.js +0 -1
- package/dist/scroll-list/interface.d.ts +0 -2
- package/dist/scroll-list/scroll-item.svelte +0 -2
- package/dist/select/interface.d.ts +0 -14
- package/dist/select/option.svelte +0 -5
- package/dist/select/option.svelte.d.ts +0 -5
- package/dist/select/select.svelte +0 -14
- package/dist/side-sheet/interface.d.ts +0 -1
- package/dist/side-sheet/side-sheet.svelte +0 -9
- package/dist/skeleton/index.js +0 -1
- package/dist/skeleton/interface.d.ts +0 -2
- package/dist/skeleton/skeleton-item.svelte +0 -1
- package/dist/slider/interface.d.ts +0 -5
- package/dist/slider/slider.svelte +14 -11
- package/dist/space/interface.d.ts +0 -1
- package/dist/space/space.svelte +0 -1
- package/dist/steps/context.d.ts +0 -1
- package/dist/steps/interface.d.ts +0 -2
- package/dist/steps/step.svelte +0 -3
- package/dist/switch/switch.svelte +0 -2
- package/dist/table/body/base-row.svelte +0 -4
- package/dist/table/body/base-row.svelte.d.ts +0 -4
- package/dist/table/body/body.svelte +0 -7
- package/dist/table/body/body.svelte.d.ts +0 -5
- package/dist/table/body/expanded-row.svelte +0 -1
- package/dist/table/body/expanded-row.svelte.d.ts +0 -1
- package/dist/table/body/section-row.svelte +0 -2
- package/dist/table/body/section-row.svelte.d.ts +0 -2
- package/dist/table/column-filter-menu.svelte +0 -3
- package/dist/table/column-filter-menu.svelte.d.ts +0 -3
- package/dist/table/column-filter.svelte +0 -2
- package/dist/table/column-filter.svelte.d.ts +0 -2
- package/dist/table/column-selection.svelte +1 -2
- package/dist/table/column-selection.svelte.d.ts +0 -1
- package/dist/table/column-sorter.svelte +1 -6
- package/dist/table/column-sorter.svelte.d.ts +1 -6
- package/dist/table/context.d.ts +0 -10
- package/dist/table/context.js +0 -1
- package/dist/table/custom-expand-icon.svelte +0 -2
- package/dist/table/custom-expand-icon.svelte.d.ts +0 -2
- package/dist/table/head-table.svelte +0 -1
- package/dist/table/head-table.svelte.d.ts +0 -1
- package/dist/table/interface.d.ts +2 -21
- package/dist/table/table-cell.svelte +0 -7
- package/dist/table/table-cell.svelte.d.ts +0 -7
- package/dist/table/table-header-row.svelte +0 -2
- package/dist/table/table-header-row.svelte.d.ts +0 -2
- package/dist/table/table-pagination.svelte +0 -2
- package/dist/table/table-pagination.svelte.d.ts +0 -2
- package/dist/table/table.svelte +0 -5
- package/dist/table/utils.d.ts +1 -13
- package/dist/table/utils.js +1 -11
- package/dist/tabs/index.js +0 -1
- package/dist/tabs/interface.d.ts +0 -13
- package/dist/tabs/tab-bar.svelte +0 -3
- package/dist/tabs/tab-bar.svelte.d.ts +0 -1
- package/dist/tabs/tab-pane.svelte +0 -2
- package/dist/tabs/tabs.svelte +0 -1
- package/dist/tag-input/interface.d.ts +0 -5
- package/dist/tag-input/tag-input.svelte +2 -3
- package/dist/tag-input/tag-item.svelte +0 -1
- package/dist/tag-input/tag-item.svelte.d.ts +0 -1
- package/dist/time-picker/combobox.svelte +0 -1
- package/dist/time-picker/interface.d.ts +0 -9
- package/dist/time-picker/time-picker.svelte +0 -2
- package/dist/timeline/interface.d.ts +0 -4
- package/dist/timeline/timeline.svelte +0 -1
- package/dist/toast/context.d.ts +0 -2
- package/dist/toast/interface.d.ts +0 -2
- package/dist/toast/static-api.js +0 -1
- package/dist/toast/toast.svelte +0 -1
- package/dist/toast/use-toast.js +0 -1
- package/dist/tooltip/context.d.ts +0 -2
- package/dist/tooltip/interface.d.ts +0 -2
- package/dist/tooltip/tooltip.svelte +0 -5
- package/dist/transfer/interface.d.ts +1 -8
- package/dist/transfer/transfer-selected-item.svelte +0 -1
- package/dist/transfer/transfer-selected-item.svelte.d.ts +0 -1
- package/dist/transfer/transfer.svelte +3 -3
- package/dist/tree/auto-sizer.svelte +0 -1
- package/dist/tree/context.d.ts +0 -1
- package/dist/tree/interface.d.ts +0 -9
- package/dist/tree/node-collapsible.svelte +0 -1
- package/dist/tree/node-list.svelte +0 -4
- package/dist/tree/tree-node.svelte +0 -1
- package/dist/tree/tree.svelte +5 -3
- package/dist/tree/use-tree-keyboard.svelte.d.ts +1 -8
- package/dist/tree/use-tree-keyboard.svelte.js +1 -6
- package/dist/tree-select/interface.d.ts +0 -11
- package/dist/tree-select/tree-select.svelte +0 -2
- package/dist/typography/base.svelte +0 -2
- package/dist/typography/index.js +0 -1
- package/dist/typography/interface.d.ts +0 -1
- package/dist/typography/internal.d.ts +0 -2
- package/dist/upload/file-card.svelte +0 -1
- package/dist/upload/index.js +0 -1
- package/dist/upload/interface.d.ts +0 -4
- package/dist/upload/upload.svelte +0 -1
- package/dist/user-guide/interface.d.ts +0 -1
- package/dist/user-guide/user-guide.svelte +0 -1
- package/dist/video-player/video-progress.svelte +0 -2
- package/package.json +3 -3
|
@@ -11,14 +11,12 @@ type DataAttributes = {
|
|
|
11
11
|
type AriaAttributes = {
|
|
12
12
|
[key: `aria-${string}`]: unknown;
|
|
13
13
|
};
|
|
14
|
-
/** The attributes an `items` entry hands to its li */
|
|
15
14
|
interface EntryAttributes extends DataAttributes, AriaAttributes {
|
|
16
15
|
class?: ClassValue;
|
|
17
16
|
style?: string;
|
|
18
17
|
onmouseenter?: (event: MouseEvent) => void;
|
|
19
18
|
onmouseleave?: (event: MouseEvent) => void;
|
|
20
19
|
}
|
|
21
|
-
/** The attributes of the item or header link; Nav spreads them onto the a element */
|
|
22
20
|
export type NavLinkOptions = HTMLAnchorAttributes;
|
|
23
21
|
export interface NavItemProps extends Omit<HTMLAttributes<HTMLLIElement>, 'children'> {
|
|
24
22
|
disabled?: boolean;
|
|
@@ -54,7 +52,6 @@ export interface SelectedData {
|
|
|
54
52
|
text?: string | number;
|
|
55
53
|
domEvent?: MouseEvent | KeyboardEvent;
|
|
56
54
|
}
|
|
57
|
-
/** Dropdown props of a popup Sub */
|
|
58
55
|
export type SubDropdownProps = DropdownProps;
|
|
59
56
|
export interface SubNavProps extends Omit<HTMLAttributes<HTMLLIElement>, 'children'> {
|
|
60
57
|
disabled?: boolean;
|
|
@@ -67,7 +64,6 @@ export interface SubNavProps extends Omit<HTMLAttributes<HTMLLIElement>, 'childr
|
|
|
67
64
|
/** Applies when dropdownProps is not given */
|
|
68
65
|
subDropdownProps?: SubDropdownProps;
|
|
69
66
|
text?: string | number;
|
|
70
|
-
/** The Sub's items: Nav.Item and Nav.Sub, rendered in the inline list or the popup */
|
|
71
67
|
children?: Snippet;
|
|
72
68
|
/** Replaces the shown text. Named `label`: `text` is the prop, and a prop and a snippet share one namespace */
|
|
73
69
|
label?: Snippet;
|
|
@@ -98,7 +94,6 @@ export interface NavCollapseButtonProps {
|
|
|
98
94
|
}]>;
|
|
99
95
|
onToggle: () => void;
|
|
100
96
|
}
|
|
101
|
-
/** An entry of `items`: Item or Sub data, the attributes its li takes, and nested entries; Nav's snippets give its content */
|
|
102
97
|
export interface NavItemConfig extends EntryAttributes {
|
|
103
98
|
disabled?: boolean;
|
|
104
99
|
dropdownProps?: SubDropdownProps;
|
|
@@ -113,9 +108,7 @@ export interface NavItemConfig extends EntryAttributes {
|
|
|
113
108
|
tooltipHideDelay?: number;
|
|
114
109
|
tooltipShowDelay?: number;
|
|
115
110
|
}
|
|
116
|
-
/** A string entry is both the text and the itemKey of a plain item */
|
|
117
111
|
export type NavItems = (string | NavItemConfig)[];
|
|
118
|
-
/** The `header` prop as data; `logo` is a snippet shown with the header */
|
|
119
112
|
export interface NavHeaderConfig extends Omit<NavHeaderProps, 'children'> {
|
|
120
113
|
}
|
|
121
114
|
export interface NavFooterConfig extends Omit<NavFooterProps, 'children'> {
|
|
@@ -146,12 +139,10 @@ export interface NavWrapperArgs {
|
|
|
146
139
|
itemElement: Snippet;
|
|
147
140
|
isSubNav: boolean;
|
|
148
141
|
isInSubNav: boolean;
|
|
149
|
-
/** What the Nav.Item or Nav.Sub was given */
|
|
150
142
|
props: Partial<NavItemProps> | Partial<SubNavProps>;
|
|
151
143
|
}
|
|
152
144
|
export interface NavItemRenderProps {
|
|
153
145
|
item: NavItemConfig;
|
|
154
|
-
/** Nesting depth of the entry, 0 at the top */
|
|
155
146
|
level: number;
|
|
156
147
|
}
|
|
157
148
|
export interface NavProps extends Omit<HTMLAttributes<HTMLElement>, 'children'> {
|
|
@@ -165,7 +156,6 @@ export interface NavProps extends Omit<HTMLAttributes<HTMLElement>, 'children'>
|
|
|
165
156
|
openKeys?: ItemKey[] | null;
|
|
166
157
|
/** Bindable; null is a controlled empty value */
|
|
167
158
|
selectedKeys?: ItemKey[] | null;
|
|
168
|
-
/** Dropdown props of the Subs generated from `items` */
|
|
169
159
|
subDropdownProps?: SubDropdownProps;
|
|
170
160
|
subNavCloseDelay?: number;
|
|
171
161
|
subNavMotion?: boolean;
|
|
@@ -173,20 +163,14 @@ export interface NavProps extends Omit<HTMLAttributes<HTMLElement>, 'children'>
|
|
|
173
163
|
toggleIconPosition?: 'left' | 'right';
|
|
174
164
|
tooltipHideDelay?: number;
|
|
175
165
|
tooltipShowDelay?: number;
|
|
176
|
-
/** A config object, or content that holds a `NavHeader`; it shows before the list */
|
|
177
166
|
header?: NavHeaderConfig | Snippet;
|
|
178
|
-
/** A config object, or content that holds a `NavFooter`; it shows after the list */
|
|
179
167
|
footer?: NavFooterConfig | Snippet;
|
|
180
|
-
/** Nav.Item and Nav.Sub, after the ones made from `items` */
|
|
181
168
|
children?: Snippet;
|
|
182
169
|
wrapper?: Snippet<[NavWrapperArgs]>;
|
|
183
|
-
/** For the entries of `items` */
|
|
184
170
|
icon?: Snippet<[NavItemRenderProps & NavIconArgs]>;
|
|
185
|
-
/**
|
|
171
|
+
/** Without it the entry's text shows */
|
|
186
172
|
text?: Snippet<[NavItemRenderProps]>;
|
|
187
|
-
/** For the items made from `items` */
|
|
188
173
|
toggleIcon?: Snippet<[NavItemRenderProps & NavIconArgs]>;
|
|
189
|
-
/** For the Subs made from `items` */
|
|
190
174
|
expandIcon?: Snippet<[NavItemRenderProps & NavExpandIconArgs]>;
|
|
191
175
|
onClick?: (data: NavClickData) => void;
|
|
192
176
|
onCollapseChange?: (isCollapsed: boolean) => void;
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
import { getNavContext } from './context.js';
|
|
13
13
|
import type { NavIconArgs, NavLinkOptions, OnSelectedData, SelectedData } from './interface.js';
|
|
14
14
|
|
|
15
|
-
// The li of a Nav.Item or Nav.Sub, or the Dropdown.Item that stands in for it inside a popup
|
|
16
15
|
interface ItemShellProps extends Omit<HTMLAttributes<HTMLLIElement>, 'children'> {
|
|
17
16
|
isSubNav?: boolean;
|
|
18
17
|
/** Resolved by the caller: a Sub provides its own context to the subtree, which includes this shell */
|
|
@@ -20,7 +19,6 @@
|
|
|
20
19
|
level: number;
|
|
21
20
|
disabled?: boolean;
|
|
22
21
|
indent?: boolean | number;
|
|
23
|
-
/** Or'ed with the collapsed state of the Nav */
|
|
24
22
|
isCollapsed?: boolean;
|
|
25
23
|
itemKey?: ItemKey;
|
|
26
24
|
link?: string;
|
|
@@ -28,12 +26,10 @@
|
|
|
28
26
|
text?: string | number;
|
|
29
27
|
tooltipHideDelay?: number;
|
|
30
28
|
tooltipShowDelay?: number;
|
|
31
|
-
/** What the item was given, reported in `selectedItems` */
|
|
32
29
|
given: Record<string, unknown>;
|
|
33
30
|
icon?: Snippet<[NavIconArgs]>;
|
|
34
31
|
toggleIcon?: Snippet<[NavIconArgs]>;
|
|
35
32
|
label?: Snippet;
|
|
36
|
-
/** A Sub's title and list, in place of the control */
|
|
37
33
|
content?: Snippet;
|
|
38
34
|
onItemClick?: (data: SelectedData) => void;
|
|
39
35
|
}
|
|
@@ -9,7 +9,6 @@ interface ItemShellProps extends Omit<HTMLAttributes<HTMLLIElement>, 'children'>
|
|
|
9
9
|
level: number;
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
indent?: boolean | number;
|
|
12
|
-
/** Or'ed with the collapsed state of the Nav */
|
|
13
12
|
isCollapsed?: boolean;
|
|
14
13
|
itemKey?: ItemKey;
|
|
15
14
|
link?: string;
|
|
@@ -17,12 +16,10 @@ interface ItemShellProps extends Omit<HTMLAttributes<HTMLLIElement>, 'children'>
|
|
|
17
16
|
text?: string | number;
|
|
18
17
|
tooltipHideDelay?: number;
|
|
19
18
|
tooltipShowDelay?: number;
|
|
20
|
-
/** What the item was given, reported in `selectedItems` */
|
|
21
19
|
given: Record<string, unknown>;
|
|
22
20
|
icon?: Snippet<[NavIconArgs]>;
|
|
23
21
|
toggleIcon?: Snippet<[NavIconArgs]>;
|
|
24
22
|
label?: Snippet;
|
|
25
|
-
/** A Sub's title and list, in place of the control */
|
|
26
23
|
content?: Snippet;
|
|
27
24
|
onItemClick?: (data: SelectedData) => void;
|
|
28
25
|
}
|
|
@@ -10,8 +10,6 @@
|
|
|
10
10
|
const ctx = getNavContext('Nav.Footer');
|
|
11
11
|
|
|
12
12
|
const prefix = cssClasses.PREFIX;
|
|
13
|
-
|
|
14
|
-
// the button only takes an empty footer of a vertical nav
|
|
15
13
|
const showButton = $derived(!children && Boolean(collapseButton) && ctx.mode !== strings.MODE_HORIZONTAL);
|
|
16
14
|
</script>
|
|
17
15
|
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import type { NavItemType } from '@fibrae/semi-foundation/navigation/foundation';
|
|
4
4
|
import type { NavExpandIconArgs, NavIconArgs, NavItemConfig, NavItemRenderProps, SubDropdownProps } from './interface.js';
|
|
5
5
|
import NavItem from './nav-item.svelte';
|
|
6
|
-
// the template recurses through its own file
|
|
7
6
|
import NavItems from './nav-items.svelte';
|
|
8
7
|
import SubNav from './sub-nav.svelte';
|
|
9
8
|
|
|
@@ -57,7 +57,6 @@
|
|
|
57
57
|
const NO_TREE: NavItemType[] = [];
|
|
58
58
|
const prefix = cssClasses.PREFIX;
|
|
59
59
|
|
|
60
|
-
// null is a controlled empty value, which the foundation's readers handle
|
|
61
60
|
const foundationProps: NavigationBaseProps = {
|
|
62
61
|
get children() {
|
|
63
62
|
return children ? NO_TREE : undefined;
|
|
@@ -175,7 +174,8 @@
|
|
|
175
174
|
};
|
|
176
175
|
|
|
177
176
|
// $state.snapshot: a parent mutating its own array in place still shows up as a change
|
|
178
|
-
|
|
177
|
+
// children is part of it so the foundation compares the previous props with the same shape, otherwise every change looks like a new tree
|
|
178
|
+
const snapshot = () => ({ children: foundationProps.children, items, selectedKeys: $state.snapshot(selectedKeys), openKeys: $state.snapshot(openKeys) });
|
|
179
179
|
|
|
180
180
|
let previous = untrack(snapshot);
|
|
181
181
|
|
|
@@ -18,8 +18,6 @@
|
|
|
18
18
|
|
|
19
19
|
type Foundation = SubNavFoundation<SubNavBaseProps>;
|
|
20
20
|
type Adapter = SubNavAdapter<SubNavBaseProps>;
|
|
21
|
-
|
|
22
|
-
// the title takes the trigger props of a Dropdown, of a Tooltip, or none
|
|
23
21
|
type TitleTriggerProps = Omit<Partial<DropdownTriggerProps>, 'aria-haspopup' | 'aria-expanded'> & { 'aria-haspopup'?: 'menu' | 'dialog'; 'aria-expanded'?: boolean | 'true' | 'false' };
|
|
24
22
|
|
|
25
23
|
// Left undefined when not passed, so `wrapper` receives only what the Sub was given
|
|
@@ -65,8 +63,6 @@
|
|
|
65
63
|
const isSelected = $derived(itemKey !== undefined && outer.selectedKeys.includes(itemKey));
|
|
66
64
|
const horizontal = $derived(outer.mode === strings.MODE_HORIZONTAL);
|
|
67
65
|
const isPopup = $derived(outer.isCollapsed || horizontal);
|
|
68
|
-
|
|
69
|
-
// inside a popup menu the title is the menuitem that opens a submenu
|
|
70
66
|
const menuTitle = $derived(isPopup && outer.isInSubNav);
|
|
71
67
|
|
|
72
68
|
// A disabled Sub opens no Dropdown; collapsed, it shows its hidden text in a tooltip instead
|
|
@@ -119,7 +115,6 @@
|
|
|
119
115
|
// the title is a button (or a menuitem div); a disabled one stays focusable so that it can be found
|
|
120
116
|
const inlineAttrs = $derived(isPopup ? {} : { 'aria-controls': isOpen ? subListId : undefined, 'aria-expanded': isOpen });
|
|
121
117
|
|
|
122
|
-
// the child context: the Sub's own title and list are below it
|
|
123
118
|
setNavContext(
|
|
124
119
|
Object.create(outer, {
|
|
125
120
|
isInSubNav: { get: () => true },
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import { getNavContext } from './context.js';
|
|
4
4
|
import type { NavWrapperArgs } from './interface.js';
|
|
5
5
|
|
|
6
|
-
// Hands the item's li to the Nav's `wrapper` snippet when there is one; otherwise the li renders as it is
|
|
7
6
|
let { itemElement, isSubNav, isInSubNav, itemProps }: { itemElement: Snippet; isSubNav: boolean; isInSubNav: boolean; itemProps: NavWrapperArgs['props'] } = $props();
|
|
8
7
|
|
|
9
8
|
const ctx = getNavContext('Nav.Item');
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import type { NoticeInstance } from '@fibrae/semi-foundation/notification/notification-foundation';
|
|
2
2
|
import type { ConfigProps } from '@fibrae/semi-foundation/notification/notification-list-foundation';
|
|
3
|
-
/** A notice as the store holds it: `add` always has an id, and the offsets ride along from the options */
|
|
4
3
|
export type ListedNotice = NoticeInstance & Required<Pick<NoticeInstance, 'id'>> & Pick<ConfigProps, 'top' | 'bottom' | 'left' | 'right'>;
|
|
5
4
|
export interface NoticeListContext {
|
|
6
5
|
/** The pointer or focus is inside the position's list: every notice's countdown waits */
|
|
7
6
|
readonly paused: boolean;
|
|
8
|
-
/** The notices the latest store change updated in place */
|
|
9
7
|
readonly updatedItems: readonly NoticeInstance[];
|
|
10
|
-
/** The notices the store removed that are still leaving */
|
|
11
8
|
readonly removedItems: readonly NoticeInstance[];
|
|
12
9
|
/** Queues text for the live region; `read` runs when it is written */
|
|
13
10
|
announce: (key: string, read: () => string) => void;
|
|
@@ -18,22 +18,18 @@ export interface NoticeProps extends Omit<FoundationNoticeProps, 'title' | 'cont
|
|
|
18
18
|
left?: ConfigProps['left'];
|
|
19
19
|
right?: ConfigProps['right'];
|
|
20
20
|
}
|
|
21
|
-
/** Props of the single notice the list renders; list-level options are stripped before they reach it */
|
|
22
21
|
export interface NoticeItemProps extends Omit<NoticeProps, 'top' | 'bottom' | 'left' | 'right' | 'zIndex' | 'getPopupContainer' | 'stack' | 'position'> {
|
|
23
22
|
placement: NoticePosition;
|
|
24
23
|
stack?: boolean;
|
|
25
24
|
stackExpanded?: boolean;
|
|
26
25
|
/** Shown notices in front of this one, which sets how far it sinks behind them in a collapsed stack */
|
|
27
26
|
depth?: number;
|
|
28
|
-
/** z-index inside a stack, newest on top */
|
|
29
27
|
layer?: number;
|
|
30
28
|
/** The store removed the notice: it plays its leave animation, then calls `onLeaveEnd` */
|
|
31
29
|
leaving?: boolean;
|
|
32
30
|
onLeaveEnd?: () => void;
|
|
33
|
-
/** Asks the list to remove the notice, with its id */
|
|
34
31
|
close?: (id: string) => void;
|
|
35
32
|
}
|
|
36
|
-
/** A hook mounts its own wrapper, so the wrapper-level options do not apply */
|
|
37
33
|
export type NotificationHookOptions = Omit<NoticeProps, 'type' | 'id' | 'zIndex' | 'getPopupContainer'>;
|
|
38
34
|
export interface NotificationHookApi {
|
|
39
35
|
success: (config: NotificationHookOptions) => string;
|
|
@@ -44,7 +40,6 @@ export interface NotificationHookApi {
|
|
|
44
40
|
close: (id: string) => void;
|
|
45
41
|
}
|
|
46
42
|
export interface NoticeHandle {
|
|
47
|
-
/** Starts the duration over */
|
|
48
43
|
restartCloseTimer: () => void;
|
|
49
44
|
pauseCloseTimer: () => void;
|
|
50
45
|
resumeCloseTimer: () => void;
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
|
|
13
13
|
interface NoticeListProps {
|
|
14
14
|
placement: NoticePosition;
|
|
15
|
-
/** The position's notices, newest first, leaving ones included */
|
|
16
15
|
items: ListedNotice[];
|
|
17
16
|
removedItems: readonly NoticeInstance[];
|
|
18
17
|
updatedItems: readonly NoticeInstance[];
|
|
@@ -35,7 +34,6 @@
|
|
|
35
34
|
const threshold = $derived(getStackThreshold(items[0].stack ?? defaults('stack')));
|
|
36
35
|
const expanded = $derived(paused || shownCount <= threshold);
|
|
37
36
|
|
|
38
|
-
// The newest notice decides the list's offsets
|
|
39
37
|
const listStyle = $derived.by(() => {
|
|
40
38
|
const newest = items[0];
|
|
41
39
|
return {
|
|
@@ -3,7 +3,6 @@ import type NotificationListStore from '@fibrae/semi-foundation/notification/not
|
|
|
3
3
|
import { type ListedNotice } from './context.js';
|
|
4
4
|
interface NoticeListProps {
|
|
5
5
|
placement: NoticePosition;
|
|
6
|
-
/** The position's notices, newest first, leaving ones included */
|
|
7
6
|
items: ListedNotice[];
|
|
8
7
|
removedItems: readonly NoticeInstance[];
|
|
9
8
|
updatedItems: readonly NoticeInstance[];
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
import { getNoticeListContext } from './context.js';
|
|
15
15
|
import type { NoticeItemProps } from './interface.js';
|
|
16
16
|
|
|
17
|
-
// The foundation reads only these two
|
|
18
17
|
type FoundationProps = Pick<NoticeItemProps, 'id' | 'duration'>;
|
|
19
18
|
type Foundation = NotificationFoundation<FoundationProps>;
|
|
20
19
|
type Adapter = NoticeAdapter<FoundationProps>;
|
|
@@ -102,7 +101,6 @@
|
|
|
102
101
|
};
|
|
103
102
|
|
|
104
103
|
const handleAnimationEnd = (event: AnimationEvent) => {
|
|
105
|
-
// the content's own animations bubble up to here
|
|
106
104
|
if (event.target !== event.currentTarget) return;
|
|
107
105
|
if (!leaving) {
|
|
108
106
|
entered = true;
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
import type { NotificationListProps } from './interface.js';
|
|
11
11
|
import NoticeList from './notice-list.svelte';
|
|
12
12
|
|
|
13
|
-
// A list renders one store for its whole life
|
|
14
13
|
let { store }: NotificationListProps = $props();
|
|
15
14
|
const defaults = useDefaultProps('Notification');
|
|
16
15
|
|
|
@@ -14,7 +14,6 @@ let wrapper = null;
|
|
|
14
14
|
let list = null;
|
|
15
15
|
function addNotice(notice) {
|
|
16
16
|
assertClient('Notification', 'Notification.useNotification');
|
|
17
|
-
// an explicit undefined must not replace the defaults
|
|
18
17
|
const merged = { ...store.defaults, ...omitInstanceIds(semiGlobal.config.overrideDefaultProps?.Notification), ...omitBy(notice, (value) => value === undefined) };
|
|
19
18
|
const id = merged.id ?? createId('notification');
|
|
20
19
|
if (!wrapper) {
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
2
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
-
/** The default item shape: any record, read by `itemKey` */
|
|
4
3
|
export type OverflowListItem = Record<string, any>;
|
|
5
4
|
export type OverflowListKey = string | number;
|
|
6
5
|
export interface OverflowListItemSnippetProps<T> {
|
|
7
6
|
item: T;
|
|
8
|
-
/** The item's position in `items` */
|
|
9
7
|
index: number;
|
|
10
8
|
}
|
|
11
9
|
export interface OverflowListOverflowSnippetProps<T> {
|
|
@@ -56,7 +56,6 @@
|
|
|
56
56
|
return rest.style ? { css: rest.style } : undefined;
|
|
57
57
|
};
|
|
58
58
|
|
|
59
|
-
// The foundation reads the props through one object
|
|
60
59
|
const foundationProps: OverflowListBaseProps = {
|
|
61
60
|
get items() {
|
|
62
61
|
return readItems();
|
|
@@ -172,7 +171,6 @@
|
|
|
172
171
|
});
|
|
173
172
|
};
|
|
174
173
|
|
|
175
|
-
// Reset the view when items, style, keys or collapseFrom change, before the DOM shows the new props
|
|
176
174
|
$effect.pre(() => {
|
|
177
175
|
const next = viewProps();
|
|
178
176
|
// read keys here so in-place edits of a $state array are tracked
|
|
@@ -10,7 +10,6 @@ export interface PaginationProps extends Omit<HTMLAttributes<HTMLUListElement>,
|
|
|
10
10
|
size?: 'small' | 'default';
|
|
11
11
|
/** Bindable; leave it out for an uncontrolled page. `bind:currentPage={get, set}` makes it fully controlled */
|
|
12
12
|
currentPage?: number;
|
|
13
|
-
/** Not rendered when `size` is `small` */
|
|
14
13
|
showSizeChanger?: boolean;
|
|
15
14
|
showQuickJumper?: boolean;
|
|
16
15
|
/** Position of the omitted pages popover and the size changer dropdown; not used by the `small` size */
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
import RestPages from './rest-pages.svelte';
|
|
18
18
|
import StepButton from './step-button.svelte';
|
|
19
19
|
|
|
20
|
-
// The props the foundation reads, plus the ones its initial state reads
|
|
21
20
|
interface FoundationProps extends PaginationBaseProps {
|
|
22
21
|
defaultCurrentPage?: number;
|
|
23
22
|
pageSize?: number;
|
|
@@ -59,7 +58,6 @@
|
|
|
59
58
|
const globalCurrentPage = defaults('currentPage');
|
|
60
59
|
const globalPageSize = defaults('pageSize');
|
|
61
60
|
|
|
62
|
-
// $bindable needs destructuring, so the foundation reads the props through getters
|
|
63
61
|
const foundationProps: FoundationProps = {
|
|
64
62
|
get currentPage() {
|
|
65
63
|
return currentPage ?? globalCurrentPage;
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
|
|
8
8
|
interface StepButtonProps {
|
|
9
9
|
kind: 'prev' | 'next';
|
|
10
|
-
/** The locale name, kept unless the content is a lone text */
|
|
11
10
|
label: string;
|
|
12
11
|
disabled: boolean;
|
|
13
12
|
text?: string | Snippet;
|
|
@@ -19,8 +18,6 @@
|
|
|
19
18
|
let contentKind = $state<SlotKind>();
|
|
20
19
|
|
|
21
20
|
const prefix = cssClasses.PREFIX;
|
|
22
|
-
|
|
23
|
-
// A string names the button from the first frame; a snippet only after its rendered content is known
|
|
24
21
|
const namedByContent = $derived(typeof text === 'string' ? text !== '' : text !== undefined && contentKind === 'text');
|
|
25
22
|
|
|
26
23
|
// A snippet exposes nothing to read before it renders, so a lone text names the button from the second frame on;
|
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
|
|
21
21
|
const locale = useLocale('PinCode');
|
|
22
22
|
|
|
23
|
-
// each cell stores its own handle by index
|
|
24
23
|
let inputs = $state<(ReturnType<typeof Input> | undefined)[]>([]);
|
|
25
24
|
|
|
26
25
|
// The inputs are the focus targets, so their description and state go to each one; on the root a Tooltip's
|
|
@@ -30,7 +29,6 @@
|
|
|
30
29
|
// injected by Form: not DOM attributes, and no single cell carries the code's name
|
|
31
30
|
const dropped = new Set(['name', 'insetLabel', 'insetLabelId']);
|
|
32
31
|
|
|
33
|
-
// $bindable needs destructuring, so the foundation reads the props through getters
|
|
34
32
|
const foundationProps: PinCodeBaseProps = {
|
|
35
33
|
get value() {
|
|
36
34
|
return value;
|
|
@@ -88,13 +86,15 @@
|
|
|
88
86
|
// moving between the digits is not entering or leaving the code: Form's blur validation waits until focus is outside
|
|
89
87
|
const isOutside = (event: FocusEvent & { currentTarget: HTMLElement }) => !(event.relatedTarget instanceof Node && event.currentTarget.contains(event.relatedTarget));
|
|
90
88
|
|
|
91
|
-
const handleFocusIn = (event: FocusEvent & { currentTarget:
|
|
89
|
+
const handleFocusIn = (event: FocusEvent & { currentTarget: EventTarget & HTMLDivElement }) => {
|
|
90
|
+
rest.onfocusin?.(event);
|
|
92
91
|
if (isOutside(event)) {
|
|
93
92
|
onFocus?.(event);
|
|
94
93
|
}
|
|
95
94
|
};
|
|
96
95
|
|
|
97
|
-
const handleFocusOut = (event: FocusEvent & { currentTarget:
|
|
96
|
+
const handleFocusOut = (event: FocusEvent & { currentTarget: EventTarget & HTMLDivElement }) => {
|
|
97
|
+
rest.onfocusout?.(event);
|
|
98
98
|
if (isOutside(event)) {
|
|
99
99
|
onBlur?.(event);
|
|
100
100
|
}
|
|
@@ -105,7 +105,6 @@
|
|
|
105
105
|
(next) => foundation.updateValueList(Array.from(next || ''))
|
|
106
106
|
);
|
|
107
107
|
|
|
108
|
-
/** Focuses the input at `index` (0-based) with the caret after its character */
|
|
109
108
|
export function focus(index: number) {
|
|
110
109
|
inputs[index]?.focus();
|
|
111
110
|
inputs[index]?.setSelectionRange(1, 1);
|
|
@@ -16,7 +16,6 @@ export interface PopconfirmProps extends Omit<PopoverProps, 'content'> {
|
|
|
16
16
|
okText?: string;
|
|
17
17
|
okType?: ButtonType;
|
|
18
18
|
showCloseIcon?: boolean;
|
|
19
|
-
/** Names the dialog; a string or a snippet */
|
|
20
19
|
title?: string | Snippet;
|
|
21
20
|
content?: Snippet<[RenderContentProps]>;
|
|
22
21
|
/** Replaces the warning icon; `null` shows no icon */
|
|
@@ -103,7 +103,6 @@
|
|
|
103
103
|
// A disabled Popconfirm renders the trigger alone; a spread of no props leaves the user's element as written
|
|
104
104
|
const noTriggerProps = {} as TooltipTriggerProps;
|
|
105
105
|
|
|
106
|
-
// $bindable needs destructuring, so the foundation reads the props through getters
|
|
107
106
|
const foundationProps: PopconfirmBaseProps = {
|
|
108
107
|
get cancelButtonProps() {
|
|
109
108
|
return cancelButtonProps;
|
|
@@ -230,7 +229,6 @@
|
|
|
230
229
|
if (popoverVisible) foundation.handlePopupOpen();
|
|
231
230
|
});
|
|
232
231
|
|
|
233
|
-
/** Focuses the trigger (only with returnFocusOnClose and a non-custom trigger) */
|
|
234
232
|
export function focusTrigger() {
|
|
235
233
|
popover?.focusTrigger();
|
|
236
234
|
}
|
|
@@ -21,7 +21,6 @@ export interface PopoverProps {
|
|
|
21
21
|
* A combobox passes presentation because it points at the inner listbox itself
|
|
22
22
|
*/
|
|
23
23
|
role?: string;
|
|
24
|
-
/** On the popup */
|
|
25
24
|
class?: string;
|
|
26
25
|
/** On the popup; its `background-color` and `border-color` also color the arrow */
|
|
27
26
|
style?: string;
|
|
@@ -56,7 +56,6 @@
|
|
|
56
56
|
const popupSpacing = $derived(getPopoverSpacing(spacing, showArrow));
|
|
57
57
|
const stop = $derived(stopPropagation === undefined ? undefined : Boolean(stopPropagation));
|
|
58
58
|
|
|
59
|
-
/** Focuses the trigger (only with returnFocusOnClose and a non-custom trigger) */
|
|
60
59
|
export function focusTrigger() {
|
|
61
60
|
tooltip?.focusTrigger();
|
|
62
61
|
}
|
package/dist/radio/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import RadioGroupPart from './radio-group.svelte';
|
|
2
2
|
import RadioBase from './radio.svelte';
|
|
3
|
-
// Svelte components are functions, so the part attaches to the component itself
|
|
4
3
|
export const Radio = Object.assign(RadioBase, { Group: RadioGroupPart });
|
|
5
4
|
export { default as RadioGroup } from './radio-group.svelte';
|
|
@@ -38,7 +38,6 @@
|
|
|
38
38
|
const uid = $props.id();
|
|
39
39
|
const syncs = new SvelteSet<() => void>();
|
|
40
40
|
|
|
41
|
-
// $bindable needs destructuring, so the foundation reads the props through getters
|
|
42
41
|
const foundationProps: RadioGroupBaseProps = {
|
|
43
42
|
get mode() {
|
|
44
43
|
return mode;
|
|
@@ -110,7 +109,8 @@
|
|
|
110
109
|
});
|
|
111
110
|
|
|
112
111
|
// Moving between the radios is not leaving the group: a form's blur validation waits until focus is outside.
|
|
113
|
-
const handleFocusout = (event: FocusEvent & { currentTarget:
|
|
112
|
+
const handleFocusout = (event: FocusEvent & { currentTarget: EventTarget & HTMLDivElement }) => {
|
|
113
|
+
rest.onfocusout?.(event);
|
|
114
114
|
if (!(event.relatedTarget instanceof Node && event.currentTarget.contains(event.relatedTarget))) {
|
|
115
115
|
onBlur?.(event);
|
|
116
116
|
}
|
package/dist/radio/radio.svelte
CHANGED
|
@@ -46,7 +46,6 @@
|
|
|
46
46
|
// make an uncontrolled radio read as controlled; a `checked` equal to the echo counts as uncontrolled instead.
|
|
47
47
|
let echoed: boolean | undefined;
|
|
48
48
|
|
|
49
|
-
// $bindable needs destructuring, so the foundation reads the props through getters
|
|
50
49
|
const foundationProps: RadioBaseProps = {
|
|
51
50
|
get checked() {
|
|
52
51
|
return checked === echoed ? undefined : checked;
|
|
@@ -34,7 +34,6 @@ export interface RatingItemProps {
|
|
|
34
34
|
disabled: boolean;
|
|
35
35
|
count: number;
|
|
36
36
|
size: number | 'small' | 'default';
|
|
37
|
-
/** A custom unit used as is; otherwise the locale names it */
|
|
38
37
|
unit?: string;
|
|
39
38
|
preventScroll?: boolean;
|
|
40
39
|
/** No radio stands for the value: this star's first radio is the Tab stop */
|
|
@@ -42,7 +41,6 @@ export interface RatingItemProps {
|
|
|
42
41
|
character?: string | Snippet;
|
|
43
42
|
/** From a wrapping Tooltip: the description reaches the radios, the Tab stop is dropped */
|
|
44
43
|
trigger?: TooltipTriggerProps;
|
|
45
|
-
/** The pointer moved over the star: a preview of its value */
|
|
46
44
|
onPreview: (event: MouseEvent) => void;
|
|
47
45
|
onPick: (event: MouseEvent) => void;
|
|
48
46
|
/** Enter or Space on a radio, or a click without a pointer (assistive technology): the value that radio stands for */
|
package/dist/rating/item.svelte
CHANGED
|
@@ -71,7 +71,6 @@
|
|
|
71
71
|
}
|
|
72
72
|
};
|
|
73
73
|
|
|
74
|
-
/** Focuses the radio of this star that stands for `starValue`: the first half for a half value */
|
|
75
74
|
export function starFocus(starValue: number) {
|
|
76
75
|
const radio = RatingFoundation.isFirstRadio(starValue, index, allowHalf) ? first : second;
|
|
77
76
|
radio?.focus({ preventScroll });
|
|
@@ -14,8 +14,6 @@
|
|
|
14
14
|
import RatingItem from './item.svelte';
|
|
15
15
|
|
|
16
16
|
type ClickEvent = MouseEvent | KeyboardEvent;
|
|
17
|
-
|
|
18
|
-
// the DOM typings give relatedTarget as an EventTarget, but a focus event's is a Node or null
|
|
19
17
|
type ListFocusEvent = FocusEvent & RatingFocusEvent;
|
|
20
18
|
type Foundation = RatingFoundation<RatingBaseProps, RatingState, ClickEvent, ListFocusEvent, KeyboardEvent>;
|
|
21
19
|
type Adapter = RatingAdapter<RatingBaseProps, RatingState, ClickEvent, ListFocusEvent, KeyboardEvent>;
|
|
@@ -54,12 +52,10 @@
|
|
|
54
52
|
// roving Tab stop. A radiogroup has no control to carry a name.
|
|
55
53
|
const DROPPED_ATTRS = new Set(['tabindex', 'name']);
|
|
56
54
|
|
|
57
|
-
// $bindable needs destructuring, so the foundation reads the props through getters
|
|
58
55
|
const foundationProps: RatingBaseProps = {
|
|
59
56
|
get value() {
|
|
60
57
|
return value;
|
|
61
58
|
},
|
|
62
|
-
// an unset value starts empty, and a value that goes back to undefined returns to it
|
|
63
59
|
defaultValue: 0,
|
|
64
60
|
get count() {
|
|
65
61
|
return count;
|
|
@@ -87,7 +83,6 @@
|
|
|
87
83
|
(view) => RatingFoundation.getInitialState(view),
|
|
88
84
|
(base) => ({
|
|
89
85
|
focusStar: (starValue) => {
|
|
90
|
-
// a value between radios has no radio to focus: Tab's landing radio stands in, as for focus()
|
|
91
86
|
if (!RatingFoundation.isRadioValue(starValue, count, allowHalf)) {
|
|
92
87
|
focusTabStop();
|
|
93
88
|
return;
|
|
@@ -100,7 +95,6 @@
|
|
|
100
95
|
notifyHoverChange: (hoverValue) => onHoverChange?.(hoverValue),
|
|
101
96
|
setValue: (next) => base.setState({ value: next }),
|
|
102
97
|
notifyChange: (next) => {
|
|
103
|
-
// the bindable prop is the source of truth: bound, the write reaches the parent; unbound, it overrides locally
|
|
104
98
|
value = next;
|
|
105
99
|
onChange?.(next);
|
|
106
100
|
},
|
|
@@ -176,7 +170,6 @@
|
|
|
176
170
|
}
|
|
177
171
|
);
|
|
178
172
|
|
|
179
|
-
/** Focuses the radio that Tab would reach */
|
|
180
173
|
export function focus() {
|
|
181
174
|
if (!disabled) {
|
|
182
175
|
focusTabStop();
|
|
@@ -39,7 +39,6 @@ export interface ResizableProps extends Omit<HTMLAttributes<HTMLDivElement>, 'on
|
|
|
39
39
|
onChange?: ResizeCallback;
|
|
40
40
|
onResizeEnd?: ResizeCallback;
|
|
41
41
|
children?: Snippet;
|
|
42
|
-
/** Content of each enabled handle */
|
|
43
42
|
handle?: Snippet<[ResizableHandleSnippetProps]>;
|
|
44
43
|
}
|
|
45
44
|
export interface ResizeGroupProps extends HTMLAttributes<HTMLDivElement> {
|
|
@@ -58,6 +57,5 @@ export interface ResizeItemProps extends Omit<HTMLAttributes<HTMLDivElement>, 'o
|
|
|
58
57
|
children?: Snippet;
|
|
59
58
|
}
|
|
60
59
|
export interface ResizeHandlerProps extends HTMLAttributes<HTMLDivElement> {
|
|
61
|
-
/** Replaces the default grip icon */
|
|
62
60
|
children?: Snippet;
|
|
63
61
|
}
|