origam 2.43.0 → 2.44.1
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 +116 -0
- package/dist/src/assets/css/main.css +1 -1
- package/dist/src/assets/css/tokens/dark-pinned.css +5 -1
- package/dist/src/assets/css/tokens/dark-system.css +5 -1
- package/dist/src/assets/css/tokens/dark.css +10 -2
- package/dist/src/assets/css/tokens/light.css +5 -1
- package/dist/src/assets/locales/en.json +3 -0
- package/dist/src/assets/locales/fr.json +3 -0
- package/dist/src/assets/scss/tokens/_dark.scss +10 -2
- package/dist/src/assets/scss/tokens/_light.scss +5 -1
- package/dist/src/components/Audio/OrigamAudio.vue +1 -1
- package/dist/src/components/Btn/OrigamBtn.vue +31 -10
- package/dist/src/components/Chart/OrigamChartRadar.vue +1 -1
- package/dist/src/components/ColorPickerField/OrigamColorPickerField.vue +3 -5
- package/dist/src/components/ConfirmWrapper/OrigamConfirmWrapper.vue +0 -1
- package/dist/src/components/DataTable/OrigamDataTableFooter.vue +3 -1
- package/dist/src/components/DataTable/OrigamDataTableHeaderCell.vue +20 -2
- package/dist/src/components/DatePicker/OrigamDatePickerControls.vue +1 -1
- package/dist/src/components/DatePickerField/OrigamDatePickerField.vue +3 -5
- package/dist/src/components/Drawer/OrigamDrawer.vue +65 -3
- package/dist/src/components/ExpansionPanel/OrigamExpansionPanel.vue +6 -4
- package/dist/src/components/ExpansionPanel/OrigamExpansionPanelContent.vue +1 -1
- package/dist/src/components/ExpansionPanel/OrigamExpansionPanelHeader.vue +1 -1
- package/dist/src/components/Field/OrigamField.vue +17 -7
- package/dist/src/components/FileField/OrigamFileField.vue +3 -3
- package/dist/src/components/Form/OrigamForm.vue +0 -1
- package/dist/src/components/Input/OrigamInput.vue +0 -1
- package/dist/src/components/List/OrigamListChildren.vue +1 -1
- package/dist/src/components/Messages/OrigamMessages.vue +1 -1
- package/dist/src/components/NumberField/OrigamNumberField.vue +13 -5
- package/dist/src/components/OtpInputField/OrigamOtpInputField.vue +8 -5
- package/dist/src/components/PasswordField/OrigamPasswordField.vue +3 -3
- package/dist/src/components/Select/OrigamSelect.vue +22 -5
- package/dist/src/components/Stepper/OrigamStepper.vue +22 -1
- package/dist/src/components/Stepper/OrigamStepperItem.vue +46 -21
- package/dist/src/components/TextField/OrigamTextField.vue +3 -3
- package/dist/src/components/TextareaField/OrigamTextareaField.vue +3 -3
- package/dist/src/components/Toolbar/OrigamToolbar.vue +1 -1
- package/dist/src/components/Video/OrigamVideo.vue +1 -1
- package/dist/src/composables/Commons/adjacentInner.composable.cjs +17 -3
- package/dist/src/composables/Commons/adjacentInner.composable.d.ts +5 -3
- package/dist/src/composables/Commons/adjacentInner.composable.js +18 -4
- package/dist/src/composables/Commons/link.composable.cjs +6 -5
- package/dist/src/composables/Commons/link.composable.js +6 -5
- package/dist/src/composables/Commons/popup-dialog-aria.composable.cjs +26 -0
- package/dist/src/composables/Commons/popup-dialog-aria.composable.d.ts +23 -0
- package/dist/src/composables/Commons/popup-dialog-aria.composable.js +17 -0
- package/dist/src/composables/Commons/stack.composable.cjs +2 -19
- package/dist/src/composables/Commons/stack.composable.d.ts +1 -1
- package/dist/src/composables/Commons/stack.composable.js +3 -20
- package/dist/src/composables/Commons/style.composable.cjs +3 -2
- package/dist/src/composables/Commons/style.composable.js +3 -2
- package/dist/src/composables/index.cjs +12 -0
- package/dist/src/composables/index.d.ts +1 -0
- package/dist/src/composables/index.js +1 -0
- package/dist/src/consts/Commons/style.const.cjs +9 -0
- package/dist/src/consts/Commons/style.const.d.ts +26 -0
- package/dist/src/consts/Commons/style.const.js +3 -0
- package/dist/src/consts/index.cjs +11 -0
- package/dist/src/consts/index.d.ts +1 -0
- package/dist/src/consts/index.js +1 -0
- package/dist/src/directives/Contrast/contrast.directive.cjs +5 -1
- package/dist/src/directives/Contrast/contrast.directive.js +5 -1
- package/dist/src/interfaces/ExpansionPanel/expansion-panel.interface.d.ts +1 -0
- package/dist/src/interfaces/Stepper/stepper-item.interface.d.ts +11 -2
- package/dist/src/interfaces/Stepper/stepper.interface.d.ts +7 -0
- package/dist/src/themes/origam.theme.cjs +0 -2
- package/dist/src/themes/origam.theme.js +2 -2
- package/dist/src/types/tokens.type.d.ts +1 -1
- package/dist/src/utils/Commons/style.util.cjs +30 -0
- package/dist/src/utils/Commons/style.util.d.ts +18 -0
- package/dist/src/utils/Commons/style.util.js +23 -0
- package/dist/src/utils/index.cjs +11 -0
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/utils/index.js +1 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { computed, useSlots } from "vue";
|
|
1
|
+
import { computed, onBeforeUpdate, shallowRef, useSlots } from "vue";
|
|
2
2
|
import { KEYBOARD_VALUES } from "../../enums/Commons/hotkey.enum.js";
|
|
3
3
|
import { hasEvent } from "../../utils/Commons/commons.util.js";
|
|
4
4
|
import { useAccessibleCommand } from "./accessibleCommand.composable.js";
|
|
@@ -6,20 +6,30 @@ import { getCurrentInstance } from "../../utils/Commons/getCurrentInstance.util.
|
|
|
6
6
|
export function useAdjacentInner(props) {
|
|
7
7
|
const vm = getCurrentInstance("OrigamAdjacentInner");
|
|
8
8
|
const slots = useSlots();
|
|
9
|
+
const slotsVersion = shallowRef(0);
|
|
10
|
+
onBeforeUpdate(() => {
|
|
11
|
+
slotsVersion.value++;
|
|
12
|
+
});
|
|
13
|
+
const slotPresence = computed(() => ({
|
|
14
|
+
version: slotsVersion.value,
|
|
15
|
+
prependInner: !!slots.prependInner,
|
|
16
|
+
appendInner: !!slots.appendInner,
|
|
17
|
+
clear: !!slots.clear
|
|
18
|
+
}));
|
|
9
19
|
const hasPrependInnerMedia = computed(() => {
|
|
10
20
|
return !!(props.prependInnerAvatar || props.prependInnerIcon);
|
|
11
21
|
});
|
|
12
22
|
const hasPrependInner = computed(() => {
|
|
13
|
-
return
|
|
23
|
+
return slotPresence.value.prependInner || hasPrependInnerMedia.value;
|
|
14
24
|
});
|
|
15
25
|
const hasAppendInnerMedia = computed(() => {
|
|
16
26
|
return !!(props.appendInnerAvatar || props.appendInnerIcon);
|
|
17
27
|
});
|
|
18
28
|
const hasAppendInner = computed(() => {
|
|
19
|
-
return
|
|
29
|
+
return slotPresence.value.appendInner || hasAppendInnerMedia.value;
|
|
20
30
|
});
|
|
21
31
|
const hasClear = computed(() => {
|
|
22
|
-
return props.clearable ||
|
|
32
|
+
return !!props.clearable || slotPresence.value.clear;
|
|
23
33
|
});
|
|
24
34
|
const onClickPrependInner = (e) => {
|
|
25
35
|
vm.emit("click:prependInner", e);
|
|
@@ -36,6 +46,8 @@ export function useAdjacentInner(props) {
|
|
|
36
46
|
const isAppendInnerClickable = computed(() => {
|
|
37
47
|
return hasEvent(vm.attrs, "click:appendInner") || hasEvent(vm.vnode.props ?? {}, "click:appendInner");
|
|
38
48
|
});
|
|
49
|
+
const appendInnerRelay = computed(() => isAppendInnerClickable.value ? onClickAppendInner : void 0);
|
|
50
|
+
const prependInnerRelay = computed(() => isPrependInnerClickable.value ? onClickPrependInner : void 0);
|
|
39
51
|
const ownsKey = (e) => e.target === e.currentTarget;
|
|
40
52
|
const onKeydownPrependInner = (e) => {
|
|
41
53
|
if (!isPrependInnerClickable.value) return;
|
|
@@ -75,6 +87,8 @@ export function useAdjacentInner(props) {
|
|
|
75
87
|
hasClear,
|
|
76
88
|
isPrependInnerClickable,
|
|
77
89
|
isAppendInnerClickable,
|
|
90
|
+
appendInnerRelay,
|
|
91
|
+
prependInnerRelay,
|
|
78
92
|
onClickPrependInner,
|
|
79
93
|
onClickAppendInner,
|
|
80
94
|
onKeydownPrependInner,
|
|
@@ -26,17 +26,18 @@ function useLink(props, attrs) {
|
|
|
26
26
|
}
|
|
27
27
|
const link = props.to ? RouterLink.useLink(props) : void 0;
|
|
28
28
|
const route = (0, _route.useRoute)();
|
|
29
|
+
const isExactActive = link && (0, _vue.computed)(() => {
|
|
30
|
+
if (!route.value) return link.isExactActive?.value;
|
|
31
|
+
return link.isExactActive?.value && (0, _commons.deepEqual)(link.route.value.query, route.value.query);
|
|
32
|
+
});
|
|
29
33
|
return {
|
|
30
34
|
tag,
|
|
31
35
|
isLink,
|
|
32
36
|
isClickable,
|
|
33
37
|
route: link?.route,
|
|
34
38
|
navigate: link?.navigate,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (!route.value) return link.isExactActive?.value;
|
|
38
|
-
return link.isExactActive?.value && (0, _commons.deepEqual)(link.route.value.query, route.value.query);
|
|
39
|
-
}),
|
|
39
|
+
isExactActive,
|
|
40
|
+
isActive: link && (0, _vue.computed)(() => props.exact ? !!isExactActive?.value : link.isActive.value),
|
|
40
41
|
href: (0, _vue.computed)(() => props.to ? link?.route.value.href : props.href)
|
|
41
42
|
};
|
|
42
43
|
}
|
|
@@ -20,17 +20,18 @@ export function useLink(props, attrs) {
|
|
|
20
20
|
}
|
|
21
21
|
const link = props.to ? RouterLink.useLink(props) : void 0;
|
|
22
22
|
const route = useRoute();
|
|
23
|
+
const isExactActive = link && computed(() => {
|
|
24
|
+
if (!route.value) return link.isExactActive?.value;
|
|
25
|
+
return link.isExactActive?.value && deepEqual(link.route.value.query, route.value.query);
|
|
26
|
+
});
|
|
23
27
|
return {
|
|
24
28
|
tag,
|
|
25
29
|
isLink,
|
|
26
30
|
isClickable,
|
|
27
31
|
route: link?.route,
|
|
28
32
|
navigate: link?.navigate,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
if (!route.value) return link.isExactActive?.value;
|
|
32
|
-
return link.isExactActive?.value && deepEqual(link.route.value.query, route.value.query);
|
|
33
|
-
}),
|
|
33
|
+
isExactActive,
|
|
34
|
+
isActive: link && computed(() => props.exact ? !!isExactActive?.value : link.isActive.value),
|
|
34
35
|
href: computed(() => props.to ? link?.route.value.href : props.href)
|
|
35
36
|
};
|
|
36
37
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.usePopupDialogAria = usePopupDialogAria;
|
|
7
|
+
var _getCurrentInstance = require("../../utils/Commons/getCurrentInstance.util.cjs");
|
|
8
|
+
var _vue = require("vue");
|
|
9
|
+
function usePopupDialogAria(name, label, expanded) {
|
|
10
|
+
const menuId = `${name}-menu-${(0, _getCurrentInstance.getUid)()}`;
|
|
11
|
+
const comboboxAriaAttrs = (0, _vue.computed)(() => ({
|
|
12
|
+
role: "combobox",
|
|
13
|
+
"aria-haspopup": "dialog",
|
|
14
|
+
"aria-controls": menuId,
|
|
15
|
+
"aria-expanded": expanded.value ? "true" : "false"
|
|
16
|
+
}));
|
|
17
|
+
const menuAriaProps = (0, _vue.computed)(() => ({
|
|
18
|
+
id: menuId,
|
|
19
|
+
role: "dialog",
|
|
20
|
+
"aria-label": label()
|
|
21
|
+
}));
|
|
22
|
+
return {
|
|
23
|
+
comboboxAriaAttrs,
|
|
24
|
+
menuAriaProps
|
|
25
|
+
};
|
|
26
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
/*********************************************************
|
|
3
|
+
* usePopupDialogAria
|
|
4
|
+
*
|
|
5
|
+
* @description
|
|
6
|
+
* ARIA d'un champ combobox dont le menu est un `dialog` (calendrier,
|
|
7
|
+
* color picker), pas une liste de `menuitem` : le menu recoit `id` +
|
|
8
|
+
* `role="dialog"` + `aria-label` (`menuAriaProps`), le combobox pointe
|
|
9
|
+
* dessus par `aria-controls` (`comboboxAriaAttrs`). #1382 / #1458
|
|
10
|
+
********************************************************/
|
|
11
|
+
export declare function usePopupDialogAria(name: string, label: () => string | undefined, expanded: Ref<boolean>): {
|
|
12
|
+
comboboxAriaAttrs: import("vue").ComputedRef<{
|
|
13
|
+
role: string;
|
|
14
|
+
'aria-haspopup': string;
|
|
15
|
+
'aria-controls': string;
|
|
16
|
+
'aria-expanded': string;
|
|
17
|
+
}>;
|
|
18
|
+
menuAriaProps: import("vue").ComputedRef<{
|
|
19
|
+
id: string;
|
|
20
|
+
role: string;
|
|
21
|
+
'aria-label': string | undefined;
|
|
22
|
+
}>;
|
|
23
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { getUid } from "../../utils/Commons/getCurrentInstance.util.js";
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
export function usePopupDialogAria(name, label, expanded) {
|
|
4
|
+
const menuId = `${name}-menu-${getUid()}`;
|
|
5
|
+
const comboboxAriaAttrs = computed(() => ({
|
|
6
|
+
role: "combobox",
|
|
7
|
+
"aria-haspopup": "dialog",
|
|
8
|
+
"aria-controls": menuId,
|
|
9
|
+
"aria-expanded": expanded.value ? "true" : "false"
|
|
10
|
+
}));
|
|
11
|
+
const menuAriaProps = computed(() => ({
|
|
12
|
+
id: menuId,
|
|
13
|
+
role: "dialog",
|
|
14
|
+
"aria-label": label()
|
|
15
|
+
}));
|
|
16
|
+
return { comboboxAriaAttrs, menuAriaProps };
|
|
17
|
+
}
|
|
@@ -7,7 +7,6 @@ exports.useStack = useStack;
|
|
|
7
7
|
var _toggleScope = require("./toggleScope.composable.cjs");
|
|
8
8
|
var _stack = require("../../consts/Commons/stack.const.cjs");
|
|
9
9
|
var _getCurrentInstance = require("../../utils/Commons/getCurrentInstance.util.cjs");
|
|
10
|
-
var _commons = require("../../utils/Commons/commons.util.cjs");
|
|
11
10
|
var _vue = require("vue");
|
|
12
11
|
function useStack(isActive, zIndex, disableGlobalStack) {
|
|
13
12
|
const vm = (0, _getCurrentInstance.getCurrentInstance)("useStack");
|
|
@@ -33,26 +32,10 @@ function useStack(isActive, zIndex, disableGlobalStack) {
|
|
|
33
32
|
parent?.activeChildren.delete(vm.uid);
|
|
34
33
|
});
|
|
35
34
|
});
|
|
36
|
-
const globalTop = (0, _vue.
|
|
37
|
-
let topTimer;
|
|
38
|
-
(0, _vue.watchEffect)(() => {
|
|
39
|
-
if (!createStackEntry.value) return;
|
|
40
|
-
const _isTop = _stack.GLOBAL_STACK.at(-1)?.[0] === vm.uid;
|
|
41
|
-
clearTimeout(topTimer);
|
|
42
|
-
topTimer = setTimeout(() => {
|
|
43
|
-
topTimer = void 0;
|
|
44
|
-
globalTop.value = _isTop;
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
(0, _commons.tryOnScopeDispose)(() => {
|
|
48
|
-
if (topTimer !== void 0) {
|
|
49
|
-
clearTimeout(topTimer);
|
|
50
|
-
topTimer = void 0;
|
|
51
|
-
}
|
|
52
|
-
});
|
|
35
|
+
const globalTop = (0, _vue.computed)(() => !createStackEntry.value || _stack.GLOBAL_STACK.at(-1)?.[0] === vm.uid);
|
|
53
36
|
const localTop = (0, _vue.computed)(() => !stack.activeChildren.size);
|
|
54
37
|
return {
|
|
55
|
-
globalTop
|
|
38
|
+
globalTop,
|
|
56
39
|
localTop,
|
|
57
40
|
stackStyles: (0, _vue.computed)(() => ({
|
|
58
41
|
zIndex: _zIndex.value
|
|
@@ -18,7 +18,7 @@ import { Ref } from 'vue';
|
|
|
18
18
|
* must not snapshot `disableGlobalStack` either.
|
|
19
19
|
********************************************************/
|
|
20
20
|
export declare function useStack(isActive: Readonly<Ref<boolean>>, zIndex: Readonly<Ref<string | number>>, disableGlobalStack: Readonly<Ref<boolean>>): {
|
|
21
|
-
globalTop:
|
|
21
|
+
globalTop: import("vue").ComputedRef<boolean>;
|
|
22
22
|
localTop: import("vue").ComputedRef<boolean>;
|
|
23
23
|
stackStyles: import("vue").ComputedRef<{
|
|
24
24
|
zIndex: number;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { useToggleScope } from "./toggleScope.composable.js";
|
|
2
2
|
import { GLOBAL_STACK, ORIGAM_STACK_KEY, STACK_Z_INDEX_STEP } from "../../consts/Commons/stack.const.js";
|
|
3
3
|
import { getCurrentInstance } from "../../utils/Commons/getCurrentInstance.util.js";
|
|
4
|
-
import {
|
|
5
|
-
import { computed, inject, onScopeDispose, provide, reactive, readonly, shallowRef, toRaw, watchEffect } from "vue";
|
|
4
|
+
import { computed, inject, onScopeDispose, provide, reactive, shallowRef, toRaw } from "vue";
|
|
6
5
|
export function useStack(isActive, zIndex, disableGlobalStack) {
|
|
7
6
|
const vm = getCurrentInstance("useStack");
|
|
8
7
|
const createStackEntry = computed(() => !disableGlobalStack.value);
|
|
@@ -27,26 +26,10 @@ export function useStack(isActive, zIndex, disableGlobalStack) {
|
|
|
27
26
|
parent?.activeChildren.delete(vm.uid);
|
|
28
27
|
});
|
|
29
28
|
});
|
|
30
|
-
const globalTop =
|
|
31
|
-
let topTimer;
|
|
32
|
-
watchEffect(() => {
|
|
33
|
-
if (!createStackEntry.value) return;
|
|
34
|
-
const _isTop = GLOBAL_STACK.at(-1)?.[0] === vm.uid;
|
|
35
|
-
clearTimeout(topTimer);
|
|
36
|
-
topTimer = setTimeout(() => {
|
|
37
|
-
topTimer = void 0;
|
|
38
|
-
globalTop.value = _isTop;
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
tryOnScopeDispose(() => {
|
|
42
|
-
if (topTimer !== void 0) {
|
|
43
|
-
clearTimeout(topTimer);
|
|
44
|
-
topTimer = void 0;
|
|
45
|
-
}
|
|
46
|
-
});
|
|
29
|
+
const globalTop = computed(() => !createStackEntry.value || GLOBAL_STACK.at(-1)?.[0] === vm.uid);
|
|
47
30
|
const localTop = computed(() => !stack.activeChildren.size);
|
|
48
31
|
return {
|
|
49
|
-
globalTop
|
|
32
|
+
globalTop,
|
|
50
33
|
localTop,
|
|
51
34
|
stackStyles: computed(() => ({ zIndex: _zIndex.value }))
|
|
52
35
|
};
|
|
@@ -8,17 +8,18 @@ var _vue = require("vue");
|
|
|
8
8
|
var _ssrStyle = require("../../consts/Commons/ssr-style.const.cjs");
|
|
9
9
|
var _dom = require("../../utils/Commons/dom.util.cjs");
|
|
10
10
|
var _getCurrentInstance = require("../../utils/Commons/getCurrentInstance.util.cjs");
|
|
11
|
+
var _style = require("../../utils/Commons/style.util.cjs");
|
|
11
12
|
var _styleTag = require("./styleTag.composable.cjs");
|
|
12
13
|
function toKebabCase(key) {
|
|
13
14
|
return key.startsWith("--") ? key : key.replace(/[A-Z]/g, letter => `-${letter.toLowerCase()}`);
|
|
14
15
|
}
|
|
15
16
|
function toDeclarations(value) {
|
|
16
17
|
if (value == null || typeof value === "boolean" || typeof value === "number") return [];
|
|
17
|
-
if (typeof value === "string") return
|
|
18
|
+
if (typeof value === "string") return (0, _style.toSafeCssDeclarations)(value);
|
|
18
19
|
if (Array.isArray(value)) return value.flatMap(toDeclarations);
|
|
19
20
|
if (typeof value === "object") {
|
|
20
21
|
const bag = value;
|
|
21
|
-
return Object.keys(bag).filter(key => typeof bag[key] !== "undefined").map(key =>
|
|
22
|
+
return Object.keys(bag).filter(key => typeof bag[key] !== "undefined").map(key => (0, _style.toSafeCssDeclaration)(toKebabCase(key), String(bag[key]))).filter(declaration => declaration !== null);
|
|
22
23
|
}
|
|
23
24
|
return [];
|
|
24
25
|
}
|
|
@@ -2,17 +2,18 @@ import { computed, getCurrentInstance, inject, onMounted, toValue } from "vue";
|
|
|
2
2
|
import { ORIGAM_SSR_STYLES_KEY, SSR_STYLE_TAG_PREFIX } from "../../consts/Commons/ssr-style.const.js";
|
|
3
3
|
import { escapeCssIdent } from "../../utils/Commons/dom.util.js";
|
|
4
4
|
import { getCurrentInstanceName, getUid } from "../../utils/Commons/getCurrentInstance.util.js";
|
|
5
|
+
import { toSafeCssDeclaration, toSafeCssDeclarations } from "../../utils/Commons/style.util.js";
|
|
5
6
|
import { useStyleTag } from "./styleTag.composable.js";
|
|
6
7
|
function toKebabCase(key) {
|
|
7
8
|
return key.startsWith("--") ? key : key.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);
|
|
8
9
|
}
|
|
9
10
|
function toDeclarations(value) {
|
|
10
11
|
if (value == null || typeof value === "boolean" || typeof value === "number") return [];
|
|
11
|
-
if (typeof value === "string") return value
|
|
12
|
+
if (typeof value === "string") return toSafeCssDeclarations(value);
|
|
12
13
|
if (Array.isArray(value)) return value.flatMap(toDeclarations);
|
|
13
14
|
if (typeof value === "object") {
|
|
14
15
|
const bag = value;
|
|
15
|
-
return Object.keys(bag).filter((key) => typeof bag[key] !== "undefined").map((key) =>
|
|
16
|
+
return Object.keys(bag).filter((key) => typeof bag[key] !== "undefined").map((key) => toSafeCssDeclaration(toKebabCase(key), String(bag[key]))).filter((declaration) => declaration !== null);
|
|
16
17
|
}
|
|
17
18
|
return [];
|
|
18
19
|
}
|
|
@@ -876,6 +876,18 @@ Object.keys(_teleport).forEach(function (key) {
|
|
|
876
876
|
}
|
|
877
877
|
});
|
|
878
878
|
});
|
|
879
|
+
var _popupDialogAria = require("./Commons/popup-dialog-aria.composable.cjs");
|
|
880
|
+
Object.keys(_popupDialogAria).forEach(function (key) {
|
|
881
|
+
if (key === "default" || key === "__esModule") return;
|
|
882
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
883
|
+
if (key in exports && exports[key] === _popupDialogAria[key]) return;
|
|
884
|
+
Object.defineProperty(exports, key, {
|
|
885
|
+
enumerable: true,
|
|
886
|
+
get: function () {
|
|
887
|
+
return _popupDialogAria[key];
|
|
888
|
+
}
|
|
889
|
+
});
|
|
890
|
+
});
|
|
879
891
|
var _teleportTypography = require("./Commons/teleport-typography.composable.cjs");
|
|
880
892
|
Object.keys(_teleportTypography).forEach(function (key) {
|
|
881
893
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -70,6 +70,7 @@ export * from './Commons/margin.composable';
|
|
|
70
70
|
export * from './Commons/lazy.composable';
|
|
71
71
|
export * from './Commons/items.composable';
|
|
72
72
|
export * from './Commons/teleport.composable';
|
|
73
|
+
export * from './Commons/popup-dialog-aria.composable';
|
|
73
74
|
export * from './Commons/teleport-typography.composable';
|
|
74
75
|
export * from './Commons/hydration.composable';
|
|
75
76
|
export * from './Commons/stack.composable';
|
|
@@ -70,6 +70,7 @@ export * from "./Commons/margin.composable.js";
|
|
|
70
70
|
export * from "./Commons/lazy.composable.js";
|
|
71
71
|
export * from "./Commons/items.composable.js";
|
|
72
72
|
export * from "./Commons/teleport.composable.js";
|
|
73
|
+
export * from "./Commons/popup-dialog-aria.composable.js";
|
|
73
74
|
export * from "./Commons/teleport-typography.composable.js";
|
|
74
75
|
export * from "./Commons/hydration.composable.js";
|
|
75
76
|
export * from "./Commons/stack.composable.js";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.CSS_UNSAFE_VALUE_REGEX = exports.CSS_PROPERTY_NAME_REGEX = exports.CSS_LITERAL_REGEX = void 0;
|
|
7
|
+
const CSS_LITERAL_REGEX = exports.CSS_LITERAL_REGEX = /"(?:[^"\\\n\r\f]|\\.)*"|'(?:[^'\\\n\r\f]|\\.)*'|url\(\s*[^\s"'()\\]*\s*\)/gi;
|
|
8
|
+
const CSS_UNSAFE_VALUE_REGEX = exports.CSS_UNSAFE_VALUE_REGEX = /[;{}<>@\\\n\r\f"']|\/\*|\*\/|expression\s*\(/i;
|
|
9
|
+
const CSS_PROPERTY_NAME_REGEX = exports.CSS_PROPERTY_NAME_REGEX = /^(?:--[\w-]+|-?[a-z][a-z0-9-]*)$/i;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*********************************************************
|
|
2
|
+
* CSS_LITERAL_REGEX / CSS_UNSAFE_VALUE_REGEX / CSS_PROPERTY_NAME_REGEX (#1113)
|
|
3
|
+
*
|
|
4
|
+
* @description
|
|
5
|
+
* `useStyle()` serialises style values into the TEXT of a stylesheet, so a
|
|
6
|
+
* value is only safe when it cannot leave its declaration.
|
|
7
|
+
*
|
|
8
|
+
* @description
|
|
9
|
+
* `CSS_LITERAL_REGEX` matches the two places where `;`, `{`, `}` are plain
|
|
10
|
+
* content to the CSS tokenizer: a balanced quoted string and an unquoted
|
|
11
|
+
* `url(…)` body (`url(data:image/png;base64,…)`). They are masked before the
|
|
12
|
+
* unsafe test, so a `font-family: "A;B"` or a data URL keeps passing.
|
|
13
|
+
*
|
|
14
|
+
* @description
|
|
15
|
+
* `CSS_UNSAFE_VALUE_REGEX`, run on the MASKED value: a declaration or block
|
|
16
|
+
* boundary (`;` `{` `}`), markup (`<` `>`), an at-rule (`@`), an escape (`\`,
|
|
17
|
+
* which can spell `}` as `\7d`), a line break, a comment, a quote left
|
|
18
|
+
* unbalanced by the mask, or IE's `expression(`.
|
|
19
|
+
*
|
|
20
|
+
* @description
|
|
21
|
+
* `CSS_PROPERTY_NAME_REGEX`: a custom property (`--origam-btn---bg`) or a
|
|
22
|
+
* plain / vendor-prefixed property name, nothing else.
|
|
23
|
+
********************************************************/
|
|
24
|
+
export declare const CSS_LITERAL_REGEX: RegExp;
|
|
25
|
+
export declare const CSS_UNSAFE_VALUE_REGEX: RegExp;
|
|
26
|
+
export declare const CSS_PROPERTY_NAME_REGEX: RegExp;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export const CSS_LITERAL_REGEX = /"(?:[^"\\\n\r\f]|\\.)*"|'(?:[^'\\\n\r\f]|\\.)*'|url\(\s*[^\s"'()\\]*\s*\)/gi;
|
|
2
|
+
export const CSS_UNSAFE_VALUE_REGEX = /[;{}<>@\\\n\r\f"']|\/\*|\*\/|expression\s*\(/i;
|
|
3
|
+
export const CSS_PROPERTY_NAME_REGEX = /^(?:--[\w-]+|-?[a-z][a-z0-9-]*)$/i;
|
|
@@ -80,6 +80,17 @@ Object.keys(_ssrStyle).forEach(function (key) {
|
|
|
80
80
|
}
|
|
81
81
|
});
|
|
82
82
|
});
|
|
83
|
+
var _style = require("./Commons/style.const.cjs");
|
|
84
|
+
Object.keys(_style).forEach(function (key) {
|
|
85
|
+
if (key === "default" || key === "__esModule") return;
|
|
86
|
+
if (key in exports && exports[key] === _style[key]) return;
|
|
87
|
+
Object.defineProperty(exports, key, {
|
|
88
|
+
enumerable: true,
|
|
89
|
+
get: function () {
|
|
90
|
+
return _style[key];
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
});
|
|
83
94
|
var _density = require("./Commons/density.const.cjs");
|
|
84
95
|
Object.keys(_density).forEach(function (key) {
|
|
85
96
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -5,6 +5,7 @@ export * from './Commons/commons.const';
|
|
|
5
5
|
export * from './Commons/date.const';
|
|
6
6
|
export * from './Commons/defaults.const';
|
|
7
7
|
export * from './Commons/ssr-style.const';
|
|
8
|
+
export * from './Commons/style.const';
|
|
8
9
|
export * from './Commons/density.const';
|
|
9
10
|
export * from './Commons/dimension.const';
|
|
10
11
|
export * from './Commons/layout.const';
|
package/dist/src/consts/index.js
CHANGED
|
@@ -5,6 +5,7 @@ export * from "./Commons/commons.const.js";
|
|
|
5
5
|
export * from "./Commons/date.const.js";
|
|
6
6
|
export * from "./Commons/defaults.const.js";
|
|
7
7
|
export * from "./Commons/ssr-style.const.js";
|
|
8
|
+
export * from "./Commons/style.const.js";
|
|
8
9
|
export * from "./Commons/density.const.js";
|
|
9
10
|
export * from "./Commons/dimension.const.js";
|
|
10
11
|
export * from "./Commons/layout.const.js";
|
|
@@ -165,8 +165,12 @@ function wcagRatio(a, b) {
|
|
|
165
165
|
const WHITE = [255, 255, 255];
|
|
166
166
|
const BLACK = [0, 0, 0];
|
|
167
167
|
function enforceContrast(el, enabled) {
|
|
168
|
+
const wasFixed = el.dataset.origamContrastFixed === "true";
|
|
168
169
|
delete el.dataset.origamContrastFixed;
|
|
169
|
-
if (!enabled || typeof window === "undefined")
|
|
170
|
+
if (!enabled || typeof window === "undefined") {
|
|
171
|
+
if (wasFixed) el.style.removeProperty("color");
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
170
174
|
if (el.dataset.origamColorLocked === "true") return;
|
|
171
175
|
const bg = channelsOf(resolvePaintedBackground(el));
|
|
172
176
|
if (!bg) return;
|
|
@@ -143,8 +143,12 @@ function wcagRatio(a, b) {
|
|
|
143
143
|
const WHITE = [255, 255, 255];
|
|
144
144
|
const BLACK = [0, 0, 0];
|
|
145
145
|
function enforceContrast(el, enabled) {
|
|
146
|
+
const wasFixed = el.dataset.origamContrastFixed === "true";
|
|
146
147
|
delete el.dataset.origamContrastFixed;
|
|
147
|
-
if (!enabled || typeof window === "undefined")
|
|
148
|
+
if (!enabled || typeof window === "undefined") {
|
|
149
|
+
if (wasFixed) el.style.removeProperty("color");
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
148
152
|
if (el.dataset.origamColorLocked === "true") return;
|
|
149
153
|
const bg = channelsOf(resolvePaintedBackground(el));
|
|
150
154
|
if (!bg) return;
|
|
@@ -39,6 +39,7 @@ export interface IExpansionPanelProps extends ITagProps, ICommonsComponentProps,
|
|
|
39
39
|
export interface IExpansionPanelGroupItemProvide extends IGroupItemProvide {
|
|
40
40
|
headerId: Ref<string | undefined>;
|
|
41
41
|
contentId: Ref<string | undefined>;
|
|
42
|
+
uid: string;
|
|
42
43
|
}
|
|
43
44
|
/** Emits fired by `<OrigamExpansionPanel>` — group membership lifecycle. */
|
|
44
45
|
export interface IExpansionPanelEmits extends IGroupEmits {
|
|
@@ -26,8 +26,17 @@ export interface IStepperItemEmits {
|
|
|
26
26
|
* IStepperItemSlots
|
|
27
27
|
*
|
|
28
28
|
* @description
|
|
29
|
-
* Slot signatures for `<OrigamStepperItem
|
|
30
|
-
*
|
|
29
|
+
* Slot signatures for `<OrigamStepperItem>`. Indicator icon, title and
|
|
30
|
+
* subtitle stay derived from props; `prepend` / `append` add rich content
|
|
31
|
+
* around them (a status pill, a counter, an action): `prepend` renders
|
|
32
|
+
* before the indicator, `append` after the label. `<OrigamStepper>` forwards
|
|
33
|
+
* them in `items` mode as `item-prepend` / `item-append` (connectors kept).
|
|
31
34
|
********************************************************/
|
|
35
|
+
export interface IStepperItemSlotProps {
|
|
36
|
+
index: number;
|
|
37
|
+
status: TStepperItemStatus;
|
|
38
|
+
}
|
|
32
39
|
export interface IStepperItemSlots {
|
|
40
|
+
prepend?: (props: IStepperItemSlotProps) => any;
|
|
41
|
+
append?: (props: IStepperItemSlotProps) => any;
|
|
33
42
|
}
|
|
@@ -9,6 +9,7 @@ import type { IMarginProps } from '../Commons/margin.interface';
|
|
|
9
9
|
import type { IPaddingProps } from '../Commons/padding.interface';
|
|
10
10
|
import type { IRoundedProps } from '../Commons/rounded.interface';
|
|
11
11
|
import type { ISizeProps } from '../Commons/size.interface';
|
|
12
|
+
import type { IStepperItemSlotProps } from './stepper-item.interface';
|
|
12
13
|
import type { TIcon } from '../../types/Icon/icon.type';
|
|
13
14
|
import type { TStepperItemStatus, TStepperOrientation } from '../../types/Stepper/stepper.type';
|
|
14
15
|
/*********************************************************
|
|
@@ -48,4 +49,10 @@ export interface IStepperEmits {
|
|
|
48
49
|
export interface IStepperSlots {
|
|
49
50
|
/** Overrides the whole auto-generated item list. */
|
|
50
51
|
default?: () => any;
|
|
52
|
+
'item-prepend'?: (props: IStepperItemSlotProps & {
|
|
53
|
+
item: IStepperItem;
|
|
54
|
+
}) => any;
|
|
55
|
+
'item-append'?: (props: IStepperItemSlotProps & {
|
|
56
|
+
item: IStepperItem;
|
|
57
|
+
}) => any;
|
|
51
58
|
}
|
|
@@ -268,7 +268,6 @@ const origamLightTheme = exports.origamLightTheme = {
|
|
|
268
268
|
},
|
|
269
269
|
"origam-chip": {
|
|
270
270
|
size: "small",
|
|
271
|
-
variant: "outlined",
|
|
272
271
|
color: "primary",
|
|
273
272
|
pill: true,
|
|
274
273
|
border: true,
|
|
@@ -682,7 +681,6 @@ const origamDarkTheme = exports.origamDarkTheme = {
|
|
|
682
681
|
},
|
|
683
682
|
"origam-chip": {
|
|
684
683
|
size: "small",
|
|
685
|
-
variant: "outlined",
|
|
686
684
|
color: "primary",
|
|
687
685
|
pill: true,
|
|
688
686
|
border: true,
|
|
@@ -172,7 +172,7 @@ export const origamLightTheme = {
|
|
|
172
172
|
"origam-btn-toggle": { variant: "text", size: "small" },
|
|
173
173
|
"origam-card": { tag: "div", density: "default", rounded: "lg", border: true },
|
|
174
174
|
"origam-checkbox": { density: "default" },
|
|
175
|
-
"origam-chip": { size: "small",
|
|
175
|
+
"origam-chip": { size: "small", color: "primary", pill: true, border: true, borderColor: "var(--origam-color__action--primary---bg)" },
|
|
176
176
|
"origam-clipboard": { tag: "span" },
|
|
177
177
|
"origam-code": { tag: "figure", rounded: "lg" },
|
|
178
178
|
"origam-color-picker-field": { density: "default", border: true, rounded: true },
|
|
@@ -342,7 +342,7 @@ export const origamDarkTheme = {
|
|
|
342
342
|
"origam-btn-toggle": { variant: "text", size: "small" },
|
|
343
343
|
"origam-card": { tag: "div", density: "default", rounded: "lg", border: true },
|
|
344
344
|
"origam-checkbox": { density: "default" },
|
|
345
|
-
"origam-chip": { size: "small",
|
|
345
|
+
"origam-chip": { size: "small", color: "primary", pill: true, border: true, borderColor: "var(--origam-color__action--primary---bg)" },
|
|
346
346
|
"origam-clipboard": { tag: "span" },
|
|
347
347
|
"origam-code": { tag: "figure", rounded: "lg" },
|
|
348
348
|
"origam-color-picker-field": { density: "default", border: true, rounded: true },
|