ku4web-components 6.4.85 → 6.4.87

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 (194) hide show
  1. package/dist/cjs/ku4-carousel-controls.cjs.entry.js +2 -2
  2. package/dist/cjs/ku4-carousel-slide.cjs.entry.js +1 -1
  3. package/dist/cjs/ku4-carousel.cjs.entry.js +3 -3
  4. package/dist/cjs/ku4-col.cjs.entry.js +1 -1
  5. package/dist/cjs/ku4-drawer.cjs.entry.js +1 -1
  6. package/dist/cjs/ku4-feature.cjs.entry.js +2 -2
  7. package/dist/cjs/ku4-focus-trap.cjs.entry.js +26 -26
  8. package/dist/cjs/ku4-form.cjs.entry.js +3 -3
  9. package/dist/cjs/ku4-grid.cjs.entry.js +1 -1
  10. package/dist/cjs/ku4-label.cjs.entry.js +2 -2
  11. package/dist/cjs/ku4-mask.cjs.entry.js +3 -3
  12. package/dist/cjs/ku4-modal.cjs.entry.js +9 -4
  13. package/dist/cjs/ku4-panel.cjs.entry.js +1 -1
  14. package/dist/cjs/ku4-preview.cjs.entry.js +14 -43
  15. package/dist/cjs/ku4-tab-list.cjs.entry.js +4 -4
  16. package/dist/cjs/ku4-tab-panel.cjs.entry.js +3 -3
  17. package/dist/cjs/ku4-tab.cjs.entry.js +3 -3
  18. package/dist/cjs/ku4-table.cjs.entry.js +1 -1
  19. package/dist/cjs/ku4-tooltip.cjs.entry.js +2 -2
  20. package/dist/cjs/ku4-validation.cjs.entry.js +2 -2
  21. package/dist/cjs/ku4web-components.cjs.js +7 -102
  22. package/dist/cjs/loader.cjs.js +2 -18
  23. package/dist/esm/ku4-carousel-controls.entry.js +2 -2
  24. package/dist/esm/ku4-carousel-slide.entry.js +1 -1
  25. package/dist/esm/ku4-carousel.entry.js +3 -3
  26. package/dist/esm/ku4-col.entry.js +1 -1
  27. package/dist/esm/ku4-drawer.entry.js +1 -1
  28. package/dist/esm/ku4-feature.entry.js +2 -2
  29. package/dist/esm/ku4-focus-trap.entry.js +3 -3
  30. package/dist/esm/ku4-form.entry.js +3 -3
  31. package/dist/esm/ku4-grid.entry.js +1 -1
  32. package/dist/esm/ku4-label.entry.js +2 -2
  33. package/dist/esm/ku4-mask.entry.js +3 -3
  34. package/dist/esm/ku4-modal.entry.js +9 -4
  35. package/dist/esm/ku4-panel.entry.js +1 -1
  36. package/dist/esm/ku4-preview.entry.js +5 -34
  37. package/dist/esm/ku4-tab-list.entry.js +4 -4
  38. package/dist/esm/ku4-tab-panel.entry.js +3 -3
  39. package/dist/esm/ku4-tab.entry.js +3 -3
  40. package/dist/esm/ku4-table.entry.js +1 -1
  41. package/dist/esm/ku4-tooltip.entry.js +2 -2
  42. package/dist/esm/ku4-validation.entry.js +2 -2
  43. package/dist/esm/ku4web-components.js +7 -102
  44. package/dist/esm/loader.js +2 -18
  45. package/dist/esm-es5/ku4-mask.entry.js +1 -1
  46. package/dist/esm-es5/ku4-modal.entry.js +1 -1
  47. package/dist/esm-es5/ku4web-components.js +1 -1
  48. package/dist/esm-es5/loader.js +1 -1
  49. package/dist/index.js +1 -1
  50. package/dist/ku4web-components/index.esm.js +0 -1
  51. package/dist/ku4web-components/ku4web-components.css +1 -299
  52. package/dist/ku4web-components/ku4web-components.esm.js +1 -129
  53. package/dist/ku4web-components/ku4web-components.js +1 -1
  54. package/dist/ku4web-components/p-479f3ff2.entry.js +1 -0
  55. package/dist/ku4web-components/{p-5a60b1d4.system.entry.js → p-cf860f7a.system.entry.js} +1 -1
  56. package/dist/ku4web-components/p-d66b1c43.system.js +1 -1
  57. package/dist/ku4web-components/p-eace33d2.system.entry.js +1 -0
  58. package/dist/ku4web-components/p-f6b9d36e.entry.js +1 -0
  59. package/dist/types/components/ku4-modal/ku4-modal.d.ts +5 -0
  60. package/dist/types/components.d.ts +10 -2
  61. package/package.json +1 -1
  62. package/dist/cjs/app-globals-3a1e7e63.js +0 -5
  63. package/dist/cjs/css-shim-af499675.js +0 -6
  64. package/dist/cjs/dom-0e8e7262.js +0 -75
  65. package/dist/cjs/index-31267995.js +0 -3093
  66. package/dist/cjs/index-517c4086.js +0 -14
  67. package/dist/cjs/index-d6fca091.js +0 -10
  68. package/dist/cjs/uid-8ec2f63e.js +0 -11
  69. package/dist/collection/capabilities/a11y/aria.js +0 -26
  70. package/dist/collection/capabilities/angular/index.js +0 -24
  71. package/dist/collection/capabilities/decorators/deprecated.js +0 -20
  72. package/dist/collection/capabilities/decorators/index.js +0 -3
  73. package/dist/collection/capabilities/decorators/memoize.js +0 -7
  74. package/dist/collection/capabilities/dom/isFocusable.js +0 -7
  75. package/dist/collection/capabilities/dom/queryFocusable.js +0 -2
  76. package/dist/collection/capabilities/identity/uid.js +0 -6
  77. package/dist/collection/capabilities/mask/index.js +0 -5
  78. package/dist/collection/capabilities/mask/patterns/date.js +0 -40
  79. package/dist/collection/capabilities/mask/patterns/index.js +0 -7
  80. package/dist/collection/capabilities/react/index.js +0 -25
  81. package/dist/collection/capabilities/testing/html.js +0 -14
  82. package/dist/collection/capabilities/testing/styles.js +0 -14
  83. package/dist/collection/capabilities/vue/index.js +0 -28
  84. package/dist/collection/capabilities/vue3/index.js +0 -26
  85. package/dist/collection/collection-manifest.json +0 -31
  86. package/dist/collection/components/ku4-carousel/ku4-carousel.css +0 -221
  87. package/dist/collection/components/ku4-carousel/ku4-carousel.js +0 -369
  88. package/dist/collection/components/ku4-carousel-controls/ku4-carousel-controls.css +0 -32
  89. package/dist/collection/components/ku4-carousel-controls/ku4-carousel-controls.js +0 -112
  90. package/dist/collection/components/ku4-carousel-slide/ku4-carousel-slide.css +0 -3
  91. package/dist/collection/components/ku4-carousel-slide/ku4-carousel-slide.js +0 -159
  92. package/dist/collection/components/ku4-col/ku4-col.css +0 -601
  93. package/dist/collection/components/ku4-col/ku4-col.js +0 -288
  94. package/dist/collection/components/ku4-drawer/ku4-drawer.css +0 -56
  95. package/dist/collection/components/ku4-drawer/ku4-drawer.js +0 -163
  96. package/dist/collection/components/ku4-feature/ku4-feature.js +0 -70
  97. package/dist/collection/components/ku4-focus-trap/ku4-focus-trap.css +0 -3
  98. package/dist/collection/components/ku4-focus-trap/ku4-focus-trap.js +0 -441
  99. package/dist/collection/components/ku4-form/ku4-form.js +0 -225
  100. package/dist/collection/components/ku4-grid/ku4-grid.css +0 -751
  101. package/dist/collection/components/ku4-grid/ku4-grid.js +0 -408
  102. package/dist/collection/components/ku4-label/ku4-label.css +0 -36
  103. package/dist/collection/components/ku4-label/ku4-label.js +0 -115
  104. package/dist/collection/components/ku4-mask/ku4-mask.css +0 -3
  105. package/dist/collection/components/ku4-mask/ku4-mask.js +0 -458
  106. package/dist/collection/components/ku4-modal/ku4-modal.css +0 -85
  107. package/dist/collection/components/ku4-modal/ku4-modal.js +0 -208
  108. package/dist/collection/components/ku4-panel/ku4-panel.css +0 -14
  109. package/dist/collection/components/ku4-panel/ku4-panel.js +0 -119
  110. package/dist/collection/components/ku4-preview/ku4-preview.css +0 -23
  111. package/dist/collection/components/ku4-preview/ku4-preview.js +0 -266
  112. package/dist/collection/components/ku4-tab/ku4-tab.css +0 -82
  113. package/dist/collection/components/ku4-tab/ku4-tab.js +0 -191
  114. package/dist/collection/components/ku4-tab-list/ku4-tab-list.css +0 -6
  115. package/dist/collection/components/ku4-tab-list/ku4-tab-list.js +0 -118
  116. package/dist/collection/components/ku4-tab-panel/ku4-tab-panel.css +0 -26
  117. package/dist/collection/components/ku4-tab-panel/ku4-tab-panel.js +0 -166
  118. package/dist/collection/components/ku4-table/ku4-table.css +0 -116
  119. package/dist/collection/components/ku4-table/ku4-table.js +0 -120
  120. package/dist/collection/components/ku4-tooltip/ku4-tooltip.css +0 -56
  121. package/dist/collection/components/ku4-tooltip/ku4-tooltip.js +0 -274
  122. package/dist/collection/components/ku4-validation/ku4-validation.css +0 -19
  123. package/dist/collection/components/ku4-validation/ku4-validation.js +0 -364
  124. package/dist/collection/components/ku4-validation/validate.js +0 -14
  125. package/dist/collection/index.js +0 -1
  126. package/dist/collection/security.js +0 -27
  127. package/dist/esm/app-globals-0f993ce5.js +0 -3
  128. package/dist/esm/css-shim-5697df59.js +0 -4
  129. package/dist/esm/dom-1d32cb7b.js +0 -73
  130. package/dist/esm/index-135dacad.js +0 -3
  131. package/dist/esm/index-52b04dce.js +0 -3057
  132. package/dist/esm/index-f13d1b41.js +0 -3
  133. package/dist/esm/uid-a7ff854d.js +0 -9
  134. package/dist/ku4web-components/app-globals-0f993ce5.js +0 -3
  135. package/dist/ku4web-components/app-globals-497eb362.system.js +0 -1
  136. package/dist/ku4web-components/css-shim-2eb8ce1f.system.js +0 -1
  137. package/dist/ku4web-components/css-shim-5697df59.js +0 -4
  138. package/dist/ku4web-components/dom-1d32cb7b.js +0 -73
  139. package/dist/ku4web-components/dom-e6a9d306.system.js +0 -21
  140. package/dist/ku4web-components/index-135dacad.js +0 -3
  141. package/dist/ku4web-components/index-4036ffa2.system.js +0 -1
  142. package/dist/ku4web-components/index-52b04dce.js +0 -3057
  143. package/dist/ku4web-components/index-9bb2580f.system.js +0 -1
  144. package/dist/ku4web-components/index-dcd9a8a7.system.js +0 -1
  145. package/dist/ku4web-components/index-f13d1b41.js +0 -3
  146. package/dist/ku4web-components/index.system.js +0 -1
  147. package/dist/ku4web-components/ku4-carousel-controls.entry.js +0 -89
  148. package/dist/ku4web-components/ku4-carousel-controls.system.entry.js +0 -1
  149. package/dist/ku4web-components/ku4-carousel-slide.entry.js +0 -47
  150. package/dist/ku4web-components/ku4-carousel-slide.system.entry.js +0 -1
  151. package/dist/ku4web-components/ku4-carousel.entry.js +0 -175
  152. package/dist/ku4web-components/ku4-carousel.system.entry.js +0 -1
  153. package/dist/ku4web-components/ku4-col.entry.js +0 -75
  154. package/dist/ku4web-components/ku4-col.system.entry.js +0 -1
  155. package/dist/ku4web-components/ku4-drawer.entry.js +0 -35
  156. package/dist/ku4web-components/ku4-drawer.system.entry.js +0 -1
  157. package/dist/ku4web-components/ku4-feature.entry.js +0 -29
  158. package/dist/ku4web-components/ku4-feature.system.entry.js +0 -1
  159. package/dist/ku4web-components/ku4-focus-trap.entry.js +0 -323
  160. package/dist/ku4web-components/ku4-focus-trap.system.entry.js +0 -1
  161. package/dist/ku4web-components/ku4-form.entry.js +0 -112
  162. package/dist/ku4web-components/ku4-form.system.entry.js +0 -1
  163. package/dist/ku4web-components/ku4-grid.entry.js +0 -108
  164. package/dist/ku4web-components/ku4-grid.system.entry.js +0 -1
  165. package/dist/ku4web-components/ku4-label.entry.js +0 -70
  166. package/dist/ku4web-components/ku4-label.system.entry.js +0 -1
  167. package/dist/ku4web-components/ku4-mask.entry.js +0 -342
  168. package/dist/ku4web-components/ku4-mask.system.entry.js +0 -1
  169. package/dist/ku4web-components/ku4-modal.entry.js +0 -75
  170. package/dist/ku4web-components/ku4-modal.system.entry.js +0 -1
  171. package/dist/ku4web-components/ku4-panel.entry.js +0 -49
  172. package/dist/ku4web-components/ku4-panel.system.entry.js +0 -1
  173. package/dist/ku4web-components/ku4-preview.entry.js +0 -128
  174. package/dist/ku4web-components/ku4-preview.system.entry.js +0 -1
  175. package/dist/ku4web-components/ku4-tab-list.entry.js +0 -76
  176. package/dist/ku4web-components/ku4-tab-list.system.entry.js +0 -1
  177. package/dist/ku4web-components/ku4-tab-panel.entry.js +0 -72
  178. package/dist/ku4web-components/ku4-tab-panel.system.entry.js +0 -1
  179. package/dist/ku4web-components/ku4-tab.entry.js +0 -63
  180. package/dist/ku4web-components/ku4-tab.system.entry.js +0 -1
  181. package/dist/ku4web-components/ku4-table.entry.js +0 -79
  182. package/dist/ku4web-components/ku4-table.system.entry.js +0 -1
  183. package/dist/ku4web-components/ku4-tooltip.entry.js +0 -120
  184. package/dist/ku4web-components/ku4-tooltip.system.entry.js +0 -1
  185. package/dist/ku4web-components/ku4-validation.entry.js +0 -162
  186. package/dist/ku4web-components/ku4-validation.system.entry.js +0 -1
  187. package/dist/ku4web-components/ku4web-components.system.js +0 -1
  188. package/dist/ku4web-components/p-138904dc.system.entry.js +0 -1
  189. package/dist/ku4web-components/p-dd0d306b.entry.js +0 -1
  190. package/dist/ku4web-components/p-ef0b529f.entry.js +0 -1
  191. package/dist/ku4web-components/shadow-css-6a0a96e7.system.js +0 -13
  192. package/dist/ku4web-components/shadow-css-dfa0587f.js +0 -388
  193. package/dist/ku4web-components/uid-3373ce49.system.js +0 -1
  194. package/dist/ku4web-components/uid-a7ff854d.js +0 -9
@@ -1,342 +0,0 @@
1
- import { r as registerInstance, h } from './index-52b04dce.js';
2
- import { a, Y, t } from './index-135dacad.js';
3
-
4
- const ku4MaskCss = ":host{display:none}";
5
-
6
- const Ku4Mask = class {
7
- constructor(hostRef) {
8
- registerInstance(this, hostRef);
9
- this.charIndexes = [];
10
- this.reverseCharIndexes = [];
11
- this.previousValue = '';
12
- this.currentValue = '';
13
- this.touchStart = false;
14
- /**
15
- * Mask template
16
- */
17
- this.template = '';
18
- /**
19
- * A regex of characters to ban from
20
- * entry. A user will not be able to input
21
- * any character in this set of characters.
22
- * E.g. ban="[()-]" will not allow a user to
23
- * input (, ), or - into the target input.
24
- */
25
- this.ban = '';
26
- /**
27
- * A test pattern for the mask to allow or
28
- * disallow characters at targeted points
29
- * in the input. The pattern is a character
30
- * separated value of regular expressions
31
- * where the first character denotes the
32
- * character separator at each subsequent
33
- * value is a regular expression for the
34
- * character at that indicated index.
35
- * E.g. `pattern=",[345],,,[^abc]"` would mean
36
- * that "," is the separator and that the
37
- * first character must be a 3, 4, or 5, and
38
- * the fourth character cannot be an a, b or c.
39
- */
40
- this.pattern = '';
41
- /**
42
- * Mask Character
43
- */
44
- this.char = '_';
45
- /**
46
- * Hide mask
47
- */
48
- this.hidden = false;
49
- this.handleFocus = this.handleFocus.bind(this);
50
- this.handleBlur = this.handleBlur.bind(this);
51
- this.handleKeyDown = this.handleKeyDown.bind(this);
52
- this.handleInput = this.handleInput.bind(this);
53
- this.handleTouchStart = this.handleTouchStart.bind(this);
54
- this.init();
55
- }
56
- init() {
57
- this.chars = this.char && new RegExp(this.char);
58
- this.banned = this.ban && new RegExp(this.ban);
59
- const pattern = this.pattern.replace(/[\s\n]/gm, '');
60
- this.patterns = pattern.substr(1).split(pattern[0]).map((v) => {
61
- try {
62
- return v && new RegExp(v) || null;
63
- }
64
- catch (e) {
65
- /**
66
- * TODO: Remove try/catch when Safari supports lookbehinds.
67
- * Safari does not support lookbehinds and blows up everything
68
- * because of this. This try catch allows all masking behaviour
69
- * to continue to work except for patterns that include lookbehinds.
70
- */
71
- }
72
- });
73
- this.charIndexes = this.template.split('')
74
- .reduce((acc, char, i) => {
75
- if (this.chars.test(char)) {
76
- acc.push(i);
77
- }
78
- return acc;
79
- }, []);
80
- this.reverseCharIndexes = [...this.charIndexes].reverse();
81
- return this;
82
- }
83
- templateHandler(newTemplate, oldTemplate) {
84
- const { input, previousCharIndex, previousValue, currentValue, value, char } = this;
85
- const previousLength = a.unmask(previousValue, oldTemplate, char).length;
86
- const currentLength = a.unmask(currentValue, oldTemplate, char).length;
87
- const nextIndex = previousLength < currentLength ? previousCharIndex + 1 : previousCharIndex;
88
- this.init().value = a.mask(a.unmask(value, oldTemplate, char), newTemplate, char);
89
- input.setSelectionRange(nextIndex, nextIndex);
90
- }
91
- charHandler(newChar, oldChar) {
92
- const { value, template } = this;
93
- this.init().value = a.mask(a.unmask(value, template, oldChar), template, newChar);
94
- }
95
- get previousCharIndex() {
96
- return this.reverseCharIndexes.find(i => this.selectionStart > i) || this.charIndexes[0];
97
- }
98
- get value() {
99
- return this.currentValue;
100
- }
101
- set value(value) {
102
- const { chars, hidden, input } = this;
103
- const indexOfChar = value.search(chars);
104
- this.currentValue = value;
105
- input.value = hidden && indexOfChar > -1 ? value.substring(0, indexOfChar) : value;
106
- }
107
- handleTouchStart() {
108
- this.touchStart = true;
109
- }
110
- handleFocus() {
111
- // Abort if the browser is IE11
112
- // @ts-ignore - Leveraging documentMode to determine unsupported browser
113
- if (window.document.documentMode) {
114
- return;
115
- }
116
- const { input, template, char, chars, touchStart } = this;
117
- const inputUnmasked = a.unmask(input.value, template, char);
118
- const valueUnmasked = a.unmask(this.value, template, char);
119
- this.value = inputUnmasked !== valueUnmasked
120
- ? a.mask(input.value, template, char)
121
- : a.mask(valueUnmasked, template, char);
122
- Y(0).then(() => {
123
- const index = input.value.search(chars);
124
- const selection = index < 0 ? input.value.length : index;
125
- this.input.setSelectionRange(index < 0 && !touchStart ? 0 : selection, selection);
126
- this.touchStart = false;
127
- });
128
- }
129
- handleBlur() {
130
- const { template, char } = this;
131
- if (t.isEmpty(a.unmask(this.value, template, char))) {
132
- this.value = '';
133
- }
134
- }
135
- handleKeyDown(e) {
136
- // Abort if the browser is IE11
137
- // @ts-ignore - Leveraging documentMode to determine unsupported browser
138
- if (window.document.documentMode) {
139
- return;
140
- }
141
- const { banned, hidden, template, char } = this;
142
- if (e.key &&
143
- e.key.length === 1 &&
144
- banned &&
145
- (banned.test(e.key) &&
146
- !(e.altKey || e.ctrlKey || e.metaKey))) {
147
- e.preventDefault();
148
- }
149
- this.previousValue = hidden ? a.mask(a.unmask(e.target.value, template, char), template, char) : e.target.value;
150
- this.selectionStart = e.target.selectionStart;
151
- this.selectionEnd = e.target.selectionEnd;
152
- }
153
- handleInput(e) {
154
- // Abort if the browser is IE11
155
- // @ts-ignore - Leveraging documentMode to determine unsupported browser
156
- if (window.document.documentMode) {
157
- return;
158
- }
159
- const { input, template, char, chars, previousValue, banned, selectionStart, selectionEnd, previousCharIndex, patterns, charIndexes, reverseCharIndexes } = this;
160
- if (!chars.test(this.previousValue) &&
161
- !(e.type === 'input' && !e.inputType) &&
162
- e.inputType !== 'insertFromPaste' &&
163
- e.inputType !== 'deleteContentBackward' &&
164
- e.inputType !== 'deleteContentForward' &&
165
- e.inputType !== 'deleteByCut' &&
166
- selectionStart === selectionEnd) {
167
- this.value = previousValue;
168
- return;
169
- }
170
- if (e.inputType === 'insertFromPaste') {
171
- try {
172
- navigator.clipboard.readText()
173
- .then((rawData) => {
174
- const data = rawData.replace(new RegExp(banned, 'g'), '');
175
- if (t.isNullOrEmpty(data)) {
176
- this.value = previousValue;
177
- input.setSelectionRange(selectionStart, selectionStart);
178
- return;
179
- }
180
- if (!banned || !banned.test(data)) {
181
- let nextValue = previousValue;
182
- if (selectionStart < selectionEnd) {
183
- const startValue = reverseCharIndexes.find(v => v <= selectionStart - 1);
184
- const endValue = reverseCharIndexes.find(v => v <= selectionEnd - 1);
185
- const startInsertIndex = charIndexes.findIndex(v => v === startValue);
186
- const endInsertIndex = charIndexes.findIndex(v => v === endValue);
187
- const unmasked = a.unmask(previousValue, template, char);
188
- const newValue = unmasked.substring(0, startInsertIndex + 1) + unmasked.substring(endInsertIndex + 1, previousValue.length);
189
- nextValue = a.mask(newValue, template, char);
190
- }
191
- const charIndex = charIndexes.find(v => v >= selectionStart);
192
- const insertIndex = charIndexes.findIndex(v => v === charIndex);
193
- const unmasked = a.unmask(nextValue, template, char);
194
- nextValue = unmasked.substring(0, insertIndex) + data + unmasked.substring(insertIndex, previousValue.length);
195
- this.value = a.mask(nextValue, template, char);
196
- const index = charIndexes[insertIndex + data.length] || this.value.search(chars) || this.value.length;
197
- input.setSelectionRange(index, index);
198
- }
199
- });
200
- this.value = previousValue;
201
- input.setSelectionRange(selectionStart, selectionStart);
202
- return;
203
- }
204
- catch (e) {
205
- this.value = previousValue;
206
- input.setSelectionRange(selectionStart, selectionStart);
207
- return;
208
- }
209
- }
210
- if (e.inputType === 'deleteContentBackward' || e.inputType === 'deleteByCut') {
211
- const startValue = reverseCharIndexes.find(v => v <= selectionStart - 1);
212
- const endValue = reverseCharIndexes.find(v => v <= selectionEnd - 1);
213
- const startInsertIndex = charIndexes.findIndex(v => v === startValue);
214
- const endInsertIndex = charIndexes.findIndex(v => v === endValue);
215
- const unmasked = a.unmask(previousValue, template, char);
216
- if (startInsertIndex < endInsertIndex) {
217
- const newValue = unmasked.substring(0, startInsertIndex + 1) + unmasked.substring(endInsertIndex + 1, previousValue.length);
218
- this.value = a.mask(newValue, template, char);
219
- newValue && startInsertIndex > -1
220
- ? input.setSelectionRange(previousCharIndex + 1, previousCharIndex + 1)
221
- : input.setSelectionRange(previousCharIndex, previousCharIndex);
222
- }
223
- else {
224
- const newValue = unmasked.substring(0, startInsertIndex) + unmasked.substring(endInsertIndex + 1, previousValue.length);
225
- this.value = a.mask(newValue, template, char);
226
- input.setSelectionRange(previousCharIndex, previousCharIndex);
227
- }
228
- return;
229
- }
230
- if (e.inputType === 'deleteContentForward') {
231
- const charIndex = charIndexes.find(v => v >= selectionStart);
232
- const insertIndex = charIndexes.findIndex(v => v === charIndex);
233
- const unmasked = a.unmask(previousValue, template, char);
234
- const newValue = unmasked.substring(0, insertIndex) + unmasked.substring(insertIndex + 1, previousValue.length);
235
- this.value = a.mask(newValue, template, char);
236
- input.setSelectionRange(selectionStart, selectionStart);
237
- return;
238
- }
239
- //Abort if auxiliary key is pressed.
240
- if (e.altKey || e.ctrlKey || e.metaKey) {
241
- return;
242
- }
243
- //Abort if disallowed character
244
- if (!e.data) {
245
- if (e.type === 'input' && !e.inputType) {
246
- const { value } = e.target;
247
- const charIndex = charIndexes.find(v => v >= selectionStart);
248
- const insertIndex = charIndexes.findIndex(v => v === charIndex);
249
- const unmasked = a.unmask(value, template, char);
250
- const allowed = value.replace(new RegExp(banned, 'g'), '');
251
- const nextValue = unmasked.substring(0, insertIndex) + allowed;
252
- const index = charIndexes.find(v => v > charIndex);
253
- this.value = a.mask(nextValue, template, char);
254
- const patternIndex = charIndexes.findIndex(v => v >= index);
255
- const validationIndex = patternIndex < 0 ? charIndexes.length - 1 : patternIndex - 1;
256
- this.validate(nextValue, patterns[validationIndex]);
257
- }
258
- else {
259
- this.value = previousValue;
260
- input.setSelectionRange(selectionStart, selectionStart);
261
- }
262
- return;
263
- }
264
- //Append
265
- if (chars.test(previousValue.charAt(selectionStart)) ||
266
- selectionStart === template.length) {
267
- const unmasked = a.unmask(previousValue, template, char);
268
- this.value = a.mask(unmasked + e.data, template, char);
269
- const charIndex = this.value.search(chars);
270
- const index = charIndex < 0 ? template.length : charIndex;
271
- input.setSelectionRange(index, index);
272
- const patternIndex = charIndexes.findIndex(v => v >= index);
273
- const validationIndex = patternIndex < 0 ? charIndexes.length - 1 : patternIndex - 1;
274
- this.validate(e.data, patterns[validationIndex]);
275
- }
276
- //Insert
277
- else {
278
- let nextValue = previousValue;
279
- if (selectionStart < selectionEnd) {
280
- const startValue = reverseCharIndexes.find(v => v <= selectionStart - 1);
281
- const endValue = reverseCharIndexes.find(v => v <= selectionEnd - 1);
282
- const startInsertIndex = charIndexes.findIndex(v => v === startValue);
283
- const endInsertIndex = charIndexes.findIndex(v => v === endValue);
284
- const unmasked = a.unmask(previousValue, template, char);
285
- const newValue = unmasked.substring(0, startInsertIndex + 1) + unmasked.substring(endInsertIndex + 1, previousValue.length);
286
- nextValue = a.mask(newValue, template, char);
287
- }
288
- const charIndex = charIndexes.find(v => v >= selectionStart);
289
- const insertIndex = charIndexes.findIndex(v => v === charIndex);
290
- const unmasked = a.unmask(nextValue, template, char);
291
- nextValue = unmasked.substring(0, insertIndex) + e.data + unmasked.substring(insertIndex, previousValue.length);
292
- const index = charIndexes.find(v => v > charIndex);
293
- this.value = a.mask(nextValue, template, char);
294
- input.setSelectionRange(index, index);
295
- const patternIndex = charIndexes.findIndex(v => v >= index);
296
- const validationIndex = patternIndex < 0 ? charIndexes.length - 1 : patternIndex - 1;
297
- this.validate(e.data, patterns[validationIndex]);
298
- }
299
- }
300
- validate(data, pattern) {
301
- const { previousValue, input, value, selectionStart } = this;
302
- if (t.exists(pattern) &&
303
- !(pattern.test(data) || (/\(\?[!<=]/.test(pattern.toString()) && pattern.test(value)))) {
304
- this.value = previousValue;
305
- input.setSelectionRange(selectionStart, selectionStart);
306
- }
307
- }
308
- componentWillLoad() {
309
- this.input = document.getElementById(this.for);
310
- if (t.exists(this.input)) {
311
- this.input.addEventListener('focus', this.handleFocus);
312
- this.input.addEventListener('blur', this.handleBlur);
313
- this.input.addEventListener('keydown', this.handleKeyDown);
314
- this.input.addEventListener('input', this.handleInput);
315
- this.input.addEventListener('ku4-mask-input', this.handleInput);
316
- this.input.addEventListener('touchstart', this.handleTouchStart, { passive: true });
317
- }
318
- else {
319
- // eslint-disable-next-line no-console
320
- console.error('ku4-mask must have a valid `for` referencing target field `id`.');
321
- }
322
- }
323
- disconnectedCallback() {
324
- if (this.input && this.input.removeEventListener) {
325
- this.input.removeEventListener('focus', this.handleFocus);
326
- this.input.removeEventListener('blur', this.handleBlur);
327
- this.input.removeEventListener('keydown', this.handleKeyDown);
328
- this.input.removeEventListener('input', this.handleInput);
329
- this.input.removeEventListener('touchstart', this.handleTouchStart);
330
- }
331
- }
332
- render() {
333
- return h("slot", null);
334
- }
335
- static get watchers() { return {
336
- "template": ["templateHandler"],
337
- "char": ["charHandler"]
338
- }; }
339
- };
340
- Ku4Mask.style = ku4MaskCss;
341
-
342
- export { Ku4Mask as ku4_mask };
@@ -1 +0,0 @@
1
- var __spreadArray=this&&this.__spreadArray||function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,a;r<i;r++){if(a||!(r in e)){if(!a)a=Array.prototype.slice.call(e,0,r);a[r]=e[r]}}return t.concat(a||Array.prototype.slice.call(e))};System.register(["./index-4036ffa2.system.js","./index-dcd9a8a7.system.js"],(function(t){"use strict";var e,n,r,i,a;return{setters:[function(t){e=t.r;n=t.h},function(t){r=t.a;i=t.Y;a=t.t}],execute:function(){var s=":host{display:none}";var u=t("ku4_mask",function(){function t(t){e(this,t);this.charIndexes=[];this.reverseCharIndexes=[];this.previousValue="";this.currentValue="";this.touchStart=false;this.template="";this.ban="";this.pattern="";this.char="_";this.hidden=false;this.handleFocus=this.handleFocus.bind(this);this.handleBlur=this.handleBlur.bind(this);this.handleKeyDown=this.handleKeyDown.bind(this);this.handleInput=this.handleInput.bind(this);this.handleTouchStart=this.handleTouchStart.bind(this);this.init()}t.prototype.init=function(){var t=this;this.chars=this.char&&new RegExp(this.char);this.banned=this.ban&&new RegExp(this.ban);var e=this.pattern.replace(/[\s\n]/gm,"");this.patterns=e.substr(1).split(e[0]).map((function(t){try{return t&&new RegExp(t)||null}catch(e){}}));this.charIndexes=this.template.split("").reduce((function(e,n,r){if(t.chars.test(n)){e.push(r)}return e}),[]);this.reverseCharIndexes=__spreadArray([],this.charIndexes,true).reverse();return this};t.prototype.templateHandler=function(t,e){var n=this,i=n.input,a=n.previousCharIndex,s=n.previousValue,u=n.currentValue,h=n.value,l=n.char;var o=r.unmask(s,e,l).length;var d=r.unmask(u,e,l).length;var c=o<d?a+1:a;this.init().value=r.mask(r.unmask(h,e,l),t,l);i.setSelectionRange(c,c)};t.prototype.charHandler=function(t,e){var n=this,i=n.value,a=n.template;this.init().value=r.mask(r.unmask(i,a,e),a,t)};Object.defineProperty(t.prototype,"previousCharIndex",{get:function(){var t=this;return this.reverseCharIndexes.find((function(e){return t.selectionStart>e}))||this.charIndexes[0]},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"value",{get:function(){return this.currentValue},set:function(t){var e=this,n=e.chars,r=e.hidden,i=e.input;var a=t.search(n);this.currentValue=t;i.value=r&&a>-1?t.substring(0,a):t},enumerable:false,configurable:true});t.prototype.handleTouchStart=function(){this.touchStart=true};t.prototype.handleFocus=function(){var t=this;if(window.document.documentMode){return}var e=this,n=e.input,a=e.template,s=e.char,u=e.chars,h=e.touchStart;var l=r.unmask(n.value,a,s);var o=r.unmask(this.value,a,s);this.value=l!==o?r.mask(n.value,a,s):r.mask(o,a,s);i(0).then((function(){var e=n.value.search(u);var r=e<0?n.value.length:e;t.input.setSelectionRange(e<0&&!h?0:r,r);t.touchStart=false}))};t.prototype.handleBlur=function(){var t=this,e=t.template,n=t.char;if(a.isEmpty(r.unmask(this.value,e,n))){this.value=""}};t.prototype.handleKeyDown=function(t){if(window.document.documentMode){return}var e=this,n=e.banned,i=e.hidden,a=e.template,s=e.char;if(t.key&&t.key.length===1&&n&&(n.test(t.key)&&!(t.altKey||t.ctrlKey||t.metaKey))){t.preventDefault()}this.previousValue=i?r.mask(r.unmask(t.target.value,a,s),a,s):t.target.value;this.selectionStart=t.target.selectionStart;this.selectionEnd=t.target.selectionEnd};t.prototype.handleInput=function(t){var e=this;if(window.document.documentMode){return}var n=this,i=n.input,s=n.template,u=n.char,h=n.chars,l=n.previousValue,o=n.banned,d=n.selectionStart,c=n.selectionEnd,v=n.previousCharIndex,p=n.patterns,f=n.charIndexes,g=n.reverseCharIndexes;if(!h.test(this.previousValue)&&!(t.type==="input"&&!t.inputType)&&t.inputType!=="insertFromPaste"&&t.inputType!=="deleteContentBackward"&&t.inputType!=="deleteContentForward"&&t.inputType!=="deleteByCut"&&d===c){this.value=l;return}if(t.inputType==="insertFromPaste"){try{navigator.clipboard.readText().then((function(t){var n=t.replace(new RegExp(o,"g"),"");if(a.isNullOrEmpty(n)){e.value=l;i.setSelectionRange(d,d);return}if(!o||!o.test(n)){var v=l;if(d<c){var p=g.find((function(t){return t<=d-1}));var m=g.find((function(t){return t<=c-1}));var y=f.findIndex((function(t){return t===p}));var k=f.findIndex((function(t){return t===m}));var b=r.unmask(l,s,u);var x=b.substring(0,y+1)+b.substring(k+1,l.length);v=r.mask(x,s,u)}var I=f.find((function(t){return t>=d}));var S=f.findIndex((function(t){return t===I}));var w=r.unmask(v,s,u);v=w.substring(0,S)+n+w.substring(S,l.length);e.value=r.mask(v,s,u);var E=f[S+n.length]||e.value.search(h)||e.value.length;i.setSelectionRange(E,E)}}));this.value=l;i.setSelectionRange(d,d);return}catch(t){this.value=l;i.setSelectionRange(d,d);return}}if(t.inputType==="deleteContentBackward"||t.inputType==="deleteByCut"){var m=g.find((function(t){return t<=d-1}));var y=g.find((function(t){return t<=c-1}));var k=f.findIndex((function(t){return t===m}));var b=f.findIndex((function(t){return t===y}));var x=r.unmask(l,s,u);if(k<b){var I=x.substring(0,k+1)+x.substring(b+1,l.length);this.value=r.mask(I,s,u);I&&k>-1?i.setSelectionRange(v+1,v+1):i.setSelectionRange(v,v)}else{var I=x.substring(0,k)+x.substring(b+1,l.length);this.value=r.mask(I,s,u);i.setSelectionRange(v,v)}return}if(t.inputType==="deleteContentForward"){var S=f.find((function(t){return t>=d}));var w=f.findIndex((function(t){return t===S}));var x=r.unmask(l,s,u);var I=x.substring(0,w)+x.substring(w+1,l.length);this.value=r.mask(I,s,u);i.setSelectionRange(d,d);return}if(t.altKey||t.ctrlKey||t.metaKey){return}if(!t.data){if(t.type==="input"&&!t.inputType){var E=t.target.value;var R=f.find((function(t){return t>=d}));var w=f.findIndex((function(t){return t===R}));var x=r.unmask(E,s,u);var T=E.replace(new RegExp(o,"g"),"");var C=x.substring(0,w)+T;var L=f.find((function(t){return t>R}));this.value=r.mask(C,s,u);var K=f.findIndex((function(t){return t>=L}));var B=K<0?f.length-1:K-1;this.validate(C,p[B])}else{this.value=l;i.setSelectionRange(d,d)}return}if(h.test(l.charAt(d))||d===s.length){var x=r.unmask(l,s,u);this.value=r.mask(x+t.data,s,u);var V=this.value.search(h);var F=V<0?s.length:V;i.setSelectionRange(F,F);var K=f.findIndex((function(t){return t>=F}));var B=K<0?f.length-1:K-1;this.validate(t.data,p[B])}else{var C=l;if(d<c){var _=g.find((function(t){return t<=d-1}));var A=g.find((function(t){return t<=c-1}));var k=f.findIndex((function(t){return t===_}));var b=f.findIndex((function(t){return t===A}));var D=r.unmask(l,s,u);var I=D.substring(0,k+1)+D.substring(b+1,l.length);C=r.mask(I,s,u)}var j=f.find((function(t){return t>=d}));var w=f.findIndex((function(t){return t===j}));var x=r.unmask(C,s,u);C=x.substring(0,w)+t.data+x.substring(w,l.length);var P=f.find((function(t){return t>j}));this.value=r.mask(C,s,u);i.setSelectionRange(P,P);var K=f.findIndex((function(t){return t>=P}));var B=K<0?f.length-1:K-1;this.validate(t.data,p[B])}};t.prototype.validate=function(t,e){var n=this,r=n.previousValue,i=n.input,s=n.value,u=n.selectionStart;if(a.exists(e)&&!(e.test(t)||/\(\?[!<=]/.test(e.toString())&&e.test(s))){this.value=r;i.setSelectionRange(u,u)}};t.prototype.componentWillLoad=function(){this.input=document.getElementById(this.for);if(a.exists(this.input)){this.input.addEventListener("focus",this.handleFocus);this.input.addEventListener("blur",this.handleBlur);this.input.addEventListener("keydown",this.handleKeyDown);this.input.addEventListener("input",this.handleInput);this.input.addEventListener("ku4-mask-input",this.handleInput);this.input.addEventListener("touchstart",this.handleTouchStart,{passive:true})}else{console.error("ku4-mask must have a valid `for` referencing target field `id`.")}};t.prototype.disconnectedCallback=function(){if(this.input&&this.input.removeEventListener){this.input.removeEventListener("focus",this.handleFocus);this.input.removeEventListener("blur",this.handleBlur);this.input.removeEventListener("keydown",this.handleKeyDown);this.input.removeEventListener("input",this.handleInput);this.input.removeEventListener("touchstart",this.handleTouchStart)}};t.prototype.render=function(){return n("slot",null)};Object.defineProperty(t,"watchers",{get:function(){return{template:["templateHandler"],char:["charHandler"]}},enumerable:false,configurable:true});return t}());u.style=s}}}));
@@ -1,75 +0,0 @@
1
- import { r as registerInstance, e as createEvent, h, f as Host, g as getElement } from './index-52b04dce.js';
2
- import { t } from './index-135dacad.js';
3
- import { D as Document, K as Key } from './index-f13d1b41.js';
4
-
5
- const ku4ModalCss = "@-webkit-keyframes ku4-modal-content-enter{0%{-webkit-transform:var(--ku4-modal-content-animation-start-transform, scale(0.5));transform:var(--ku4-modal-content-animation-start-transform, scale(0.5));opacity:var(--ku4-modal-content-animation-start-opacity, 0)}50%{-webkit-transform:var(--ku4-modal-content-animation-mid-transform, scale(1.2));transform:var(--ku4-modal-content-animation-mid-transform, scale(1.2));opacity:var(--ku4-modal-content-animation-mid-opacity, 0.8)}100%{-webkit-transform:var(--ku4-modal-content-animation-end-transform, scale(1));transform:var(--ku4-modal-content-animation-end-transform, scale(1));opacity:var(--ku4-modal-content-animation-end-opacity, 1)}}@keyframes ku4-modal-content-enter{0%{-webkit-transform:var(--ku4-modal-content-animation-start-transform, scale(0.5));transform:var(--ku4-modal-content-animation-start-transform, scale(0.5));opacity:var(--ku4-modal-content-animation-start-opacity, 0)}50%{-webkit-transform:var(--ku4-modal-content-animation-mid-transform, scale(1.2));transform:var(--ku4-modal-content-animation-mid-transform, scale(1.2));opacity:var(--ku4-modal-content-animation-mid-opacity, 0.8)}100%{-webkit-transform:var(--ku4-modal-content-animation-end-transform, scale(1));transform:var(--ku4-modal-content-animation-end-transform, scale(1));opacity:var(--ku4-modal-content-animation-end-opacity, 1)}}@-webkit-keyframes ku4-modal-overlay-enter{0%{-webkit-transform:var(--ku4-modal-overlay-animation-start-transform, none);transform:var(--ku4-modal-overlay-animation-start-transform, none);opacity:var(--ku4-modal-overlay-animation-start-opacity, 0)}50%{-webkit-transform:var(--ku4-modal-overlay-animation-mid-transform, none);transform:var(--ku4-modal-overlay-animation-mid-transform, none);opacity:var(--ku4-modal-overlay-animation-mid-opacity, 0.35)}100%{-webkit-transform:var(--ku4-modal-overlay-animation-end-transform, none);transform:var(--ku4-modal-overlay-animation-end-transform, none);opacity:var(--ku4-modal-overlay-animation-end-opacity, 0.4)}}@keyframes ku4-modal-overlay-enter{0%{-webkit-transform:var(--ku4-modal-overlay-animation-start-transform, none);transform:var(--ku4-modal-overlay-animation-start-transform, none);opacity:var(--ku4-modal-overlay-animation-start-opacity, 0)}50%{-webkit-transform:var(--ku4-modal-overlay-animation-mid-transform, none);transform:var(--ku4-modal-overlay-animation-mid-transform, none);opacity:var(--ku4-modal-overlay-animation-mid-opacity, 0.35)}100%{-webkit-transform:var(--ku4-modal-overlay-animation-end-transform, none);transform:var(--ku4-modal-overlay-animation-end-transform, none);opacity:var(--ku4-modal-overlay-animation-end-opacity, 0.4)}}:host{position:fixed;display:none;top:0;left:0;width:100vw;height:100vh;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;background:transparent;overflow:auto;-webkit-transform-style:var(--ku4-modal-transform-style, initial);transform-style:var(--ku4-modal-transform-style, initial)}.ku4-modal-content{position:relative;top:0;left:0}.ku4-modal-overlay{position:fixed;display:-ms-flexbox;display:flex;top:0;left:0;width:100%;height:100%;opacity:0;background:var(--ku4-modal-overlay-background, #000)}:host([visible]){display:-ms-flexbox;display:flex;z-index:var(--ku4-modal-z-index, 5)}:host([visible]) .ku4-modal-content{-webkit-animation-name:ku4-modal-content-enter;animation-name:ku4-modal-content-enter;-webkit-animation-duration:var(--ku4-modal-content-animation-duration, 0.4s);animation-duration:var(--ku4-modal-content-animation-duration, 0.4s);-webkit-animation-timing-function:var(--ku4-modal-content-animation-timing-function, ease);animation-timing-function:var(--ku4-modal-content-animation-timing-function, ease);-webkit-transform:var(--ku4-modal-content-transform, none);transform:var(--ku4-modal-content-transform, none);opacity:var(--ku4-modal-content-opacity, 1);z-index:calc(var(--ku4-modal-z-index, 5) + 1)}:host([visible]) .ku4-modal-overlay{-webkit-animation-name:ku4-modal-overlay-enter;animation-name:ku4-modal-overlay-enter;-webkit-animation-duration:var(--ku4-modal-overlay-animation-duration, 0.4s);animation-duration:var(--ku4-modal-overlay-animation-duration, 0.4s);-webkit-animation-timing-function:var(--ku4-modal-overlay-animation-timing-function, ease);animation-timing-function:var(--ku4-modal-overlay-animation-timing-function, ease);-webkit-transform:var(--ku4-modal-overlay-transform, none);transform:var(--ku4-modal-overlay-transform, none);opacity:var(--ku4-modal-overlay-opacity, 0.4);z-index:calc(var(--ku4-modal-z-index, 5))}:host([visible=false]){display:none}";
6
-
7
- const Ku4Modal = class {
8
- constructor(hostRef) {
9
- registerInstance(this, hostRef);
10
- this.didDisplay = createEvent(this, "display", 7);
11
- this.didDismiss = createEvent(this, "dismiss", 7);
12
- /**
13
- * Visible when true
14
- */
15
- // eslint-disable-next-line @stencil/strict-mutable
16
- this.visible = false;
17
- /**
18
- * Will not dismiss by clicking and touching outside when false;
19
- */
20
- this.dismissable = true;
21
- }
22
- handleVisibility(value) {
23
- if (value) {
24
- Document.preventScroll();
25
- if (t.exists(this.trap)) {
26
- this.trap.activate();
27
- }
28
- }
29
- else {
30
- Document.resumeScroll();
31
- if (t.exists(this.trap)) {
32
- this.trap.deactivate();
33
- }
34
- }
35
- }
36
- handleKeyUp(e) {
37
- if (this.visible && Key.esc.didFire(e)) {
38
- this.dismiss();
39
- }
40
- }
41
- /**
42
- * Display modal
43
- */
44
- async display() {
45
- this.visible = true;
46
- this.didDisplay.emit(this);
47
- }
48
- /**
49
- * Dismiss modal
50
- */
51
- async dismiss() {
52
- this.visible = false;
53
- this.didDismiss.emit(this);
54
- }
55
- componentDidLoad() {
56
- try {
57
- this.trap = this.host.querySelector('ku4-focus-trap') ||
58
- (document.querySelector(this.focusTrap));
59
- this.handleVisibility(this.visible);
60
- }
61
- catch (e) {
62
- throw new Error(`Cannot connect ku4-focus-trap: ${e.messsage}`);
63
- }
64
- }
65
- render() {
66
- return (h(Host, { role: "dialog", "aria-modal": "true" }, h("section", { class: "ku4-modal-content" }, h("slot", null)), h("section", { class: "ku4-modal-overlay", onClick: () => this.dismissable && this.dismiss(), "aria-hidden": "true" })));
67
- }
68
- get host() { return getElement(this); }
69
- static get watchers() { return {
70
- "visible": ["handleVisibility"]
71
- }; }
72
- };
73
- Ku4Modal.style = ku4ModalCss;
74
-
75
- export { Ku4Modal as ku4_modal };
@@ -1 +0,0 @@
1
- var __awaiter=this&&this.__awaiter||function(t,a,n,o){function i(t){return t instanceof n?t:new n((function(a){a(t)}))}return new(n||(n=Promise))((function(n,r){function e(t){try{m(o.next(t))}catch(a){r(a)}}function s(t){try{m(o["throw"](t))}catch(a){r(a)}}function m(t){t.done?n(t.value):i(t.value).then(e,s)}m((o=o.apply(t,a||[])).next())}))};var __generator=this&&this.__generator||function(t,a){var n={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},o,i,r,e;return e={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(e[Symbol.iterator]=function(){return this}),e;function s(t){return function(a){return m([t,a])}}function m(e){if(o)throw new TypeError("Generator is already executing.");while(n)try{if(o=1,i&&(r=e[0]&2?i["return"]:e[0]?i["throw"]||((r=i["return"])&&r.call(i),0):i.next)&&!(r=r.call(i,e[1])).done)return r;if(i=0,r)e=[e[0]&2,r.value];switch(e[0]){case 0:case 1:r=e;break;case 4:n.label++;return{value:e[1],done:false};case 5:n.label++;i=e[1];e=[0];continue;case 7:e=n.ops.pop();n.trys.pop();continue;default:if(!(r=n.trys,r=r.length>0&&r[r.length-1])&&(e[0]===6||e[0]===2)){n=0;continue}if(e[0]===3&&(!r||e[1]>r[0]&&e[1]<r[3])){n.label=e[1];break}if(e[0]===6&&n.label<r[1]){n.label=r[1];r=e;break}if(r&&n.label<r[2]){n.label=r[2];n.ops.push(e);break}if(r[2])n.ops.pop();n.trys.pop();continue}e=a.call(t,n)}catch(s){e=[6,s];i=0}finally{o=r=0}if(e[0]&5)throw e[1];return{value:e[0]?e[1]:void 0,done:true}}};System.register(["./index-4036ffa2.system.js","./index-dcd9a8a7.system.js","./index-9bb2580f.system.js"],(function(t){"use strict";var a,n,o,i,r,e,s,m;return{setters:[function(t){a=t.r;n=t.e;o=t.h;i=t.f;r=t.g},function(t){e=t.t},function(t){s=t.D;m=t.K}],execute:function(){var l="@-webkit-keyframes ku4-modal-content-enter{0%{-webkit-transform:var(--ku4-modal-content-animation-start-transform, scale(0.5));transform:var(--ku4-modal-content-animation-start-transform, scale(0.5));opacity:var(--ku4-modal-content-animation-start-opacity, 0)}50%{-webkit-transform:var(--ku4-modal-content-animation-mid-transform, scale(1.2));transform:var(--ku4-modal-content-animation-mid-transform, scale(1.2));opacity:var(--ku4-modal-content-animation-mid-opacity, 0.8)}100%{-webkit-transform:var(--ku4-modal-content-animation-end-transform, scale(1));transform:var(--ku4-modal-content-animation-end-transform, scale(1));opacity:var(--ku4-modal-content-animation-end-opacity, 1)}}@keyframes ku4-modal-content-enter{0%{-webkit-transform:var(--ku4-modal-content-animation-start-transform, scale(0.5));transform:var(--ku4-modal-content-animation-start-transform, scale(0.5));opacity:var(--ku4-modal-content-animation-start-opacity, 0)}50%{-webkit-transform:var(--ku4-modal-content-animation-mid-transform, scale(1.2));transform:var(--ku4-modal-content-animation-mid-transform, scale(1.2));opacity:var(--ku4-modal-content-animation-mid-opacity, 0.8)}100%{-webkit-transform:var(--ku4-modal-content-animation-end-transform, scale(1));transform:var(--ku4-modal-content-animation-end-transform, scale(1));opacity:var(--ku4-modal-content-animation-end-opacity, 1)}}@-webkit-keyframes ku4-modal-overlay-enter{0%{-webkit-transform:var(--ku4-modal-overlay-animation-start-transform, none);transform:var(--ku4-modal-overlay-animation-start-transform, none);opacity:var(--ku4-modal-overlay-animation-start-opacity, 0)}50%{-webkit-transform:var(--ku4-modal-overlay-animation-mid-transform, none);transform:var(--ku4-modal-overlay-animation-mid-transform, none);opacity:var(--ku4-modal-overlay-animation-mid-opacity, 0.35)}100%{-webkit-transform:var(--ku4-modal-overlay-animation-end-transform, none);transform:var(--ku4-modal-overlay-animation-end-transform, none);opacity:var(--ku4-modal-overlay-animation-end-opacity, 0.4)}}@keyframes ku4-modal-overlay-enter{0%{-webkit-transform:var(--ku4-modal-overlay-animation-start-transform, none);transform:var(--ku4-modal-overlay-animation-start-transform, none);opacity:var(--ku4-modal-overlay-animation-start-opacity, 0)}50%{-webkit-transform:var(--ku4-modal-overlay-animation-mid-transform, none);transform:var(--ku4-modal-overlay-animation-mid-transform, none);opacity:var(--ku4-modal-overlay-animation-mid-opacity, 0.35)}100%{-webkit-transform:var(--ku4-modal-overlay-animation-end-transform, none);transform:var(--ku4-modal-overlay-animation-end-transform, none);opacity:var(--ku4-modal-overlay-animation-end-opacity, 0.4)}}:host{position:fixed;display:none;top:0;left:0;width:100vw;height:100vh;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;background:transparent;overflow:auto;-webkit-transform-style:var(--ku4-modal-transform-style, initial);transform-style:var(--ku4-modal-transform-style, initial)}.ku4-modal-content{position:relative;top:0;left:0}.ku4-modal-overlay{position:fixed;display:-ms-flexbox;display:flex;top:0;left:0;width:100%;height:100%;opacity:0;background:var(--ku4-modal-overlay-background, #000)}:host([visible]){display:-ms-flexbox;display:flex;z-index:var(--ku4-modal-z-index, 5)}:host([visible]) .ku4-modal-content{-webkit-animation-name:ku4-modal-content-enter;animation-name:ku4-modal-content-enter;-webkit-animation-duration:var(--ku4-modal-content-animation-duration, 0.4s);animation-duration:var(--ku4-modal-content-animation-duration, 0.4s);-webkit-animation-timing-function:var(--ku4-modal-content-animation-timing-function, ease);animation-timing-function:var(--ku4-modal-content-animation-timing-function, ease);-webkit-transform:var(--ku4-modal-content-transform, none);transform:var(--ku4-modal-content-transform, none);opacity:var(--ku4-modal-content-opacity, 1);z-index:calc(var(--ku4-modal-z-index, 5) + 1)}:host([visible]) .ku4-modal-overlay{-webkit-animation-name:ku4-modal-overlay-enter;animation-name:ku4-modal-overlay-enter;-webkit-animation-duration:var(--ku4-modal-overlay-animation-duration, 0.4s);animation-duration:var(--ku4-modal-overlay-animation-duration, 0.4s);-webkit-animation-timing-function:var(--ku4-modal-overlay-animation-timing-function, ease);animation-timing-function:var(--ku4-modal-overlay-animation-timing-function, ease);-webkit-transform:var(--ku4-modal-overlay-transform, none);transform:var(--ku4-modal-overlay-transform, none);opacity:var(--ku4-modal-overlay-opacity, 0.4);z-index:calc(var(--ku4-modal-z-index, 5))}:host([visible=false]){display:none}";var u=t("ku4_modal",function(){function t(t){a(this,t);this.didDisplay=n(this,"display",7);this.didDismiss=n(this,"dismiss",7);this.visible=false;this.dismissable=true}t.prototype.handleVisibility=function(t){if(t){s.preventScroll();if(e.exists(this.trap)){this.trap.activate()}}else{s.resumeScroll();if(e.exists(this.trap)){this.trap.deactivate()}}};t.prototype.handleKeyUp=function(t){if(this.visible&&m.esc.didFire(t)){this.dismiss()}};t.prototype.display=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.visible=true;this.didDisplay.emit(this);return[2]}))}))};t.prototype.dismiss=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.visible=false;this.didDismiss.emit(this);return[2]}))}))};t.prototype.componentDidLoad=function(){try{this.trap=this.host.querySelector("ku4-focus-trap")||document.querySelector(this.focusTrap);this.handleVisibility(this.visible)}catch(t){throw new Error("Cannot connect ku4-focus-trap: ".concat(t.messsage))}};t.prototype.render=function(){var t=this;return o(i,{role:"dialog","aria-modal":"true"},o("section",{class:"ku4-modal-content"},o("slot",null)),o("section",{class:"ku4-modal-overlay",onClick:function(){return t.dismissable&&t.dismiss()},"aria-hidden":"true"}))};Object.defineProperty(t.prototype,"host",{get:function(){return r(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{visible:["handleVisibility"]}},enumerable:false,configurable:true});return t}());u.style=l}}}));
@@ -1,49 +0,0 @@
1
- import { r as registerInstance, h, f as Host, g as getElement } from './index-52b04dce.js';
2
-
3
- const ku4PanelCss = ":host{-webkit-backface-visibility:hidden;display:block;width:100%;height:auto;max-height:0;-webkit-transition:max-height 0.4s, padding 0.6s;transition:max-height 0.4s, padding 0.6s;overflow:hidden}:host([open]){padding-top:inherit;padding-bottom:inherit}";
4
-
5
- const Ku4Panel = class {
6
- constructor(hostRef) {
7
- registerInstance(this, hostRef);
8
- /**
9
- * Set true to display panel
10
- */
11
- this.open = false;
12
- this.maxHeight = this.open ? 'none' : '0px';
13
- }
14
- openHandler(value) {
15
- if (value) {
16
- this.maxHeight = `${this.host.scrollHeight}px`;
17
- }
18
- else {
19
- this.host.style.maxHeight = `${this.host.scrollHeight}px`;
20
- this.maxHeight = '0px';
21
- }
22
- }
23
- handleTransitionEnd() {
24
- this.maxHeight = this.open ? 'none' : '0px';
25
- }
26
- /**
27
- * Toggle panel state
28
- */
29
- async toggle() {
30
- this.open = !this.open;
31
- }
32
- /**
33
- * Close panel
34
- */
35
- async close() {
36
- this.open = false;
37
- }
38
- render() {
39
- const { open, maxHeight } = this;
40
- return (h(Host, { "aria-hidden": open ? 'false' : 'true', tabIndex: open ? 0 : -1, style: { maxHeight } }, h("slot", null)));
41
- }
42
- get host() { return getElement(this); }
43
- static get watchers() { return {
44
- "open": ["openHandler"]
45
- }; }
46
- };
47
- Ku4Panel.style = ku4PanelCss;
48
-
49
- export { Ku4Panel as ku4_panel };
@@ -1 +0,0 @@
1
- var __awaiter=this&&this.__awaiter||function(t,e,n,i){function r(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,o){function a(t){try{u(i.next(t))}catch(e){o(e)}}function s(t){try{u(i["throw"](t))}catch(e){o(e)}}function u(t){t.done?n(t.value):r(t.value).then(a,s)}u((i=i.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(t){return function(e){return u([t,e])}}function u(a){if(i)throw new TypeError("Generator is already executing.");while(n)try{if(i=1,r&&(o=a[0]&2?r["return"]:a[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;if(r=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;r=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){n.label=a[1];break}if(a[0]===6&&n.label<o[1]){n.label=o[1];o=a;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(a);break}if(o[2])n.ops.pop();n.trys.pop();continue}a=e.call(t,n)}catch(s){a=[6,s];r=0}finally{i=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./index-4036ffa2.system.js"],(function(t){"use strict";var e,n,i,r;return{setters:[function(t){e=t.r;n=t.h;i=t.f;r=t.g}],execute:function(){var o=":host{-webkit-backface-visibility:hidden;display:block;width:100%;height:auto;max-height:0;-webkit-transition:max-height 0.4s, padding 0.6s;transition:max-height 0.4s, padding 0.6s;overflow:hidden}:host([open]){padding-top:inherit;padding-bottom:inherit}";var a=t("ku4_panel",function(){function t(t){e(this,t);this.open=false;this.maxHeight=this.open?"none":"0px"}t.prototype.openHandler=function(t){if(t){this.maxHeight="".concat(this.host.scrollHeight,"px")}else{this.host.style.maxHeight="".concat(this.host.scrollHeight,"px");this.maxHeight="0px"}};t.prototype.handleTransitionEnd=function(){this.maxHeight=this.open?"none":"0px"};t.prototype.toggle=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.open=!this.open;return[2]}))}))};t.prototype.close=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.open=false;return[2]}))}))};t.prototype.render=function(){var t=this,e=t.open,r=t.maxHeight;return n(i,{"aria-hidden":e?"false":"true",tabIndex:e?0:-1,style:{maxHeight:r}},n("slot",null))};Object.defineProperty(t.prototype,"host",{get:function(){return r(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{open:["openHandler"]}},enumerable:false,configurable:true});return t}());a.style=o}}}));