luna-plus 0.0.39 → 0.0.42
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/Affix/Affix.svelte +1 -1
- package/dist/Alert/Alert.svelte +6 -6
- package/dist/Autocomplete/Autocomplete.svelte +9 -9
- package/dist/Avatar/Avatar.svelte +5 -5
- package/dist/Backtop/Backtop.svelte +1 -1
- package/dist/Badge/Badge.svelte +4 -4
- package/dist/Breadcrumb/Breadcrumb.svelte +7 -7
- package/dist/Breadcrumb/BreadcrumbItem.svelte +6 -6
- package/dist/Button/Button.svelte +2 -2
- package/dist/Calendar/Calendar.svelte +16 -16
- package/dist/Card/Card.svelte +4 -4
- package/dist/Carousel/Carousel.svelte +6 -6
- package/dist/Carousel/CarouselItem.svelte +1 -1
- package/dist/Cascader/Cascader.svelte +12 -12
- package/dist/Checkbox/Checkbox.svelte +5 -5
- package/dist/Checkbox/CheckboxGroup.svelte +1 -1
- package/dist/Collapse/Collapse.svelte +1 -1
- package/dist/Collapse/CollapseItem.svelte +6 -6
- package/dist/ColorPicker/ColorPicker.svelte +13 -13
- package/dist/Container/Aside.svelte +1 -1
- package/dist/Container/Container.svelte +1 -1
- package/dist/Container/Footer.svelte +1 -1
- package/dist/Container/Header.svelte +1 -1
- package/dist/Container/Main.svelte +1 -1
- package/dist/DatePicker/DatePicker.svelte +20 -20
- package/dist/DateTimePicker/DateTimePicker.svelte +31 -31
- package/dist/Descriptions/Descriptions.svelte +6 -6
- package/dist/Descriptions/DescriptionsItem.svelte +6 -6
- package/dist/Dialog/Dialog.svelte +15 -9
- package/dist/Divider/Divider.svelte +6 -6
- package/dist/Drawer/Drawer.svelte +8 -8
- package/dist/Dropdown/Dropdown.svelte +8 -8
- package/dist/Dropdown/DropdownItem.svelte +2 -2
- package/dist/Dropdown/DropdownMenu.svelte +1 -1
- package/dist/Empty/Empty.svelte +4 -4
- package/dist/Form/Form.svelte +1 -1
- package/dist/Form/FormItem.svelte +4 -4
- package/dist/Icon/Icon.svelte +1 -1
- package/dist/Image/Image.svelte +13 -13
- package/dist/Input/Input.svelte +7 -7
- package/dist/InputNumber/InputNumber.svelte +7 -7
- package/dist/InputTag/InputTag.svelte +4 -4
- package/dist/Link/Link.svelte +1 -1
- package/dist/Loading/Loading.svelte +6 -6
- package/dist/Menu/Menu.svelte +10 -10
- package/dist/Message/Message.svelte +4 -4
- package/dist/Message/MessageQueue.svelte +4 -4
- package/dist/Message/message.js +1 -1
- package/dist/MessageBox/MessageBox.svelte +6 -6
- package/dist/MessageBox/messageBox.js +2 -2
- package/dist/Notification/Notification.svelte +8 -8
- package/dist/Pagination/Pagination.svelte +19 -19
- package/dist/PinInput/PinInput.svelte +2 -2
- package/dist/Popconfirm/Popconfirm.svelte +8 -8
- package/dist/Popover/Popover.svelte +5 -5
- package/dist/Progress/Progress.svelte +4 -4
- package/dist/Radio/Radio.svelte +5 -5
- package/dist/Radio/RadioGroup.svelte +1 -1
- package/dist/Rating/Rating.svelte +7 -7
- package/dist/Result/Result.svelte +6 -6
- package/dist/Segmented/Segmented.svelte +4 -4
- package/dist/Select/Option.svelte +1 -1
- package/dist/Select/OptionGroup.svelte +3 -3
- package/dist/Select/Select.svelte +13 -13
- package/dist/Skeleton/Skeleton.svelte +2 -2
- package/dist/Skeleton/SkeletonItem.svelte +1 -1
- package/dist/Slider/Slider.svelte +12 -12
- package/dist/Space/Space.svelte +5 -5
- package/dist/Statistic/Countdown.svelte +6 -6
- package/dist/Statistic/Statistic.svelte +6 -6
- package/dist/Steps/Step.svelte +8 -8
- package/dist/Steps/Steps.svelte +1 -1
- package/dist/Switch/Switch.svelte +7 -7
- package/dist/Table/Table.svelte +32 -32
- package/dist/Tabs/TabPane.svelte +1 -1
- package/dist/Tabs/Tabs.svelte +14 -14
- package/dist/Tabs/TabsContext.js +1 -1
- package/dist/Tag/Tag.svelte +2 -2
- package/dist/Textarea/Textarea.svelte +3 -3
- package/dist/TimePicker/TimePicker.svelte +19 -19
- package/dist/Timeline/Timeline.svelte +1 -1
- package/dist/Timeline/TimelineItem.svelte +7 -7
- package/dist/Tooltip/OverflowTooltip.svelte +5 -5
- package/dist/Tooltip/Tooltip.svelte +3 -3
- package/dist/Transfer/Transfer.svelte +30 -25
- package/dist/Tree/Tree.svelte +1 -1
- package/dist/Tree/TreeNode.svelte +6 -6
- package/dist/TreeSelect/TreeSelect.svelte +25 -25
- package/dist/Upload/Upload.svelte +32 -32
- package/dist/Watermark/Watermark.svelte +3 -3
- package/package.json +1 -1
- package/styles/index.css +1 -1
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
|
|
55
55
|
const panelStyle = $derived(isHorizontal ? `width: ${sizeStyle}` : `height: ${sizeStyle}`)
|
|
56
56
|
|
|
57
|
-
const classes = $derived(`
|
|
57
|
+
const classes = $derived(`ln-drawer ln-drawer--${direction}${visible ? ' is-open' : ''}${closing ? ' is-closing' : ''}${cls ? ` ${cls}` : ''}`)
|
|
58
58
|
|
|
59
59
|
const close = async (): Promise<void> => {
|
|
60
60
|
if (closing) return
|
|
@@ -101,15 +101,15 @@
|
|
|
101
101
|
{#if visible || closing}
|
|
102
102
|
<div bind:this={drawerRef} class={classes} role="dialog" aria-modal="true" tabindex="-1" onkeydown={handleKeydown} {...attrs}>
|
|
103
103
|
{#if modal}
|
|
104
|
-
<div class="
|
|
104
|
+
<div class="ln-drawer__overlay" onclick={handleOverlayClick} aria-hidden="true"></div>
|
|
105
105
|
{/if}
|
|
106
106
|
|
|
107
|
-
<div class="
|
|
108
|
-
<header class="
|
|
107
|
+
<div class="ln-drawer__panel" style={panelStyle}>
|
|
108
|
+
<header class="ln-drawer__header">
|
|
109
109
|
{#if header}
|
|
110
110
|
{@render header()}
|
|
111
111
|
{:else if title}
|
|
112
|
-
<span class="
|
|
112
|
+
<span class="ln-drawer__title">
|
|
113
113
|
{#if typeof title === 'string'}
|
|
114
114
|
{title}
|
|
115
115
|
{:else}
|
|
@@ -119,20 +119,20 @@
|
|
|
119
119
|
{/if}
|
|
120
120
|
|
|
121
121
|
{#if showClose}
|
|
122
|
-
<button type="button" class="
|
|
122
|
+
<button type="button" class="ln-drawer__close" onclick={close} aria-label="Close">
|
|
123
123
|
<Icon icon={X} size={16} />
|
|
124
124
|
</button>
|
|
125
125
|
{/if}
|
|
126
126
|
</header>
|
|
127
127
|
|
|
128
|
-
<div class="
|
|
128
|
+
<div class="ln-drawer__body">
|
|
129
129
|
{#if children}
|
|
130
130
|
{@render children()}
|
|
131
131
|
{/if}
|
|
132
132
|
</div>
|
|
133
133
|
|
|
134
134
|
{#if footer}
|
|
135
|
-
<footer class="
|
|
135
|
+
<footer class="ln-drawer__footer">
|
|
136
136
|
{@render footer({ close })}
|
|
137
137
|
</footer>
|
|
138
138
|
{/if}
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
let showTimer: ReturnType<typeof setTimeout> | null = null;
|
|
33
33
|
let hideTimer: ReturnType<typeof setTimeout> | null = null;
|
|
34
34
|
|
|
35
|
-
const dropdownId = `
|
|
35
|
+
const dropdownId = `ln-dropdown-${Math.random().toString(36).slice(2, 9)}`;
|
|
36
36
|
|
|
37
37
|
const clearTimers = (): void => {
|
|
38
38
|
if (showTimer) {
|
|
@@ -260,11 +260,11 @@
|
|
|
260
260
|
});
|
|
261
261
|
|
|
262
262
|
const rootClasses = $derived(
|
|
263
|
-
`
|
|
263
|
+
`ln-dropdown ln-dropdown--${size}${visible ? " is-open" : ""}${disabled ? " is-disabled" : ""}${cls ? ` ${cls}` : ""}`,
|
|
264
264
|
);
|
|
265
265
|
|
|
266
266
|
const dropdownClasses = $derived(
|
|
267
|
-
`
|
|
267
|
+
`ln-dropdown__popper is-${actualPlacement}${popperClass ? ` ${popperClass}` : ""}`,
|
|
268
268
|
);
|
|
269
269
|
|
|
270
270
|
const maxHeightStyle = $derived(
|
|
@@ -279,14 +279,14 @@
|
|
|
279
279
|
<div
|
|
280
280
|
class={rootClasses}
|
|
281
281
|
bind:this={rootEl}
|
|
282
|
-
style="--
|
|
282
|
+
style="--ln-dropdown-offset: {offset}px;"
|
|
283
283
|
role="group"
|
|
284
284
|
tabindex="-1"
|
|
285
285
|
onpointerover={handleHoverEnter}
|
|
286
286
|
onpointerout={handleHoverLeave}
|
|
287
287
|
>
|
|
288
288
|
<div
|
|
289
|
-
class="
|
|
289
|
+
class="ln-dropdown__trigger"
|
|
290
290
|
role="button"
|
|
291
291
|
tabindex={disabled ? -1 : 0}
|
|
292
292
|
aria-haspopup="menu"
|
|
@@ -308,15 +308,15 @@
|
|
|
308
308
|
class={dropdownClasses}
|
|
309
309
|
role="menu"
|
|
310
310
|
tabindex="-1"
|
|
311
|
-
style:--
|
|
311
|
+
style:--ln-dropdown-max-height={maxHeightStyle}
|
|
312
312
|
in:fly={flyParams}
|
|
313
313
|
out:fly={flyParams}
|
|
314
314
|
bind:this={popperEl}
|
|
315
315
|
>
|
|
316
316
|
{#if showArrow}
|
|
317
|
-
<div class="
|
|
317
|
+
<div class="ln-dropdown__arrow" aria-hidden="true"></div>
|
|
318
318
|
{/if}
|
|
319
|
-
<div class="
|
|
319
|
+
<div class="ln-dropdown__content">
|
|
320
320
|
{#if dropdown}
|
|
321
321
|
{@render dropdown()}
|
|
322
322
|
{/if}
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
const classes = $derived(
|
|
31
|
-
`
|
|
31
|
+
`ln-dropdown-item${disabled ? " is-disabled" : ""}${divided ? " is-divided" : ""}${danger ? " is-danger" : ""}${cls ? ` ${cls}` : ""}`,
|
|
32
32
|
);
|
|
33
33
|
</script>
|
|
34
34
|
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
onkeydown={handleKeyDown}
|
|
42
42
|
>
|
|
43
43
|
{#if icon}
|
|
44
|
-
<span class="
|
|
44
|
+
<span class="ln-dropdown-item__icon">
|
|
45
45
|
{@render icon()}
|
|
46
46
|
</span>
|
|
47
47
|
{/if}
|
package/dist/Empty/Empty.svelte
CHANGED
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
|
|
12
12
|
let { description = '暂无数据', image, children, actions, class: cls = '', ...attrs }: EmptyProps = $props()
|
|
13
13
|
|
|
14
|
-
const classes = $derived(cls ? `
|
|
14
|
+
const classes = $derived(cls ? `ln-empty ${cls}` : 'ln-empty')
|
|
15
15
|
</script>
|
|
16
16
|
|
|
17
17
|
<div {...attrs} class={classes} aria-live="polite">
|
|
18
|
-
<div class="
|
|
18
|
+
<div class="ln-empty__image" aria-hidden="true">
|
|
19
19
|
{#if image}
|
|
20
20
|
{@render image()}
|
|
21
21
|
{:else}
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
</svg>
|
|
28
28
|
{/if}
|
|
29
29
|
</div>
|
|
30
|
-
<div class="
|
|
30
|
+
<div class="ln-empty__description">
|
|
31
31
|
{#if children}
|
|
32
32
|
{@render children()}
|
|
33
33
|
{:else}
|
|
@@ -35,6 +35,6 @@
|
|
|
35
35
|
{/if}
|
|
36
36
|
</div>
|
|
37
37
|
{#if actions}
|
|
38
|
-
<div class="
|
|
38
|
+
<div class="ln-empty__actions">{@render actions()}</div>
|
|
39
39
|
{/if}
|
|
40
40
|
</div>
|
package/dist/Form/Form.svelte
CHANGED
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
|
|
60
60
|
setContext(FORM_CONTEXT_KEY, formContext)
|
|
61
61
|
|
|
62
|
-
const classes = $derived(`
|
|
62
|
+
const classes = $derived(`ln-form ln-form--${size}${inline ? ' ln-form--inline' : ''}${disabled ? ' is-disabled' : ''}${cls ? ` ${cls}` : ''}`)
|
|
63
63
|
|
|
64
64
|
const clearValidate = (props?: string[]) => clearValidation(props)
|
|
65
65
|
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
})
|
|
140
140
|
|
|
141
141
|
const classes = $derived(
|
|
142
|
-
`
|
|
142
|
+
`ln-form-item ln-form-item--${effectiveSize}${messageType ? ` is-${messageType}` : ''}${validating ? ' is-validating' : ''}${inlineMessage ? ' is-inline-message' : ''}${form?.disabled ? ' is-disabled' : ''}${cls ? ` ${cls}` : ''}`
|
|
143
143
|
)
|
|
144
144
|
|
|
145
145
|
const labelStyle = $derived(form?.labelWidth ? `width: ${form.labelWidth}` : undefined)
|
|
@@ -166,19 +166,19 @@
|
|
|
166
166
|
{...attrs}
|
|
167
167
|
>
|
|
168
168
|
{#if label}
|
|
169
|
-
<div class="
|
|
169
|
+
<div class="ln-form-item__label" style={labelStyle}>
|
|
170
170
|
{label}
|
|
171
171
|
</div>
|
|
172
172
|
{/if}
|
|
173
173
|
|
|
174
|
-
<div class="
|
|
174
|
+
<div class="ln-form-item__content">
|
|
175
175
|
{#if children}
|
|
176
176
|
{@render children()}
|
|
177
177
|
{/if}
|
|
178
178
|
|
|
179
179
|
{#if showMessage && (message || validating)}
|
|
180
180
|
<div
|
|
181
|
-
class="
|
|
181
|
+
class="ln-form-item__message"
|
|
182
182
|
class:is-inline={inlineMessage}
|
|
183
183
|
class:is-error={messageType === 'error'}
|
|
184
184
|
class:is-success={messageType === 'success'}
|
package/dist/Icon/Icon.svelte
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
const sizeValue = $derived(typeof size === "number" ? `${size}px` : size);
|
|
22
22
|
|
|
23
|
-
const classes = $derived(cls ? `
|
|
23
|
+
const classes = $derived(cls ? `ln-icon ${cls}` : "ln-icon");
|
|
24
24
|
|
|
25
25
|
// lucide 0.563.0+ 图标格式为 [[tag, attrs], [tag, attrs], ...]
|
|
26
26
|
type IconTuple = [string, Record<string, any>];
|
package/dist/Image/Image.svelte
CHANGED
|
@@ -83,26 +83,26 @@
|
|
|
83
83
|
if (src) status = 'loading'
|
|
84
84
|
})
|
|
85
85
|
|
|
86
|
-
const classes = $derived(`
|
|
86
|
+
const classes = $derived(`ln-image${hasPreview ? ' is-preview' : ''}${cls ? ` ${cls}` : ''}`)
|
|
87
87
|
</script>
|
|
88
88
|
|
|
89
89
|
<div class={classes} {...attrs}>
|
|
90
90
|
{#if status === 'loading' && placeholder}
|
|
91
|
-
<div class="
|
|
91
|
+
<div class="ln-image__placeholder">
|
|
92
92
|
{@render placeholder()}
|
|
93
93
|
</div>
|
|
94
94
|
{/if}
|
|
95
95
|
|
|
96
96
|
{#if status === 'error' && error}
|
|
97
|
-
<div class="
|
|
97
|
+
<div class="ln-image__error">
|
|
98
98
|
{@render error()}
|
|
99
99
|
</div>
|
|
100
100
|
{:else if hasPreview}
|
|
101
|
-
<button type="button" class="
|
|
102
|
-
<img {src} {alt} class="
|
|
101
|
+
<button type="button" class="ln-image__wrapper" onclick={openPreview}>
|
|
102
|
+
<img {src} {alt} class="ln-image__inner" style="object-fit: {fit}" loading={lazy ? 'lazy' : undefined} onload={handleLoad} onerror={handleError} />
|
|
103
103
|
</button>
|
|
104
104
|
{:else}
|
|
105
|
-
<img {src} {alt} class="
|
|
105
|
+
<img {src} {alt} class="ln-image__inner" style="object-fit: {fit}" loading={lazy ? 'lazy' : undefined} onload={handleLoad} onerror={handleError} />
|
|
106
106
|
{/if}
|
|
107
107
|
|
|
108
108
|
{#if children}
|
|
@@ -111,24 +111,24 @@
|
|
|
111
111
|
</div>
|
|
112
112
|
|
|
113
113
|
{#if showPreview}
|
|
114
|
-
<div class="
|
|
115
|
-
<div class="
|
|
114
|
+
<div class="ln-image-viewer" role="dialog" aria-modal="true" tabindex="-1" onkeydown={handleKeydown} onclick={hideOnClickModal ? closePreview : undefined}>
|
|
115
|
+
<div class="ln-image-viewer__mask"></div>
|
|
116
116
|
|
|
117
|
-
<button type="button" class="
|
|
117
|
+
<button type="button" class="ln-image-viewer__close" onclick={closePreview} aria-label="Close">
|
|
118
118
|
<Icon icon={X} size={24} color="#fff" />
|
|
119
119
|
</button>
|
|
120
120
|
|
|
121
121
|
{#if previewSrcList.length > 1}
|
|
122
|
-
<button type="button" class="
|
|
122
|
+
<button type="button" class="ln-image-viewer__prev" onclick={prevImage} aria-label="Previous">
|
|
123
123
|
<Icon icon={ChevronLeft} size={24} color="#fff" />
|
|
124
124
|
</button>
|
|
125
|
-
<button type="button" class="
|
|
125
|
+
<button type="button" class="ln-image-viewer__next" onclick={nextImage} aria-label="Next">
|
|
126
126
|
<Icon icon={ChevronRight} size={24} color="#fff" />
|
|
127
127
|
</button>
|
|
128
128
|
{/if}
|
|
129
129
|
|
|
130
|
-
<div class="
|
|
131
|
-
<img src={currentPreviewSrc} alt="" class="
|
|
130
|
+
<div class="ln-image-viewer__canvas">
|
|
131
|
+
<img src={currentPreviewSrc} alt="" class="ln-image-viewer__img" />
|
|
132
132
|
</div>
|
|
133
133
|
</div>
|
|
134
134
|
{/if}
|
package/dist/Input/Input.svelte
CHANGED
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
const suffixCount = $derived((suffix ? 1 : 0) + (showClear ? 1 : 0) + (showPwdToggle ? 1 : 0))
|
|
42
42
|
|
|
43
43
|
const classes = $derived(
|
|
44
|
-
`
|
|
44
|
+
`ln-input ln-input--${size}${disabled ? ' is-disabled' : ''}${focused ? ' is-focused' : ''}${prefix ? ' has-prefix' : ''}${suffixCount >= 1 ? ' has-suffix' : ''}${suffixCount >= 2 ? ' has-suffix-2' : ''}${suffixCount >= 3 ? ' has-suffix-3' : ''}${cls ? ` ${cls}` : ''}`
|
|
45
45
|
)
|
|
46
46
|
|
|
47
47
|
const handleInput = (e: Event & { currentTarget: HTMLInputElement }): void => {
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
const handleAnimationStart = (e: AnimationEvent & { currentTarget: HTMLInputElement }): void => {
|
|
63
|
-
if (e.animationName === '
|
|
63
|
+
if (e.animationName === 'ln-input-autofill') {
|
|
64
64
|
updateAutofillFromNode(e.currentTarget)
|
|
65
65
|
}
|
|
66
66
|
}
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
|
|
110
110
|
<div class={classes}>
|
|
111
111
|
{#if prefix}
|
|
112
|
-
<span class="
|
|
112
|
+
<span class="ln-input__prefix">
|
|
113
113
|
{@render prefix()}
|
|
114
114
|
</span>
|
|
115
115
|
{/if}
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
name={name}
|
|
123
123
|
autocomplete={autocomplete as any}
|
|
124
124
|
type={resolvedType}
|
|
125
|
-
class="
|
|
125
|
+
class="ln-input__inner"
|
|
126
126
|
{placeholder}
|
|
127
127
|
{disabled}
|
|
128
128
|
{readonly}
|
|
@@ -138,11 +138,11 @@
|
|
|
138
138
|
/>
|
|
139
139
|
|
|
140
140
|
{#if suffix || showClear || showPwdToggle}
|
|
141
|
-
<span class="
|
|
141
|
+
<span class="ln-input__suffix">
|
|
142
142
|
{#if showPwdToggle}
|
|
143
143
|
<button
|
|
144
144
|
type="button"
|
|
145
|
-
class="
|
|
145
|
+
class="ln-input__password"
|
|
146
146
|
onmousedown={(e: MouseEvent) => {
|
|
147
147
|
e.preventDefault()
|
|
148
148
|
handleTogglePassword()
|
|
@@ -157,7 +157,7 @@
|
|
|
157
157
|
{#if showClear}
|
|
158
158
|
<button
|
|
159
159
|
type="button"
|
|
160
|
-
class="
|
|
160
|
+
class="ln-input__clear"
|
|
161
161
|
onmousedown={(e: MouseEvent) => {
|
|
162
162
|
e.preventDefault()
|
|
163
163
|
handleClear()
|
|
@@ -78,31 +78,31 @@
|
|
|
78
78
|
const isMaxDisabled = $derived((modelValue ?? 0) >= max)
|
|
79
79
|
|
|
80
80
|
const classes = $derived(
|
|
81
|
-
`
|
|
81
|
+
`ln-input-number ln-input-number--${size}${controls ? ' is-controls' : ''}${controlsPosition === 'right' ? ' is-controls-right' : ''}${disabled ? ' is-disabled' : ''}${isFocused ? ' is-focus' : ''}${cls ? ` ${cls}` : ''}`
|
|
82
82
|
)
|
|
83
83
|
</script>
|
|
84
84
|
|
|
85
85
|
<div class={classes} {...attrs}>
|
|
86
86
|
{#if controls && controlsPosition !== 'right'}
|
|
87
|
-
<button type="button" class="
|
|
87
|
+
<button type="button" class="ln-input-number__decrease" disabled={disabled || isMinDisabled} onclick={decrease} tabindex="-1">
|
|
88
88
|
<Icon icon={Minus} size={14} />
|
|
89
89
|
</button>
|
|
90
90
|
{/if}
|
|
91
91
|
|
|
92
|
-
<input type="number" class="
|
|
92
|
+
<input type="number" class="ln-input-number__input" value={modelValue} {min} {max} {step} {disabled} {readonly} {placeholder} oninput={handleInput} onfocus={() => isFocused = true} onblur={handleBlur} />
|
|
93
93
|
|
|
94
94
|
{#if controls && controlsPosition !== 'right'}
|
|
95
|
-
<button type="button" class="
|
|
95
|
+
<button type="button" class="ln-input-number__increase" disabled={disabled || isMaxDisabled} onclick={increase} tabindex="-1">
|
|
96
96
|
<Icon icon={Plus} size={14} />
|
|
97
97
|
</button>
|
|
98
98
|
{/if}
|
|
99
99
|
|
|
100
100
|
{#if controls && controlsPosition === 'right'}
|
|
101
|
-
<div class="
|
|
102
|
-
<button type="button" class="
|
|
101
|
+
<div class="ln-input-number__controls">
|
|
102
|
+
<button type="button" class="ln-input-number__increase" disabled={disabled || isMaxDisabled} onclick={increase} tabindex="-1">
|
|
103
103
|
<Icon icon={ChevronUp} size={12} />
|
|
104
104
|
</button>
|
|
105
|
-
<button type="button" class="
|
|
105
|
+
<button type="button" class="ln-input-number__decrease" disabled={disabled || isMinDisabled} onclick={decrease} tabindex="-1">
|
|
106
106
|
<Icon icon={ChevronDown} size={12} />
|
|
107
107
|
</button>
|
|
108
108
|
</div>
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
|
|
40
40
|
const classes = $derived(
|
|
41
41
|
[
|
|
42
|
-
'
|
|
43
|
-
`
|
|
42
|
+
'ln-input-tag',
|
|
43
|
+
`ln-input-tag--${size}`,
|
|
44
44
|
disabled && 'is-disabled',
|
|
45
45
|
readonly && 'is-readonly',
|
|
46
46
|
focused && 'is-focused',
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
</script>
|
|
137
137
|
|
|
138
138
|
<div class={classes} onclick={focusInput} {...attrs}>
|
|
139
|
-
<div class="
|
|
139
|
+
<div class="ln-input-tag__inner">
|
|
140
140
|
{#each modelValue as tag, i (allowDuplicates ? i : tag)}
|
|
141
141
|
<Tag type={tagType} size={tagSize} closable={!disabled && !readonly} onclose={() => removeAt(i)}>
|
|
142
142
|
{tag}
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
|
|
146
146
|
<input
|
|
147
147
|
bind:this={inputRef}
|
|
148
|
-
class="
|
|
148
|
+
class="ln-input-tag__input"
|
|
149
149
|
type="text"
|
|
150
150
|
value={inputValue}
|
|
151
151
|
placeholder={modelValue.length === 0 ? placeholder : ''}
|
package/dist/Link/Link.svelte
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
let { href, type = 'default', underline = true, disabled = false, children, onclick, target, rel, class: cls = '', ...attrs }: LinkProps = $props()
|
|
17
17
|
|
|
18
|
-
const classes = $derived(`
|
|
18
|
+
const classes = $derived(`ln-link ln-link--${type}${underline ? ' is-underline' : ''}${disabled ? ' is-disabled' : ''}${cls ? ` ${cls}` : ''}`)
|
|
19
19
|
|
|
20
20
|
const handleClick = (e: MouseEvent): void => {
|
|
21
21
|
if (disabled) {
|
|
@@ -24,11 +24,11 @@
|
|
|
24
24
|
}
|
|
25
25
|
})
|
|
26
26
|
|
|
27
|
-
const classes = $derived(`
|
|
27
|
+
const classes = $derived(`ln-loading${fullscreen ? ' is-fullscreen' : ''}${cls ? ` ${cls}` : ''}`)
|
|
28
28
|
const maskStyle = $derived.by(() => {
|
|
29
29
|
if (!background) return undefined
|
|
30
30
|
// 用 CSS 变量覆写默认遮罩背景(theme-chalk 会在 dark 下自动切换变量)
|
|
31
|
-
return `--
|
|
31
|
+
return `--ln-loading-mask-bg: ${background}`
|
|
32
32
|
})
|
|
33
33
|
</script>
|
|
34
34
|
|
|
@@ -38,17 +38,17 @@
|
|
|
38
38
|
{/if}
|
|
39
39
|
|
|
40
40
|
{#if visible}
|
|
41
|
-
<div class="
|
|
42
|
-
<div class="
|
|
41
|
+
<div class="ln-loading__mask" style={maskStyle} role="status" aria-label="Loading">
|
|
42
|
+
<div class="ln-loading__spinner">
|
|
43
43
|
{#if spinner}
|
|
44
44
|
{@render spinner()}
|
|
45
45
|
{:else}
|
|
46
|
-
<div class="
|
|
46
|
+
<div class="ln-loading__icon">
|
|
47
47
|
<Icon icon={Loader2} size={42} />
|
|
48
48
|
</div>
|
|
49
49
|
{/if}
|
|
50
50
|
{#if text}
|
|
51
|
-
<p class="
|
|
51
|
+
<p class="ln-loading__text">{text}</p>
|
|
52
52
|
{/if}
|
|
53
53
|
</div>
|
|
54
54
|
</div>
|
package/dist/Menu/Menu.svelte
CHANGED
|
@@ -209,7 +209,7 @@
|
|
|
209
209
|
|
|
210
210
|
// CSS 类
|
|
211
211
|
const classes = $derived(
|
|
212
|
-
`
|
|
212
|
+
`ln-menu ln-menu--${mode}${collapsed ? " is-collapsed" : ""}${cls ? ` ${cls}` : ""}`,
|
|
213
213
|
);
|
|
214
214
|
|
|
215
215
|
// 箭头图标
|
|
@@ -223,7 +223,7 @@
|
|
|
223
223
|
{@const showSubmenu = shouldShowSubmenu(item)}
|
|
224
224
|
{@const iconSize = depth === 0 ? 18 : 16}
|
|
225
225
|
<li
|
|
226
|
-
class="
|
|
226
|
+
class="ln-menu__item"
|
|
227
227
|
class:is-active={isActive(item)}
|
|
228
228
|
class:has-active-child={hasActiveChild(item)}
|
|
229
229
|
class:is-disabled={item.disabled}
|
|
@@ -233,7 +233,7 @@
|
|
|
233
233
|
onmouseleave={() => handleMouseLeave(item)}
|
|
234
234
|
>
|
|
235
235
|
<div
|
|
236
|
-
class="
|
|
236
|
+
class="ln-menu__item-content"
|
|
237
237
|
role="menuitem"
|
|
238
238
|
tabindex={item.disabled ? -1 : 0}
|
|
239
239
|
aria-haspopup={hasChildren ? "true" : undefined}
|
|
@@ -242,15 +242,15 @@
|
|
|
242
242
|
onkeydown={(e: KeyboardEvent) => handleKeydown(item, e)}
|
|
243
243
|
>
|
|
244
244
|
{#if item.icon}
|
|
245
|
-
<span class="
|
|
245
|
+
<span class="ln-menu__item-icon">
|
|
246
246
|
<Icon icon={item.icon} size={iconSize} />
|
|
247
247
|
</span>
|
|
248
248
|
{/if}
|
|
249
|
-
<span class="
|
|
249
|
+
<span class="ln-menu__item-label">{item.label}</span>
|
|
250
250
|
{#if hasChildren}
|
|
251
251
|
<button
|
|
252
252
|
type="button"
|
|
253
|
-
class="
|
|
253
|
+
class="ln-menu__item-arrow"
|
|
254
254
|
class:is-open={showSubmenu}
|
|
255
255
|
tabindex={mode === "vertical" && !collapsed ? 0 : -1}
|
|
256
256
|
aria-label="Toggle submenu"
|
|
@@ -264,7 +264,7 @@
|
|
|
264
264
|
{#if hasChildren && showSubmenu}
|
|
265
265
|
{#if mode === "horizontal" || collapsed}
|
|
266
266
|
<ul
|
|
267
|
-
class="
|
|
267
|
+
class="ln-menu__popup{depth > 0 ? ' ln-menu__popup--nested' : ''}"
|
|
268
268
|
role="menu"
|
|
269
269
|
transition:scale|global={{ duration: 150, start: 0.95, opacity: 0 }}
|
|
270
270
|
>
|
|
@@ -274,7 +274,7 @@
|
|
|
274
274
|
</ul>
|
|
275
275
|
{:else}
|
|
276
276
|
<ul
|
|
277
|
-
class="
|
|
277
|
+
class="ln-menu__submenu"
|
|
278
278
|
role="menu"
|
|
279
279
|
transition:slide|global={{ duration: 200 }}
|
|
280
280
|
>
|
|
@@ -288,10 +288,10 @@
|
|
|
288
288
|
{/snippet}
|
|
289
289
|
|
|
290
290
|
<nav bind:this={menuRef} class={classes} role="menu" {...attrs}>
|
|
291
|
-
<ul class="
|
|
291
|
+
<ul class="ln-menu__list" role="menubar">
|
|
292
292
|
{#each items as item (getItemId(item))}
|
|
293
293
|
{#if item.group && (items.indexOf(item) === 0 || items[items.indexOf(item) - 1]?.group !== item.group)}
|
|
294
|
-
<li class="
|
|
294
|
+
<li class="ln-menu__group" role="presentation">
|
|
295
295
|
{#if !collapsed}{item.group}{/if}
|
|
296
296
|
</li>
|
|
297
297
|
{/if}
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
|
|
35
35
|
const icon = $derived(icons[type]);
|
|
36
36
|
const classes = $derived(
|
|
37
|
-
`
|
|
37
|
+
`ln-message ln-message--${type}${center ? " is-center" : ""}${cls ? ` ${cls}` : ""}`,
|
|
38
38
|
);
|
|
39
39
|
</script>
|
|
40
40
|
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
transition:fly={{ y: -20, duration: 250, opacity: 0 }}
|
|
46
46
|
{...attrs}
|
|
47
47
|
>
|
|
48
|
-
<Icon {icon} class="
|
|
49
|
-
<span class="
|
|
48
|
+
<Icon {icon} class="ln-message__icon" />
|
|
49
|
+
<span class="ln-message__content">{message}</span>
|
|
50
50
|
{#if showClose}
|
|
51
51
|
<button
|
|
52
52
|
type="button"
|
|
53
|
-
class="
|
|
53
|
+
class="ln-message__close"
|
|
54
54
|
onclick={onclose}
|
|
55
55
|
aria-label="关闭"
|
|
56
56
|
>
|
|
@@ -40,20 +40,20 @@
|
|
|
40
40
|
{#each messages as message, index (message.id)}
|
|
41
41
|
{#if message.visible}
|
|
42
42
|
<div
|
|
43
|
-
class="
|
|
43
|
+
class="ln-message ln-message--{message.type}"
|
|
44
44
|
class:is-center={message.center}
|
|
45
45
|
class:is-closable={message.showClose}
|
|
46
46
|
style="top: {getOffset(index)}px;"
|
|
47
47
|
transition:fly={{ y: -20, duration: 250, opacity: 0 }}
|
|
48
48
|
>
|
|
49
|
-
<Icon icon={getIcon(message.type)} size={16} class="
|
|
50
|
-
<div class="
|
|
49
|
+
<Icon icon={getIcon(message.type)} size={16} class="ln-message__icon" />
|
|
50
|
+
<div class="ln-message__content">
|
|
51
51
|
{message.message}
|
|
52
52
|
</div>
|
|
53
53
|
{#if message.showClose}
|
|
54
54
|
<button
|
|
55
55
|
type="button"
|
|
56
|
-
class="
|
|
56
|
+
class="ln-message__close"
|
|
57
57
|
onclick={() => onClose(message.id)}
|
|
58
58
|
aria-label="Close"
|
|
59
59
|
>
|
package/dist/Message/message.js
CHANGED
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
{#if options}
|
|
90
90
|
{@const opts = options}
|
|
91
91
|
<div
|
|
92
|
-
class="
|
|
92
|
+
class="ln-messagebox__wrapper"
|
|
93
93
|
use:portal
|
|
94
94
|
>
|
|
95
95
|
<Dialog
|
|
@@ -99,23 +99,23 @@
|
|
|
99
99
|
closeOnClickModal={false}
|
|
100
100
|
closeOnEsc={true}
|
|
101
101
|
onclose={handleCancel}
|
|
102
|
-
class={`
|
|
102
|
+
class={`ln-messagebox ln-messagebox--${opts.type ?? "info"}`}
|
|
103
103
|
>
|
|
104
104
|
{#snippet header()}
|
|
105
|
-
<div class="
|
|
105
|
+
<div class="ln-messagebox__header-content">
|
|
106
106
|
<Icon
|
|
107
107
|
icon={getIcon(opts.type)}
|
|
108
108
|
size={20}
|
|
109
|
-
class="
|
|
109
|
+
class="ln-messagebox__icon"
|
|
110
110
|
/>
|
|
111
111
|
{#if opts.title}
|
|
112
|
-
<span class="
|
|
112
|
+
<span class="ln-messagebox__title">{opts.title}</span>
|
|
113
113
|
{/if}
|
|
114
114
|
</div>
|
|
115
115
|
{/snippet}
|
|
116
116
|
|
|
117
117
|
{#snippet children()}
|
|
118
|
-
<div class="
|
|
118
|
+
<div class="ln-messagebox__body">{opts.content}</div>
|
|
119
119
|
{/snippet}
|
|
120
120
|
|
|
121
121
|
{#snippet footer()}
|