origam 2.17.1 → 2.18.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.
Files changed (215) hide show
  1. package/CHANGELOG.md +895 -0
  2. package/dist/src/assets/css/main.css +1 -1
  3. package/dist/src/assets/css/tokens/dark.css +193 -26
  4. package/dist/src/assets/css/tokens/light.css +78 -11
  5. package/dist/src/assets/locales/en.json +21 -6
  6. package/dist/src/assets/locales/fr.json +21 -6
  7. package/dist/src/assets/scss/main.scss +10 -2
  8. package/dist/src/assets/scss/tokens/_dark.scss +2914 -13
  9. package/dist/src/assets/scss/tokens/_light.scss +78 -11
  10. package/dist/src/components/Alert/OrigamAlert.vue +6 -6
  11. package/dist/src/components/Avatar/OrigamAvatar.vue +15 -2
  12. package/dist/src/components/Badge/OrigamBadge.vue +7 -7
  13. package/dist/src/components/Breadcrumb/OrigamBreadcrumbItem.vue +23 -4
  14. package/dist/src/components/Btn/OrigamBtn.vue +22 -16
  15. package/dist/src/components/Btn/OrigamBtnGroup.vue +1 -1
  16. package/dist/src/components/Calendar/OrigamCalendar.vue +1 -1
  17. package/dist/src/components/Card/OrigamCard.vue +2 -0
  18. package/dist/src/components/Card/OrigamCardHeader.vue +7 -7
  19. package/dist/src/components/Carousel/OrigamCarousel.vue +14 -1
  20. package/dist/src/components/Chart/OrigamChartBoxPlot.vue +1 -1
  21. package/dist/src/components/Chart/OrigamChartBullet.vue +3 -2
  22. package/dist/src/components/Chart/OrigamChartCandlestick.vue +2 -2
  23. package/dist/src/components/Chart/OrigamChartCartesian.vue +49 -4
  24. package/dist/src/components/Chart/OrigamChartLegend.vue +39 -18
  25. package/dist/src/components/Chart/OrigamChartPareto.vue +7 -1
  26. package/dist/src/components/Chart/OrigamChartPictorial.vue +2 -2
  27. package/dist/src/components/Chart/OrigamChartRadar.vue +3 -1
  28. package/dist/src/components/Chart/OrigamChartSparkline.vue +3 -1
  29. package/dist/src/components/Chart/OrigamChartStreamgraph.vue +2 -1
  30. package/dist/src/components/Checkbox/OrigamCheckbox.vue +2 -0
  31. package/dist/src/components/Checkbox/OrigamCheckboxGroup.vue +36 -11
  32. package/dist/src/components/Chip/OrigamChip.vue +19 -4
  33. package/dist/src/components/Code/OrigamCode.vue +20 -3
  34. package/dist/src/components/ColorPickerField/OrigamColorPickerField.vue +30 -5
  35. package/dist/src/components/CommandPalette/OrigamCommandPalette.vue +3 -3
  36. package/dist/src/components/ConfirmWrapper/OrigamConfirmWrapper.vue +6 -6
  37. package/dist/src/components/ContextualMenu/OrigamContextualMenu.vue +0 -4
  38. package/dist/src/components/DataList/OrigamDataList.vue +2 -0
  39. package/dist/src/components/DataList/OrigamDataText.vue +6 -6
  40. package/dist/src/components/DataList/OrigamDataTitle.vue +6 -6
  41. package/dist/src/components/DataTable/OrigamDataTableHeaderCell.vue +1 -1
  42. package/dist/src/components/DataTable/OrigamDataTableHeadersCell.vue +4 -1
  43. package/dist/src/components/DatePicker/OrigamDatePicker.vue +2 -0
  44. package/dist/src/components/DatePicker/OrigamDatePickerHeader.vue +6 -6
  45. package/dist/src/components/DatePickerField/OrigamDatePickerField.vue +21 -1
  46. package/dist/src/components/Dialog/OrigamDialog.vue +25 -0
  47. package/dist/src/components/Dialog/OrigamDialogConfirmation.vue +6 -0
  48. package/dist/src/components/ExpansionPanel/OrigamExpansionPanel.vue +2 -0
  49. package/dist/src/components/ExpansionPanel/OrigamExpansionPanelHeader.vue +6 -6
  50. package/dist/src/components/Field/OrigamField.vue +47 -15
  51. package/dist/src/components/FileField/OrigamFileField.vue +5 -1
  52. package/dist/src/components/Icon/OrigamSvgIcon.vue +3 -1
  53. package/dist/src/components/Img/OrigamImg.vue +9 -2
  54. package/dist/src/components/InfiniteScroll/OrigamInfiniteScroll.vue +34 -18
  55. package/dist/src/components/InlineEdit/OrigamInlineEdit.vue +46 -5
  56. package/dist/src/components/Input/OrigamInput.vue +6 -6
  57. package/dist/src/components/List/OrigamListGroup.vue +4 -0
  58. package/dist/src/components/List/OrigamListItem.vue +68 -4
  59. package/dist/src/components/Masonry/OrigamMasonry.vue +18 -2
  60. package/dist/src/components/Menu/OrigamMenu.vue +79 -9
  61. package/dist/src/components/NumberField/OrigamNumberField.vue +13 -3
  62. package/dist/src/components/OtpInputField/OrigamOtpInputField.vue +35 -11
  63. package/dist/src/components/PasswordField/OrigamPasswordField.vue +5 -1
  64. package/dist/src/components/Radio/OrigamRadio.vue +2 -0
  65. package/dist/src/components/Radio/OrigamRadioGroup.vue +36 -11
  66. package/dist/src/components/RatingField/OrigamRatingField.vue +58 -7
  67. package/dist/src/components/RatingField/OrigamRatingFieldItem.vue +78 -30
  68. package/dist/src/components/Select/OrigamSelect.vue +44 -21
  69. package/dist/src/components/SliderField/OrigamSliderField.vue +20 -10
  70. package/dist/src/components/Snackbar/OrigamSnackbarGroup.vue +1 -1
  71. package/dist/src/components/Switch/OrigamSwitch.vue +2 -0
  72. package/dist/src/components/Tabs/OrigamTab.vue +7 -4
  73. package/dist/src/components/Tabs/OrigamTabPanel.vue +4 -2
  74. package/dist/src/components/Tabs/OrigamTabs.vue +7 -5
  75. package/dist/src/components/TextField/OrigamTextField.vue +5 -1
  76. package/dist/src/components/TextareaField/OrigamTextareaField.vue +5 -1
  77. package/dist/src/components/Transition/OrigamExpandX.vue +19 -3
  78. package/dist/src/components/Transition/OrigamExpandY.vue +19 -3
  79. package/dist/src/components/Transition/OrigamTranslateScale.vue +26 -4
  80. package/dist/src/components/Video/OrigamVideo.vue +3 -2
  81. package/dist/src/components/Window/OrigamWindow.vue +20 -3
  82. package/dist/src/composables/Commons/accessibleCommand.composable.cjs +26 -0
  83. package/dist/src/composables/Commons/accessibleCommand.composable.d.ts +78 -0
  84. package/dist/src/composables/Commons/accessibleCommand.composable.js +20 -0
  85. package/dist/src/composables/Commons/activator.composable.cjs +10 -1
  86. package/dist/src/composables/Commons/activator.composable.js +11 -2
  87. package/dist/src/composables/Commons/adjacent.composable.cjs +17 -0
  88. package/dist/src/composables/Commons/adjacent.composable.d.ts +12 -0
  89. package/dist/src/composables/Commons/adjacent.composable.js +17 -0
  90. package/dist/src/composables/Commons/adjacentInner.composable.cjs +20 -0
  91. package/dist/src/composables/Commons/adjacentInner.composable.d.ts +24 -5
  92. package/dist/src/composables/Commons/adjacentInner.composable.js +20 -0
  93. package/dist/src/composables/Commons/audio.composable.cjs +14 -1
  94. package/dist/src/composables/Commons/audio.composable.js +14 -1
  95. package/dist/src/composables/Commons/backButton.composable.cjs +3 -1
  96. package/dist/src/composables/Commons/backButton.composable.js +3 -1
  97. package/dist/src/composables/Commons/border.composable.d.ts +13 -0
  98. package/dist/src/composables/Commons/colorEffect.composable.cjs +58 -46
  99. package/dist/src/composables/Commons/colorEffect.composable.d.ts +10 -5
  100. package/dist/src/composables/Commons/colorEffect.composable.js +70 -46
  101. package/dist/src/composables/Commons/createLayout.composable.cjs +21 -12
  102. package/dist/src/composables/Commons/createLayout.composable.js +21 -12
  103. package/dist/src/composables/Commons/delay.composable.d.ts +16 -0
  104. package/dist/src/composables/Commons/dimension.composable.d.ts +11 -0
  105. package/dist/src/composables/Commons/elevation.composable.cjs +6 -2
  106. package/dist/src/composables/Commons/elevation.composable.d.ts +37 -1
  107. package/dist/src/composables/Commons/elevation.composable.js +7 -2
  108. package/dist/src/composables/Commons/goTo.composable.cjs +4 -2
  109. package/dist/src/composables/Commons/goTo.composable.js +5 -3
  110. package/dist/src/composables/Commons/group.composable.cjs +14 -14
  111. package/dist/src/composables/Commons/group.composable.js +14 -14
  112. package/dist/src/composables/Commons/hotkey.composable.d.ts +18 -7
  113. package/dist/src/composables/Commons/hydration.composable.d.ts +8 -0
  114. package/dist/src/composables/Commons/link.composable.d.ts +20 -0
  115. package/dist/src/composables/Commons/locationStrategies.composable.d.ts +17 -0
  116. package/dist/src/composables/Commons/message.composable.d.ts +19 -5
  117. package/dist/src/composables/Commons/position.composable.d.ts +17 -6
  118. package/dist/src/composables/Commons/refs.composable.d.ts +11 -5
  119. package/dist/src/composables/Commons/rounded.composable.d.ts +11 -1
  120. package/dist/src/composables/Commons/scrolling.composable.cjs +15 -12
  121. package/dist/src/composables/Commons/scrolling.composable.js +15 -12
  122. package/dist/src/composables/Commons/size.composable.d.ts +15 -0
  123. package/dist/src/composables/Commons/ssrBoot.composable.cjs +9 -1
  124. package/dist/src/composables/Commons/ssrBoot.composable.js +10 -2
  125. package/dist/src/composables/Commons/stack.composable.cjs +13 -1
  126. package/dist/src/composables/Commons/stack.composable.js +13 -1
  127. package/dist/src/composables/Commons/theme-props-resolver.composable.cjs +41 -32
  128. package/dist/src/composables/Commons/theme-props-resolver.composable.js +41 -32
  129. package/dist/src/composables/Commons/validation.composable.cjs +3 -3
  130. package/dist/src/composables/Commons/validation.composable.js +3 -3
  131. package/dist/src/composables/Commons/virtual.composable.cjs +24 -8
  132. package/dist/src/composables/Commons/virtual.composable.js +24 -8
  133. package/dist/src/composables/Masonry/masonry.composable.cjs +18 -11
  134. package/dist/src/composables/Masonry/masonry.composable.js +18 -11
  135. package/dist/src/composables/Parallax/parallax.composable.cjs +1 -1
  136. package/dist/src/composables/Parallax/parallax.composable.js +1 -1
  137. package/dist/src/composables/index.cjs +36 -0
  138. package/dist/src/composables/index.d.ts +3 -0
  139. package/dist/src/composables/index.js +3 -0
  140. package/dist/src/consts/Chart/chart-cartesian.const.cjs +5 -2
  141. package/dist/src/consts/Chart/chart-cartesian.const.d.ts +42 -0
  142. package/dist/src/consts/Chart/chart-cartesian.const.js +3 -0
  143. package/dist/src/consts/Commons/elevation.const.cjs +5 -1
  144. package/dist/src/consts/Commons/elevation.const.d.ts +52 -2
  145. package/dist/src/consts/Commons/elevation.const.js +4 -0
  146. package/dist/src/consts/Commons/ripple.const.cjs +13 -3
  147. package/dist/src/consts/Commons/ripple.const.js +13 -3
  148. package/dist/src/consts/RatingField/rating-field.const.cjs +10 -0
  149. package/dist/src/consts/RatingField/rating-field.const.d.ts +36 -0
  150. package/dist/src/consts/RatingField/rating-field.const.js +12 -0
  151. package/dist/src/consts/index.cjs +11 -0
  152. package/dist/src/consts/index.d.ts +1 -0
  153. package/dist/src/consts/index.js +1 -0
  154. package/dist/src/directives/ClickOutside/clickOutside.directive.cjs +2 -0
  155. package/dist/src/directives/ClickOutside/clickOutside.directive.js +2 -0
  156. package/dist/src/directives/Ripple/ripple.directive.cjs +2 -0
  157. package/dist/src/directives/Ripple/ripple.directive.js +2 -0
  158. package/dist/src/enums/Commons/color.enum.cjs +0 -1
  159. package/dist/src/enums/Commons/color.enum.d.ts +14 -5
  160. package/dist/src/enums/Commons/color.enum.js +0 -1
  161. package/dist/src/enums/Sheet/sheet.enum.d.ts +1 -1
  162. package/dist/src/interfaces/Btn/btn.interface.d.ts +7 -10
  163. package/dist/src/interfaces/Chart/chart-cartesian.interface.d.ts +6 -2
  164. package/dist/src/interfaces/Commons/activator.interface.d.ts +3 -2
  165. package/dist/src/interfaces/Commons/adjacent.interface.d.ts +29 -0
  166. package/dist/src/interfaces/Commons/group.interface.d.ts +13 -2
  167. package/dist/src/interfaces/Commons/ripple.interface.d.ts +16 -0
  168. package/dist/src/interfaces/Commons/scroll.interface.d.ts +3 -2
  169. package/dist/src/interfaces/DataTable/data-table-header.interface.d.ts +2 -2
  170. package/dist/src/interfaces/DatePicker/date-picker-month.interface.d.ts +2 -1
  171. package/dist/src/interfaces/Menu/menu.interface.d.ts +28 -1
  172. package/dist/src/interfaces/OtpInputField/otp-input-field.interface.d.ts +21 -1
  173. package/dist/src/interfaces/RatingField/rating-field-item.interface.d.ts +16 -1
  174. package/dist/src/interfaces/index.cjs +11 -0
  175. package/dist/src/interfaces/index.d.ts +1 -0
  176. package/dist/src/interfaces/index.js +1 -0
  177. package/dist/src/nuxt/module.cjs +2 -1
  178. package/dist/src/nuxt/module.js +2 -1
  179. package/dist/src/origam.cjs +1 -2
  180. package/dist/src/origam.js +1 -2
  181. package/dist/src/themes/origam.theme.cjs +8 -14
  182. package/dist/src/themes/origam.theme.js +6 -8
  183. package/dist/src/types/Commons/color.type.d.ts +4 -3
  184. package/dist/src/types/Commons/commons.type.d.ts +33 -0
  185. package/dist/src/types/Commons/theme.type.d.ts +2 -1
  186. package/dist/src/types/Sheet/sheet.type.d.ts +2 -1
  187. package/dist/src/types/index.cjs +22 -0
  188. package/dist/src/types/index.d.ts +2 -0
  189. package/dist/src/types/index.js +2 -0
  190. package/dist/src/types/tokens.type.d.ts +1 -1
  191. package/dist/src/utils/Commons/a11y.util.cjs +35 -0
  192. package/dist/src/utils/Commons/a11y.util.d.ts +63 -0
  193. package/dist/src/utils/Commons/a11y.util.js +33 -0
  194. package/dist/src/utils/Commons/clickOutside.util.cjs +5 -1
  195. package/dist/src/utils/Commons/clickOutside.util.js +5 -1
  196. package/dist/src/utils/Commons/color.util.cjs +10 -15
  197. package/dist/src/utils/Commons/color.util.d.ts +34 -28
  198. package/dist/src/utils/Commons/color.util.js +9 -16
  199. package/dist/src/utils/Commons/goTo.util.cjs +31 -14
  200. package/dist/src/utils/Commons/goTo.util.d.ts +1 -1
  201. package/dist/src/utils/Commons/goTo.util.js +31 -16
  202. package/dist/src/utils/Commons/location.util.cjs +18 -3
  203. package/dist/src/utils/Commons/location.util.js +18 -3
  204. package/dist/src/utils/Commons/ripple.util.cjs +5 -1
  205. package/dist/src/utils/Commons/ripple.util.js +5 -1
  206. package/dist/src/utils/index.cjs +11 -0
  207. package/dist/src/utils/index.d.ts +1 -0
  208. package/dist/src/utils/index.js +1 -0
  209. package/package.json +13 -2
  210. package/dist/src/consts/Btn/btn.const.cjs +0 -7
  211. package/dist/src/consts/Btn/btn.const.d.ts +0 -32
  212. package/dist/src/consts/Btn/btn.const.js +0 -1
  213. package/dist/src/types/Commons/locale.type.cjs +0 -1
  214. package/dist/src/types/Commons/locale.type.d.ts +0 -0
  215. package/dist/src/types/Commons/locale.type.js +0 -0
@@ -7,6 +7,7 @@ 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");
10
11
  var _vue = require("vue");
11
12
  function useStack(isActive, zIndex, disableGlobalStack) {
12
13
  const vm = (0, _getCurrentInstance.getCurrentInstance)("useStack");
@@ -33,10 +34,21 @@ function useStack(isActive, zIndex, disableGlobalStack) {
33
34
  });
34
35
  });
35
36
  const globalTop = (0, _vue.shallowRef)(true);
37
+ let topTimer;
36
38
  (0, _vue.watchEffect)(() => {
37
39
  if (!createStackEntry.value) return;
38
40
  const _isTop = _stack.GLOBAL_STACK.at(-1)?.[0] === vm.uid;
39
- setTimeout(() => globalTop.value = _isTop);
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
+ }
40
52
  });
41
53
  const localTop = (0, _vue.computed)(() => !stack.activeChildren.size);
42
54
  return {
@@ -1,6 +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 { tryOnScopeDispose } from "../../utils/Commons/commons.util.js";
4
5
  import { computed, inject, onScopeDispose, provide, reactive, readonly, shallowRef, toRaw, watchEffect } from "vue";
5
6
  export function useStack(isActive, zIndex, disableGlobalStack) {
6
7
  const vm = getCurrentInstance("useStack");
@@ -27,10 +28,21 @@ export function useStack(isActive, zIndex, disableGlobalStack) {
27
28
  });
28
29
  });
29
30
  const globalTop = shallowRef(true);
31
+ let topTimer;
30
32
  watchEffect(() => {
31
33
  if (!createStackEntry.value) return;
32
34
  const _isTop = GLOBAL_STACK.at(-1)?.[0] === vm.uid;
33
- setTimeout(() => globalTop.value = _isTop);
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
+ }
34
46
  });
35
47
  const localTop = computed(() => !stack.activeChildren.size);
36
48
  return {
@@ -35,6 +35,44 @@ function passedPropValue(vnodeProps, key) {
35
35
  }
36
36
  return void 0;
37
37
  }
38
+ function collectTargetKeys(themedKeysUnion, defaults, name) {
39
+ const ownKeys = themedKeysUnion.get(name);
40
+ const globalKeys = themedKeysUnion.get("global");
41
+ const providerOwnKeys = defaults.value?.[name];
42
+ const providerGlobalKeys = defaults.value?.global;
43
+ if (!ownKeys?.size && !globalKeys?.size && !providerOwnKeys && !providerGlobalKeys) return null;
44
+ const targetKeys = ownKeys ? new Set(ownKeys) : /* @__PURE__ */new Set();
45
+ if (globalKeys) for (const key of globalKeys) targetKeys.add(key);
46
+ if (providerOwnKeys) for (const key in providerOwnKeys) targetKeys.add(key);
47
+ if (providerGlobalKeys) for (const key in providerGlobalKeys) targetKeys.add(key);
48
+ return targetKeys;
49
+ }
50
+ function patchThemedPropSlot(instance, defaults, name, key) {
51
+ const rawProps = instance.props;
52
+ const fallbackValue = (0, _vue.shallowRef)(rawProps[key]);
53
+ let wasPassed = passedPropValue(instance.vnode.props, key) !== void 0;
54
+ Object.defineProperty(rawProps, key, {
55
+ configurable: true,
56
+ enumerable: true,
57
+ get() {
58
+ const fallback = fallbackValue.value;
59
+ if (wasPassed) return fallback;
60
+ const componentDefaults = defaults.value?.[name];
61
+ if (componentDefaults && componentDefaults[key] !== void 0) {
62
+ return componentDefaults[key];
63
+ }
64
+ const globalDefaults = defaults.value?.global;
65
+ if (globalDefaults && globalDefaults[key] !== void 0) {
66
+ return globalDefaults[key];
67
+ }
68
+ return fallback;
69
+ },
70
+ set(value) {
71
+ wasPassed = passedPropValue(instance.vnode.props, key) !== void 0;
72
+ fallbackValue.value = value;
73
+ }
74
+ });
75
+ }
38
76
  function installThemePropsResolver(app, themedKeysUnion) {
39
77
  app.mixin({
40
78
  beforeCreate() {
@@ -42,44 +80,15 @@ function installThemePropsResolver(app, themedKeysUnion) {
42
80
  if (!instance) return;
43
81
  const name = (0, _getCurrentInstance.getCurrentInstanceName)("theme-props-resolver");
44
82
  const defaults = (0, _vue.inject)(_defaults.ORIGAM_DEFAULTS_KEY, (0, _vue.ref)({}));
45
- const ownKeys = themedKeysUnion.get(name);
46
- const globalKeys = themedKeysUnion.get("global");
47
- const providerOwnKeys = defaults.value?.[name];
48
- const providerGlobalKeys = defaults.value?.global;
49
- if (!ownKeys?.size && !globalKeys?.size && !providerOwnKeys && !providerGlobalKeys) return;
83
+ const targetKeys = collectTargetKeys(themedKeysUnion, defaults, name);
84
+ if (!targetKeys) return;
50
85
  const rawProps = instance.props;
51
- const targetKeys = ownKeys ? new Set(ownKeys) : /* @__PURE__ */new Set();
52
- if (globalKeys) for (const key of globalKeys) targetKeys.add(key);
53
- if (providerOwnKeys) for (const key in providerOwnKeys) targetKeys.add(key);
54
- if (providerGlobalKeys) for (const key in providerGlobalKeys) targetKeys.add(key);
55
86
  for (const key of targetKeys) {
56
87
  if (!(key in rawProps)) {
57
88
  (0, _color.warnUnsupportedProp)(name, key, `theme names this prop but <${name}> does not declare it`);
58
89
  continue;
59
90
  }
60
- const fallbackValue = (0, _vue.shallowRef)(rawProps[key]);
61
- let passedValue = passedPropValue(instance.vnode.props, key);
62
- Object.defineProperty(rawProps, key, {
63
- configurable: true,
64
- enumerable: true,
65
- get() {
66
- const fallback = fallbackValue.value;
67
- if (passedValue !== void 0) return passedValue;
68
- const componentDefaults = defaults.value?.[name];
69
- if (componentDefaults && componentDefaults[key] !== void 0) {
70
- return componentDefaults[key];
71
- }
72
- const globalDefaults = defaults.value?.global;
73
- if (globalDefaults && globalDefaults[key] !== void 0) {
74
- return globalDefaults[key];
75
- }
76
- return fallback;
77
- },
78
- set(value) {
79
- passedValue = passedPropValue(instance.vnode.props, key);
80
- fallbackValue.value = value;
81
- }
82
- });
91
+ patchThemedPropSlot(instance, defaults, name, key);
83
92
  }
84
93
  }
85
94
  });
@@ -28,6 +28,44 @@ function passedPropValue(vnodeProps, key) {
28
28
  }
29
29
  return void 0;
30
30
  }
31
+ function collectTargetKeys(themedKeysUnion, defaults, name) {
32
+ const ownKeys = themedKeysUnion.get(name);
33
+ const globalKeys = themedKeysUnion.get("global");
34
+ const providerOwnKeys = defaults.value?.[name];
35
+ const providerGlobalKeys = defaults.value?.global;
36
+ if (!ownKeys?.size && !globalKeys?.size && !providerOwnKeys && !providerGlobalKeys) return null;
37
+ const targetKeys = ownKeys ? new Set(ownKeys) : /* @__PURE__ */ new Set();
38
+ if (globalKeys) for (const key of globalKeys) targetKeys.add(key);
39
+ if (providerOwnKeys) for (const key in providerOwnKeys) targetKeys.add(key);
40
+ if (providerGlobalKeys) for (const key in providerGlobalKeys) targetKeys.add(key);
41
+ return targetKeys;
42
+ }
43
+ function patchThemedPropSlot(instance, defaults, name, key) {
44
+ const rawProps = instance.props;
45
+ const fallbackValue = shallowRef(rawProps[key]);
46
+ let wasPassed = passedPropValue(instance.vnode.props, key) !== void 0;
47
+ Object.defineProperty(rawProps, key, {
48
+ configurable: true,
49
+ enumerable: true,
50
+ get() {
51
+ const fallback = fallbackValue.value;
52
+ if (wasPassed) return fallback;
53
+ const componentDefaults = defaults.value?.[name];
54
+ if (componentDefaults && componentDefaults[key] !== void 0) {
55
+ return componentDefaults[key];
56
+ }
57
+ const globalDefaults = defaults.value?.global;
58
+ if (globalDefaults && globalDefaults[key] !== void 0) {
59
+ return globalDefaults[key];
60
+ }
61
+ return fallback;
62
+ },
63
+ set(value) {
64
+ wasPassed = passedPropValue(instance.vnode.props, key) !== void 0;
65
+ fallbackValue.value = value;
66
+ }
67
+ });
68
+ }
31
69
  export function installThemePropsResolver(app, themedKeysUnion) {
32
70
  app.mixin({
33
71
  beforeCreate() {
@@ -35,44 +73,15 @@ export function installThemePropsResolver(app, themedKeysUnion) {
35
73
  if (!instance) return;
36
74
  const name = getCurrentInstanceName("theme-props-resolver");
37
75
  const defaults = inject(ORIGAM_DEFAULTS_KEY, ref({}));
38
- const ownKeys = themedKeysUnion.get(name);
39
- const globalKeys = themedKeysUnion.get("global");
40
- const providerOwnKeys = defaults.value?.[name];
41
- const providerGlobalKeys = defaults.value?.global;
42
- if (!ownKeys?.size && !globalKeys?.size && !providerOwnKeys && !providerGlobalKeys) return;
76
+ const targetKeys = collectTargetKeys(themedKeysUnion, defaults, name);
77
+ if (!targetKeys) return;
43
78
  const rawProps = instance.props;
44
- const targetKeys = ownKeys ? new Set(ownKeys) : /* @__PURE__ */ new Set();
45
- if (globalKeys) for (const key of globalKeys) targetKeys.add(key);
46
- if (providerOwnKeys) for (const key in providerOwnKeys) targetKeys.add(key);
47
- if (providerGlobalKeys) for (const key in providerGlobalKeys) targetKeys.add(key);
48
79
  for (const key of targetKeys) {
49
80
  if (!(key in rawProps)) {
50
81
  warnUnsupportedProp(name, key, `theme names this prop but <${name}> does not declare it`);
51
82
  continue;
52
83
  }
53
- const fallbackValue = shallowRef(rawProps[key]);
54
- let passedValue = passedPropValue(instance.vnode.props, key);
55
- Object.defineProperty(rawProps, key, {
56
- configurable: true,
57
- enumerable: true,
58
- get() {
59
- const fallback = fallbackValue.value;
60
- if (passedValue !== void 0) return passedValue;
61
- const componentDefaults = defaults.value?.[name];
62
- if (componentDefaults && componentDefaults[key] !== void 0) {
63
- return componentDefaults[key];
64
- }
65
- const globalDefaults = defaults.value?.global;
66
- if (globalDefaults && globalDefaults[key] !== void 0) {
67
- return globalDefaults[key];
68
- }
69
- return fallback;
70
- },
71
- set(value) {
72
- passedValue = passedPropValue(instance.vnode.props, key);
73
- fallbackValue.value = value;
74
- }
75
- });
84
+ patchThemedPropSlot(instance, defaults, name, key);
76
85
  }
77
86
  }
78
87
  });
@@ -85,13 +85,13 @@ function useValidation(props, name = (0, _getCurrentInstance.getCurrentInstanceN
85
85
  });
86
86
  (0, _toggleScope.useToggleScope)(() => validateOn.value.input, () => {
87
87
  (0, _vue.watch)(validationModel, () => {
88
- if (validationModel.value != null) {
89
- validate();
90
- } else if (props.focused) {
88
+ if (validationModel.value == null && props.focused) {
91
89
  const unwatch = (0, _vue.watch)(() => props.focused, val => {
92
90
  if (!val) validate();
93
91
  unwatch();
94
92
  });
93
+ } else {
94
+ validate();
95
95
  }
96
96
  });
97
97
  });
@@ -90,13 +90,13 @@ export function useValidation(props, name = getCurrentInstanceName(), id = getUi
90
90
  });
91
91
  useToggleScope(() => validateOn.value.input, () => {
92
92
  watch(validationModel, () => {
93
- if (validationModel.value != null) {
94
- validate();
95
- } else if (props.focused) {
93
+ if (validationModel.value == null && props.focused) {
96
94
  const unwatch = watch(() => props.focused, (val) => {
97
95
  if (!val) validate();
98
96
  unwatch();
99
97
  });
98
+ } else {
99
+ validate();
100
100
  }
101
101
  });
102
102
  });
@@ -15,6 +15,17 @@ var _vue = require("vue");
15
15
  function useVirtual(props, items) {
16
16
  const display = (0, _display.useDisplay)();
17
17
  const goTo = (0, _goTo.useGoTo)();
18
+ const frames = /* @__PURE__ */new Set();
19
+ let raf = -1;
20
+ let disposed = false;
21
+ const scheduleFrame = cb => {
22
+ if (disposed || !_commons.IN_BROWSER) return;
23
+ const id = requestAnimationFrame(() => {
24
+ frames.delete(id);
25
+ cb();
26
+ });
27
+ frames.add(id);
28
+ };
18
29
  const itemHeight = (0, _vue.shallowRef)(0);
19
30
  (0, _vue.watchEffect)(() => {
20
31
  itemHeight.value = parseFloat(props.itemHeight || 0);
@@ -72,16 +83,21 @@ function useVirtual(props, items) {
72
83
  calculateVisibleItems();
73
84
  if (!~targetScrollIndex) return;
74
85
  (0, _vue.nextTick)(() => {
75
- if (_commons.IN_BROWSER) {
76
- window.requestAnimationFrame(() => {
77
- scrollToIndex(targetScrollIndex);
78
- targetScrollIndex = -1;
79
- });
80
- }
86
+ scheduleFrame(() => {
87
+ scrollToIndex(targetScrollIndex);
88
+ targetScrollIndex = -1;
89
+ });
81
90
  });
82
91
  });
83
92
  (0, _vue.onScopeDispose)(() => {
84
93
  updateOffsets.clear();
94
+ disposed = true;
95
+ for (const id of frames) cancelAnimationFrame(id);
96
+ frames.clear();
97
+ if (raf !== -1) {
98
+ cancelAnimationFrame(raf);
99
+ raf = -1;
100
+ }
85
101
  });
86
102
  const handleItemResize = (index, height) => {
87
103
  const prevHeight = sizes[index];
@@ -106,7 +122,7 @@ function useVirtual(props, items) {
106
122
  if (oldVal) {
107
123
  calculateVisibleItems();
108
124
  if (val < oldVal) {
109
- requestAnimationFrame(() => {
125
+ scheduleFrame(() => {
110
126
  scrollVelocity = 0;
111
127
  calculateVisibleItems();
112
128
  });
@@ -134,8 +150,8 @@ function useVirtual(props, items) {
134
150
  lastScrollTime = 0;
135
151
  calculateVisibleItems();
136
152
  };
137
- let raf = -1;
138
153
  const calculateVisibleItems = () => {
154
+ if (disposed || !_commons.IN_BROWSER) return;
139
155
  cancelAnimationFrame(raf);
140
156
  raf = requestAnimationFrame(calcVisibleItems);
141
157
  };
@@ -17,6 +17,17 @@ import { computed, nextTick, onMounted, onScopeDispose, ref, shallowRef, watch,
17
17
  export function useVirtual(props, items) {
18
18
  const display = useDisplay();
19
19
  const goTo = useGoTo();
20
+ const frames = /* @__PURE__ */ new Set();
21
+ let raf = -1;
22
+ let disposed = false;
23
+ const scheduleFrame = (cb) => {
24
+ if (disposed || !IN_BROWSER) return;
25
+ const id = requestAnimationFrame(() => {
26
+ frames.delete(id);
27
+ cb();
28
+ });
29
+ frames.add(id);
30
+ };
20
31
  const itemHeight = shallowRef(0);
21
32
  watchEffect(() => {
22
33
  itemHeight.value = parseFloat(props.itemHeight || 0);
@@ -67,16 +78,21 @@ export function useVirtual(props, items) {
67
78
  calculateVisibleItems();
68
79
  if (!~targetScrollIndex) return;
69
80
  nextTick(() => {
70
- if (IN_BROWSER) {
71
- window.requestAnimationFrame(() => {
72
- scrollToIndex(targetScrollIndex);
73
- targetScrollIndex = -1;
74
- });
75
- }
81
+ scheduleFrame(() => {
82
+ scrollToIndex(targetScrollIndex);
83
+ targetScrollIndex = -1;
84
+ });
76
85
  });
77
86
  });
78
87
  onScopeDispose(() => {
79
88
  updateOffsets.clear();
89
+ disposed = true;
90
+ for (const id of frames) cancelAnimationFrame(id);
91
+ frames.clear();
92
+ if (raf !== -1) {
93
+ cancelAnimationFrame(raf);
94
+ raf = -1;
95
+ }
80
96
  });
81
97
  const handleItemResize = (index, height) => {
82
98
  const prevHeight = sizes[index];
@@ -101,7 +117,7 @@ export function useVirtual(props, items) {
101
117
  if (oldVal) {
102
118
  calculateVisibleItems();
103
119
  if (val < oldVal) {
104
- requestAnimationFrame(() => {
120
+ scheduleFrame(() => {
105
121
  scrollVelocity = 0;
106
122
  calculateVisibleItems();
107
123
  });
@@ -129,8 +145,8 @@ export function useVirtual(props, items) {
129
145
  lastScrollTime = 0;
130
146
  calculateVisibleItems();
131
147
  };
132
- let raf = -1;
133
148
  const calculateVisibleItems = () => {
149
+ if (disposed || !IN_BROWSER) return;
134
150
  cancelAnimationFrame(raf);
135
151
  raf = requestAnimationFrame(calcVisibleItems);
136
152
  };
@@ -64,17 +64,11 @@ function bucketFill(heights, containerWidth, gap, columns, align = "top") {
64
64
  columns: cols
65
65
  };
66
66
  }
67
- function createResizeObserver(callback) {
67
+ function createResizeObserver(schedule, callback) {
68
68
  if (typeof window === "undefined" || typeof ResizeObserver === "undefined") {
69
69
  return null;
70
70
  }
71
- return new ResizeObserver(() => {
72
- if (typeof window !== "undefined") {
73
- window.requestAnimationFrame(callback);
74
- } else {
75
- callback();
76
- }
77
- });
71
+ return new ResizeObserver(() => schedule(callback));
78
72
  }
79
73
  function useMasonry(options) {
80
74
  const containerRef = (0, _vue.ref)(null);
@@ -86,6 +80,16 @@ function useMasonry(options) {
86
80
  });
87
81
  let containerObserver = null;
88
82
  let itemObserver = null;
83
+ const frames = /* @__PURE__ */new Set();
84
+ let disposed = false;
85
+ const scheduleFrame = cb => {
86
+ if (disposed || typeof window === "undefined") return;
87
+ const id = window.requestAnimationFrame(() => {
88
+ frames.delete(id);
89
+ cb();
90
+ });
91
+ frames.add(id);
92
+ };
89
93
  const setItem = (index, el) => {
90
94
  const previous = items.get(index);
91
95
  if (previous && previous !== el && itemObserver) {
@@ -124,17 +128,17 @@ function useMasonry(options) {
124
128
  }
125
129
  if (!container) return;
126
130
  if (!containerObserver) {
127
- containerObserver = createResizeObserver(relayout);
131
+ containerObserver = createResizeObserver(scheduleFrame, relayout);
128
132
  }
129
133
  if (!itemObserver) {
130
- itemObserver = createResizeObserver(relayout);
134
+ itemObserver = createResizeObserver(scheduleFrame, relayout);
131
135
  }
132
136
  if (containerObserver) containerObserver.observe(container);
133
137
  if (itemObserver) {
134
138
  for (const el of items.values()) itemObserver.observe(el);
135
139
  }
136
140
  if (typeof window !== "undefined") {
137
- window.requestAnimationFrame(relayout);
141
+ scheduleFrame(relayout);
138
142
  } else {
139
143
  relayout();
140
144
  }
@@ -142,6 +146,9 @@ function useMasonry(options) {
142
146
  immediate: false
143
147
  });
144
148
  (0, _vue.onBeforeUnmount)(() => {
149
+ disposed = true;
150
+ for (const id of frames) window.cancelAnimationFrame(id);
151
+ frames.clear();
145
152
  containerObserver?.disconnect();
146
153
  itemObserver?.disconnect();
147
154
  containerObserver = null;
@@ -56,17 +56,11 @@ export function bucketFill(heights, containerWidth, gap, columns, align = "top")
56
56
  columns: cols
57
57
  };
58
58
  }
59
- function createResizeObserver(callback) {
59
+ function createResizeObserver(schedule, callback) {
60
60
  if (typeof window === "undefined" || typeof ResizeObserver === "undefined") {
61
61
  return null;
62
62
  }
63
- return new ResizeObserver(() => {
64
- if (typeof window !== "undefined") {
65
- window.requestAnimationFrame(callback);
66
- } else {
67
- callback();
68
- }
69
- });
63
+ return new ResizeObserver(() => schedule(callback));
70
64
  }
71
65
  export function useMasonry(options) {
72
66
  const containerRef = ref(null);
@@ -78,6 +72,16 @@ export function useMasonry(options) {
78
72
  });
79
73
  let containerObserver = null;
80
74
  let itemObserver = null;
75
+ const frames = /* @__PURE__ */ new Set();
76
+ let disposed = false;
77
+ const scheduleFrame = (cb) => {
78
+ if (disposed || typeof window === "undefined") return;
79
+ const id = window.requestAnimationFrame(() => {
80
+ frames.delete(id);
81
+ cb();
82
+ });
83
+ frames.add(id);
84
+ };
81
85
  const setItem = (index, el) => {
82
86
  const previous = items.get(index);
83
87
  if (previous && previous !== el && itemObserver) {
@@ -122,17 +126,17 @@ export function useMasonry(options) {
122
126
  }
123
127
  if (!container) return;
124
128
  if (!containerObserver) {
125
- containerObserver = createResizeObserver(relayout);
129
+ containerObserver = createResizeObserver(scheduleFrame, relayout);
126
130
  }
127
131
  if (!itemObserver) {
128
- itemObserver = createResizeObserver(relayout);
132
+ itemObserver = createResizeObserver(scheduleFrame, relayout);
129
133
  }
130
134
  if (containerObserver) containerObserver.observe(container);
131
135
  if (itemObserver) {
132
136
  for (const el of items.values()) itemObserver.observe(el);
133
137
  }
134
138
  if (typeof window !== "undefined") {
135
- window.requestAnimationFrame(relayout);
139
+ scheduleFrame(relayout);
136
140
  } else {
137
141
  relayout();
138
142
  }
@@ -140,6 +144,9 @@ export function useMasonry(options) {
140
144
  { immediate: false }
141
145
  );
142
146
  onBeforeUnmount(() => {
147
+ disposed = true;
148
+ for (const id of frames) window.cancelAnimationFrame(id);
149
+ frames.clear();
143
150
  containerObserver?.disconnect();
144
151
  itemObserver?.disconnect();
145
152
  containerObserver = null;
@@ -219,7 +219,7 @@ function useParallaxRuntime(options) {
219
219
  host.addEventListener("mousemove", onMouseMove, {
220
220
  passive: true
221
221
  });
222
- requestAnimationFrame(tick);
222
+ rafId = requestAnimationFrame(tick);
223
223
  }
224
224
  });
225
225
  (0, _vue.onBeforeUnmount)(() => {
@@ -214,7 +214,7 @@ export function useParallaxRuntime(options) {
214
214
  window.addEventListener("resize", onScroll, { passive: true });
215
215
  if (!cssScrollDriven.value) {
216
216
  host.addEventListener("mousemove", onMouseMove, { passive: true });
217
- requestAnimationFrame(tick);
217
+ rafId = requestAnimationFrame(tick);
218
218
  }
219
219
  });
220
220
  onBeforeUnmount(() => {
@@ -528,6 +528,18 @@ Object.keys(_stateEffect).forEach(function (key) {
528
528
  }
529
529
  });
530
530
  });
531
+ var _accessibleCommand = require("./Commons/accessibleCommand.composable.cjs");
532
+ Object.keys(_accessibleCommand).forEach(function (key) {
533
+ if (key === "default" || key === "__esModule") return;
534
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
535
+ if (key in exports && exports[key] === _accessibleCommand[key]) return;
536
+ Object.defineProperty(exports, key, {
537
+ enumerable: true,
538
+ get: function () {
539
+ return _accessibleCommand[key];
540
+ }
541
+ });
542
+ });
531
543
  var _adjacent = require("./Commons/adjacent.composable.cjs");
532
544
  Object.keys(_adjacent).forEach(function (key) {
533
545
  if (key === "default" || key === "__esModule") return;
@@ -1512,6 +1524,18 @@ Object.keys(_mask).forEach(function (key) {
1512
1524
  }
1513
1525
  });
1514
1526
  });
1527
+ var _hotkey = require("./Commons/hotkey.composable.cjs");
1528
+ Object.keys(_hotkey).forEach(function (key) {
1529
+ if (key === "default" || key === "__esModule") return;
1530
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
1531
+ if (key in exports && exports[key] === _hotkey[key]) return;
1532
+ Object.defineProperty(exports, key, {
1533
+ enumerable: true,
1534
+ get: function () {
1535
+ return _hotkey[key];
1536
+ }
1537
+ });
1538
+ });
1515
1539
  var _qrCode = require("./QrCode/qr-code.composable.cjs");
1516
1540
  Object.keys(_qrCode).forEach(function (key) {
1517
1541
  if (key === "default" || key === "__esModule") return;
@@ -1549,6 +1573,18 @@ Object.keys(_useMediaPlayer).forEach(function (key) {
1549
1573
  });
1550
1574
  });
1551
1575
  var _videoPlayer = require("./Video/video-player.composable.cjs");
1576
+ var _useAudioPlayer = require("./Audio/use-audio-player.composable.cjs");
1577
+ Object.keys(_useAudioPlayer).forEach(function (key) {
1578
+ if (key === "default" || key === "__esModule") return;
1579
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
1580
+ if (key in exports && exports[key] === _useAudioPlayer[key]) return;
1581
+ Object.defineProperty(exports, key, {
1582
+ enumerable: true,
1583
+ get: function () {
1584
+ return _useAudioPlayer[key];
1585
+ }
1586
+ });
1587
+ });
1552
1588
  var _useWaveform = require("./Audio/use-waveform.composable.cjs");
1553
1589
  Object.keys(_useWaveform).forEach(function (key) {
1554
1590
  if (key === "default" || key === "__esModule") return;
@@ -41,6 +41,7 @@ export * from './Commons/link.composable';
41
41
  export * from './Commons/backButton.composable';
42
42
  export * from './Commons/scopeId.composable';
43
43
  export * from './Commons/stateEffect.composable';
44
+ export * from './Commons/accessibleCommand.composable';
44
45
  export * from './Commons/adjacent.composable';
45
46
  export * from './Commons/adjacentInner.composable';
46
47
  export * from './Commons/validation.composable';
@@ -123,6 +124,7 @@ export * from './TextareaField/textarea-field-rich.composable';
123
124
  export * from './Commons/cssSupport.composable';
124
125
  export * from './Commons/cssSupportClient.composable';
125
126
  export * from './Commons/mask.composable';
127
+ export * from './Commons/hotkey.composable';
126
128
  export * from './QrCode/qr-code.composable';
127
129
  export * from './Watermark/watermark.composable';
128
130
  export * from './Media/use-media-player.composable';
@@ -139,6 +141,7 @@ export * from './Media/use-media-player.composable';
139
141
  * `VIDEO_DEFAULT_PRELOAD` vit dans `src/consts/Video/video.const.ts`.
140
142
  ********************************************************/
141
143
  export { useVideoPlayer } from './Video/video-player.composable';
144
+ export * from './Audio/use-audio-player.composable';
142
145
  export * from './Audio/use-waveform.composable';
143
146
  export * from './Calendar/calendar.composable';
144
147
  export * from './Chart/chart.composable';
@@ -41,6 +41,7 @@ export * from "./Commons/link.composable.js";
41
41
  export * from "./Commons/backButton.composable.js";
42
42
  export * from "./Commons/scopeId.composable.js";
43
43
  export * from "./Commons/stateEffect.composable.js";
44
+ export * from "./Commons/accessibleCommand.composable.js";
44
45
  export * from "./Commons/adjacent.composable.js";
45
46
  export * from "./Commons/adjacentInner.composable.js";
46
47
  export * from "./Commons/validation.composable.js";
@@ -123,10 +124,12 @@ export * from "./TextareaField/textarea-field-rich.composable.js";
123
124
  export * from "./Commons/cssSupport.composable.js";
124
125
  export * from "./Commons/cssSupportClient.composable.js";
125
126
  export * from "./Commons/mask.composable.js";
127
+ export * from "./Commons/hotkey.composable.js";
126
128
  export * from "./QrCode/qr-code.composable.js";
127
129
  export * from "./Watermark/watermark.composable.js";
128
130
  export * from "./Media/use-media-player.composable.js";
129
131
  export { useVideoPlayer } from "./Video/video-player.composable.js";
132
+ export * from "./Audio/use-audio-player.composable.js";
130
133
  export * from "./Audio/use-waveform.composable.js";
131
134
  export * from "./Calendar/calendar.composable.js";
132
135
  export * from "./Chart/chart.composable.js";