@sia.soul/sia-react-ui 0.1.69 → 0.1.70
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 +5 -7
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -7
- 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++;
|
package/dist/index.d.cts
CHANGED
|
@@ -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
|
/** 收起状态变化回调 */
|
package/dist/index.d.ts
CHANGED
|
@@ -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
|
/** 收起状态变化回调 */
|
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++;
|