niuma-ui 1.3.0 → 1.3.2
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/CHANGELOG.md +25 -0
- package/dist/components/RsButton.css +119 -61
- package/dist/components/RsButton.d.ts +3 -3
- package/dist/components/RsButton.impl.js +4 -12
- package/dist/components/RsButton.js +1 -1
- package/dist/components/RsDialog.css +1 -0
- package/dist/components/RsDialog.d.ts +5 -0
- package/dist/components/RsDialog.impl.js +4 -0
- package/dist/components/RsDrawer.css +1 -0
- package/dist/components/RsFieldset.css +92 -0
- package/dist/components/RsFieldset.d.ts +61 -0
- package/dist/components/RsFieldset.impl.js +78 -0
- package/dist/components/RsFieldset.js +8 -0
- package/dist/components/RsFormItem.css +19 -19
- package/dist/components/RsFormItem.d.ts +6 -4
- package/dist/components/RsFormItem.impl.js +12 -2
- package/dist/components/RsFormItem.js +1 -1
- package/dist/components/RsInput.css +78 -69
- package/dist/components/RsInput.js +1 -1
- package/dist/components/RsLog.css +198 -0
- package/dist/components/RsLog.d.ts +126 -0
- package/dist/components/RsLog.impl.js +619 -0
- package/dist/components/RsLog.js +8 -0
- package/dist/components/RsTable.impl.js +2 -1
- package/dist/components/RsTextarea.css +126 -0
- package/dist/components/RsTextarea.d.ts +114 -0
- package/dist/components/RsTextarea.impl.js +385 -0
- package/dist/components/RsTextarea.js +8 -0
- package/dist/components/RsTooltip.css +4 -3
- package/dist/components/RsTooltip.d.ts +2 -0
- package/dist/components/RsTooltip.impl.js +5 -2
- package/dist/components/RsVirtualList.css +6 -6
- package/dist/components/RsVirtualList.d.ts +1 -1
- package/dist/components/RsVirtualList.impl.js +9 -4
- package/dist/components/RsVirtualList.js +1 -1
- package/dist/components/button-utils.d.ts +19 -10
- package/dist/components/button-utils.js +22 -7
- package/dist/components/dialog-window.d.ts +2 -0
- package/dist/components/dialog-window.js +2 -1
- package/dist/components/fieldset-utils.d.ts +29 -0
- package/dist/components/fieldset-utils.js +12 -0
- package/dist/components/log-utils.d.ts +105 -0
- package/dist/components/log-utils.js +354 -0
- package/dist/components/table/rs-table-props.d.ts +8 -0
- package/dist/components/table/rs-table-props.js +1 -0
- package/dist/components/table/rs-table.css +7 -0
- package/dist/index.d.ts +10 -2
- package/dist/index.js +24 -0
- package/dist/lib/rs-dayjs.js +1 -1
- package/dist/locale/messages.js +42 -0
- package/dist/styles.css +37 -0
- package/dist/vite-plugins/niuma-ui-host.d.ts +8 -0
- package/dist/vite-plugins/niuma-ui-host.js +47 -9
- package/package.json +1 -1
package/dist/locale/messages.js
CHANGED
|
@@ -21,6 +21,8 @@ var zhCN = {
|
|
|
21
21
|
"form.validate.required": "请填写{label}",
|
|
22
22
|
"form.list.add": "添加",
|
|
23
23
|
"form.list.remove": "删除",
|
|
24
|
+
"fieldset.help": "分组说明",
|
|
25
|
+
"tooltip.help": "说明",
|
|
24
26
|
"input.formatInvalid": "格式不正确",
|
|
25
27
|
"input.rule.email": "请输入有效的邮箱地址",
|
|
26
28
|
"input.rule.number": "请输入有效数字",
|
|
@@ -153,6 +155,25 @@ var zhCN = {
|
|
|
153
155
|
"terminal.searchNext": "下一个",
|
|
154
156
|
"terminal.searchPrev": "上一个",
|
|
155
157
|
"terminal.searchClose": "关闭搜索",
|
|
158
|
+
"log.label": "日志",
|
|
159
|
+
"log.empty": "暂无日志",
|
|
160
|
+
"log.search": "搜索日志",
|
|
161
|
+
"log.searchPlaceholder": "过滤正文…",
|
|
162
|
+
"log.copy": "复制全文",
|
|
163
|
+
"log.copyMatches": "复制匹配行",
|
|
164
|
+
"log.copied": "已复制",
|
|
165
|
+
"log.filter": "按级别过滤",
|
|
166
|
+
"log.newLines": "新增 {count} 行",
|
|
167
|
+
"log.lineNo": "第 {n} 行",
|
|
168
|
+
"log.level.trace": "跟踪",
|
|
169
|
+
"log.level.debug": "调试",
|
|
170
|
+
"log.level.info": "信息",
|
|
171
|
+
"log.level.notice": "通知",
|
|
172
|
+
"log.level.success": "成功",
|
|
173
|
+
"log.level.warn": "警告",
|
|
174
|
+
"log.level.error": "错误",
|
|
175
|
+
"log.level.fatal": "致命",
|
|
176
|
+
"log.level.plain": "输出",
|
|
156
177
|
"playground.brand": "Niuma UI",
|
|
157
178
|
"playground.subtitle": "Vue 3 组件演示",
|
|
158
179
|
"playground.nav.label": "组件导航",
|
|
@@ -229,6 +250,8 @@ var enUS = {
|
|
|
229
250
|
"form.validate.required": "Please enter {label}",
|
|
230
251
|
"form.list.add": "Add",
|
|
231
252
|
"form.list.remove": "Remove",
|
|
253
|
+
"fieldset.help": "Group help",
|
|
254
|
+
"tooltip.help": "Help",
|
|
232
255
|
"input.formatInvalid": "Invalid format",
|
|
233
256
|
"input.rule.email": "Enter a valid email address",
|
|
234
257
|
"input.rule.number": "Enter a valid number",
|
|
@@ -361,6 +384,25 @@ var enUS = {
|
|
|
361
384
|
"terminal.searchNext": "Next",
|
|
362
385
|
"terminal.searchPrev": "Previous",
|
|
363
386
|
"terminal.searchClose": "Close search",
|
|
387
|
+
"log.label": "Log",
|
|
388
|
+
"log.empty": "No log output",
|
|
389
|
+
"log.search": "Search logs",
|
|
390
|
+
"log.searchPlaceholder": "Filter lines…",
|
|
391
|
+
"log.copy": "Copy all",
|
|
392
|
+
"log.copyMatches": "Copy matching lines",
|
|
393
|
+
"log.copied": "Copied",
|
|
394
|
+
"log.filter": "Filter levels",
|
|
395
|
+
"log.newLines": "{count} new lines",
|
|
396
|
+
"log.lineNo": "Line {n}",
|
|
397
|
+
"log.level.trace": "Trace",
|
|
398
|
+
"log.level.debug": "Debug",
|
|
399
|
+
"log.level.info": "Info",
|
|
400
|
+
"log.level.notice": "Notice",
|
|
401
|
+
"log.level.success": "Success",
|
|
402
|
+
"log.level.warn": "Warning",
|
|
403
|
+
"log.level.error": "Error",
|
|
404
|
+
"log.level.fatal": "Fatal",
|
|
405
|
+
"log.level.plain": "Output",
|
|
364
406
|
"playground.brand": "Niuma UI",
|
|
365
407
|
"playground.subtitle": "Vue 3 component demos",
|
|
366
408
|
"playground.nav.label": "Component navigation",
|
package/dist/styles.css
CHANGED
|
@@ -1090,6 +1090,23 @@ html {
|
|
|
1090
1090
|
--rs-terminal-ansi-bright-cyan: #8ad4d4;
|
|
1091
1091
|
--rs-terminal-ansi-bright-white: #ffffff;
|
|
1092
1092
|
|
|
1093
|
+
/* Log:级别色走 on-container,对照 WCAG AA(相对 --rs-log-bg) */
|
|
1094
|
+
--rs-log-bg: var(--rs-terminal-bg);
|
|
1095
|
+
--rs-log-fg: var(--rs-terminal-fg);
|
|
1096
|
+
--rs-log-border: var(--rs-terminal-border);
|
|
1097
|
+
--rs-log-stripe: var(--rs-terminal-row-stripe);
|
|
1098
|
+
--rs-log-muted: var(--rs-text-secondary);
|
|
1099
|
+
--rs-log-trace: var(--rs-text-tertiary);
|
|
1100
|
+
--rs-log-debug: var(--rs-text-secondary);
|
|
1101
|
+
--rs-log-info: var(--rs-on-info-container);
|
|
1102
|
+
--rs-log-notice: var(--rs-info);
|
|
1103
|
+
--rs-log-success: var(--rs-on-success-container);
|
|
1104
|
+
--rs-log-warn: var(--rs-on-warning-container);
|
|
1105
|
+
--rs-log-error: var(--rs-on-danger-container);
|
|
1106
|
+
--rs-log-fatal: var(--rs-danger);
|
|
1107
|
+
--rs-log-hit-bg: color-mix(in srgb, var(--rs-warning) 38%, var(--rs-log-bg));
|
|
1108
|
+
--rs-log-hit-fg: var(--rs-log-fg);
|
|
1109
|
+
|
|
1093
1110
|
--rs-shadow-sm: 0 1px 3px rgb(0 0 0 / 0.4);
|
|
1094
1111
|
--rs-shadow: 0 4px 16px rgb(0 0 0 / 0.45), 0 0 0 0.5px rgb(255 255 255 / 0.08);
|
|
1095
1112
|
--rs-shadow-lg: 0 12px 32px rgb(0 0 0 / 0.5), 0 0 0 0.5px rgb(255 255 255 / 0.1);
|
|
@@ -1315,6 +1332,22 @@ html {
|
|
|
1315
1332
|
--rs-terminal-ansi-bright-cyan: #0d7f8a;
|
|
1316
1333
|
--rs-terminal-ansi-bright-white: #1d1d1f;
|
|
1317
1334
|
|
|
1335
|
+
--rs-log-bg: var(--rs-terminal-bg);
|
|
1336
|
+
--rs-log-fg: var(--rs-terminal-fg);
|
|
1337
|
+
--rs-log-border: var(--rs-terminal-border);
|
|
1338
|
+
--rs-log-stripe: var(--rs-terminal-row-stripe);
|
|
1339
|
+
--rs-log-muted: var(--rs-text-secondary);
|
|
1340
|
+
--rs-log-trace: var(--rs-text-tertiary);
|
|
1341
|
+
--rs-log-debug: var(--rs-text-secondary);
|
|
1342
|
+
--rs-log-info: var(--rs-on-info-container);
|
|
1343
|
+
--rs-log-notice: var(--rs-info);
|
|
1344
|
+
--rs-log-success: var(--rs-on-success-container);
|
|
1345
|
+
--rs-log-warn: var(--rs-on-warning-container);
|
|
1346
|
+
--rs-log-error: var(--rs-on-danger-container);
|
|
1347
|
+
--rs-log-fatal: var(--rs-danger);
|
|
1348
|
+
--rs-log-hit-bg: color-mix(in srgb, var(--rs-warning) 32%, var(--rs-log-bg));
|
|
1349
|
+
--rs-log-hit-fg: var(--rs-log-fg);
|
|
1350
|
+
|
|
1318
1351
|
--rs-shadow-sm: 0 1px 2px rgb(0 0 0 / 0.04), 0 0 0 0.5px rgb(0 0 0 / 0.04);
|
|
1319
1352
|
--rs-shadow: 0 4px 16px rgb(0 0 0 / 0.08), 0 0 0 0.5px rgb(0 0 0 / 0.06);
|
|
1320
1353
|
--rs-shadow-lg: 0 12px 32px rgb(0 0 0 / 0.12), 0 0 0 0.5px rgb(0 0 0 / 0.08);
|
|
@@ -1850,6 +1883,10 @@ code {
|
|
|
1850
1883
|
}
|
|
1851
1884
|
|
|
1852
1885
|
.rs-field__label {
|
|
1886
|
+
display: inline-flex;
|
|
1887
|
+
align-items: center;
|
|
1888
|
+
flex-wrap: nowrap;
|
|
1889
|
+
gap: 0.25rem;
|
|
1853
1890
|
color: var(--rs-label-color);
|
|
1854
1891
|
font-size: var(--rs-label-font-size);
|
|
1855
1892
|
font-weight: var(--rs-label-font-weight);
|
|
@@ -19,6 +19,14 @@ export type NiumaUiBinding = {
|
|
|
19
19
|
* serve 改写具名导入到源码并 alias styles;build 只补 Tailwind @source。
|
|
20
20
|
*/
|
|
21
21
|
export declare function niumaUiHost(options?: NiumaUiHostOptions): Plugin[];
|
|
22
|
+
/**
|
|
23
|
+
* DayjsServeAliases 把 CJS 插件指到 ESM 构建。
|
|
24
|
+
* 发布桶 / 源码被 exclude 后,Vite 否则会按 ESM 加载 UMD,报没有 default。
|
|
25
|
+
*/
|
|
26
|
+
export declare function dayjsServeAliases(root: string): {
|
|
27
|
+
find: RegExp;
|
|
28
|
+
replacement: string;
|
|
29
|
+
}[];
|
|
22
30
|
/**
|
|
23
31
|
* ToSourceRel 把目录收成 Tailwind @source 可用的相对路径。
|
|
24
32
|
*/
|
|
@@ -30,7 +30,40 @@ export function niumaUiHost(options = {}) {
|
|
|
30
30
|
return [niumaUiHostAlias(ctx), niumaUiHostRewrite(ctx), niumaUiHostTailwindSource(ctx)];
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
33
|
+
* DayjsServeAliases 把 CJS 插件指到 ESM 构建。
|
|
34
|
+
* 发布桶 / 源码被 exclude 后,Vite 否则会按 ESM 加载 UMD,报没有 default。
|
|
35
|
+
*/
|
|
36
|
+
export function dayjsServeAliases(root) {
|
|
37
|
+
let req;
|
|
38
|
+
try {
|
|
39
|
+
req = createRequire(join(root, 'package.json'));
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
return [];
|
|
43
|
+
}
|
|
44
|
+
const aliases = [];
|
|
45
|
+
try {
|
|
46
|
+
aliases.push({
|
|
47
|
+
find: /^dayjs\/plugin\/customParseFormat(?:\.js)?$/,
|
|
48
|
+
replacement: req.resolve('dayjs/esm/plugin/customParseFormat'),
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
// dayjs 未装在包旁时跳过
|
|
53
|
+
}
|
|
54
|
+
try {
|
|
55
|
+
aliases.push({
|
|
56
|
+
find: /^dayjs$/,
|
|
57
|
+
replacement: req.resolve('dayjs/esm'),
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
// dayjs 未装在包旁时跳过
|
|
62
|
+
}
|
|
63
|
+
return aliases;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* NiumaUiHostAlias 仅在 serve 时补 dayjs ESM 别名;有 src 时再改 styles 并排除整桶预构建。
|
|
34
67
|
*/
|
|
35
68
|
function niumaUiHostAlias(ctx) {
|
|
36
69
|
return {
|
|
@@ -38,15 +71,20 @@ function niumaUiHostAlias(ctx) {
|
|
|
38
71
|
apply: 'serve',
|
|
39
72
|
enforce: 'pre',
|
|
40
73
|
config() {
|
|
41
|
-
|
|
42
|
-
|
|
74
|
+
const dayjsAlias = dayjsServeAliases(ctx.root);
|
|
75
|
+
if (!ctx.hasSrc) {
|
|
76
|
+
return dayjsAlias.length > 0 ? { resolve: { alias: dayjsAlias } } : {};
|
|
77
|
+
}
|
|
43
78
|
const styles = join(ctx.root, 'src/styles.css');
|
|
44
|
-
const alias =
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
79
|
+
const alias = [
|
|
80
|
+
...(existsSync(styles)
|
|
81
|
+
? [
|
|
82
|
+
{ find: '@niuma/ui/styles.css', replacement: styles },
|
|
83
|
+
{ find: 'niuma-ui/styles.css', replacement: styles },
|
|
84
|
+
]
|
|
85
|
+
: []),
|
|
86
|
+
...dayjsAlias,
|
|
87
|
+
];
|
|
50
88
|
return {
|
|
51
89
|
resolve: alias.length > 0 ? { alias } : {},
|
|
52
90
|
// 不要把 reka-ui / @lucide/vue / vue-sonner 写进 include:
|