@sia.soul/sia-react-ui 0.1.69 → 0.1.71
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/index.cjs +6 -8
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +6 -8
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -23539,7 +23539,7 @@ function QueryForm({
|
|
|
23539
23539
|
collapsible = true,
|
|
23540
23540
|
collapsed: controlledCollapsed,
|
|
23541
23541
|
defaultCollapsed = false,
|
|
23542
|
-
collapsedCount =
|
|
23542
|
+
collapsedCount = Infinity,
|
|
23543
23543
|
onCollapsedChange,
|
|
23544
23544
|
quickQueries = [],
|
|
23545
23545
|
quickQuerySize = "small",
|
|
@@ -23620,17 +23620,15 @@ function QueryForm({
|
|
|
23620
23620
|
allFields.length > 0 && requiredWidth > row.clientWidth + 0.5
|
|
23621
23621
|
);
|
|
23622
23622
|
if (toggle) toggle.hidden = Boolean(toggleHidden);
|
|
23623
|
+
row.classList.toggle("is-collapsed", wasCollapsed);
|
|
23624
|
+
const widths = collapsed ? allFields.slice(0, limit).map((field) => field.getBoundingClientRect().width) : [];
|
|
23625
|
+
let remaining = row.clientWidth - actions.getBoundingClientRect().width;
|
|
23623
23626
|
hiddenFields.forEach((field) => {
|
|
23624
23627
|
field.hidden = true;
|
|
23625
23628
|
});
|
|
23626
|
-
row.classList.toggle("is-collapsed", wasCollapsed);
|
|
23627
23629
|
if (!collapsed) return;
|
|
23628
|
-
let remaining = row.clientWidth - actions.getBoundingClientRect().width;
|
|
23629
23630
|
let count = 0;
|
|
23630
|
-
for (const
|
|
23631
|
-
row.querySelectorAll(":scope > .sia-query-form__field")
|
|
23632
|
-
).slice(0, limit)) {
|
|
23633
|
-
const width = parseFloat(getComputedStyle(field).width) || 220;
|
|
23631
|
+
for (const width of widths) {
|
|
23634
23632
|
if (remaining + 0.5 < width + gap) break;
|
|
23635
23633
|
remaining -= width + gap;
|
|
23636
23634
|
count++;
|
|
@@ -23846,7 +23844,7 @@ function QueryForm({
|
|
|
23846
23844
|
]
|
|
23847
23845
|
}
|
|
23848
23846
|
),
|
|
23849
|
-
savedQueries.length
|
|
23847
|
+
savedQueries.length ? /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)("div", { className: "sia-query-form__saved", "aria-label": "\u5DF2\u4FDD\u5B58\u5FEB\u6377\u67E5\u8BE2", children: [
|
|
23850
23848
|
savedQueries.map((query, index) => /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
23851
23849
|
Tag,
|
|
23852
23850
|
{
|
package/dist/index.d.cts
CHANGED
|
@@ -3126,7 +3126,7 @@ interface QueryFormProps<T extends FormValues = FormValues> extends Omit<FormPro
|
|
|
3126
3126
|
* @defaultValue true
|
|
3127
3127
|
*/
|
|
3128
3128
|
collapsible?: boolean;
|
|
3129
|
-
/** 受控收起状态,需在 onCollapsedChange
|
|
3129
|
+
/** 受控收起状态,需在 onCollapsedChange 中更新;全部字段能单行显示时不执行收起。收起时保留字段挂载和值,只隐藏放不下的字段,底部快捷标签始终保留。 */
|
|
3130
3130
|
collapsed?: boolean;
|
|
3131
3131
|
/**
|
|
3132
3132
|
* 非受控模式的初始收起状态;默认展开全部查询条件,即使条件超过一行也不自动收起。显式传 true 时才初始收起。
|
|
@@ -3134,8 +3134,8 @@ interface QueryFormProps<T extends FormValues = FormValues> extends Omit<FormPro
|
|
|
3134
3134
|
*/
|
|
3135
3135
|
defaultCollapsed?: boolean;
|
|
3136
3136
|
/**
|
|
3137
|
-
*
|
|
3138
|
-
* @defaultValue
|
|
3137
|
+
* 收起时最多保留的字段数;默认按可用宽度自动填满一行,并预留操作区宽度。显式指定时作为数量上限,空间不足会进一步减少;全部字段能单行显示时不限制字段数。
|
|
3138
|
+
* @defaultValue Infinity
|
|
3139
3139
|
*/
|
|
3140
3140
|
collapsedCount?: number;
|
|
3141
3141
|
/** 收起状态变化回调 */
|
|
@@ -3151,7 +3151,7 @@ interface QueryFormProps<T extends FormValues = FormValues> extends Omit<FormPro
|
|
|
3151
3151
|
*/
|
|
3152
3152
|
quickQuerySize?: ButtonSize;
|
|
3153
3153
|
/**
|
|
3154
|
-
*
|
|
3154
|
+
* 底部已保存快捷查询标签。点击回填该项条件并查询;收起时仍可使用。业务方负责加载数据,并在保存或删除成功后更新此数组。
|
|
3155
3155
|
* @defaultValue []
|
|
3156
3156
|
*/
|
|
3157
3157
|
savedQueries?: readonly QueryFormShortcut<T>[];
|
package/dist/index.d.ts
CHANGED
|
@@ -3126,7 +3126,7 @@ interface QueryFormProps<T extends FormValues = FormValues> extends Omit<FormPro
|
|
|
3126
3126
|
* @defaultValue true
|
|
3127
3127
|
*/
|
|
3128
3128
|
collapsible?: boolean;
|
|
3129
|
-
/** 受控收起状态,需在 onCollapsedChange
|
|
3129
|
+
/** 受控收起状态,需在 onCollapsedChange 中更新;全部字段能单行显示时不执行收起。收起时保留字段挂载和值,只隐藏放不下的字段,底部快捷标签始终保留。 */
|
|
3130
3130
|
collapsed?: boolean;
|
|
3131
3131
|
/**
|
|
3132
3132
|
* 非受控模式的初始收起状态;默认展开全部查询条件,即使条件超过一行也不自动收起。显式传 true 时才初始收起。
|
|
@@ -3134,8 +3134,8 @@ interface QueryFormProps<T extends FormValues = FormValues> extends Omit<FormPro
|
|
|
3134
3134
|
*/
|
|
3135
3135
|
defaultCollapsed?: boolean;
|
|
3136
3136
|
/**
|
|
3137
|
-
*
|
|
3138
|
-
* @defaultValue
|
|
3137
|
+
* 收起时最多保留的字段数;默认按可用宽度自动填满一行,并预留操作区宽度。显式指定时作为数量上限,空间不足会进一步减少;全部字段能单行显示时不限制字段数。
|
|
3138
|
+
* @defaultValue Infinity
|
|
3139
3139
|
*/
|
|
3140
3140
|
collapsedCount?: number;
|
|
3141
3141
|
/** 收起状态变化回调 */
|
|
@@ -3151,7 +3151,7 @@ interface QueryFormProps<T extends FormValues = FormValues> extends Omit<FormPro
|
|
|
3151
3151
|
*/
|
|
3152
3152
|
quickQuerySize?: ButtonSize;
|
|
3153
3153
|
/**
|
|
3154
|
-
*
|
|
3154
|
+
* 底部已保存快捷查询标签。点击回填该项条件并查询;收起时仍可使用。业务方负责加载数据,并在保存或删除成功后更新此数组。
|
|
3155
3155
|
* @defaultValue []
|
|
3156
3156
|
*/
|
|
3157
3157
|
savedQueries?: readonly QueryFormShortcut<T>[];
|
package/dist/index.js
CHANGED
|
@@ -8583,7 +8583,7 @@ function QueryForm({
|
|
|
8583
8583
|
collapsible = true,
|
|
8584
8584
|
collapsed: controlledCollapsed,
|
|
8585
8585
|
defaultCollapsed = false,
|
|
8586
|
-
collapsedCount =
|
|
8586
|
+
collapsedCount = Infinity,
|
|
8587
8587
|
onCollapsedChange,
|
|
8588
8588
|
quickQueries = [],
|
|
8589
8589
|
quickQuerySize = "small",
|
|
@@ -8664,17 +8664,15 @@ function QueryForm({
|
|
|
8664
8664
|
allFields.length > 0 && requiredWidth > row.clientWidth + 0.5
|
|
8665
8665
|
);
|
|
8666
8666
|
if (toggle) toggle.hidden = Boolean(toggleHidden);
|
|
8667
|
+
row.classList.toggle("is-collapsed", wasCollapsed);
|
|
8668
|
+
const widths = collapsed ? allFields.slice(0, limit).map((field) => field.getBoundingClientRect().width) : [];
|
|
8669
|
+
let remaining = row.clientWidth - actions.getBoundingClientRect().width;
|
|
8667
8670
|
hiddenFields.forEach((field) => {
|
|
8668
8671
|
field.hidden = true;
|
|
8669
8672
|
});
|
|
8670
|
-
row.classList.toggle("is-collapsed", wasCollapsed);
|
|
8671
8673
|
if (!collapsed) return;
|
|
8672
|
-
let remaining = row.clientWidth - actions.getBoundingClientRect().width;
|
|
8673
8674
|
let count = 0;
|
|
8674
|
-
for (const
|
|
8675
|
-
row.querySelectorAll(":scope > .sia-query-form__field")
|
|
8676
|
-
).slice(0, limit)) {
|
|
8677
|
-
const width = parseFloat(getComputedStyle(field).width) || 220;
|
|
8675
|
+
for (const width of widths) {
|
|
8678
8676
|
if (remaining + 0.5 < width + gap) break;
|
|
8679
8677
|
remaining -= width + gap;
|
|
8680
8678
|
count++;
|
|
@@ -8890,7 +8888,7 @@ function QueryForm({
|
|
|
8890
8888
|
]
|
|
8891
8889
|
}
|
|
8892
8890
|
),
|
|
8893
|
-
savedQueries.length
|
|
8891
|
+
savedQueries.length ? /* @__PURE__ */ jsxs24("div", { className: "sia-query-form__saved", "aria-label": "\u5DF2\u4FDD\u5B58\u5FEB\u6377\u67E5\u8BE2", children: [
|
|
8894
8892
|
savedQueries.map((query, index) => /* @__PURE__ */ jsx26(
|
|
8895
8893
|
Tag,
|
|
8896
8894
|
{
|