547 Commits

Author SHA1 Message Date
f8f02c63ab fix: 为 data_filter code 类型字段添加空选项
- 检查已有空选项避免重复
- 始终注入空选项确保可清空筛选
2026-06-02 17:26:02 +08:00
a2a80ac922 docs: update api_doc.js dependency comment to reference local 3parties/marked.js 2026-06-02 17:15:31 +08:00
d41c386acf feat: add ApiDoc widget - renders API docs from markdown with sidebar nav, method badges, code copy 2026-06-02 17:08:42 +08:00
d67bd84d4d fix: normalize full URLs to relative paths in Router
When ?page= param contains a full URL (e.g. https://domain/module/page.ui),
normalize it to relative path (/module/page.ui) before loading.
Applied in _restore, _loadInto, navigate, and _onReplace.
2026-06-01 23:41:50 +08:00
e5981ba447 style: redesign add/delete icons for modern UI consistency
Replace add.svg and delete.svg with minimalist design:
- 1.5px stroke width for thin, elegant appearance
- Round line caps and joins for smooth edges
- Consistent style across both icons
- Uses currentColor for theme compatibility
2026-06-01 15:40:38 +08:00
74db534e41 chore: ignore NFS temp files 2026-06-01 15:29:35 +08:00
6aaac666d5 chore: remove stale NFS temp file from repo 2026-06-01 15:29:29 +08:00
8109292f8a fix: UiText auto-height on setValue when element not yet rendered
Add requestAnimationFrame deferred handleInput() call in setValue()
to ensure textarea height recalculates after DOM render, fixing
single-line display when value is set during Form build phase.
2026-06-01 15:26:57 +08:00
d1661e7ab6 bugfix 2026-06-01 12:09:00 +08:00
88c6fd3138 bugfix 2026-06-01 11:40:38 +08:00
b46c82b402 bugfix 2026-05-31 22:48:54 +08:00
bd706943ce bugfix 2026-05-31 22:48:23 +08:00
b43d2e7cbd fix: codeViewBuilder支持DataRow调用(rec为undefined时用desc.user_data)并增加field_name_text查找逻辑 2026-05-31 15:59:17 +08:00
f49994cea7 fix: Menu widget now triggers Router._onReplace for SPA URL tracking
Menu widget's menu_clicked() was bypassing the standard _buildWidget
path in bricks.js, so Router._onReplace was never called when navigating
via sidebar menu items. This caused:
- Browser URL not updating on menu clicks
- F5 refresh not restoring the current page

Added Router hook after t.add_widget(w) in menu_clicked(), matching
the same pattern used in bricks.js _buildWidget.
2026-05-31 12:32:17 +08:00
216221f67f 暗色主题: 菜单图标添加filter:invert(1)自适应 2026-05-31 11:22:07 +08:00
ebc8959f4c fix: 暗色主题输入框背景色优化 #1E293B → #0F172A
全局 inputbox 在 dark 主题下使用更深的背景色,与页面主色调协调
2026-05-30 14:32:21 +08:00
fe98b07466 chore: remove dist/ from git tracking, add to .gitignore 2026-05-30 13:47:28 +08:00
db1934fd1c fix: UiType.setValue typo vlaue -> value 2026-05-30 13:45:07 +08:00
81fd808d02 fix: data_filter form fields missing uitype and browserfields lookup
1. Default uitype to 'str' when no alter matches (text input)
2. Handle alter.uitype='select' by converting to code with inline data
3. Read browserfields from opts.row_options.browserfields (CRUD-generated
   UIs nest it under row_options, not at opts top level)
2026-05-30 01:18:55 +08:00
94a95b529b bugfix 2026-05-29 23:11:12 +08:00
fb718b6249 bugfix 2026-05-29 23:10:45 +08:00
1291f7fee3 fix: UiCode build_options uses valueField/textField fallback to 'value'/'text'
When valueField/textField are not explicitly set in opts, the auto-select
logic (line 1140) and nullable empty-option creation (lines 1144-1145) used
data[0][undefined] which returned undefined, causing:
- Single-option selects to show blank (auto-select failed)
- nullable empty options to have undefined keys

Now extracts vf/tf local variables with ||'value'/||'text' fallback at the
top of build_options(), used consistently throughout.
2026-05-29 23:03:52 +08:00
976fcbcc3b bugfix 2026-05-29 22:58:16 +08:00
a3f51f79fe bugfix 2026-05-29 22:56:57 +08:00
970f60e6f5 fix: add background-color to tabular-row-selected for visible selection highlight 2026-05-29 19:25:16 +08:00
ed95c8c88f debug: use console.log instead of bricks.debug for tabular click tracing 2026-05-29 13:58:42 +08:00
d83f91e951 debug: add logging to record_clicked to trace click events 2026-05-29 13:55:30 +08:00
456e8d4e01 revert: restore event.target.bricks_widget assignment in record_clicked 2026-05-29 13:54:32 +08:00
7ca370c0af fix: improve tabular row click handling
- Remove unused event.target.bricks_widget assignment
- Add check to prevent clicks on interactive elements (A, BUTTON, INPUT, SELECT, TEXTAREA) from triggering row selection
- This ensures toolbar buttons and form inputs inside rows work correctly
2026-05-29 13:52:08 +08:00
b866f236ec fix: Menu widget default bgcolor from 'white' to 'transparent'
Menu constructor hardcoded background to 'white' when no bgcolor option
was provided. This caused white background in sidebar menus regardless
of theme (dark/light). Changed default to 'transparent' so Menu inherits
parent container's themed background color.
2026-05-29 11:09:23 +08:00
05f869af18 feat(widget.js): 扩展opts_set_style支持更多CSS属性
新增支持的样式属性:
- borderRadius, borderTopLeftRadius等圆角属性
- border, borderColor, borderWidth, borderStyle等边框属性
- padding方向细分: paddingLeft/Right/Top/Bottom
- flex布局: flexGrow, flex, flexBasis, flexDirection, flexWrap, alignItems, justifyContent, gap, order
- 视觉效果: opacity, boxShadow, textShadow, transition, transform
- 文本: textDecoration, textTransform, whiteSpace, wordBreak
- 其他: pointerEvents, userSelect, objectFit, outline, boxSizing

注意: fontSize/fontWeight不加入keys,保留charsize响应式缩放机制
2026-05-28 23:46:44 +08:00
e448d242d7 bugfix 2026-05-28 15:54:21 +08:00
dfe2b418b0 fix: sync dist/css/bricks.css with dark theme CSS overrides 2026-05-28 13:59:03 +08:00
fe6d7117ca fix: dark theme for menu items, popup content, and WindowsPanel
- .menuitem: dark bg #334155 + light text #E2E8F0 (with !important to
  override Menu widget's inline backgroundColor:white)
- .popup .vbox/.vcontainer/.vscroll: override inline white bg
- .popup h1-h6: light text color for headings
- .mini-window: dark card style for WindowsPanel dock items
- .toppopup: dark shadow variant
2026-05-28 13:51:19 +08:00
447a3d91bc fix: add [data-theme=dark] CSS overrides for CRUD/tabular/card/input components
Sage shell defaults to dark theme but bricks.css had no dark rules,
causing light-gray text (#8a8a8a) on light backgrounds (#fafafa/#efefef)
in CRUD tables — unreadable against the dark shell.

Added comprehensive [data-theme=dark] overrides:
- body: #CBD5E1 text on #0F172A bg
- .card/.tabular/.tabular-row: dark slate backgrounds
- .inputbox/.popup/.modal/.toolbar: dark variants
- .accordion/.tabpanel/.message: dark variants
2026-05-28 11:37:56 +08:00
565699bd6b refactor: rename event sage_login to user_logined 2026-05-27 18:01:51 +08:00
ffc9350fcb feat: dispatch sage_login event after successful login in withLoginInfo
jsoncall.js: after login retry succeeds, dispatch 'sage_login' on bricks.app
so shell can reload the global menu dynamically.
2026-05-27 17:57:38 +08:00
2e22085122 feat: 401后登录成功自动重试原始请求
- withLoginInfo 改为接收完整 opts(含 method/headers/params)
- 等待 login_window 的 destroy 事件(=登录成功信号)
- 登录成功后重试原始请求
- 重试仍401则返回null(避免死循环)
- 用户手动关闭登录窗口时也触发重试,401则返回null
2026-05-27 15:39:34 +08:00
3c8757bd2c feat: add bricks.Router for SPA URL state management
- New router.js: configurable target tracking, History API integration
- Hook in _buildWidget: tracks urlwidget replace into registered targets
- Init via bricks.Router.init({targets: [{id, param}]})
- Supports: refresh restore, deep linking, back/forward navigation
- Excludes: Popup/PopupWindow/NewWindow (modal, transient)
- Non-tracked targets unaffected (login state, header, etc.)
2026-05-27 15:19:17 +08:00
6312ae8e22 bugfix 2026-05-27 13:40:13 +08:00
2ccd47ea03 Revert "feat: add shell_theme.css and shell_theme.js to header.tmpl"
This reverts commit 3ba2e0db2ee7adabdf3746db513493f12305e9e6.
2026-05-26 15:59:49 +08:00
3ba2e0db2e feat: add shell_theme.css and shell_theme.js to header.tmpl 2026-05-26 15:52:29 +08:00
6d47eeb795 feat: data_filter support via toolbar search button + popup Form
When CRUD JSON has data_filter in params:
- Toolbar shows a '搜索' button (name:'filter')
- Click opens PopupWindow with Form widget
- Form fields are dynamically generated from data_filter definition
  - Extracts all {var, field, op} from AND/OR/NOT nested structure
  - Supports dropdown (uitype:'code') via browserfields.alters config
  - Customizable labels via filter_labels option
- Form submit collects values → stored in this.filter_values
- merge_search_params() sends data_filter (JSON string) + each var value
  to backend API as URL parameters
- Backend .dspy uses sqlor.filter.DBFilter.gen(ns) for SQL WHERE clause

Deleted previous inline DataFilter widget approach; replaced with
popup Form pattern that matches existing CRUD edit/add form UX.
2026-05-25 14:15:59 +08:00
431245648d feat: add DataFilter widget for data_filter support in DataViewer
- New bricks.DataFilter widget (bricks/data_filter.js): parses data_filter
  JSON definition, renders search input fields for each var parameter,
  supports AND/OR/NOT nested structures, and UiCode dropdowns for fields
  with browserfields.alters uitype=code configuration.
- Modified DataViewer (bricks/dataviewer.js): added build_datafilter_widget(),
  filter_event_handle(), filter_clear_handle() methods; extended
  merge_search_params() to send data_filter JSON + collected var values
  to the backend API.
- Updated build.sh: added data_filter.js to the JS concatenation list.

Backend integration: DataViewer sends data_filter (JSON string) and
each var's user input value as URL params. Backend .dspy uses
sqlor.filter.DBFilter to convert to SQL WHERE clause.
2026-05-25 14:02:58 +08:00
5a94ae73d9 buggix 2026-05-25 12:28:45 +08:00
0c274cca51 buggix 2026-05-25 12:27:05 +08:00
07878a13b2 bugfix 2026-05-25 12:04:45 +08:00
9844311385 bugfix 2026-05-25 11:47:26 +08:00
1722340bc1 buggix 2026-05-24 16:46:27 +08:00
83f1214a37 buggix 2026-05-24 16:42:09 +08:00