origam 2.37.6 → 2.37.7
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 +11 -0
- package/dist/src/components/ColorPickerField/OrigamColorPickerField.vue +2 -2
- package/dist/src/components/DatePickerField/OrigamDatePickerField.vue +2 -2
- package/dist/src/components/FileField/OrigamFileField.vue +3 -3
- package/dist/src/components/NumberField/OrigamNumberField.vue +2 -2
- package/dist/src/components/PasswordField/OrigamPasswordField.vue +3 -3
- package/dist/src/components/Select/OrigamSelect.vue +2 -2
- package/dist/src/components/TextField/OrigamTextField.vue +3 -3
- package/dist/src/components/TextareaField/OrigamTextareaField.vue +3 -3
- package/dist/src/composables/Commons/props.composable.cjs +15 -9
- package/dist/src/composables/Commons/props.composable.d.ts +10 -0
- package/dist/src/composables/Commons/props.composable.js +14 -9
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -18,6 +18,17 @@ This project follows [Semantic Versioning](https://semver.org).
|
|
|
18
18
|
|
|
19
19
|
## [Unreleased]
|
|
20
20
|
|
|
21
|
+
## [2.37.7] - 2026-10-21
|
|
22
|
+
|
|
23
|
+
### Fixed — champs de saisie : id et props relayées différents entre le rendu serveur et le client (#1226)
|
|
24
|
+
|
|
25
|
+
`OrigamTextField`, `OrigamSelect`, `OrigamTextareaField`, `OrigamPasswordField` et `OrigamFileField` relayaient leurs props via une ref de template (`childRef.value?.filterProps(…)`). Or cette ref vaut `undefined` au rendu serveur et pendant l'hydratation. L'`id` de l'`<input>`, `aria-describedby`, `density` et `rounded` n'arrivaient donc qu'après le montage, sans avertissement d'hydratation.
|
|
26
|
+
|
|
27
|
+
- Nouveau `filterPropsOf(Component, props, excludes)` (`composables/Commons/props.composable.ts`) : il lit les noms de props dans la définition statique du composant, sans ref.
|
|
28
|
+
- Appliqué aux 5 champs, ainsi qu'à `OrigamColorPickerField`, `OrigamDatePickerField` et `OrigamNumberField`, pour que `rules` et `validationValue` arrivent ensemble au premier rendu.
|
|
29
|
+
- Vérifié : TU `field-ssr-relay.spec.ts` (`renderToString` puis hydratation), 4/4 rouges sur le parent, verts après ; suite TU complète verte (PR #1234).
|
|
30
|
+
- Suivi : une trentaine d'autres composants relaient encore par ref (#1239).
|
|
31
|
+
|
|
21
32
|
## [2.37.6] - 2026-10-21
|
|
22
33
|
|
|
23
34
|
### Fixed — `OrigamDrawer` sans `attach` : contenu absent du rendu serveur et hydratation en erreur (#1223)
|
|
@@ -136,7 +136,7 @@ import OrigamSheet from "../Sheet/OrigamSheet.vue";
|
|
|
136
136
|
import OrigamTextField from "../TextField/OrigamTextField.vue";
|
|
137
137
|
import OrigamTranslateScale from "../Transition/OrigamTranslateScale.vue";
|
|
138
138
|
import { useLocale } from "../../composables/Commons/locale.composable";
|
|
139
|
-
import { useProps } from "../../composables/Commons/props.composable";
|
|
139
|
+
import { filterPropsOf, useProps } from "../../composables/Commons/props.composable";
|
|
140
140
|
import { useTeleportTypography } from "../../composables/Commons/teleport-typography.composable";
|
|
141
141
|
import { useVModel } from "../../composables/Commons/vModel.composable";
|
|
142
142
|
import { useStyle } from "../../composables/Commons/style.composable";
|
|
@@ -417,7 +417,7 @@ const handleAfterLeave = () => {
|
|
|
417
417
|
}
|
|
418
418
|
};
|
|
419
419
|
const textFieldProps = computed(() => {
|
|
420
|
-
return
|
|
420
|
+
return filterPropsOf(OrigamTextField, props, ["class", "id", "style", "dirty", "modelValue", "placeholder", "validationValue", "focused"]);
|
|
421
421
|
});
|
|
422
422
|
const colorPickerProps = computed(() => {
|
|
423
423
|
return origamColorPickerRef.value?.filterProps(props, [
|
|
@@ -183,7 +183,7 @@ import OrigamTextField from "../TextField/OrigamTextField.vue";
|
|
|
183
183
|
import OrigamTranslateScale from "../Transition/OrigamTranslateScale.vue";
|
|
184
184
|
import { useDate } from "../../composables/Commons/date.composable";
|
|
185
185
|
import { useLocale } from "../../composables/Commons/locale.composable";
|
|
186
|
-
import { useProps } from "../../composables/Commons/props.composable";
|
|
186
|
+
import { filterPropsOf, useProps } from "../../composables/Commons/props.composable";
|
|
187
187
|
import { useTeleportTypography } from "../../composables/Commons/teleport-typography.composable";
|
|
188
188
|
import { useTextColor } from "../../composables/Commons/textColor.composable";
|
|
189
189
|
import { useVModel } from "../../composables/Commons/vModel.composable";
|
|
@@ -517,7 +517,7 @@ const handleChipMousedown = (e) => {
|
|
|
517
517
|
e.stopPropagation();
|
|
518
518
|
};
|
|
519
519
|
const textFieldProps = computed(() => {
|
|
520
|
-
return
|
|
520
|
+
return filterPropsOf(OrigamTextField, props, ["class", "id", "style", "dirty", "modelValue", "placeholder", "validationValue", "focused"]);
|
|
521
521
|
});
|
|
522
522
|
const datePickerProps = computed(() => {
|
|
523
523
|
return origamDatePickerRef.value?.filterProps(
|
|
@@ -394,7 +394,7 @@ import { useBothColor } from "../../composables/Commons/bothColor.composable";
|
|
|
394
394
|
import { useDensity } from "../../composables/Commons/density.composable";
|
|
395
395
|
import { useFocus } from "../../composables/Commons/focus.composable";
|
|
396
396
|
import { useLocale } from "../../composables/Commons/locale.composable";
|
|
397
|
-
import { useProps } from "../../composables/Commons/props.composable";
|
|
397
|
+
import { filterPropsOf, useProps } from "../../composables/Commons/props.composable";
|
|
398
398
|
import { useStyle } from "../../composables/Commons/style.composable";
|
|
399
399
|
import { useVModel } from "../../composables/Commons/vModel.composable";
|
|
400
400
|
import { DENSITY } from "../../enums/Commons/density.enum";
|
|
@@ -765,10 +765,10 @@ const dropzoneSubtitleText = computed(() => {
|
|
|
765
765
|
});
|
|
766
766
|
const [rootAttrs, inputAttrs] = filterInputAttrs(attrs);
|
|
767
767
|
const inputProps = computed(() => {
|
|
768
|
-
return
|
|
768
|
+
return filterPropsOf(OrigamInput, props, ["modelValue", "class", "style", "focused", ...BORDER_PROP_KEYS]);
|
|
769
769
|
});
|
|
770
770
|
const fieldProps = computed(() => {
|
|
771
|
-
return
|
|
771
|
+
return filterPropsOf(OrigamField, props, ["class", "style", "id", "active", "dirty", "disabled", "focused", "error"]);
|
|
772
772
|
});
|
|
773
773
|
const fileFieldStyles = computed(() => {
|
|
774
774
|
return [
|
|
@@ -292,7 +292,7 @@ import { useAdjacentInner } from "../../composables/Commons/adjacentInner.compos
|
|
|
292
292
|
import { useFocus } from "../../composables/Commons/focus.composable";
|
|
293
293
|
import { useHold } from "../../composables/NumberField/hold.composable";
|
|
294
294
|
import { useLocale } from "../../composables/Commons/locale.composable";
|
|
295
|
-
import { useProps } from "../../composables/Commons/props.composable";
|
|
295
|
+
import { filterPropsOf, useProps } from "../../composables/Commons/props.composable";
|
|
296
296
|
import { useVModel } from "../../composables/Commons/vModel.composable";
|
|
297
297
|
import { useStyle } from "../../composables/Commons/style.composable";
|
|
298
298
|
import { UNSEEDED } from "../../consts/Commons/vmodel.const";
|
|
@@ -663,7 +663,7 @@ const handleBlur = () => {
|
|
|
663
663
|
clampModel();
|
|
664
664
|
};
|
|
665
665
|
const textFieldProps = computed(() => {
|
|
666
|
-
return
|
|
666
|
+
return filterPropsOf(OrigamTextField, props, ["modelValue", "class", "style", "validationValue"]);
|
|
667
667
|
});
|
|
668
668
|
const hasAppendInner = computed(() => {
|
|
669
669
|
return slots.appendInner || !props.hideControls;
|
|
@@ -315,7 +315,7 @@ import { useAdjacent } from "../../composables/Commons/adjacent.composable";
|
|
|
315
315
|
import { useAdjacentInner } from "../../composables/Commons/adjacentInner.composable";
|
|
316
316
|
import { useFocus } from "../../composables/Commons/focus.composable";
|
|
317
317
|
import { useLocale } from "../../composables/Commons/locale.composable";
|
|
318
|
-
import { useProps } from "../../composables/Commons/props.composable";
|
|
318
|
+
import { filterPropsOf, useProps } from "../../composables/Commons/props.composable";
|
|
319
319
|
import { useStyle } from "../../composables/Commons/style.composable";
|
|
320
320
|
import { useVModel } from "../../composables/Commons/vModel.composable";
|
|
321
321
|
import { BORDER_PROP_KEYS } from "../../consts/Commons/border.const";
|
|
@@ -640,10 +640,10 @@ const enrichedRules = computed(() => {
|
|
|
640
640
|
});
|
|
641
641
|
const [rootAttrs, inputAttrs] = filterInputAttrs(attrs);
|
|
642
642
|
const inputProps = computed(() => {
|
|
643
|
-
return
|
|
643
|
+
return filterPropsOf(OrigamInput, props, ["modelValue", "class", "style", "focused", ...BORDER_PROP_KEYS]);
|
|
644
644
|
});
|
|
645
645
|
const fieldProps = computed(() => {
|
|
646
|
-
return
|
|
646
|
+
return filterPropsOf(OrigamField, props, ["class", "id", "active", "dirty", "disabled", "focused", "error", "style"]);
|
|
647
647
|
});
|
|
648
648
|
const resolvedMenuProps = computed(() => {
|
|
649
649
|
return {
|
|
@@ -298,7 +298,7 @@ import OrigamVirtualScroll from "../VirtualScroll/OrigamVirtualScroll.vue";
|
|
|
298
298
|
import { useFilter } from "../../composables/Commons/filters.composable";
|
|
299
299
|
import { useItems } from "../../composables/Commons/items.composable";
|
|
300
300
|
import { useLocale } from "../../composables/Commons/locale.composable";
|
|
301
|
-
import { useProps } from "../../composables/Commons/props.composable";
|
|
301
|
+
import { filterPropsOf, useProps } from "../../composables/Commons/props.composable";
|
|
302
302
|
import { useScrolling } from "../../composables/Commons/scrolling.composable";
|
|
303
303
|
import { useStyle } from "../../composables/Commons/style.composable";
|
|
304
304
|
import { useTeleportTypography } from "../../composables/Commons/teleport-typography.composable";
|
|
@@ -945,7 +945,7 @@ const hasList = computed(() => {
|
|
|
945
945
|
return !props.hideNoData || displayItems.value.length || slots.prependItem || slots.appendItem || slots.noData;
|
|
946
946
|
});
|
|
947
947
|
const textFieldProps = computed(() => {
|
|
948
|
-
return
|
|
948
|
+
return filterPropsOf(OrigamTextField, props, ["class", "id", "style", "counterValue", "dirty", "modelValue", "placeholder", "validationValue", "focused"]);
|
|
949
949
|
});
|
|
950
950
|
const listSize = computed(() => {
|
|
951
951
|
return props.size ?? SIZES.DEFAULT;
|
|
@@ -195,7 +195,7 @@ import { useAdjacentInner } from "../../composables/Commons/adjacentInner.compos
|
|
|
195
195
|
import { useFocus } from "../../composables/Commons/focus.composable";
|
|
196
196
|
import { useLocale } from "../../composables/Commons/locale.composable";
|
|
197
197
|
import { useMask } from "../../composables/Commons/mask.composable";
|
|
198
|
-
import { useProps } from "../../composables/Commons/props.composable";
|
|
198
|
+
import { filterPropsOf, useProps } from "../../composables/Commons/props.composable";
|
|
199
199
|
import { useStyle } from "../../composables/Commons/style.composable";
|
|
200
200
|
import { useVModel } from "../../composables/Commons/vModel.composable";
|
|
201
201
|
import { BORDER_PROP_KEYS } from "../../consts/Commons/border.const";
|
|
@@ -509,10 +509,10 @@ const filteredAttrs = computed(() => filterInputAttrs(attrs));
|
|
|
509
509
|
const rootAttrs = computed(() => filteredAttrs.value[0]);
|
|
510
510
|
const inputAttrs = computed(() => filteredAttrs.value[1]);
|
|
511
511
|
const inputProps = computed(() => {
|
|
512
|
-
return
|
|
512
|
+
return filterPropsOf(OrigamInput, props, ["modelValue", "class", "style", "focused", ...BORDER_PROP_KEYS]);
|
|
513
513
|
});
|
|
514
514
|
const fieldProps = computed(() => {
|
|
515
|
-
return
|
|
515
|
+
return filterPropsOf(OrigamField, props, ["class", "id", "active", "dirty", "disabled", "focused", "error", "style"]);
|
|
516
516
|
});
|
|
517
517
|
const textFieldStyles = computed(() => {
|
|
518
518
|
return [
|
|
@@ -271,7 +271,7 @@ import { useAdjacentInner } from "../../composables/Commons/adjacentInner.compos
|
|
|
271
271
|
import { useDragResizer } from "../../composables/Commons/dragResizer.composable";
|
|
272
272
|
import { useFocus } from "../../composables/Commons/focus.composable";
|
|
273
273
|
import { useLocale } from "../../composables/Commons/locale.composable";
|
|
274
|
-
import { useProps } from "../../composables/Commons/props.composable";
|
|
274
|
+
import { filterPropsOf, useProps } from "../../composables/Commons/props.composable";
|
|
275
275
|
import { useStyle } from "../../composables/Commons/style.composable";
|
|
276
276
|
import { useTextareaRich } from "../../composables/TextareaField/textarea-field-rich.composable";
|
|
277
277
|
import { useTheme } from "../../composables/Commons/theme.composable";
|
|
@@ -656,10 +656,10 @@ const enrichedRules = computed(() => {
|
|
|
656
656
|
});
|
|
657
657
|
const [rootAttrs, inputAttrs] = filterInputAttrs(attrs);
|
|
658
658
|
const inputProps = computed(() => {
|
|
659
|
-
return
|
|
659
|
+
return filterPropsOf(OrigamInput, props, ["modelValue", "class", "style", "focused", "centerAffix", ...BORDER_PROP_KEYS]);
|
|
660
660
|
});
|
|
661
661
|
const fieldProps = computed(() => {
|
|
662
|
-
return
|
|
662
|
+
return filterPropsOf(OrigamField, props, ["class", "id", "style", "active", "dirty", "disabled", "focused", "error", "centerAffix"]);
|
|
663
663
|
});
|
|
664
664
|
const textareaFieldStyles = computed(() => {
|
|
665
665
|
return [
|
|
@@ -3,20 +3,26 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.filterPropsOf = filterPropsOf;
|
|
6
7
|
exports.useProps = useProps;
|
|
7
8
|
var _commons = require("../../utils/Commons/commons.util.cjs");
|
|
8
9
|
function useProps(props) {
|
|
9
|
-
const
|
|
10
|
-
const filterProps = (properties, excludes = defaultExcludes) => {
|
|
11
|
-
const propKeys = Object.keys(props).filter(key => !excludes.includes(key));
|
|
12
|
-
const picked = (0, _commons.pick)(properties, propKeys);
|
|
13
|
-
for (const key of Object.keys(picked)) {
|
|
14
|
-
if (picked[key] === void 0) delete picked[key];
|
|
15
|
-
}
|
|
16
|
-
return picked;
|
|
17
|
-
};
|
|
10
|
+
const filterProps = (properties, excludes = defaultExcludes) => pickDeclared(properties, Object.keys(props), excludes);
|
|
18
11
|
return {
|
|
19
12
|
filterProps,
|
|
20
13
|
props
|
|
21
14
|
};
|
|
15
|
+
}
|
|
16
|
+
const defaultExcludes = ["class", "style", "id"];
|
|
17
|
+
function pickDeclared(properties, declared, excludes) {
|
|
18
|
+
const propKeys = declared.filter(key => !excludes.includes(key));
|
|
19
|
+
const picked = (0, _commons.pick)(properties, propKeys);
|
|
20
|
+
for (const key of Object.keys(picked)) {
|
|
21
|
+
if (picked[key] === void 0) delete picked[key];
|
|
22
|
+
}
|
|
23
|
+
return picked;
|
|
24
|
+
}
|
|
25
|
+
function filterPropsOf(component, properties, excludes = defaultExcludes) {
|
|
26
|
+
const declared = component.props;
|
|
27
|
+
return pickDeclared(properties, Array.isArray(declared) ? declared : Object.keys(declared ?? {}), excludes);
|
|
22
28
|
}
|
|
@@ -48,3 +48,13 @@ import type { IFilterPropsOptions } from '../../interfaces/Commons/commons.inter
|
|
|
48
48
|
* this one.
|
|
49
49
|
********************************************************/
|
|
50
50
|
export declare function useProps<T extends object>(props: T): IFilterPropsOptions<T>;
|
|
51
|
+
/*********************************************************
|
|
52
|
+
* filterPropsOf — #1226
|
|
53
|
+
*
|
|
54
|
+
* Same output as `childRef.value?.filterProps(props, excludes)`, but the child's
|
|
55
|
+
* declared prop names are read from its STATIC component definition instead of
|
|
56
|
+
* through a template ref. The ref is `undefined` on the server and during
|
|
57
|
+
* hydration, so every relayed prop (`id`, `variant`, `rounded`…) was missing
|
|
58
|
+
* from the SSR HTML and arrived one tick after mount, with no hydration warning.
|
|
59
|
+
********************************************************/
|
|
60
|
+
export declare function filterPropsOf(component: object, properties: object, excludes?: string[]): Record<string, unknown>;
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { pick } from "../../utils/Commons/commons.util.js";
|
|
2
2
|
export function useProps(props) {
|
|
3
|
-
const
|
|
4
|
-
const filterProps = (properties, excludes = defaultExcludes) => {
|
|
5
|
-
const propKeys = Object.keys(props).filter((key) => !excludes.includes(key));
|
|
6
|
-
const picked = pick(properties, propKeys);
|
|
7
|
-
for (const key of Object.keys(picked)) {
|
|
8
|
-
if (picked[key] === void 0) delete picked[key];
|
|
9
|
-
}
|
|
10
|
-
return picked;
|
|
11
|
-
};
|
|
3
|
+
const filterProps = (properties, excludes = defaultExcludes) => pickDeclared(properties, Object.keys(props), excludes);
|
|
12
4
|
return { filterProps, props };
|
|
13
5
|
}
|
|
6
|
+
const defaultExcludes = ["class", "style", "id"];
|
|
7
|
+
function pickDeclared(properties, declared, excludes) {
|
|
8
|
+
const propKeys = declared.filter((key) => !excludes.includes(key));
|
|
9
|
+
const picked = pick(properties, propKeys);
|
|
10
|
+
for (const key of Object.keys(picked)) {
|
|
11
|
+
if (picked[key] === void 0) delete picked[key];
|
|
12
|
+
}
|
|
13
|
+
return picked;
|
|
14
|
+
}
|
|
15
|
+
export function filterPropsOf(component, properties, excludes = defaultExcludes) {
|
|
16
|
+
const declared = component.props;
|
|
17
|
+
return pickDeclared(properties, Array.isArray(declared) ? declared : Object.keys(declared ?? {}), excludes);
|
|
18
|
+
}
|