origam 2.40.1 → 2.41.0
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 +20 -0
- package/dist/src/components/Breadcrumb/OrigamBreadcrumb.vue +2 -1
- package/dist/src/components/Chart/OrigamChartCartesian.vue +1 -2
- package/dist/src/components/Code/OrigamCode.vue +5 -16
- package/dist/src/components/DataTable/OrigamDataTable.vue +4 -5
- package/dist/src/components/Dialog/OrigamDialog.vue +3 -10
- package/dist/src/components/Drawer/OrigamDrawer.vue +4 -2
- package/dist/src/components/Grids/OrigamRow.vue +8 -11
- package/dist/src/components/Media/OrigamMediaController.vue +3 -2
- package/dist/src/components/Overlay/OrigamOverlay.vue +3 -4
- package/dist/src/components/Transition/OrigamTranslateScale.vue +4 -1
- package/dist/src/components/Window/OrigamWindow.vue +2 -3
- package/dist/src/composables/Commons/accessibleCommand.composable.cjs +2 -1
- package/dist/src/composables/Commons/accessibleCommand.composable.js +2 -1
- package/dist/src/composables/Commons/backButton.composable.cjs +14 -18
- package/dist/src/composables/Commons/backButton.composable.d.ts +4 -2
- package/dist/src/composables/Commons/backButton.composable.js +14 -18
- package/dist/src/composables/Commons/backgroundColor.composable.cjs +7 -3
- package/dist/src/composables/Commons/backgroundColor.composable.js +6 -3
- package/dist/src/composables/Commons/bothColor.composable.cjs +6 -2
- package/dist/src/composables/Commons/bothColor.composable.js +7 -4
- package/dist/src/composables/Commons/colorEffect.composable.cjs +2 -1
- package/dist/src/composables/Commons/colorEffect.composable.js +3 -1
- package/dist/src/composables/Commons/createLayout.composable.cjs +3 -2
- package/dist/src/composables/Commons/createLayout.composable.js +3 -2
- package/dist/src/composables/Commons/cssSupportClient.composable.d.ts +2 -1
- package/dist/src/composables/Commons/dragResizer.composable.cjs +7 -10
- package/dist/src/composables/Commons/dragResizer.composable.d.ts +2 -2
- package/dist/src/composables/Commons/dragResizer.composable.js +7 -10
- package/dist/src/composables/Commons/elevation.composable.cjs +2 -1
- package/dist/src/composables/Commons/elevation.composable.js +2 -1
- package/dist/src/composables/Commons/locationStrategies.composable.d.ts +1 -1
- package/dist/src/composables/Commons/passedProps.composable.cjs +1 -1
- package/dist/src/composables/Commons/passedProps.composable.js +1 -1
- package/dist/src/composables/Commons/textColor.composable.cjs +7 -3
- package/dist/src/composables/Commons/textColor.composable.js +6 -3
- package/dist/src/composables/Commons/touch.composable.cjs +17 -1
- package/dist/src/composables/Commons/touch.composable.js +17 -1
- package/dist/src/composables/Parallax/parallax.composable.cjs +2 -10
- package/dist/src/composables/Parallax/parallax.composable.js +2 -10
- package/dist/src/consts/Commons/border.const.cjs +5 -1
- package/dist/src/consts/Commons/border.const.js +5 -1
- package/dist/src/consts/TextField/text-field.const.d.ts +1 -2
- package/dist/src/consts/TextField/text-field.const.js +1 -2
- package/dist/src/directives/Contrast/contrast.directive.cjs +1 -1
- package/dist/src/directives/Contrast/contrast.directive.js +1 -1
- package/dist/src/enums/BottomNav/bottom-nav.enum.cjs +4 -5
- package/dist/src/enums/BottomNav/bottom-nav.enum.js +4 -5
- package/dist/src/interfaces/Blockquote/blockquote.interface.d.ts +1 -1
- package/dist/src/interfaces/Chart/chart-map.interface.d.ts +5 -4
- package/dist/src/interfaces/Commons/activator.interface.d.ts +1 -1
- package/dist/src/interfaces/Parallax/parallax.interface.d.ts +3 -2
- package/dist/src/origam-core.cjs +1 -1
- package/dist/src/origam-core.js +1 -1
- package/dist/src/types/Grids/row.type.d.ts +2 -1
- package/dist/src/types/Parallax/parallax.type.d.ts +1 -2
- package/dist/src/types/TextField/text-field.type.d.ts +2 -1
- package/dist/src/utils/Commons/animation.util.cjs +7 -4
- package/dist/src/utils/Commons/animation.util.js +4 -1
- package/dist/src/utils/Commons/nested.util.cjs +3 -1
- package/dist/src/utils/Commons/nested.util.js +4 -1
- package/dist/src/utils/Commons/spacing.util.cjs +1 -1
- package/dist/src/utils/Commons/spacing.util.js +1 -1
- package/dist/src/utils/Commons/token-name.util.cjs +9 -6
- package/dist/src/utils/Commons/token-name.util.js +9 -6
- package/package.json +1 -1
|
@@ -16,17 +16,18 @@ export function useDragResizer(el, value, min, max, axis) {
|
|
|
16
16
|
removeListeners.forEach((fn) => fn());
|
|
17
17
|
resizing.value = false;
|
|
18
18
|
};
|
|
19
|
+
const moveHandler = (start, initialStart) => (e) => {
|
|
20
|
+
const clickOffset = getPosition(e, isHorizontal.value ? CLIENT_POSITION.X : CLIENT_POSITION.Y);
|
|
21
|
+
const delta = clickOffset - start;
|
|
22
|
+
value.value = clamp(initialStart + delta, toValue(min), toValue(max));
|
|
23
|
+
};
|
|
19
24
|
const onMouseDown = (e) => {
|
|
20
25
|
e.preventDefault();
|
|
21
26
|
e.stopPropagation();
|
|
22
27
|
const start = getPosition(e, isHorizontal.value ? CLIENT_POSITION.X : CLIENT_POSITION.Y);
|
|
23
28
|
const initialStart = value.value;
|
|
24
29
|
resizing.value = true;
|
|
25
|
-
const onMouseMove = (
|
|
26
|
-
const clickOffset = getPosition(e2, isHorizontal.value ? CLIENT_POSITION.X : CLIENT_POSITION.Y);
|
|
27
|
-
const delta = clickOffset - start;
|
|
28
|
-
value.value = clamp(initialStart + delta, toValue(min), toValue(max));
|
|
29
|
-
};
|
|
30
|
+
const onMouseMove = moveHandler(start, initialStart);
|
|
30
31
|
const onMouseUp = onDragEnd;
|
|
31
32
|
removeListeners.push(...[
|
|
32
33
|
addWindowListener("mousemove", onMouseMove, onUnmountedCleanupFns),
|
|
@@ -39,11 +40,7 @@ export function useDragResizer(el, value, min, max, axis) {
|
|
|
39
40
|
const start = getPosition(e, isHorizontal.value ? CLIENT_POSITION.X : CLIENT_POSITION.Y);
|
|
40
41
|
const initialStart = value.value;
|
|
41
42
|
resizing.value = true;
|
|
42
|
-
const onTouchMove = (
|
|
43
|
-
const clickOffset = getPosition(e2, isHorizontal.value ? CLIENT_POSITION.X : CLIENT_POSITION.Y);
|
|
44
|
-
const delta = clickOffset - start;
|
|
45
|
-
value.value = clamp(initialStart + delta, toValue(min), toValue(max));
|
|
46
|
-
};
|
|
43
|
+
const onTouchMove = moveHandler(start, initialStart);
|
|
47
44
|
const onTouchEnd = onDragEnd;
|
|
48
45
|
removeListeners.push(...[
|
|
49
46
|
addWindowListener("touchmove", onTouchMove, onUnmountedCleanupFns),
|
|
@@ -21,7 +21,8 @@ function isUtilityRung(value) {
|
|
|
21
21
|
}
|
|
22
22
|
function shadowVar(rung) {
|
|
23
23
|
const fallback = _elevation.SHADOW_RUNG_FALLBACK[rung];
|
|
24
|
-
|
|
24
|
+
const fallbackArg = fallback ? `, ${fallback}` : "";
|
|
25
|
+
return `var(${_elevation.SHADOW_TOKEN_PREFIX}${rung}${fallbackArg})`;
|
|
25
26
|
}
|
|
26
27
|
const _bgWarned = /* @__PURE__ */new WeakSet();
|
|
27
28
|
function warnBgColorUsage(bgColor) {
|
|
@@ -24,7 +24,8 @@ function isUtilityRung(value) {
|
|
|
24
24
|
}
|
|
25
25
|
function shadowVar(rung) {
|
|
26
26
|
const fallback = SHADOW_RUNG_FALLBACK[rung];
|
|
27
|
-
|
|
27
|
+
const fallbackArg = fallback ? `, ${fallback}` : "";
|
|
28
|
+
return `var(${SHADOW_TOKEN_PREFIX}${rung}${fallbackArg})`;
|
|
28
29
|
}
|
|
29
30
|
const _bgWarned = /* @__PURE__ */ new WeakSet();
|
|
30
31
|
function warnBgColorUsage(bgColor) {
|
|
@@ -11,7 +11,7 @@ import type { ILocationStrategyData, ILocationStrategyProps } from '../../interf
|
|
|
11
11
|
*
|
|
12
12
|
* @description
|
|
13
13
|
* ⛔ `locationStrategy="static"` NE POSITIONNE RIEN. `staticLocationStrategy`
|
|
14
|
-
* (utils/Commons/location.util.ts) a un corps reduit a
|
|
14
|
+
* (utils/Commons/location.util.ts) a un corps reduit a un commentaire de tache restante : elle rend
|
|
15
15
|
* `undefined`, donc `updateLocation` reste `undefined` et `contentStyles`
|
|
16
16
|
* reste `{}`. Mesure, contenu et cible reels attaches au document :
|
|
17
17
|
* `static` → `contentStyles = {}` / `updateLocation = undefined` ;
|
|
@@ -9,7 +9,7 @@ var _getCurrentInstance = require("../../utils/Commons/getCurrentInstance.util.c
|
|
|
9
9
|
function usePassedProps(_props, instanceLabel = "usePassedProps") {
|
|
10
10
|
const vm = (0, _getCurrentInstance.getCurrentInstance)(instanceLabel);
|
|
11
11
|
return key => {
|
|
12
|
-
const vnodeProps = vm.vnode.props
|
|
12
|
+
const vnodeProps = vm.vnode.props ?? {};
|
|
13
13
|
for (const k in vnodeProps) {
|
|
14
14
|
if (k === key || (0, _commons.camelize)(k) === key) return vnodeProps[k] !== void 0;
|
|
15
15
|
}
|
|
@@ -3,7 +3,7 @@ import { getCurrentInstance } from "../../utils/Commons/getCurrentInstance.util.
|
|
|
3
3
|
export function usePassedProps(_props, instanceLabel = "usePassedProps") {
|
|
4
4
|
const vm = getCurrentInstance(instanceLabel);
|
|
5
5
|
return (key) => {
|
|
6
|
-
const vnodeProps = vm.vnode.props
|
|
6
|
+
const vnodeProps = vm.vnode.props ?? {};
|
|
7
7
|
for (const k in vnodeProps) {
|
|
8
8
|
if (k === key || camelize(k) === key) return vnodeProps[k] !== void 0;
|
|
9
9
|
}
|
|
@@ -7,9 +7,13 @@ exports.useTextColor = useTextColor;
|
|
|
7
7
|
var _vue = require("vue");
|
|
8
8
|
var _color = require("./color.composable.cjs");
|
|
9
9
|
function useTextColor(props, name) {
|
|
10
|
-
const colors = (0, _vue.computed)(() =>
|
|
11
|
-
text
|
|
12
|
-
|
|
10
|
+
const colors = (0, _vue.computed)(() => {
|
|
11
|
+
let text = null;
|
|
12
|
+
if ((0, _vue.isRef)(props)) text = props.value;else if (name) text = props[name];
|
|
13
|
+
return {
|
|
14
|
+
text
|
|
15
|
+
};
|
|
16
|
+
});
|
|
13
17
|
const {
|
|
14
18
|
colorClasses: textColorClasses,
|
|
15
19
|
colorStyles: textColorStyles
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { computed, isRef } from "vue";
|
|
2
2
|
import { useColor } from "./color.composable.js";
|
|
3
3
|
export function useTextColor(props, name) {
|
|
4
|
-
const colors = computed(() =>
|
|
5
|
-
text
|
|
6
|
-
|
|
4
|
+
const colors = computed(() => {
|
|
5
|
+
let text = null;
|
|
6
|
+
if (isRef(props)) text = props.value;
|
|
7
|
+
else if (name) text = props[name];
|
|
8
|
+
return { text };
|
|
9
|
+
});
|
|
7
10
|
const { colorClasses: textColorClasses, colorStyles: textColorStyles } = useColor(colors);
|
|
8
11
|
return { textColorClasses, textColorStyles };
|
|
9
12
|
}
|
|
@@ -53,7 +53,23 @@ function useTouch({
|
|
|
53
53
|
if (touchless.value) return;
|
|
54
54
|
const touchX = e.changedTouches[0].clientX;
|
|
55
55
|
const touchY = e.changedTouches[0].clientY;
|
|
56
|
-
|
|
56
|
+
let inTouchZone;
|
|
57
|
+
switch (position.value) {
|
|
58
|
+
case "left":
|
|
59
|
+
inTouchZone = touchX < _touch.TOUCH_EDGE_ZONE_PX;
|
|
60
|
+
break;
|
|
61
|
+
case "right":
|
|
62
|
+
inTouchZone = touchX > document.documentElement.clientWidth - _touch.TOUCH_EDGE_ZONE_PX;
|
|
63
|
+
break;
|
|
64
|
+
case "top":
|
|
65
|
+
inTouchZone = touchY < _touch.TOUCH_EDGE_ZONE_PX;
|
|
66
|
+
break;
|
|
67
|
+
case "bottom":
|
|
68
|
+
inTouchZone = touchY > document.documentElement.clientHeight - _touch.TOUCH_EDGE_ZONE_PX;
|
|
69
|
+
break;
|
|
70
|
+
default:
|
|
71
|
+
inTouchZone = (0, _commons.oops)();
|
|
72
|
+
}
|
|
57
73
|
const inElement = isActive.value && (position.value === "left" ? touchX < width.value : position.value === "right" ? touchX > document.documentElement.clientWidth - width.value : position.value === "top" ? touchY < width.value : position.value === "bottom" ? touchY > document.documentElement.clientHeight - width.value : (0, _commons.oops)());
|
|
58
74
|
if (inTouchZone || inElement || isActive.value && isTemporary.value) {
|
|
59
75
|
maybeDragging = true;
|
|
@@ -38,7 +38,23 @@ export function useTouch({ isActive, isTemporary, width, touchless, position })
|
|
|
38
38
|
if (touchless.value) return;
|
|
39
39
|
const touchX = e.changedTouches[0].clientX;
|
|
40
40
|
const touchY = e.changedTouches[0].clientY;
|
|
41
|
-
|
|
41
|
+
let inTouchZone;
|
|
42
|
+
switch (position.value) {
|
|
43
|
+
case "left":
|
|
44
|
+
inTouchZone = touchX < TOUCH_EDGE_ZONE_PX;
|
|
45
|
+
break;
|
|
46
|
+
case "right":
|
|
47
|
+
inTouchZone = touchX > document.documentElement.clientWidth - TOUCH_EDGE_ZONE_PX;
|
|
48
|
+
break;
|
|
49
|
+
case "top":
|
|
50
|
+
inTouchZone = touchY < TOUCH_EDGE_ZONE_PX;
|
|
51
|
+
break;
|
|
52
|
+
case "bottom":
|
|
53
|
+
inTouchZone = touchY > document.documentElement.clientHeight - TOUCH_EDGE_ZONE_PX;
|
|
54
|
+
break;
|
|
55
|
+
default:
|
|
56
|
+
inTouchZone = oops();
|
|
57
|
+
}
|
|
42
58
|
const inElement = isActive.value && (position.value === "left" ? touchX < width.value : position.value === "right" ? touchX > document.documentElement.clientWidth - width.value : position.value === "top" ? touchY < width.value : position.value === "bottom" ? touchY > document.documentElement.clientHeight - width.value : oops());
|
|
43
59
|
if (inTouchZone || inElement || isActive.value && isTemporary.value) {
|
|
44
60
|
maybeDragging = true;
|
|
@@ -19,17 +19,9 @@ function usePrefersReducedMotion() {
|
|
|
19
19
|
const onChange = ev => {
|
|
20
20
|
flag.value = ev.matches;
|
|
21
21
|
};
|
|
22
|
-
|
|
23
|
-
mql.addEventListener("change", onChange);
|
|
24
|
-
} else if (typeof mql.addListener === "function") {
|
|
25
|
-
mql.addListener(onChange);
|
|
26
|
-
}
|
|
22
|
+
mql.addEventListener("change", onChange);
|
|
27
23
|
(0, _vue.onBeforeUnmount)(() => {
|
|
28
|
-
|
|
29
|
-
mql.removeEventListener("change", onChange);
|
|
30
|
-
} else if (typeof mql.removeListener === "function") {
|
|
31
|
-
mql.removeListener(onChange);
|
|
32
|
-
}
|
|
24
|
+
mql.removeEventListener("change", onChange);
|
|
33
25
|
});
|
|
34
26
|
return flag;
|
|
35
27
|
}
|
|
@@ -21,17 +21,9 @@ function usePrefersReducedMotion() {
|
|
|
21
21
|
const onChange = (ev) => {
|
|
22
22
|
flag.value = ev.matches;
|
|
23
23
|
};
|
|
24
|
-
|
|
25
|
-
mql.addEventListener("change", onChange);
|
|
26
|
-
} else if (typeof mql.addListener === "function") {
|
|
27
|
-
mql.addListener(onChange);
|
|
28
|
-
}
|
|
24
|
+
mql.addEventListener("change", onChange);
|
|
29
25
|
onBeforeUnmount(() => {
|
|
30
|
-
|
|
31
|
-
mql.removeEventListener("change", onChange);
|
|
32
|
-
} else if (typeof mql.removeListener === "function") {
|
|
33
|
-
mql.removeListener(onChange);
|
|
34
|
-
}
|
|
26
|
+
mql.removeEventListener("change", onChange);
|
|
35
27
|
});
|
|
36
28
|
return flag;
|
|
37
29
|
}
|
|
@@ -8,7 +8,11 @@ var _anchor = require("../../enums/Commons/anchor.enum.cjs");
|
|
|
8
8
|
var _border = require("../../enums/Commons/border.enum.cjs");
|
|
9
9
|
const BORDER_STYLE_ALTERNATION = Object.values(_border.BORDER_STYLE).join("|");
|
|
10
10
|
const BORDER_LENGTH_UNITS = "(?:px|pt|PC|in|cm|mm|em|rem|%|ex|ch|fr)?";
|
|
11
|
-
const
|
|
11
|
+
const BORDER_COLOR_HEX = "(?:(?:#)(?:[a-f0-9]{3}|[a-f0-9]{6}))";
|
|
12
|
+
const BORDER_COLOR_VAR = "(?:var\\(--[^)]+\\))";
|
|
13
|
+
const BORDER_COLOR_FUNCTION = "(?:(?:rgb|hsl|rgba)a?\\(.*\\))";
|
|
14
|
+
const BORDER_COLOR_NAMED = "(?:[A-Za-z]+)";
|
|
15
|
+
const BORDER_COLOR_GROUP = `(?<color>(?: ?(?:${BORDER_COLOR_HEX}|${BORDER_COLOR_VAR}|${BORDER_COLOR_FUNCTION}|${BORDER_COLOR_NAMED})){0,4})`;
|
|
12
16
|
const BORDER_REGEX = exports.BORDER_REGEX = new RegExp(`^(?<width>(?: ?var\\(--[^)]+\\)(?= +(?:${BORDER_STYLE_ALTERNATION}))| ?(?:[0-9]+)${BORDER_LENGTH_UNITS}){0,4}) {0,1}(?<style>(?:(?: ?(?:${BORDER_STYLE_ALTERNATION}))+){0,4}) ?` + BORDER_COLOR_GROUP + "$");
|
|
13
17
|
const BORDER_POSITION_MAP = exports.BORDER_POSITION_MAP = [{
|
|
14
18
|
side: _anchor.BLOCK.TOP,
|
|
@@ -2,7 +2,11 @@ import { BLOCK, INLINE, START_END } from "../../enums/Commons/anchor.enum.js";
|
|
|
2
2
|
import { BORDER_LOGICAL_AXIS, BORDER_STYLE } from "../../enums/Commons/border.enum.js";
|
|
3
3
|
const BORDER_STYLE_ALTERNATION = Object.values(BORDER_STYLE).join("|");
|
|
4
4
|
const BORDER_LENGTH_UNITS = "(?:px|pt|PC|in|cm|mm|em|rem|%|ex|ch|fr)?";
|
|
5
|
-
const
|
|
5
|
+
const BORDER_COLOR_HEX = "(?:(?:#)(?:[a-f0-9]{3}|[a-f0-9]{6}))";
|
|
6
|
+
const BORDER_COLOR_VAR = "(?:var\\(--[^)]+\\))";
|
|
7
|
+
const BORDER_COLOR_FUNCTION = "(?:(?:rgb|hsl|rgba)a?\\(.*\\))";
|
|
8
|
+
const BORDER_COLOR_NAMED = "(?:[A-Za-z]+)";
|
|
9
|
+
const BORDER_COLOR_GROUP = `(?<color>(?: ?(?:${BORDER_COLOR_HEX}|${BORDER_COLOR_VAR}|${BORDER_COLOR_FUNCTION}|${BORDER_COLOR_NAMED})){0,4})`;
|
|
6
10
|
export const BORDER_REGEX = new RegExp(
|
|
7
11
|
`^(?<width>(?: ?var\\(--[^)]+\\)(?= +(?:${BORDER_STYLE_ALTERNATION}))| ?(?:[0-9]+)${BORDER_LENGTH_UNITS}){0,4}) {0,1}(?<style>(?:(?: ?(?:${BORDER_STYLE_ALTERNATION}))+){0,4}) ?` + BORDER_COLOR_GROUP + "$"
|
|
8
12
|
);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { IMaskOptions } from '../../interfaces/Commons/mask.interface';
|
|
2
|
-
import type { TBuiltInPattern } from '../../types/TextField/text-field.type';
|
|
3
|
-
import type { TTextFieldType } from '../../types/TextField/text-field.type';
|
|
2
|
+
import type { TBuiltInPattern, TTextFieldType } from '../../types/TextField/text-field.type';
|
|
4
3
|
export declare const ACTIVE_TEXT_FIELD_TYPE: Partial<Array<TTextFieldType>>;
|
|
5
4
|
export declare const INPUT_TEXT_FIELD_TYPE: Partial<Array<TTextFieldType>>;
|
|
6
5
|
/**
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { BUILT_IN_PATTERN, PATTERN_VALIDATOR } from "../../enums/index.js";
|
|
2
|
-
import { TEXT_FIELD_TYPE } from "../../enums/index.js";
|
|
1
|
+
import { BUILT_IN_PATTERN, PATTERN_VALIDATOR, TEXT_FIELD_TYPE } from "../../enums/index.js";
|
|
3
2
|
export const ACTIVE_TEXT_FIELD_TYPE = [
|
|
4
3
|
TEXT_FIELD_TYPE.COLOR,
|
|
5
4
|
TEXT_FIELD_TYPE.FILE,
|
|
@@ -35,7 +35,7 @@ function srgbToRgb(color) {
|
|
|
35
35
|
return a < 1 ? `rgba(${r}, ${g}, ${b}, ${a})` : `rgb(${r}, ${g}, ${b})`;
|
|
36
36
|
}
|
|
37
37
|
function hexToRgb(hex) {
|
|
38
|
-
const m =
|
|
38
|
+
const m = /^#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(hex);
|
|
39
39
|
if (!m) return null;
|
|
40
40
|
const h = m[1].length <= 4 ? [...m[1]].map(c => c + c).join("") : m[1];
|
|
41
41
|
const r = parseInt(h.slice(0, 2), 16);
|
|
@@ -23,7 +23,7 @@ function srgbToRgb(color) {
|
|
|
23
23
|
return a < 1 ? `rgba(${r}, ${g}, ${b}, ${a})` : `rgb(${r}, ${g}, ${b})`;
|
|
24
24
|
}
|
|
25
25
|
function hexToRgb(hex) {
|
|
26
|
-
const m =
|
|
26
|
+
const m = /^#([0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(hex);
|
|
27
27
|
if (!m) return null;
|
|
28
28
|
const h = m[1].length <= 4 ? [...m[1]].map((c) => c + c).join("") : m[1];
|
|
29
29
|
const r = parseInt(h.slice(0, 2), 16);
|
|
@@ -4,10 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.BOTTOM_NAV_POSITION = void 0;
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
BOTTOM_NAV_POSITION2[
|
|
10
|
-
BOTTOM_NAV_POSITION2[
|
|
11
|
-
BOTTOM_NAV_POSITION2[BOTTOM_NAV_POSITION2["END"] = _align.ALIGN.END] = "END";
|
|
7
|
+
var BOTTOM_NAV_POSITION = exports.BOTTOM_NAV_POSITION = /* @__PURE__ */(BOTTOM_NAV_POSITION2 => {
|
|
8
|
+
BOTTOM_NAV_POSITION2["START"] = "start";
|
|
9
|
+
BOTTOM_NAV_POSITION2["CENTER"] = "center";
|
|
10
|
+
BOTTOM_NAV_POSITION2["END"] = "end";
|
|
12
11
|
return BOTTOM_NAV_POSITION2;
|
|
13
12
|
})(BOTTOM_NAV_POSITION || {});
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
BOTTOM_NAV_POSITION2[
|
|
4
|
-
BOTTOM_NAV_POSITION2[
|
|
5
|
-
BOTTOM_NAV_POSITION2[BOTTOM_NAV_POSITION2["END"] = ALIGN.END] = "END";
|
|
1
|
+
export var BOTTOM_NAV_POSITION = /* @__PURE__ */ ((BOTTOM_NAV_POSITION2) => {
|
|
2
|
+
BOTTOM_NAV_POSITION2["START"] = "start";
|
|
3
|
+
BOTTOM_NAV_POSITION2["CENTER"] = "center";
|
|
4
|
+
BOTTOM_NAV_POSITION2["END"] = "end";
|
|
6
5
|
return BOTTOM_NAV_POSITION2;
|
|
7
6
|
})(BOTTOM_NAV_POSITION || {});
|
|
@@ -27,7 +27,7 @@ import type { TBlockquoteAlign, TBlockquoteLang, TBlockquoteVariant } from '../.
|
|
|
27
27
|
* The two axes are meant to contrast: a dark body (`color`) reads against
|
|
28
28
|
* a coloured accent (`accentColor`).
|
|
29
29
|
*
|
|
30
|
-
*
|
|
30
|
+
* Deprecated prop `bgColor` — renamed to `accentColor` (see ROADMAP.md,
|
|
31
31
|
* "Renommer `bgColor` → `accentColor`"). `bgColor` keeps working as an
|
|
32
32
|
* alias (`accentColor ?? bgColor`, `accentColor` wins) and warns once via
|
|
33
33
|
* `warnDeprecatedProp`. Removal targeted for v3.0.0. Only Blockquote
|
|
@@ -3,6 +3,7 @@ import type { IChartPoint } from './chart-point.interface';
|
|
|
3
3
|
import type { IChartSeries } from './chart-series.interface';
|
|
4
4
|
import type { TChartMapMode } from '../../types/Chart/chart-map.type';
|
|
5
5
|
import type { TIntent } from '../../types/Commons/intent.type';
|
|
6
|
+
import type { TAnyString } from '../../types/Commons/commons.type';
|
|
6
7
|
/**
|
|
7
8
|
* A single choropleth data point keyed by ISO-3166-1 alpha-2 code.
|
|
8
9
|
*/
|
|
@@ -25,7 +26,7 @@ export interface IChartMapRouteDatum {
|
|
|
25
26
|
/** Optional flow weight — drives the stroke width via `Math.log(value + 1) * 1.5`. */
|
|
26
27
|
value?: number;
|
|
27
28
|
/** Overrides `lineColor` for this route specifically. */
|
|
28
|
-
color?: TIntent |
|
|
29
|
+
color?: TIntent | TAnyString;
|
|
29
30
|
}
|
|
30
31
|
/**
|
|
31
32
|
* Internal country descriptor produced by the map geometry engine.
|
|
@@ -103,20 +104,20 @@ export interface IChartMapProps extends IChartBaseProps {
|
|
|
103
104
|
* own background. Swapping the default would trade an adaptive
|
|
104
105
|
* behaviour for a fixed one, not just move a pixel.
|
|
105
106
|
*/
|
|
106
|
-
defaultCountryFill?: TIntent |
|
|
107
|
+
defaultCountryFill?: TIntent | TAnyString;
|
|
107
108
|
/**
|
|
108
109
|
* Stroke colour applied to all country path outlines.
|
|
109
110
|
* Supports intent names and raw CSS strings, resolved the same way as
|
|
110
111
|
* `lineColor` (#411 — was a hardcoded literal the theme could not reach).
|
|
111
112
|
* Default `'neutral'`.
|
|
112
113
|
*/
|
|
113
|
-
borderColor?: TIntent |
|
|
114
|
+
borderColor?: TIntent | TAnyString;
|
|
114
115
|
/**
|
|
115
116
|
* Default stroke colour for flight-route arcs.
|
|
116
117
|
* Overridden per route via `IChartMapRouteDatum.color`.
|
|
117
118
|
* Default `'primary'`.
|
|
118
119
|
*/
|
|
119
|
-
lineColor?: TIntent |
|
|
120
|
+
lineColor?: TIntent | TAnyString;
|
|
120
121
|
/**
|
|
121
122
|
* Radius in SVG pixels of the endpoint circles on each route.
|
|
122
123
|
* Default `4`.
|
|
@@ -2,7 +2,7 @@ import type { ComponentPublicInstance } from 'vue';
|
|
|
2
2
|
import type { IDelayProps } from './delay.interface';
|
|
3
3
|
import type { TAnyString } from '../../types/Commons/commons.type';
|
|
4
4
|
export interface IActivatorProps extends IDelayProps {
|
|
5
|
-
target?: 'parent' | 'cursor' | TAnyString | Element | ComponentPublicInstance | [x: number, y: number]
|
|
5
|
+
target?: 'parent' | 'cursor' | TAnyString | Element | ComponentPublicInstance | [x: number, y: number];
|
|
6
6
|
activator?: 'parent' | 'cursor' | TAnyString | Element | ComponentPublicInstance;
|
|
7
7
|
activatorProps?: any;
|
|
8
8
|
openOnClick?: boolean;
|
|
@@ -12,6 +12,7 @@ import type { IUseAudioProps } from '../Commons/audio.interface';
|
|
|
12
12
|
import type { TParallaxDirection, TParallaxEasing, TParallaxEvent } from '../../types/Parallax/parallax.type';
|
|
13
13
|
import type { TPoint } from '../../types/Commons/point.type';
|
|
14
14
|
import type { Ref } from 'vue';
|
|
15
|
+
import type { TAnyString } from '../../types/Commons/commons.type';
|
|
15
16
|
/*********************************************************
|
|
16
17
|
* IParallaxProps
|
|
17
18
|
*
|
|
@@ -119,7 +120,7 @@ export interface IParallaxProvide {
|
|
|
119
120
|
*/
|
|
120
121
|
export interface IParallaxLayerProvide {
|
|
121
122
|
direction: Ref<TParallaxDirection>;
|
|
122
|
-
easing: Ref<TParallaxEasing |
|
|
123
|
+
easing: Ref<TParallaxEasing | TAnyString>;
|
|
123
124
|
disabled: Ref<boolean>;
|
|
124
125
|
/**
|
|
125
126
|
* Live scroll progress, normalised to `[0, 1]`. `0` = host just entered
|
|
@@ -167,7 +168,7 @@ export interface IParallaxLayerProvide {
|
|
|
167
168
|
export interface IUseParallaxRuntimeOptions {
|
|
168
169
|
target: Ref<HTMLElement | undefined>;
|
|
169
170
|
direction: Ref<TParallaxDirection>;
|
|
170
|
-
easing: Ref<TParallaxEasing |
|
|
171
|
+
easing: Ref<TParallaxEasing | TAnyString>;
|
|
171
172
|
threshold: Ref<number>;
|
|
172
173
|
disabled: Ref<boolean>;
|
|
173
174
|
/**
|
package/dist/src/origam-core.cjs
CHANGED
|
@@ -56,7 +56,7 @@ function createOrigamCore(origam = {}) {
|
|
|
56
56
|
const allThemes = [...suppliedThemes];
|
|
57
57
|
const installedThemes = (0, _utils.installedThemesFromList)(allThemes);
|
|
58
58
|
const defaultsRef = (0, _composables.createDefaults)({});
|
|
59
|
-
defaultsRef.value = activeDefaultsFor(allThemes, allThemes[0]?.name ?? ""
|
|
59
|
+
defaultsRef.value = activeDefaultsFor(allThemes, allThemes[0]?.name ?? "");
|
|
60
60
|
const themedKeysUnion = (0, _composables.themedPropKeysUnion)(allThemes.map(theme => theme.components).filter(components2 => !!components2));
|
|
61
61
|
const variantPresets = (0, _composables.resolveVariantPresetRegistry)(_consts.VARIANT_PRESETS, allThemes.map(theme => theme.variants).filter(variants => !!variants));
|
|
62
62
|
const scope = (0, _vue.effectScope)();
|
package/dist/src/origam-core.js
CHANGED
|
@@ -67,7 +67,7 @@ export function createOrigamCore(origam = {}) {
|
|
|
67
67
|
const allThemes = [...suppliedThemes];
|
|
68
68
|
const installedThemes = installedThemesFromList(allThemes);
|
|
69
69
|
const defaultsRef = createDefaults({});
|
|
70
|
-
defaultsRef.value = activeDefaultsFor(allThemes, allThemes[0]?.name ?? ""
|
|
70
|
+
defaultsRef.value = activeDefaultsFor(allThemes, allThemes[0]?.name ?? "");
|
|
71
71
|
const themedKeysUnion = themedPropKeysUnion(
|
|
72
72
|
allThemes.map((theme) => theme.components).filter((components2) => !!components2)
|
|
73
73
|
);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import OrigamRow from '../../components/Grids/OrigamRow.vue';
|
|
2
|
+
import type { TAnyString } from '../Commons/commons.type';
|
|
2
3
|
import { FLEX_DIRECTION, ROW_GUTTER } from '../../enums/Grids/row.enum';
|
|
3
4
|
export type TFlexDirection = `${FLEX_DIRECTION}`;
|
|
4
5
|
/*********************************************************
|
|
@@ -18,5 +19,5 @@ export type TRowGutterRung = `${ROW_GUTTER}`;
|
|
|
18
19
|
* libre par une declaration en ligne — meme partage que `color` /
|
|
19
20
|
* `rounded` ailleurs dans le DS.
|
|
20
21
|
********************************************************/
|
|
21
|
-
export type TRowGutter = TRowGutterRung |
|
|
22
|
+
export type TRowGutter = TRowGutterRung | TAnyString | number;
|
|
22
23
|
export type TOrigamRow = InstanceType<typeof OrigamRow>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { PARALLAX_DIRECTION, PARALLAX_EASING } from '../../enums/Parallax/parallax.enum';
|
|
1
|
+
import { PARALLAX_DIRECTION, PARALLAX_EASING, PARALLAX_EVENT } from '../../enums/Parallax/parallax.enum';
|
|
2
2
|
import OrigamParallax from '../../components/Parallax/OrigamParallax.vue';
|
|
3
|
-
import { PARALLAX_EVENT } from '../../enums/Parallax/parallax.enum';
|
|
4
3
|
export type TParallaxDirection = `${PARALLAX_DIRECTION}`;
|
|
5
4
|
export type TParallaxEasing = `${PARALLAX_EASING}`;
|
|
6
5
|
export type TParallaxEvent = `${PARALLAX_EVENT}`;
|
|
@@ -2,6 +2,7 @@ import type { BUILT_IN_PATTERN, PATTERN_VALIDATOR } from '../../enums/TextField/
|
|
|
2
2
|
import type { IMaskOptions } from '../../interfaces/Commons/mask.interface';
|
|
3
3
|
import OrigamTextField from '../../components/TextField/OrigamTextField.vue';
|
|
4
4
|
import { MASK_TOKEN_KIND, TEXT_FIELD_TYPE } from '../../enums/TextField/text-field.enum';
|
|
5
|
+
import type { TAnyString } from '../Commons/commons.type';
|
|
5
6
|
export type TTextFieldType = `${TEXT_FIELD_TYPE}`;
|
|
6
7
|
export type TOrigamTextField = InstanceType<typeof OrigamTextField>;
|
|
7
8
|
/**
|
|
@@ -16,7 +17,7 @@ export type TBuiltInPattern = typeof BUILT_IN_PATTERN[keyof typeof BUILT_IN_PATT
|
|
|
16
17
|
* pattern string (with `#`, `A`, `*`, literals), or a full
|
|
17
18
|
* options object.
|
|
18
19
|
*/
|
|
19
|
-
export type TMask = TBuiltInPattern |
|
|
20
|
+
export type TMask = TBuiltInPattern | TAnyString | IMaskOptions | null;
|
|
20
21
|
/**
|
|
21
22
|
* Token kinds recognised by the in-house token-walker.
|
|
22
23
|
*
|
|
@@ -54,10 +54,13 @@ function animate(el, keyframes, options) {
|
|
|
54
54
|
if (typeof el.animate === "undefined") return {
|
|
55
55
|
finished: Promise.resolve()
|
|
56
56
|
};
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
let resolvedOptions = options;
|
|
58
|
+
if (prefersReducedMotion()) {
|
|
59
|
+
resolvedOptions = options == null || typeof options === "number" ? _commons.REDUCED_MOTION_ANIMATION_DURATION : {
|
|
60
|
+
...options,
|
|
61
|
+
duration: _commons.REDUCED_MOTION_ANIMATION_DURATION
|
|
62
|
+
};
|
|
63
|
+
}
|
|
61
64
|
let animation;
|
|
62
65
|
try {
|
|
63
66
|
animation = el.animate(keyframes, resolvedOptions);
|
|
@@ -39,7 +39,10 @@ export function nullifyTransforms(el) {
|
|
|
39
39
|
}
|
|
40
40
|
export function animate(el, keyframes, options) {
|
|
41
41
|
if (typeof el.animate === "undefined") return { finished: Promise.resolve() };
|
|
42
|
-
|
|
42
|
+
let resolvedOptions = options;
|
|
43
|
+
if (prefersReducedMotion()) {
|
|
44
|
+
resolvedOptions = options == null || typeof options === "number" ? REDUCED_MOTION_ANIMATION_DURATION : { ...options, duration: REDUCED_MOTION_ANIMATION_DURATION };
|
|
45
|
+
}
|
|
43
46
|
let animation;
|
|
44
47
|
try {
|
|
45
48
|
animation = el.animate(keyframes, resolvedOptions);
|
|
@@ -147,7 +147,9 @@ function classicSelectStrategy(mandatory) {
|
|
|
147
147
|
const childrenIds = children.get(parent);
|
|
148
148
|
const everySelected = childrenIds.every(cid => selected.get(cid) === _enums.SELECTED.ON);
|
|
149
149
|
const noneSelected = childrenIds.every(cid => !selected.has(cid) || selected.get(cid) === _enums.SELECTED.OFF);
|
|
150
|
-
|
|
150
|
+
let parentState = _enums.SELECTED.INDETERMINATE;
|
|
151
|
+
if (everySelected) parentState = _enums.SELECTED.ON;else if (noneSelected) parentState = _enums.SELECTED.OFF;
|
|
152
|
+
selected.set(parent, parentState);
|
|
151
153
|
parent = parents.get(parent);
|
|
152
154
|
}
|
|
153
155
|
if (mandatory && !value) {
|
|
@@ -99,7 +99,10 @@ export function classicSelectStrategy(mandatory) {
|
|
|
99
99
|
const childrenIds = children.get(parent);
|
|
100
100
|
const everySelected = childrenIds.every((cid) => selected.get(cid) === SELECTED.ON);
|
|
101
101
|
const noneSelected = childrenIds.every((cid) => !selected.has(cid) || selected.get(cid) === SELECTED.OFF);
|
|
102
|
-
|
|
102
|
+
let parentState = SELECTED.INDETERMINATE;
|
|
103
|
+
if (everySelected) parentState = SELECTED.ON;
|
|
104
|
+
else if (noneSelected) parentState = SELECTED.OFF;
|
|
105
|
+
selected.set(parent, parentState);
|
|
103
106
|
parent = parents.get(parent);
|
|
104
107
|
}
|
|
105
108
|
if (mandatory && !value) {
|
|
@@ -8,7 +8,7 @@ exports.resolveSpacingValue = resolveSpacingValue;
|
|
|
8
8
|
var _rounded = require("../../consts/Commons/rounded.const.cjs");
|
|
9
9
|
var _spacing = require("../../consts/Commons/spacing.const.cjs");
|
|
10
10
|
var _commons = require("./commons.util.cjs");
|
|
11
|
-
const SCALE_STEP_REGEX =
|
|
11
|
+
const SCALE_STEP_REGEX = /^\d+$/;
|
|
12
12
|
function resolveSpacingValue(value) {
|
|
13
13
|
if (value == null || typeof value === "boolean") return null;
|
|
14
14
|
if (typeof value === "number") return (0, _commons.convertToUnit)(value) ?? null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CUSTOM_BORDER_RADIUS_REGEX, PREDEFINED_ROUNDED } from "../../consts/Commons/rounded.const.js";
|
|
2
2
|
import { NAMED_RADIUS_TOKEN, SPACING_SCALE_STEPS, UTILITY_RADIUS_FALLBACK } from "../../consts/Commons/spacing.const.js";
|
|
3
3
|
import { convertToUnit } from "./commons.util.js";
|
|
4
|
-
const SCALE_STEP_REGEX =
|
|
4
|
+
const SCALE_STEP_REGEX = /^\d+$/;
|
|
5
5
|
export function resolveSpacingValue(value) {
|
|
6
6
|
if (value == null || typeof value === "boolean") return null;
|
|
7
7
|
if (typeof value === "number") return convertToUnit(value) ?? null;
|
|
@@ -17,16 +17,19 @@ function markedComponentVarName(path) {
|
|
|
17
17
|
const [blockName, ...rest] = path;
|
|
18
18
|
let name = `origam-${blockName}`;
|
|
19
19
|
const propParts = [];
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
let i = 0;
|
|
21
|
+
while (i < rest.length) {
|
|
22
|
+
const part = rest[i++];
|
|
23
|
+
const hasNext = i < rest.length;
|
|
24
|
+
if (part === TOKEN_GROUP_CHILD && hasNext) {
|
|
25
|
+
name += `__${rest[i++]}`;
|
|
23
26
|
continue;
|
|
24
27
|
}
|
|
25
|
-
if (
|
|
26
|
-
name += `--${rest[++
|
|
28
|
+
if (part === TOKEN_GROUP_STATE && hasNext) {
|
|
29
|
+
name += `--${rest[i++]}`;
|
|
27
30
|
continue;
|
|
28
31
|
}
|
|
29
|
-
propParts.push(
|
|
32
|
+
propParts.push(part);
|
|
30
33
|
}
|
|
31
34
|
return propParts.length === 0 ? name : `${name}---${propParts.join("-")}`;
|
|
32
35
|
}
|
|
@@ -25,16 +25,19 @@ function markedComponentVarName(path) {
|
|
|
25
25
|
const [blockName, ...rest] = path;
|
|
26
26
|
let name = `origam-${blockName}`;
|
|
27
27
|
const propParts = [];
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
let i = 0;
|
|
29
|
+
while (i < rest.length) {
|
|
30
|
+
const part = rest[i++];
|
|
31
|
+
const hasNext = i < rest.length;
|
|
32
|
+
if (part === TOKEN_GROUP_CHILD && hasNext) {
|
|
33
|
+
name += `__${rest[i++]}`;
|
|
31
34
|
continue;
|
|
32
35
|
}
|
|
33
|
-
if (
|
|
34
|
-
name += `--${rest[++
|
|
36
|
+
if (part === TOKEN_GROUP_STATE && hasNext) {
|
|
37
|
+
name += `--${rest[i++]}`;
|
|
35
38
|
continue;
|
|
36
39
|
}
|
|
37
|
-
propParts.push(
|
|
40
|
+
propParts.push(part);
|
|
38
41
|
}
|
|
39
42
|
return propParts.length === 0 ? name : `${name}---${propParts.join("-")}`;
|
|
40
43
|
}
|