@quidgest/ui 0.17.9 → 0.19.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.
Files changed (135) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/dist/json/api.json +302 -143
  3. package/dist/manifest/components.json +4 -1
  4. package/dist/ui.css +460 -167
  5. package/dist/ui.esm.js +618 -631
  6. package/dist/ui.js +490 -504
  7. package/dist/ui.min.css +1 -1
  8. package/dist/ui.min.js +490 -504
  9. package/dist/ui.scss +439 -167
  10. package/esm/components/QAccordion/QAccordionItem.vue.js +1 -0
  11. package/esm/components/QCarousel/QCarousel.vue.js +1 -1
  12. package/esm/components/QCheckbox/QCheckbox.d.ts.map +1 -1
  13. package/esm/components/QCheckbox/QCheckbox.vue.js +2 -0
  14. package/esm/components/QCollapsible/QCollapsible.d.ts +2 -1
  15. package/esm/components/QCollapsible/QCollapsible.d.ts.map +1 -1
  16. package/esm/components/QCollapsible/QCollapsible.vue.js +50 -47
  17. package/esm/components/QCollapsible/constants.d.ts +6 -0
  18. package/esm/components/QCollapsible/constants.d.ts.map +1 -1
  19. package/esm/components/QCollapsible/constants.js +3 -2
  20. package/esm/components/QCollapsible/index.d.ts +6 -0
  21. package/esm/components/QCollapsible/index.d.ts.map +1 -1
  22. package/esm/components/QCollapsible/types.d.ts +11 -1
  23. package/esm/components/QCollapsible/types.d.ts.map +1 -1
  24. package/esm/components/QDateTimePicker/QDateTimePicker.d.ts.map +1 -1
  25. package/esm/components/QDateTimePicker/QDateTimePicker.vue.js +505 -597
  26. package/esm/components/QDropdownMenu/QDropdownMenuContent.d.ts +32 -16
  27. package/esm/components/QDropdownMenu/QDropdownMenuContent.d.ts.map +1 -1
  28. package/esm/components/QDropdownMenu/QDropdownMenuContent.vue.js +179 -86
  29. package/esm/components/QDropdownMenu/types.d.ts +6 -0
  30. package/esm/components/QDropdownMenu/types.d.ts.map +1 -1
  31. package/esm/components/QField/types.d.ts +3 -0
  32. package/esm/components/QField/types.d.ts.map +1 -1
  33. package/esm/components/QGrid/QCol.vue.js +1 -1
  34. package/esm/components/QLabel/QLabel.d.ts.map +1 -1
  35. package/esm/components/QLabel/QLabel.vue.js +19 -17
  36. package/esm/components/QLabel/types.d.ts +3 -0
  37. package/esm/components/QLabel/types.d.ts.map +1 -1
  38. package/esm/components/{QGroupBox/QGroupBox.d.ts → QSection/QSection.d.ts} +4 -4
  39. package/esm/components/QSection/QSection.d.ts.map +1 -0
  40. package/esm/components/{QGroupBox/QGroupBox.vue.js → QSection/QSection.vue.js} +8 -8
  41. package/esm/components/QSection/QSection2.vue.js +5 -0
  42. package/esm/components/{QGroupBox → QSection}/index.d.ts +8 -8
  43. package/esm/components/QSection/index.d.ts.map +1 -0
  44. package/esm/components/QSection/index.js +6 -0
  45. package/esm/components/QSection/types.d.ts +32 -0
  46. package/esm/components/QSection/types.d.ts.map +1 -0
  47. package/esm/components/QSidebar/QSidebar.d.ts +53 -6
  48. package/esm/components/QSidebar/QSidebar.d.ts.map +1 -1
  49. package/esm/components/QSidebar/QSidebar.vue.js +76 -106
  50. package/esm/components/QSidebar/QSidebarAnchor.d.ts +24 -210
  51. package/esm/components/QSidebar/QSidebarAnchor.d.ts.map +1 -1
  52. package/esm/components/QSidebar/QSidebarAnchor.vue.js +47 -59
  53. package/esm/components/QSidebar/QSidebarItem.d.ts +213 -0
  54. package/esm/components/QSidebar/QSidebarItem.d.ts.map +1 -0
  55. package/esm/components/QSidebar/QSidebarItem.vue.js +130 -0
  56. package/esm/components/QSidebar/QSidebarItem2.vue.js +5 -0
  57. package/esm/components/QSidebar/QSidebarPanel.d.ts +1 -7
  58. package/esm/components/QSidebar/QSidebarPanel.d.ts.map +1 -1
  59. package/esm/components/QSidebar/QSidebarPanel.vue.js +4 -10
  60. package/esm/components/QSidebar/context.d.ts +108 -0
  61. package/esm/components/QSidebar/context.d.ts.map +1 -0
  62. package/esm/components/QSidebar/context.js +4 -0
  63. package/esm/components/QSidebar/index.d.ts +166 -8
  64. package/esm/components/QSidebar/index.d.ts.map +1 -1
  65. package/esm/components/QSidebar/index.js +3 -2
  66. package/esm/components/QSidebar/types.d.ts +77 -42
  67. package/esm/components/QSidebar/types.d.ts.map +1 -1
  68. package/esm/components/QTabs/QTab.d.ts +173 -0
  69. package/esm/components/QTabs/QTab.d.ts.map +1 -0
  70. package/esm/components/QTabs/QTab.vue.js +123 -0
  71. package/esm/components/QTabs/QTab2.vue.js +5 -0
  72. package/esm/components/QTabs/QTabs.d.ts +37 -0
  73. package/esm/components/QTabs/QTabs.d.ts.map +1 -0
  74. package/esm/components/QTabs/QTabs.vue.js +162 -0
  75. package/esm/components/QTabs/QTabs2.vue.js +5 -0
  76. package/esm/components/QTabs/constants.d.ts +5 -0
  77. package/esm/components/QTabs/constants.d.ts.map +1 -0
  78. package/esm/components/QTabs/context.d.ts +85 -0
  79. package/esm/components/QTabs/context.d.ts.map +1 -0
  80. package/esm/components/QTabs/context.js +4 -0
  81. package/esm/components/QTabs/index.d.ts +166 -0
  82. package/esm/components/QTabs/index.d.ts.map +1 -0
  83. package/esm/components/QTabs/index.js +7 -0
  84. package/esm/components/QTabs/types.d.ts +108 -0
  85. package/esm/components/QTabs/types.d.ts.map +1 -0
  86. package/esm/components/__internal__/QRequiredIndicator/QRequiredIndicator.d.ts +7 -0
  87. package/esm/components/__internal__/QRequiredIndicator/QRequiredIndicator.d.ts.map +1 -0
  88. package/esm/components/__internal__/QRequiredIndicator/QRequiredIndicator.vue.js +24 -0
  89. package/esm/components/__internal__/QRequiredIndicator/QRequiredIndicator2.vue.js +5 -0
  90. package/esm/components/__internal__/QRequiredIndicator/constants.d.ts +7 -0
  91. package/esm/components/__internal__/QRequiredIndicator/constants.d.ts.map +1 -0
  92. package/esm/components/__internal__/QRequiredIndicator/constants.js +4 -0
  93. package/esm/components/__internal__/QRequiredIndicator/index.d.ts +6 -0
  94. package/esm/components/__internal__/QRequiredIndicator/index.d.ts.map +1 -0
  95. package/esm/components/__internal__/QRequiredIndicator/index.js +6 -0
  96. package/esm/components/__internal__/QRequiredIndicator/types.d.ts +18 -0
  97. package/esm/components/__internal__/QRequiredIndicator/types.d.ts.map +1 -0
  98. package/esm/components/__internal__/QSafeTriangle/QSafeTriangle.d.ts +10 -0
  99. package/esm/components/__internal__/QSafeTriangle/QSafeTriangle.d.ts.map +1 -0
  100. package/esm/components/__internal__/QSafeTriangle/QSafeTriangle.vue.js +31 -0
  101. package/esm/components/__internal__/QSafeTriangle/QSafeTriangle2.vue.js +5 -0
  102. package/esm/components/__internal__/QSafeTriangle/index.d.ts +10 -0
  103. package/esm/components/__internal__/QSafeTriangle/index.d.ts.map +1 -0
  104. package/esm/components/__internal__/QSafeTriangle/index.js +6 -0
  105. package/esm/components/__internal__/QSafeTriangle/types.d.ts +33 -0
  106. package/esm/components/__internal__/QSafeTriangle/types.d.ts.map +1 -0
  107. package/esm/components/index.d.ts +2 -1
  108. package/esm/components/index.d.ts.map +1 -1
  109. package/esm/components/index.js +41 -37
  110. package/esm/composables/useSafeTriangle/index.d.ts +31 -0
  111. package/esm/composables/useSafeTriangle/index.d.ts.map +1 -0
  112. package/esm/composables/useSafeTriangle/index.js +87 -0
  113. package/esm/index.d.ts +4 -1
  114. package/esm/utils/date.d.ts +36 -1
  115. package/esm/utils/date.d.ts.map +1 -1
  116. package/esm/utils/date.js +90 -1
  117. package/esm/utils/index.d.ts +1 -0
  118. package/esm/utils/index.d.ts.map +1 -1
  119. package/esm/utils/index.js +30 -24
  120. package/esm/utils/mask.d.ts +17 -0
  121. package/esm/utils/mask.d.ts.map +1 -0
  122. package/esm/utils/mask.js +154 -0
  123. package/esm/utils/safeTriangle.d.ts +68 -0
  124. package/esm/utils/safeTriangle.d.ts.map +1 -0
  125. package/esm/utils/safeTriangle.js +83 -0
  126. package/package.json +7 -6
  127. package/esm/components/QGroupBox/QGroupBox.d.ts.map +0 -1
  128. package/esm/components/QGroupBox/QGroupBox2.vue.js +0 -5
  129. package/esm/components/QGroupBox/index.d.ts.map +0 -1
  130. package/esm/components/QGroupBox/index.js +0 -6
  131. package/esm/components/QGroupBox/types.d.ts +0 -32
  132. package/esm/components/QGroupBox/types.d.ts.map +0 -1
  133. package/esm/composables/useInputMask/index.d.ts +0 -50
  134. package/esm/composables/useInputMask/index.d.ts.map +0 -1
  135. package/esm/composables/useInputMask/index.js +0 -408
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,mBAAmB,CAAA;AACjC,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,WAAW,CAAA;AACzB,cAAc,qBAAqB,CAAA;AACnC,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,cAAc,eAAe,CAAA;AAC7B,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA;AAC7B,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,kBAAkB,CAAA;AAChC,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,WAAW,CAAA;AACzB,cAAc,YAA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cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA;AAChC,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,kBAAkB,CAAA;AAChC,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA"}
@@ -30,25 +30,26 @@ import { QDivider as F } from "./QDivider/index.js";
30
30
  import { QDropdownMenu as te } from "./QDropdownMenu/index.js";
31
31
  import { QFileUpload as I } from "./QFileUpload/index.js";
32
32
  import { QCol as L, QContainer as R, QRow as z, QSpacer as B } from "./QGrid/index.js";
33
- import { QGroupBox as V } from "./QGroupBox/index.js";
34
- import { QInputGroup as H } from "./QInputGroup/index.js";
35
- import { QLineLoader as U } from "./QLineLoader/index.js";
36
- import { QMeter as W } from "./QMeter/index.js";
37
- import { QObfuscation as G } from "./QObfuscation/index.js";
38
- import { QPasswordField as K } from "./QPasswordField/index.js";
39
- import { QPopover as q } from "./QPopover/index.js";
40
- import { QPropertyList as J, QPropertyListGroup as Y, QPropertyListPanel as X, QPropertyListRow as Z } from "./QPropertyList/index.js";
41
- import { QRadioButton as Q, QRadioGroup as $ } from "./QRadioGroup/index.js";
33
+ import { QInputGroup as V } from "./QInputGroup/index.js";
34
+ import { QLineLoader as H } from "./QLineLoader/index.js";
35
+ import { QMeter as U } from "./QMeter/index.js";
36
+ import { QObfuscation as W } from "./QObfuscation/index.js";
37
+ import { QPasswordField as G } from "./QPasswordField/index.js";
38
+ import { QPopover as K } from "./QPopover/index.js";
39
+ import { QPropertyList as q, QPropertyListGroup as J, QPropertyListPanel as Y, QPropertyListRow as X } from "./QPropertyList/index.js";
40
+ import { QRadioButton as Z, QRadioGroup as Q } from "./QRadioGroup/index.js";
41
+ import { QSection as $ } from "./QSection/index.js";
42
42
  import { QSelect as ne } from "./QSelect/index.js";
43
43
  import { QToggle as re } from "./QToggle/index.js";
44
- import { QSidebar as ie } from "./QSidebar/index.js";
45
- import { QTextArea as ae } from "./QTextArea/index.js";
46
- import { QThemeProvider as oe } from "./QThemeProvider/index.js";
47
- import { QToast as se, QToaster as ce } from "./QToast/index.js";
48
- import { QToggleGroup as le, QToggleGroupItem as ue } from "./QToggleGroup/index.js";
49
- import { QTooltip as de } from "./QTooltip/index.js";
44
+ import { QSidebar as ie, QSidebarItem as ae } from "./QSidebar/index.js";
45
+ import { QTab as oe, QTabs as se } from "./QTabs/index.js";
46
+ import { QTextArea as ce } from "./QTextArea/index.js";
47
+ import { QThemeProvider as le } from "./QThemeProvider/index.js";
48
+ import { QToast as ue, QToaster as de } from "./QToast/index.js";
49
+ import { QToggleGroup as fe, QToggleGroupItem as pe } from "./QToggleGroup/index.js";
50
+ import { QTooltip as me } from "./QTooltip/index.js";
50
51
  //#region src/components/index.ts
51
- var fe = /* @__PURE__ */ ee({
52
+ var he = /* @__PURE__ */ ee({
52
53
  DEFAULT_TEXTS: () => b,
53
54
  QAccordion: () => c,
54
55
  QAccordionItem: () => l,
@@ -76,44 +77,47 @@ var fe = /* @__PURE__ */ ee({
76
77
  QField: () => y,
77
78
  QFileUpload: () => I,
78
79
  QFocusWrap: () => D,
79
- QGroupBox: () => V,
80
80
  QIcon: () => r,
81
81
  QIconFont: () => i,
82
82
  QIconImg: () => a,
83
83
  QIconSvg: () => o,
84
- QInputGroup: () => H,
84
+ QInputGroup: () => V,
85
85
  QLabel: () => g,
86
- QLineLoader: () => U,
86
+ QLineLoader: () => H,
87
87
  QList: () => C,
88
88
  QListItem: () => w,
89
89
  QListItemGroup: () => T,
90
- QMeter: () => W,
91
- QObfuscation: () => G,
90
+ QMeter: () => U,
91
+ QObfuscation: () => W,
92
92
  QOverlay: () => O,
93
- QPasswordField: () => K,
94
- QPopover: () => q,
95
- QPropertyList: () => J,
96
- QPropertyListGroup: () => Y,
97
- QPropertyListPanel: () => X,
98
- QPropertyListRow: () => Z,
99
- QRadioButton: () => Q,
100
- QRadioGroup: () => $,
93
+ QPasswordField: () => G,
94
+ QPopover: () => K,
95
+ QPropertyList: () => q,
96
+ QPropertyListGroup: () => J,
97
+ QPropertyListPanel: () => Y,
98
+ QPropertyListRow: () => X,
99
+ QRadioButton: () => Z,
100
+ QRadioGroup: () => Q,
101
101
  QRow: () => z,
102
+ QSection: () => $,
102
103
  QSelect: () => ne,
103
104
  QSidebar: () => ie,
105
+ QSidebarItem: () => ae,
104
106
  QSkeletonLoader: () => m,
105
107
  QSpacer: () => B,
106
108
  QSpinnerLoader: () => e,
107
109
  QSwitch: () => A,
108
- QTextArea: () => ae,
110
+ QTab: () => oe,
111
+ QTabs: () => se,
112
+ QTextArea: () => ce,
109
113
  QTextField: () => x,
110
- QThemeProvider: () => oe,
111
- QToast: () => se,
112
- QToaster: () => ce,
114
+ QThemeProvider: () => le,
115
+ QToast: () => ue,
116
+ QToaster: () => de,
113
117
  QToggle: () => re,
114
- QToggleGroup: () => le,
115
- QToggleGroupItem: () => ue,
116
- QTooltip: () => de
118
+ QToggleGroup: () => fe,
119
+ QToggleGroupItem: () => pe,
120
+ QTooltip: () => me
117
121
  });
118
122
  //#endregion
119
- export { b as DEFAULT_TEXTS, c as QAccordion, l as QAccordionItem, u as QAvatar, f as QBadge, p as QBadgeIndicator, t as QButton, d as QButtonGroup, n as QCard, h as QCarousel, _ as QCheckbox, v as QCheckboxLabel, L as QCol, s as QCollapsible, S as QColorPicker, k as QCombobox, R as QContainer, j as QDateTimePicker, M as QDefaultsProvider, N as QDialog, P as QDialogProvider, E as QDismissibleLayer, F as QDivider, te as QDropdownMenu, y as QField, I as QFileUpload, D as QFocusWrap, V as QGroupBox, r as QIcon, i as QIconFont, a as QIconImg, o as QIconSvg, H as QInputGroup, g as QLabel, U as QLineLoader, C as QList, w as QListItem, T as QListItemGroup, W as QMeter, G as QObfuscation, O as QOverlay, K as QPasswordField, q as QPopover, J as QPropertyList, Y as QPropertyListGroup, X as QPropertyListPanel, Z as QPropertyListRow, Q as QRadioButton, $ as QRadioGroup, z as QRow, ne as QSelect, ie as QSidebar, m as QSkeletonLoader, B as QSpacer, e as QSpinnerLoader, A as QSwitch, ae as QTextArea, x as QTextField, oe as QThemeProvider, se as QToast, ce as QToaster, re as QToggle, le as QToggleGroup, ue as QToggleGroupItem, de as QTooltip, fe as components_exports };
123
+ export { b as DEFAULT_TEXTS, c as QAccordion, l as QAccordionItem, u as QAvatar, f as QBadge, p as QBadgeIndicator, t as QButton, d as QButtonGroup, n as QCard, h as QCarousel, _ as QCheckbox, v as QCheckboxLabel, L as QCol, s as QCollapsible, S as QColorPicker, k as QCombobox, R as QContainer, j as QDateTimePicker, M as QDefaultsProvider, N as QDialog, P as QDialogProvider, E as QDismissibleLayer, F as QDivider, te as QDropdownMenu, y as QField, I as QFileUpload, D as QFocusWrap, r as QIcon, i as QIconFont, a as QIconImg, o as QIconSvg, V as QInputGroup, g as QLabel, H as QLineLoader, C as QList, w as QListItem, T as QListItemGroup, U as QMeter, W as QObfuscation, O as QOverlay, G as QPasswordField, K as QPopover, q as QPropertyList, J as QPropertyListGroup, Y as QPropertyListPanel, X as QPropertyListRow, Z as QRadioButton, Q as QRadioGroup, z as QRow, $ as QSection, ne as QSelect, ie as QSidebar, ae as QSidebarItem, m as QSkeletonLoader, B as QSpacer, e as QSpinnerLoader, A as QSwitch, oe as QTab, se as QTabs, ce as QTextArea, x as QTextField, le as QThemeProvider, ue as QToast, de as QToaster, re as QToggle, fe as QToggleGroup, pe as QToggleGroupItem, me as QTooltip, he as components_exports };
@@ -0,0 +1,31 @@
1
+ import { Placement } from '../overlay';
2
+ import { Ref } from 'vue';
3
+ type UseSafeTriangleOptions = {
4
+ enabled: Ref<boolean>;
5
+ placement: Ref<Placement>;
6
+ getParentRect: () => DOMRect | null;
7
+ getContentRect: () => DOMRect | null;
8
+ getContentRoot: () => HTMLElement | null;
9
+ shouldSuppressLeave: () => boolean;
10
+ onLeave: () => void;
11
+ /** Called when the pointer enters the open submenu (or a deeper nested menu). */
12
+ onEnterContent?: (clientX: number, clientY: number) => void;
13
+ };
14
+ /**
15
+ * Tracks pointer movement and exposes safe triangle geometry for nested submenus.
16
+ */
17
+ export declare function useSafeTriangle(options: UseSafeTriangleOptions): {
18
+ visible: Ref<boolean, boolean>;
19
+ top: Ref<number, number>;
20
+ left: Ref<number, number>;
21
+ width: Ref<number, number>;
22
+ height: Ref<number, number>;
23
+ path: Ref<string, string>;
24
+ refresh: (clientX?: number, clientY?: number) => void;
25
+ getLastPointer: () => {
26
+ x: number;
27
+ y: number;
28
+ };
29
+ };
30
+ export {};
31
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/composables/useSafeTriangle/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAW3C,OAAO,EAA+B,KAAK,GAAG,EAAE,MAAM,KAAK,CAAA;AAE3D,KAAK,sBAAsB,GAAG;IAC7B,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;IACrB,SAAS,EAAE,GAAG,CAAC,SAAS,CAAC,CAAA;IACzB,aAAa,EAAE,MAAM,OAAO,GAAG,IAAI,CAAA;IACnC,cAAc,EAAE,MAAM,OAAO,GAAG,IAAI,CAAA;IACpC,cAAc,EAAE,MAAM,WAAW,GAAG,IAAI,CAAA;IACxC,mBAAmB,EAAE,MAAM,OAAO,CAAA;IAClC,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,iFAAiF;IACjF,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CAC3D,CAAA;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,sBAAsB;;;;;;;wBA4HnC,MAAM,YAAY,MAAM;;;;;EA0DnD"}
@@ -0,0 +1,87 @@
1
+ import { getSafeTriangleGeometry as e, isPointInRect as t, isPointerInsideMenuTree as n, isPointerMovingTowardSubmenu as r, resolveSafeTrianglePlacement as i } from "../../utils/safeTriangle.js";
2
+ import { onBeforeUnmount as a, ref as o, watch as s } from "vue";
3
+ //#region src/composables/useSafeTriangle/index.ts
4
+ function c(c) {
5
+ let l = o(!1), u = o(0), d = o(0), f = o(0), p = o(0), m = o(""), h = !1, g = {
6
+ x: 0,
7
+ y: 0
8
+ }, _ = null, v = !1;
9
+ function y(e, t) {
10
+ return i(c.placement.value, e, t);
11
+ }
12
+ function b(t, n, r, i) {
13
+ if (!i) {
14
+ l.value = !1;
15
+ return;
16
+ }
17
+ let a = e(y(r, i), i, t, n);
18
+ if (!a) {
19
+ l.value = !1;
20
+ return;
21
+ }
22
+ l.value = !0, u.value = a.top, d.value = a.left, f.value = a.width, p.value = a.height, m.value = a.path;
23
+ }
24
+ function x(e, r) {
25
+ let i = c.getContentRect(), a = c.getContentRoot();
26
+ return i !== null && t(e, r, i) || a !== null && n(e, r, a);
27
+ }
28
+ function S(e, n) {
29
+ let i = c.getParentRect(), a = c.getContentRect(), o = c.getContentRoot();
30
+ if (x(e, n)) {
31
+ l.value = !1, v || c.onEnterContent?.(e, n), v = !0;
32
+ return;
33
+ }
34
+ if (v = !1, i && t(e, n, i)) {
35
+ _ = {
36
+ x: e,
37
+ y: n
38
+ }, b(e, n, i, a);
39
+ return;
40
+ }
41
+ if (!a || !_) {
42
+ l.value = !1;
43
+ return;
44
+ }
45
+ if (!r(e, n, i, a, y(i, a), _, o)) {
46
+ l.value = !1, c.shouldSuppressLeave() || c.onLeave();
47
+ return;
48
+ }
49
+ b(_.x, _.y, i, a);
50
+ }
51
+ function C(e) {
52
+ g = {
53
+ x: e.clientX,
54
+ y: e.clientY
55
+ }, c.enabled.value && S(e.clientX, e.clientY);
56
+ }
57
+ function w(e, t) {
58
+ e !== void 0 && t !== void 0 && (g = {
59
+ x: e,
60
+ y: t
61
+ }), c.enabled.value && S(g.x, g.y);
62
+ }
63
+ function T() {
64
+ h || (h = !0, document.addEventListener("pointermove", C, !0));
65
+ }
66
+ function E() {
67
+ h && (h = !1, document.removeEventListener("pointermove", C, !0), l.value = !1, v = !1, _ = null);
68
+ }
69
+ return s(c.enabled, (e) => {
70
+ if (e) {
71
+ v = !1;
72
+ let e = c.getParentRect();
73
+ _ = e && t(g.x, g.y, e) ? { ...g } : null, T(), w();
74
+ } else E();
75
+ }, { immediate: !0 }), a(E), {
76
+ visible: l,
77
+ top: u,
78
+ left: d,
79
+ width: f,
80
+ height: p,
81
+ path: m,
82
+ refresh: w,
83
+ getLastPointer: () => ({ ...g })
84
+ };
85
+ }
86
+ //#endregion
87
+ export { c as useSafeTriangle };
package/esm/index.d.ts CHANGED
@@ -36,7 +36,6 @@ declare module '@vue/runtime-core' {
36
36
  QContainer: typeof import('@quidgest/ui/components')['QContainer']
37
37
  QRow: typeof import('@quidgest/ui/components')['QRow']
38
38
  QSpacer: typeof import('@quidgest/ui/components')['QSpacer']
39
- QGroupBox: typeof import('@quidgest/ui/components')['QGroupBox']
40
39
  QIcon: typeof import('@quidgest/ui/components')['QIcon']
41
40
  QIconFont: typeof import('@quidgest/ui/components')['QIconFont']
42
41
  QIconImg: typeof import('@quidgest/ui/components')['QIconImg']
@@ -58,11 +57,15 @@ declare module '@vue/runtime-core' {
58
57
  QPropertyListPanel: typeof import('@quidgest/ui/components')['QPropertyListPanel']
59
58
  QRadioButton: typeof import('@quidgest/ui/components')['QRadioButton']
60
59
  QRadioGroup: typeof import('@quidgest/ui/components')['QRadioGroup']
60
+ QSection: typeof import('@quidgest/ui/components')['QSection']
61
61
  QSelect: typeof import('@quidgest/ui/components')['QSelect']
62
62
  QSidebar: typeof import('@quidgest/ui/components')['QSidebar']
63
+ QSidebarItem: typeof import('@quidgest/ui/components')['QSidebarItem']
63
64
  QSkeletonLoader: typeof import('@quidgest/ui/components')['QSkeletonLoader']
64
65
  QSpinnerLoader: typeof import('@quidgest/ui/components')['QSpinnerLoader']
65
66
  QSwitch: typeof import('@quidgest/ui/components')['QSwitch']
67
+ QTabs: typeof import('@quidgest/ui/components')['QTabs']
68
+ QTab: typeof import('@quidgest/ui/components')['QTab']
66
69
  QTextArea: typeof import('@quidgest/ui/components')['QTextArea']
67
70
  QTextField: typeof import('@quidgest/ui/components')['QTextField']
68
71
  DEFAULT_TEXTS: typeof import('@quidgest/ui/components')['DEFAULT_TEXTS']
@@ -2,7 +2,7 @@
2
2
  * Converts a date format pattern to an input mask pattern.
3
3
  * Supports numeric, textual, weekday, meridiem, milliseconds and quoted literal tokens.
4
4
  * @param format Date format pattern (e.g. `dd/MM/yyyy HH:mm`).
5
- * @returns Mask string consumed by `useInputMask`.
5
+ * @returns Mask string.
6
6
  * @example
7
7
  * convertDatePatternToMask('dd/MM/yyyy') => '##/##/####'
8
8
  * convertDatePatternToMask('HH:mm:ss') => '##:##:##'
@@ -193,4 +193,39 @@ export declare function getFirstDayOfMonth(date: Date): Date;
193
193
  * @returns New date set to the last day of that month.
194
194
  */
195
195
  export declare function getLastDayOfMonth(date: Date): Date;
196
+ /**
197
+ * Advances the value cursor past a format literal when it is present in the input.
198
+ * @param value Date formatted string.
199
+ * @param cursor The position of the cursor in value.
200
+ * @param token A string that represents part of the date format (ex. 'yyyy', 'MM', 'dd').
201
+ * @returns Updated cursor, or `null` when the literal is not yet in the value.
202
+ */
203
+ export declare function advancePastFormatLiteral(value: string, cursor: number, token: string): number | null;
204
+ /**
205
+ * Get the string value of the part of the datetime within it's range of possible valid values
206
+ * and padded to the specified number of digits.
207
+ * @param token A string that represents part of the date format (ex. 'yyyy', 'MM', 'dd').
208
+ * @param digits A string of digit characters that represents part of a datetime value (year, month, day etc.)
209
+ * @param value The actual numeric value of a part of a datetime (year, month, day etc.)
210
+ * @returns Normalized string value of the part of the datetime.
211
+ */
212
+ export declare function normalizeNumericToken(token: string, digits: string, value: number): string;
213
+ /**
214
+ * Get the string value of the datetime where the day is guaranteed to be within it's range of valid values.
215
+ * @param value Date formatted string.
216
+ * @param tokens Strings that represent parts of the date format (ex. 'yyyy', 'MM', 'dd').
217
+ * @returns String value of the datetime with the day clamped to it's maximum possible value.
218
+ */
219
+ export declare function clampDayByMonthYear(value: string, tokens: string[]): string;
220
+ /**
221
+ * Clamps fully-typed numeric segments to valid ranges for the provided format.
222
+ * @param value Masked user input.
223
+ * @param format Date/time format pattern.
224
+ * @param options Options
225
+ * @param options.padMaxDigits Whether to pad each segment to it's maximum digits
226
+ * @returns Input with out-of-range numeric segments normalized.
227
+ */
228
+ export declare function clampNumericSegments(value: string, format: string, options?: {
229
+ padMaxDigits: boolean;
230
+ }): string;
196
231
  //# sourceMappingURL=date.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../src/utils/date.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAqE/D;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAExD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAExD;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,GAAE,MAAU,GAAG,MAAM,CAE1E;AAKD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAMzD;AAyCD;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EA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AI,EAAE,IAAI,GAAG,IAAI,CAEnD;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAElD;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACvC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACX,MAAM,GAAG,IAAI,CAiBf;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAuB1F;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CA6D3E;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CACnC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE;IAAE,YAAY,EAAE,OAAO,CAAA;CAAE,GACjC,MAAM,CAwER"}
package/esm/utils/date.js CHANGED
@@ -476,5 +476,94 @@ function T(e) {
476
476
  function E(e) {
477
477
  return new Date(e.getFullYear(), e.getMonth() + 1, 0);
478
478
  }
479
+ function D(e, t, n) {
480
+ if (n.startsWith("'")) {
481
+ let r = n.slice(1, -1).replace(/''/g, "'");
482
+ return e.slice(t).startsWith(r) ? t + r.length : null;
483
+ }
484
+ if (n === "a") {
485
+ let n = e.slice(t), r = n.match(/^\s*(AM|PM)/i);
486
+ return r ? t + r[0].length : n.startsWith(" ") ? t + 1 : null;
487
+ }
488
+ return t >= e.length || e[t] !== n ? null : t + 1;
489
+ }
490
+ function O(e, t, n) {
491
+ let r = n;
492
+ return (e === "MM" || e === "M") && (r = Math.min(12, Math.max(1, n))), (e === "dd" || e === "d") && (r = Math.min(31, Math.max(1, n))), (e === "HH" || e === "H") && (r = Math.min(23, Math.max(0, n))), (e === "hh" || e === "h") && (r = Math.min(12, Math.max(1, n))), (e === "mm" || e === "m" || e === "ss" || e === "s") && (r = Math.min(59, Math.max(0, n))), t.length > 1 ? a(r, t.length) : r === 0 && (e === "hh" || e === "h" || e === "MM" || e === "M" || e === "dd" || e === "d") ? "1" : String(r);
493
+ }
494
+ function k(e, t) {
495
+ let n = null, r = null, i = -1, o = 0, s = null, c = 0;
496
+ for (let a of t) {
497
+ if (a.startsWith("'")) {
498
+ let t = D(e, c, a);
499
+ if (t === null) break;
500
+ c = t;
501
+ continue;
502
+ }
503
+ let t = a === "yyyy" ? 4 : a === "yy" || [
504
+ "MM",
505
+ "dd",
506
+ "M",
507
+ "d"
508
+ ].includes(a) ? 2 : 0;
509
+ if (t === 0) {
510
+ let t = D(e, c, a);
511
+ if (t === null) break;
512
+ c = t;
513
+ continue;
514
+ }
515
+ let l = e.slice(c).match(/^\d+/)?.[0]?.slice(0, t) ?? "";
516
+ if (!l) continue;
517
+ let u = c + l.length;
518
+ if (!(l.length === t || u < e.length && !/\d/.test(e[u]))) continue;
519
+ let d = Number.parseInt(l, 10);
520
+ Number.isNaN(d) || ((a === "MM" || a === "M") && (n = Math.min(12, Math.max(1, d))), a === "yyyy" && (r = d), a === "yy" && (r = d < 50 ? 2e3 + d : 1900 + d), (a === "dd" || a === "d") && (i = c, o = l.length, s = Math.max(1, d)), c = u);
521
+ }
522
+ if (i < 0 || s === null || n === null || r === null) return e;
523
+ let l = h(n - 1, r);
524
+ if (s <= l) return e;
525
+ let u = o > 1 ? a(l, o) : String(l);
526
+ return `${e.slice(0, i)}${u}${e.slice(i + o)}`;
527
+ }
528
+ function A(e, t, n) {
529
+ let r = t.match(/yyyy|yy|MMMM|MMM|MM|M|dd|d|EEEE|EEE|HH|H|hh|h|mm|m|ss|s|SSS|S|a|'(?:''|[^'])*'|./g) ?? [], i = e, o = 0;
530
+ for (let e of r) {
531
+ if (e.startsWith("'")) {
532
+ let t = D(i, o, e);
533
+ if (t === null) break;
534
+ o = t;
535
+ continue;
536
+ }
537
+ let t = e === "yyyy" ? 4 : e === "yy" ? 2 : e === "SSS" ? 3 : e === "S" ? 1 : [
538
+ "MM",
539
+ "dd",
540
+ "HH",
541
+ "hh",
542
+ "mm",
543
+ "ss",
544
+ "M",
545
+ "d",
546
+ "H",
547
+ "h",
548
+ "m",
549
+ "s"
550
+ ].includes(e) ? 2 : 0;
551
+ if (t === 0) {
552
+ let t = D(i, o, e);
553
+ if (t === null) break;
554
+ o = t;
555
+ continue;
556
+ }
557
+ let r = i.slice(o).match(/^\d+/)?.[0]?.slice(0, t) ?? "";
558
+ if (!r) continue;
559
+ let s = o + r.length;
560
+ if (!(r.length === t || s < i.length && !/\d/.test(i[s]))) continue;
561
+ let c = Number.parseInt(r, 10);
562
+ if (Number.isNaN(c)) continue;
563
+ let l = O(e, n?.padMaxDigits ? a(r, t) : r, c);
564
+ i = `${i.slice(0, o)}${l}${i.slice(s)}`, o += l.length;
565
+ }
566
+ return k(i, r);
567
+ }
479
568
  //#endregion
480
- export { C as addDays, w as addMonths, d as completePartialDateInput, e as convertDatePatternToMask, y as formatDate, n as formatUsesSeconds, t as formatUsesTime, h as getDaysInMonth, S as getEndOfDay, T as getFirstDayOfMonth, g as getFirstDayOfWeek, E as getLastDayOfMonth, x as getStartOfDay, f as inputIncludesTimePortion, v as isBetween, m as isLeapYear, _ as isSameDay, i as isTimeOnlyFormat, a as padNumber, b as parseDate, p as parseDateWithCompletion, s as parseIsoDate, r as uses12HourFormat };
569
+ export { C as addDays, w as addMonths, D as advancePastFormatLiteral, k as clampDayByMonthYear, A as clampNumericSegments, d as completePartialDateInput, e as convertDatePatternToMask, y as formatDate, n as formatUsesSeconds, t as formatUsesTime, h as getDaysInMonth, S as getEndOfDay, T as getFirstDayOfMonth, g as getFirstDayOfWeek, E as getLastDayOfMonth, x as getStartOfDay, f as inputIncludesTimePortion, v as isBetween, m as isLeapYear, _ as isSameDay, i as isTimeOnlyFormat, O as normalizeNumericToken, a as padNumber, b as parseDate, p as parseDateWithCompletion, s as parseIsoDate, r as uses12HourFormat };
@@ -16,4 +16,5 @@
16
16
  */
17
17
  export * from './color';
18
18
  export * from './date';
19
+ export * from './mask';
19
20
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,cAAc,SAAS,CAAA;AACvB,cAAc,QAAQ,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,cAAc,SAAS,CAAA;AACvB,cAAc,QAAQ,CAAA;AACtB,cAAc,QAAQ,CAAA"}
@@ -4,45 +4,51 @@ import { isValidHex as o, parseColor as s, tryParseRgb as c } from "./color/pars
4
4
  import { getComplementaryColor as l, getContrastingColor as u } from "./color/contrast.js";
5
5
  import { darken as d, lighten as f } from "./color/manipulate.js";
6
6
  import { mergeColorSchemes as p } from "./color/merge.js";
7
- import { addDays as m, addMonths as h, completePartialDateInput as g, convertDatePatternToMask as _, formatDate as v, formatUsesSeconds as y, formatUsesTime as b, getDaysInMonth as x, getEndOfDay as S, getFirstDayOfMonth as C, getFirstDayOfWeek as w, getLastDayOfMonth as T, getStartOfDay as E, inputIncludesTimePortion as D, isBetween as O, isLeapYear as k, isSameDay as A, isTimeOnlyFormat as j, padNumber as M, parseDate as N, parseDateWithCompletion as P, parseIsoDate as F, uses12HourFormat as I } from "./date.js";
7
+ import { addDays as m, addMonths as h, advancePastFormatLiteral as g, clampDayByMonthYear as _, clampNumericSegments as v, completePartialDateInput as y, convertDatePatternToMask as b, formatDate as x, formatUsesSeconds as S, formatUsesTime as C, getDaysInMonth as w, getEndOfDay as T, getFirstDayOfMonth as E, getFirstDayOfWeek as D, getLastDayOfMonth as O, getStartOfDay as k, inputIncludesTimePortion as A, isBetween as j, isLeapYear as M, isSameDay as N, isTimeOnlyFormat as P, normalizeNumericToken as F, padNumber as I, parseDate as L, parseDateWithCompletion as R, parseIsoDate as z, uses12HourFormat as B } from "./date.js";
8
+ import { applyMask as V } from "./mask.js";
8
9
  //#region src/utils/index.ts
9
- var L = /* @__PURE__ */ e({
10
+ var H = /* @__PURE__ */ e({
10
11
  addDays: () => m,
11
12
  addMonths: () => h,
12
- completePartialDateInput: () => g,
13
- convertDatePatternToMask: () => _,
13
+ advancePastFormatLiteral: () => g,
14
+ applyMask: () => V,
15
+ clampDayByMonthYear: () => _,
16
+ clampNumericSegments: () => v,
17
+ completePartialDateInput: () => y,
18
+ convertDatePatternToMask: () => b,
14
19
  darken: () => d,
15
- formatDate: () => v,
16
- formatUsesSeconds: () => y,
17
- formatUsesTime: () => b,
20
+ formatDate: () => x,
21
+ formatUsesSeconds: () => S,
22
+ formatUsesTime: () => C,
18
23
  getComplementaryColor: () => l,
19
24
  getContrastingColor: () => u,
20
- getDaysInMonth: () => x,
21
- getEndOfDay: () => S,
22
- getFirstDayOfMonth: () => C,
23
- getFirstDayOfWeek: () => w,
24
- getLastDayOfMonth: () => T,
25
- getStartOfDay: () => E,
25
+ getDaysInMonth: () => w,
26
+ getEndOfDay: () => T,
27
+ getFirstDayOfMonth: () => E,
28
+ getFirstDayOfWeek: () => D,
29
+ getLastDayOfMonth: () => O,
30
+ getStartOfDay: () => k,
26
31
  hslToRgb: () => t,
27
32
  hueToRgb: () => n,
28
- inputIncludesTimePortion: () => D,
29
- isBetween: () => O,
30
- isLeapYear: () => k,
31
- isSameDay: () => A,
32
- isTimeOnlyFormat: () => j,
33
+ inputIncludesTimePortion: () => A,
34
+ isBetween: () => j,
35
+ isLeapYear: () => M,
36
+ isSameDay: () => N,
37
+ isTimeOnlyFormat: () => P,
33
38
  isValidHex: () => o,
34
39
  lighten: () => f,
35
40
  mergeColorSchemes: () => p,
36
- padNumber: () => M,
41
+ normalizeNumericToken: () => F,
42
+ padNumber: () => I,
37
43
  parseColor: () => s,
38
- parseDate: () => N,
39
- parseDateWithCompletion: () => P,
40
- parseIsoDate: () => F,
44
+ parseDate: () => L,
45
+ parseDateWithCompletion: () => R,
46
+ parseIsoDate: () => z,
41
47
  rgbToHex: () => r,
42
48
  rgbToHsl: () => i,
43
49
  rgbToVariableString: () => a,
44
50
  tryParseRgb: () => c,
45
- uses12HourFormat: () => I
51
+ uses12HourFormat: () => B
46
52
  });
47
53
  //#endregion
48
- export { m as addDays, h as addMonths, g as completePartialDateInput, _ as convertDatePatternToMask, d as darken, v as formatDate, y as formatUsesSeconds, b as formatUsesTime, l as getComplementaryColor, u as getContrastingColor, x as getDaysInMonth, S as getEndOfDay, C as getFirstDayOfMonth, w as getFirstDayOfWeek, T as getLastDayOfMonth, E as getStartOfDay, t as hslToRgb, n as hueToRgb, D as inputIncludesTimePortion, O as isBetween, k as isLeapYear, A as isSameDay, j as isTimeOnlyFormat, o as isValidHex, f as lighten, p as mergeColorSchemes, M as padNumber, s as parseColor, N as parseDate, P as parseDateWithCompletion, F as parseIsoDate, r as rgbToHex, i as rgbToHsl, a as rgbToVariableString, c as tryParseRgb, I as uses12HourFormat, L as utils_exports };
54
+ export { m as addDays, h as addMonths, g as advancePastFormatLiteral, V as applyMask, _ as clampDayByMonthYear, v as clampNumericSegments, y as completePartialDateInput, b as convertDatePatternToMask, d as darken, x as formatDate, S as formatUsesSeconds, C as formatUsesTime, l as getComplementaryColor, u as getContrastingColor, w as getDaysInMonth, T as getEndOfDay, E as getFirstDayOfMonth, D as getFirstDayOfWeek, O as getLastDayOfMonth, k as getStartOfDay, t as hslToRgb, n as hueToRgb, A as inputIncludesTimePortion, j as isBetween, M as isLeapYear, N as isSameDay, P as isTimeOnlyFormat, o as isValidHex, f as lighten, p as mergeColorSchemes, F as normalizeNumericToken, I as padNumber, s as parseColor, L as parseDate, R as parseDateWithCompletion, z as parseIsoDate, r as rgbToHex, i as rgbToHsl, a as rgbToVariableString, c as tryParseRgb, B as uses12HourFormat, H as utils_exports };
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Applies a mask pattern to an input value.
3
+ * The mask supports:
4
+ * - `#` / `n`: single numeric digit
5
+ * - `A`: single alphabetic character, normalized to uppercase
6
+ * - `a`: single alphabetic character, normalized to lowercase
7
+ * - `p`: meridiem token (`AM` or `PM` only)
8
+ * - `W`: variable-width alphabetic segment
9
+ * - any other character: fixed separator/literal
10
+ * @param value Raw user input.
11
+ * @param maskPattern Mask to apply.
12
+ * @returns Masked value normalized to the provided pattern.
13
+ * @example
14
+ * applyMask('1234567', '##/##/####') => '12/34/567'
15
+ */
16
+ export declare function applyMask(value: string, maskPattern: string): string;
17
+ //# sourceMappingURL=mask.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mask.d.ts","sourceRoot":"","sources":["../../src/utils/mask.ts"],"names":[],"mappings":"AA0MA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAsGpE"}