@kupola/kupola 1.4.1 → 1.4.3

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.
Files changed (64) hide show
  1. package/README.md +3 -3
  2. package/css/components.css +25 -2
  3. package/css/kupola.css +3 -2
  4. package/css/table.css +74 -0
  5. package/dist/css/kupola.css +12 -1
  6. package/dist/css/kupola.min.css +1 -1
  7. package/dist/kupola.cjs.js +1800 -3609
  8. package/dist/kupola.cjs.js.map +1 -1
  9. package/dist/kupola.css +100 -3
  10. package/dist/kupola.esm.js +1791 -3610
  11. package/dist/kupola.esm.js.map +1 -1
  12. package/dist/kupola.min.css +1 -1
  13. package/dist/kupola.min.js +1 -1
  14. package/dist/kupola.min.js.map +1 -1
  15. package/dist/kupola.umd.js +1800 -3609
  16. package/dist/kupola.umd.js.map +1 -1
  17. package/dist/types/kupola.d.ts +41 -25
  18. package/js/calendar.js +3 -10
  19. package/js/carousel.js +3 -10
  20. package/js/collapse.js +3 -10
  21. package/js/color-picker.js +5 -16
  22. package/js/component.js +4 -18
  23. package/js/countdown.js +3 -10
  24. package/js/data-bind.js +56 -36
  25. package/js/datepicker.js +16 -24
  26. package/js/depends.js +27 -16
  27. package/js/dialog.js +1 -5
  28. package/js/drawer.js +3 -11
  29. package/js/dropdown.js +11 -18
  30. package/js/dynamic-tags.js +3 -10
  31. package/js/fileupload.js +10 -12
  32. package/js/form.js +26 -20
  33. package/js/global-events.js +1 -14
  34. package/js/heatmap.js +3 -12
  35. package/js/i18n.js +1 -14
  36. package/js/icons.js +2 -2
  37. package/js/image-preview.js +1 -7
  38. package/js/initializer.js +0 -43
  39. package/js/kupola-core.js +1 -13
  40. package/js/kupola-lifecycle.js +1 -9
  41. package/js/message.js +1 -6
  42. package/js/modal.js +22 -20
  43. package/js/notification.js +1 -6
  44. package/js/numberinput.js +3 -10
  45. package/js/pagination.js +0 -5
  46. package/js/registry.js +0 -4
  47. package/js/select.js +5 -16
  48. package/js/slide-captcha.js +8 -21
  49. package/js/slider.js +3 -10
  50. package/js/statcard.js +3 -11
  51. package/js/table.js +240 -262
  52. package/js/tag.js +3 -10
  53. package/js/theme.js +1 -12
  54. package/js/timepicker.js +6 -19
  55. package/js/tooltip.js +3 -10
  56. package/js/utils.js +281 -1439
  57. package/js/validation.js +2 -7
  58. package/js/virtual-list.js +13 -38
  59. package/js/web-components.js +0 -9
  60. package/package.json +14 -5
  61. package/scripts/build-css.cjs +3 -2
  62. package/types/kupola.d.ts +41 -25
  63. package/version.json +10 -0
  64. /package/css/{colors_and_type.css → colors-and-type.css} +0 -0
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  [![License](https://img.shields.io/github/license/kupola-cn/kupola)](https://github.com/kupola-cn/kupola/blob/main/LICENSE)
8
8
  [![npm](https://img.shields.io/npm/v/@kupola/kupola)](https://www.npmjs.com/package/@kupola/kupola)
9
- [![bundle size (gzip)](https://img.shields.io/badge/gzip-88%20KB-blue)](https://bundlephobia.com/package/@kupola/kupola)
9
+ [![bundle size (gzip)](https://img.shields.io/badge/gzip-104%20KB-blue)](https://bundlephobia.com/package/@kupola/kupola)
10
10
  [![GitHub stars](https://img.shields.io/github/stars/kupola-cn/kupola)](https://github.com/kupola-cn/kupola/stargazers)
11
11
 
12
12
  **HTMX** (data fetching) + **Alpine.js** (declarative interaction) + **Bootstrap** (component richness) — in one zero-dependency package.
@@ -32,7 +32,7 @@
32
32
  - **Responsive** — PC, Pad, and Phone
33
33
  - **Accessible** — WCAG AA compliant
34
34
  - **Form Validation** — Built-in validation with custom rules
35
- - **Zero Dependencies** — Pure HTML/CSS/JavaScript, ~88 KB gzipped
35
+ - **Zero Dependencies** — Pure HTML/CSS/JavaScript, ~104 KB gzipped
36
36
  - **Backend Agnostic** — Works with Flask, Django, FastAPI, Gin, Spring Boot, ASP.NET, Express, Rails, Actix-web, and any backend that outputs HTML
37
37
  - **TypeScript Ready** — Full type definitions included
38
38
 
@@ -181,7 +181,7 @@ Chrome, Firefox, Safari, Edge (latest)
181
181
  - **响应式** — 适配 PC、平板、手机
182
182
  - **无障碍** — 符合 WCAG AA 标准
183
183
  - **表单验证** — 内置验证系统,支持自定义规则
184
- - **零依赖** — 纯 HTML/CSS/JavaScript,gzip 后约 88 KB
184
+ - **零依赖** — 纯 HTML/CSS/JavaScript,gzip 后约 104 KB
185
185
  - **后端无关** — 支持 Flask、Django、FastAPI、Gin、Spring Boot、ASP.NET、Express、Rails、Actix-web 等任何输出 HTML 的后端
186
186
  - **TypeScript 支持** — 完整类型定义
187
187
 
@@ -543,7 +543,7 @@
543
543
  /* BUG-003 fix: ensure <select class="ds-input"> matches <input> height/padding */
544
544
  select.ds-input,
545
545
  .ds-input select {
546
- height: 28px;
546
+ height: 36px;
547
547
  padding: 0 var(--spacer-24) 0 var(--spacer-12);
548
548
  appearance: none;
549
549
  -webkit-appearance: none;
@@ -555,8 +555,29 @@
555
555
  cursor: pointer;
556
556
  font: inherit;
557
557
  color: var(--text-default);
558
+ background-color: var(--bg-overlay-l1);
559
+ line-height: 36px;
560
+ font-size: 14px;
558
561
  }
559
562
  select.ds-input::-ms-expand { display: none; }
563
+
564
+ /* Fix dropdown options background color - Note: limited browser support */
565
+ select.ds-input option,
566
+ .ds-input select option {
567
+ background-color: var(--bg-base-secondary);
568
+ color: var(--text-default);
569
+ padding: 10px 12px;
570
+ line-height: 1.8;
571
+ min-height: 36px;
572
+ }
573
+
574
+ select.ds-input optgroup,
575
+ .ds-input select optgroup {
576
+ background-color: var(--bg-base-secondary);
577
+ color: var(--text-default);
578
+ padding: 8px 12px;
579
+ line-height: 1.6;
580
+ }
560
581
 
561
582
  .ds-input__status-icon {
562
583
  position: absolute;
@@ -1460,12 +1481,14 @@
1460
1481
  display: flex;
1461
1482
  align-items: center;
1462
1483
  width: 100%;
1463
- padding: var(--spacer-8) var(--spacer-12);
1484
+ padding: 12px var(--spacer-12);
1485
+ min-height: 40px;
1464
1486
  background: none;
1465
1487
  border: none;
1466
1488
  border-radius: var(--radius-2);
1467
1489
  color: var(--text-default);
1468
1490
  font-size: var(--body-sm-font-size);
1491
+ line-height: 1.6;
1469
1492
  cursor: pointer;
1470
1493
  text-align: left;
1471
1494
  }
package/css/kupola.css CHANGED
@@ -1,4 +1,4 @@
1
- @import url('colors_and_type.css');
1
+ @import url('colors-and-type.css');
2
2
  @import url('theme-light.css');
3
3
  @import url('theme-dark.css');
4
4
  @import url('brand-themes.css');
@@ -9,4 +9,5 @@
9
9
  @import url('utilities.css');
10
10
  @import url('responsive.css');
11
11
  @import url('accessibility.css');
12
- @import url('animations.css');
12
+ @import url('animations.css');
13
+ @import url('table.css');
package/css/table.css ADDED
@@ -0,0 +1,74 @@
1
+ /* ================================================================
2
+ KupolaTable Styles
3
+ ================================================================ */
4
+
5
+ .kupola-table-wrapper { width: 100%; }
6
+ .kupola-table-container { overflow-x: auto; }
7
+ .kupola-table { width: 100%; border-collapse: collapse; font-size: 14px; }
8
+ .kupola-table th, .kupola-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid #e8e8e8; }
9
+ .kupola-table th { background: #fafafa; font-weight: 600; color: #333; white-space: nowrap; }
10
+ .kupola-table-striped tbody tr:nth-child(even) { background: #fafafa; }
11
+ .kupola-table-hover tbody tr:hover { background: #f0f7ff; }
12
+ .kupola-table-bordered { border: 1px solid #e8e8e8; }
13
+ .kupola-table-bordered th, .kupola-table-bordered td { border: 1px solid #e8e8e8; }
14
+ .kupola-table-compact th, .kupola-table-compact td { padding: 8px 12px; }
15
+ .kupola-table-sortable { cursor: pointer; user-select: none; position: relative; }
16
+ .kupola-table-sortable:hover { background: #f0f0f0; }
17
+ .kupola-table-sort-icon { font-size: 12px; opacity: 0.5; margin-left: 4px; }
18
+ .kupola-table-sort-asc .kupola-table-sort-icon,
19
+ .kupola-table-sort-desc .kupola-table-sort-icon { opacity: 1; color: #1890ff; }
20
+ .kupola-table-empty, .kupola-table-loading { text-align: center; padding: 40px 16px !important; color: #999; }
21
+ .kupola-table-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
22
+ .kupola-table-toolbar-right { display: flex; align-items: center; gap: 8px; }
23
+ .kupola-table-filter-input { padding: 6px 12px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 14px; width: 240px; }
24
+ .kupola-table-filter-input:focus { outline: none; border-color: #1890ff; box-shadow: 0 0 0 2px rgba(24,144,255,0.1); }
25
+ .kupola-table-info { color: #999; font-size: 13px; }
26
+ .kupola-table-selection-info { color: #1890ff; font-size: 13px; font-weight: 500; }
27
+ .kupola-table-col-selection { width: 40px; text-align: center; }
28
+ .kupola-table-col-expand { width: 40px; text-align: center; }
29
+ .kupola-table-expand-btn { background: none; border: none; cursor: pointer; font-size: 12px; padding: 2px 6px; color: #666; }
30
+ .kupola-table-expand-btn:hover { color: #1890ff; }
31
+ .kupola-table-expand-row td { background: #fafafa; padding: 16px; }
32
+ .kupola-table-row-selected { background: #e6f7ff !important; }
33
+ .kupola-table-row-selected:hover { background: #bae7ff !important; }
34
+
35
+ /* Resize */
36
+ .kupola-table-resize-handle { position: absolute; right: 0; top: 0; bottom: 0; width: 6px; cursor: col-resize; background: transparent; }
37
+ .kupola-table-resize-handle:hover { background: #1890ff; opacity: 0.3; }
38
+
39
+ /* Drag */
40
+ .kupola-table-draggable { transition: opacity 0.2s; }
41
+ .kupola-table-dragging { opacity: 0.4; }
42
+ .kupola-table-drag-over { border-top: 2px solid #1890ff !important; }
43
+
44
+ /* Edit */
45
+ .kupola-table-editable-cell { cursor: text; }
46
+ .kupola-table-editable-cell:hover { background: #e6f7ff; }
47
+ .kupola-table-edit-cell { display: flex; gap: 4px; align-items: center; }
48
+ .kupola-table-edit-input { flex: 1; padding: 2px 6px; font-size: 13px; }
49
+ .kupola-table-edit-actions { display: flex; gap: 2px; }
50
+ .kupola-table-edit-save, .kupola-table-edit-cancel { background: none; border: 1px solid #d9d9d9; border-radius: 3px; cursor: pointer; padding: 2px 6px; font-size: 12px; }
51
+ .kupola-table-edit-save { color: #52c41a; border-color: #52c41a; }
52
+ .kupola-table-edit-cancel { color: #ff4d4f; border-color: #ff4d4f; }
53
+ .kupola-table-edit-save:hover { background: #f6ffed; }
54
+ .kupola-table-edit-cancel:hover { background: #fff2f0; }
55
+
56
+ /* Tree */
57
+ .kupola-table-tree-indent { display: inline-block; }
58
+ .kupola-table-tree-toggle { background: none; border: none; cursor: pointer; font-size: 10px; padding: 0 4px; color: #666; }
59
+ .kupola-table-tree-toggle:hover { color: #1890ff; }
60
+ .kupola-table-tree-toggle-placeholder { display: inline-block; width: 18px; }
61
+
62
+ /* Virtual */
63
+ .kupola-table-virtual-wrapper .kupola-table-container { overflow-y: auto; }
64
+
65
+ /* Pagination */
66
+ .kupola-table-pagination { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 16px; padding: 8px 0; }
67
+ .kupola-table-pages { display: flex; gap: 4px; align-items: center; }
68
+ .kupola-table-page-btn { min-width: 32px; height: 32px; border: 1px solid #d9d9d9; border-radius: 4px; background: #fff; cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center; }
69
+ .kupola-table-page-btn:hover:not(:disabled):not(.active) { border-color: #1890ff; color: #1890ff; }
70
+ .kupola-table-page-btn.active { background: #1890ff; color: #fff; border-color: #1890ff; }
71
+ .kupola-table-page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
72
+ .kupola-table-page-ellipsis { padding: 0 4px; color: #999; }
73
+ .kupola-table-page-size { padding: 4px 8px; border: 1px solid #d9d9d9; border-radius: 4px; font-size: 13px; }
74
+ .kupola-table-page-info { color: #999; font-size: 13px; }
@@ -1 +1,12 @@
1
- @import "../css/scaffold.css";@import "../css/colors_and_type.css";@import "../css/theme-light.css";@import "../css/brand-themes.css";@import "../css/components.css";@import "../css/components-ext.css";@import "../css/states.css";@import "../css/responsive.css";@import "../css/animations.css";@import "../css/accessibility.css";@import "../css/utilities.css";
1
+ @import '../css/scaffold.css';
2
+ @import '../css/colors_and_type.css';
3
+ @import '../css/theme-light.css';
4
+ @import '../css/brand-themes.css';
5
+ @import '../css/components.css';
6
+ @import '../css/components-ext.css';
7
+ @import '../css/states.css';
8
+ @import '../css/responsive.css';
9
+ @import '../css/animations.css';
10
+ @import '../css/accessibility.css';
11
+ @import '../css/utilities.css';
12
+ @import '../css/table.css';
@@ -1 +1 @@
1
- @import "../css/scaffold.css";@import "../css/colors_and_type.css";@import "../css/theme-light.css";@import "../css/brand-themes.css";@import "../css/components.css";@import "../css/components-ext.css";@import "../css/states.css";@import "../css/responsive.css";@import "../css/animations.css";@import "../css/accessibility.css";@import "../css/utilities.css";
1
+ @import "../css/scaffold.css";@import "../css/colors_and_type.css";@import "../css/theme-light.css";@import "../css/brand-themes.css";@import "../css/components.css";@import "../css/components-ext.css";@import "../css/states.css";@import "../css/responsive.css";@import "../css/animations.css";@import "../css/accessibility.css";@import "../css/utilities.css";@import "../css/table.css";