@lumx/react 2.2.2 → 2.2.3-alpha-export-hook1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/_internal/AlertDialog.js +1 -1
- package/esm/_internal/AutocompleteMultiple.js.map +1 -1
- package/esm/_internal/ButtonGroup.js +0 -4
- package/esm/_internal/ButtonGroup.js.map +1 -1
- package/esm/_internal/Checkbox2.js +6 -4
- package/esm/_internal/Checkbox2.js.map +1 -1
- package/esm/_internal/Chip2.js +2 -1
- package/esm/_internal/Chip2.js.map +1 -1
- package/esm/_internal/ChipGroup.js.map +1 -1
- package/esm/_internal/ClickAwayProvider.js +1 -1
- package/esm/_internal/ClickAwayProvider.js.map +1 -1
- package/esm/_internal/DatePickerField.js +0 -4
- package/esm/_internal/DatePickerField.js.map +1 -1
- package/esm/_internal/Dialog2.js.map +1 -1
- package/esm/_internal/Dropdown2.js +1 -1
- package/esm/_internal/Dropdown2.js.map +1 -1
- package/esm/_internal/IconButton.js +0 -4
- package/esm/_internal/IconButton.js.map +1 -1
- package/esm/_internal/Lightbox2.js.map +1 -1
- package/esm/_internal/List2.js +20 -4
- package/esm/_internal/List2.js.map +1 -1
- package/esm/_internal/Notification2.js.map +1 -1
- package/esm/_internal/Popover2.js.map +1 -1
- package/esm/_internal/ProgressTrackerStepPanel.js.map +1 -1
- package/esm/_internal/RadioGroup.js +1 -1
- package/esm/_internal/SelectMultiple.js +1 -1
- package/esm/_internal/SelectMultiple.js.map +1 -1
- package/esm/_internal/SideNavigationItem.js +2 -1
- package/esm/_internal/SideNavigationItem.js.map +1 -1
- package/esm/_internal/Slider2.js +1 -1
- package/esm/_internal/Slider2.js.map +1 -1
- package/esm/_internal/SlideshowControls.js +100 -2
- package/esm/_internal/SlideshowControls.js.map +1 -1
- package/esm/_internal/Switch2.js +6 -4
- package/esm/_internal/Switch2.js.map +1 -1
- package/esm/_internal/TabPanel.js.map +1 -1
- package/esm/_internal/TableRow.js +2 -1
- package/esm/_internal/TableRow.js.map +1 -1
- package/esm/_internal/TextField.js +1 -1
- package/esm/_internal/Tooltip2.js +12 -145
- package/esm/_internal/Tooltip2.js.map +1 -1
- package/esm/_internal/alert-dialog.js +3 -3
- package/esm/_internal/autocomplete.js +6 -5
- package/esm/_internal/autocomplete.js.map +1 -1
- package/esm/_internal/avatar.js +1 -2
- package/esm/_internal/avatar.js.map +1 -1
- package/esm/_internal/badge.js +1 -2
- package/esm/_internal/badge.js.map +1 -1
- package/esm/_internal/button.js +4 -4
- package/esm/_internal/checkbox.js +2 -3
- package/esm/_internal/checkbox.js.map +1 -1
- package/esm/_internal/chip.js +2 -2
- package/esm/_internal/comment-block.js +1 -2
- package/esm/_internal/comment-block.js.map +1 -1
- package/esm/_internal/constants.js.map +1 -1
- package/esm/_internal/date-picker.js +4 -4
- package/esm/_internal/dialog.js +2 -2
- package/esm/_internal/divider.js +1 -2
- package/esm/_internal/divider.js.map +1 -1
- package/esm/_internal/drag-handle.js +1 -2
- package/esm/_internal/drag-handle.js.map +1 -1
- package/esm/_internal/dropdown.js +4 -3
- package/esm/_internal/dropdown.js.map +1 -1
- package/esm/_internal/expansion-panel.js +4 -4
- package/esm/_internal/flag.js +1 -2
- package/esm/_internal/flag.js.map +1 -1
- package/esm/_internal/flex-box.js +1 -2
- package/esm/_internal/flex-box.js.map +1 -1
- package/esm/_internal/getRootClassName.js +40 -166
- package/esm/_internal/getRootClassName.js.map +1 -1
- package/esm/_internal/grid.js +1 -2
- package/esm/_internal/grid.js.map +1 -1
- package/esm/_internal/icon.js +1 -2
- package/esm/_internal/icon.js.map +1 -1
- package/esm/_internal/image-block.js +1 -2
- package/esm/_internal/image-block.js.map +1 -1
- package/esm/{index2.js → _internal/index.js} +1 -1
- package/esm/_internal/index.js.map +1 -0
- package/esm/_internal/input-helper.js +1 -2
- package/esm/_internal/input-helper.js.map +1 -1
- package/esm/_internal/input-label.js +1 -2
- package/esm/_internal/input-label.js.map +1 -1
- package/esm/_internal/lightbox.js +4 -4
- package/esm/_internal/link-preview.js +1 -2
- package/esm/_internal/link-preview.js.map +1 -1
- package/esm/_internal/link.js +1 -2
- package/esm/_internal/link.js.map +1 -1
- package/esm/_internal/list.js +3 -3
- package/esm/_internal/message.js +1 -2
- package/esm/_internal/message.js.map +1 -1
- package/esm/_internal/mosaic.js +1 -2
- package/esm/_internal/mosaic.js.map +1 -1
- package/esm/_internal/notification.js +1 -2
- package/esm/_internal/notification.js.map +1 -1
- package/esm/_internal/onEnterPressed.js +20 -0
- package/esm/_internal/onEnterPressed.js.map +1 -0
- package/esm/_internal/onEscapePressed.js +20 -0
- package/esm/_internal/onEscapePressed.js.map +1 -0
- package/esm/_internal/popover.js +2 -2
- package/esm/_internal/post-block.js +1 -2
- package/esm/_internal/post-block.js.map +1 -1
- package/esm/_internal/progress-tracker.js +2 -3
- package/esm/_internal/progress-tracker.js.map +1 -1
- package/esm/_internal/progress.js +1 -2
- package/esm/_internal/progress.js.map +1 -1
- package/esm/_internal/radio-button.js +2 -3
- package/esm/_internal/radio-button.js.map +1 -1
- package/esm/_internal/select.js +6 -5
- package/esm/_internal/select.js.map +1 -1
- package/esm/_internal/side-navigation.js +5 -4
- package/esm/_internal/side-navigation.js.map +1 -1
- package/esm/_internal/skeleton.js +1 -2
- package/esm/_internal/skeleton.js.map +1 -1
- package/esm/_internal/slider.js +2 -3
- package/esm/_internal/slider.js.map +1 -1
- package/esm/_internal/slideshow.js +6 -5
- package/esm/_internal/slideshow.js.map +1 -1
- package/esm/_internal/switch.js +2 -3
- package/esm/_internal/switch.js.map +1 -1
- package/esm/_internal/table.js +2 -2
- package/esm/_internal/tabs.js +2 -3
- package/esm/_internal/tabs.js.map +1 -1
- package/esm/_internal/text-field.js +4 -4
- package/esm/_internal/thumbnail.js +1 -2
- package/esm/_internal/thumbnail.js.map +1 -1
- package/esm/_internal/toolbar.js +1 -2
- package/esm/_internal/toolbar.js.map +1 -1
- package/esm/_internal/tooltip.js +4 -4
- package/esm/_internal/uploader.js +1 -2
- package/esm/_internal/uploader.js.map +1 -1
- package/esm/_internal/useDelayedVisibility.js.map +1 -1
- package/esm/_internal/useDisableBodyScroll.js.map +1 -1
- package/esm/_internal/useFocusTrap.js.map +1 -1
- package/esm/_internal/useRovingTabIndex.js +1 -1
- package/esm/_internal/useRovingTabIndex.js.map +1 -1
- package/esm/_internal/user-block.js +1 -2
- package/esm/_internal/user-block.js.map +1 -1
- package/esm/hooks/useOpenHoverOrLongPress.js +172 -0
- package/esm/hooks/useOpenHoverOrLongPress.js.map +1 -0
- package/esm/index.js +8 -6
- package/esm/index.js.map +1 -1
- package/package.json +4 -4
- package/src/{hooks → _internal/hooks}/useBooleanState.tsx +0 -0
- package/src/{hooks → _internal/hooks}/useCallbackOnEscape.ts +0 -0
- package/src/{hooks → _internal/hooks}/useChipGroupNavigation.tsx +0 -0
- package/src/{hooks → _internal/hooks}/useClickAway.tsx +0 -0
- package/src/{hooks → _internal/hooks}/useDelayedVisibility.tsx +0 -0
- package/src/{hooks → _internal/hooks}/useDisableBodyScroll.ts +0 -0
- package/src/{hooks → _internal/hooks}/useEventCallback.tsx +0 -0
- package/src/{hooks → _internal/hooks}/useFocus.tsx +0 -0
- package/src/{hooks → _internal/hooks}/useFocusTrap.ts +0 -0
- package/src/{hooks → _internal/hooks}/useInfiniteScroll.tsx +0 -0
- package/src/{hooks → _internal/hooks}/useIntersectionObserver.tsx +0 -0
- package/src/{hooks → _internal/hooks}/useInterval.tsx +1 -1
- package/src/{hooks → _internal/hooks}/useKeyboardListNavigation.tsx +0 -0
- package/src/{hooks → _internal/hooks}/useListenFocus.tsx +0 -0
- package/src/{hooks → _internal/hooks}/useOnResize.ts +0 -0
- package/src/{hooks → _internal/hooks}/useRovingTabIndex.tsx +0 -0
- package/src/{hooks → _internal/hooks}/useStopPropagation.ts +0 -0
- package/src/components/autocomplete/Autocomplete.tsx +1 -1
- package/src/components/button/__snapshots__/IconButton.test.tsx.snap +0 -5
- package/src/components/checkbox/Checkbox.test.tsx +14 -0
- package/src/components/checkbox/Checkbox.tsx +5 -1
- package/src/components/checkbox/__snapshots__/Checkbox.test.tsx.snap +51 -0
- package/src/components/chip/Chip.tsx +1 -1
- package/src/components/chip/ChipGroup.tsx +1 -1
- package/src/components/date-picker/DatePickerField.tsx +2 -2
- package/src/components/dialog/Dialog.test.tsx +1 -1
- package/src/components/dialog/Dialog.tsx +5 -5
- package/src/components/dropdown/Dropdown.tsx +1 -1
- package/src/components/lightbox/Lightbox.tsx +4 -4
- package/src/components/list/List.tsx +1 -1
- package/src/components/mosaic/Mosaic.test.tsx +1 -1
- package/src/components/notification/Notification.tsx +1 -1
- package/src/components/popover/Popover.tsx +2 -2
- package/src/components/progress-tracker/ProgressTracker.tsx +1 -1
- package/src/components/select/Select.stories.tsx +1 -1
- package/src/components/select/SelectMultiple.stories.tsx +1 -1
- package/src/components/select/WithSelectContext.tsx +1 -1
- package/src/components/slider/Slider.tsx +1 -1
- package/src/components/slideshow/Slideshow.tsx +1 -1
- package/src/components/slideshow/useSwipeNavigate.ts +1 -1
- package/src/components/switch/Switch.test.tsx +10 -0
- package/src/components/switch/Switch.tsx +5 -1
- package/src/components/switch/__snapshots__/Switch.test.tsx.snap +30 -0
- package/src/components/tabs/TabList.tsx +4 -4
- package/src/components/tooltip/Tooltip.tsx +7 -4
- package/src/constants.ts +7 -1
- package/src/hooks/useOpenHoverOrLongPress.ts +140 -0
- package/src/utils/ClickAwayProvider/ClickAwayProvider.tsx +1 -1
- package/src/utils/browserDoesNotSupportHover.test.js +24 -0
- package/src/utils/browserDoesNotSupportHover.ts +2 -0
- package/types.d.ts +6 -2
- package/esm/index2.js.map +0 -1
- package/src/components/tooltip/useTooltipOpen.tsx +0 -112
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { b as _objectWithoutProperties
|
|
1
|
+
import { b as _objectWithoutProperties } from './_rollupPluginBabelHelpers.js';
|
|
2
2
|
import isBoolean from 'lodash/isBoolean';
|
|
3
|
-
import isEmpty from 'lodash/isEmpty';
|
|
4
3
|
import kebabCase from 'lodash/kebabCase';
|
|
5
|
-
import
|
|
4
|
+
import isEmpty from 'lodash/isEmpty';
|
|
6
5
|
|
|
7
6
|
function createCommonjsModule(fn, basedir, module) {
|
|
8
7
|
return module = {
|
|
@@ -67,20 +66,6 @@ var classnames = createCommonjsModule(function (module) {
|
|
|
67
66
|
}());
|
|
68
67
|
});
|
|
69
68
|
|
|
70
|
-
/**
|
|
71
|
-
* Enhance isEmpty method to also works with numbers.
|
|
72
|
-
*
|
|
73
|
-
* @param value The value to check.
|
|
74
|
-
* @return Whether the input value is empty or != 0.
|
|
75
|
-
*/
|
|
76
|
-
|
|
77
|
-
var _isEmpty = function _isEmpty(value) {
|
|
78
|
-
if (typeof value === 'number') {
|
|
79
|
-
return value === 0;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
return isEmpty(value);
|
|
83
|
-
};
|
|
84
69
|
/**
|
|
85
70
|
* Get the basic CSS class for the given type.
|
|
86
71
|
*
|
|
@@ -90,7 +75,6 @@ var _isEmpty = function _isEmpty(value) {
|
|
|
90
75
|
* @return The basic CSS class.
|
|
91
76
|
*/
|
|
92
77
|
|
|
93
|
-
|
|
94
78
|
function getBasicClass(_ref) {
|
|
95
79
|
var prefix = _ref.prefix,
|
|
96
80
|
type = _ref.type,
|
|
@@ -115,6 +99,21 @@ function getBasicClass(_ref) {
|
|
|
115
99
|
|
|
116
100
|
return "".concat(prefix, "--").concat(kebabCase(type), "-").concat(value);
|
|
117
101
|
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Enhance isEmpty method to also works with numbers.
|
|
105
|
+
*
|
|
106
|
+
* @param value The value to check.
|
|
107
|
+
* @return Whether the input value is empty or != 0.
|
|
108
|
+
*/
|
|
109
|
+
|
|
110
|
+
var _isEmpty = function _isEmpty(value) {
|
|
111
|
+
if (typeof value === 'number') {
|
|
112
|
+
return value === 0;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return isEmpty(value);
|
|
116
|
+
};
|
|
118
117
|
/**
|
|
119
118
|
* Return all basic LumX CSS classes which are available for every components.
|
|
120
119
|
*
|
|
@@ -127,9 +126,10 @@ function getBasicClass(_ref) {
|
|
|
127
126
|
* @return All LumX basic CSS classes.
|
|
128
127
|
*/
|
|
129
128
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
129
|
+
|
|
130
|
+
function handleBasicClasses(_ref) {
|
|
131
|
+
var prefix = _ref.prefix,
|
|
132
|
+
props = _objectWithoutProperties(_ref, ["prefix"]);
|
|
133
133
|
|
|
134
134
|
var otherClasses = {};
|
|
135
135
|
|
|
@@ -145,150 +145,6 @@ function handleBasicClasses(_ref2) {
|
|
|
145
145
|
|
|
146
146
|
return classnames(prefix, otherClasses);
|
|
147
147
|
}
|
|
148
|
-
/**
|
|
149
|
-
* Checks whether or not the browser support passive events.
|
|
150
|
-
* @see https://github.com/Modernizr/Modernizr/blob/6d56d814b9682843313b16060adb25a58d83a317/feature-detects/dom/passiveeventlisteners.js
|
|
151
|
-
*/
|
|
152
|
-
|
|
153
|
-
function isPassiveEventAvailable() {
|
|
154
|
-
var supportsPassiveOption = false;
|
|
155
|
-
|
|
156
|
-
try {
|
|
157
|
-
var opts = Object.defineProperty({}, 'passive', {
|
|
158
|
-
get: function get() {
|
|
159
|
-
supportsPassiveOption = true;
|
|
160
|
-
}
|
|
161
|
-
});
|
|
162
|
-
window.addEventListener('testPassiveEventSupport', noop, opts);
|
|
163
|
-
window.removeEventListener('testPassiveEventSupport', noop, opts);
|
|
164
|
-
} catch (e) {// ignored
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
return supportsPassiveOption;
|
|
168
|
-
}
|
|
169
|
-
/**
|
|
170
|
-
* Detects horizontal swipe direction without blocking the browser scroll using passive event.
|
|
171
|
-
* @see http://javascriptkit.com/javatutors/touchevents2.shtml
|
|
172
|
-
* @see https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md
|
|
173
|
-
*/
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
function detectHorizontalSwipe(touchSurface, handleSwipe) {
|
|
177
|
-
var startX;
|
|
178
|
-
var startY; // Required min distance traveled to be considered swipe.
|
|
179
|
-
|
|
180
|
-
var threshold = 150; // Maximum distance allowed at the same time in perpendicular direction.
|
|
181
|
-
|
|
182
|
-
var restraint = 150; // Maximum time allowed to travel that distance.
|
|
183
|
-
|
|
184
|
-
var allowedTime = 300;
|
|
185
|
-
var elapsedTime;
|
|
186
|
-
var startTime;
|
|
187
|
-
var finished;
|
|
188
|
-
|
|
189
|
-
var onTouchStart = function onTouchStart(evt) {
|
|
190
|
-
var _Array$from5 = Array.from(evt.changedTouches),
|
|
191
|
-
_Array$from6 = _slicedToArray(_Array$from5, 1),
|
|
192
|
-
touch = _Array$from6[0];
|
|
193
|
-
|
|
194
|
-
startX = touch.pageX;
|
|
195
|
-
startY = touch.pageY; // Record time when finger first makes contact with surface.
|
|
196
|
-
|
|
197
|
-
startTime = new Date().getTime();
|
|
198
|
-
finished = false;
|
|
199
|
-
};
|
|
200
|
-
|
|
201
|
-
var onTouchMove = function onTouchMove(evt) {
|
|
202
|
-
if (finished) {
|
|
203
|
-
return;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
elapsedTime = new Date().getTime() - startTime;
|
|
207
|
-
|
|
208
|
-
if (elapsedTime > allowedTime) {
|
|
209
|
-
// Touch swipe too long to be considered.
|
|
210
|
-
return;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
var _Array$from7 = Array.from(evt.changedTouches),
|
|
214
|
-
_Array$from8 = _slicedToArray(_Array$from7, 1),
|
|
215
|
-
touch = _Array$from8[0]; // Get horizontal dist traveled by finger while in contact with surface.
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
var distX = touch.pageX - startX; // Get vertical dist traveled by finger while in contact with surface.
|
|
219
|
-
|
|
220
|
-
var distY = touch.pageY - startY;
|
|
221
|
-
|
|
222
|
-
if (!(Math.abs(distX) >= threshold && Math.abs(distY) <= restraint)) {
|
|
223
|
-
// Swipe is not horizontal.
|
|
224
|
-
return;
|
|
225
|
-
} // Swipe direction.
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
var direction = distX < 0 ? 'left' : 'right';
|
|
229
|
-
handleSwipe(direction);
|
|
230
|
-
finished = true;
|
|
231
|
-
}; // Activate passive event if possible for better scrolling performance.
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
var eventOptions = isPassiveEventAvailable() ? {
|
|
235
|
-
passive: true
|
|
236
|
-
} : false;
|
|
237
|
-
touchSurface.addEventListener('touchstart', onTouchStart, eventOptions);
|
|
238
|
-
touchSurface.addEventListener('touchmove', onTouchMove, eventOptions);
|
|
239
|
-
return function () {
|
|
240
|
-
touchSurface.removeEventListener('touchstart', onTouchStart, eventOptions);
|
|
241
|
-
touchSurface.removeEventListener('touchmove', onTouchMove, eventOptions);
|
|
242
|
-
};
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
/**
|
|
246
|
-
* Make sure the pressed key is the enter key before calling the callback.
|
|
247
|
-
*
|
|
248
|
-
* @param handler The handler to call on enter/return press.
|
|
249
|
-
* @return The decorated function.
|
|
250
|
-
*/
|
|
251
|
-
function onEnterPressed(handler) {
|
|
252
|
-
return function (evt) {
|
|
253
|
-
if (evt.key !== 'Enter') {
|
|
254
|
-
return;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
handler(evt);
|
|
258
|
-
};
|
|
259
|
-
}
|
|
260
|
-
/**
|
|
261
|
-
* Make sure the pressed key is the escape key before calling the callback.
|
|
262
|
-
*
|
|
263
|
-
* @param handler The handler to call on enter/return press.
|
|
264
|
-
* @return The decorated function.
|
|
265
|
-
*/
|
|
266
|
-
|
|
267
|
-
function onEscapePressed(handler) {
|
|
268
|
-
return function (evt) {
|
|
269
|
-
if (evt.key !== 'Escape') {
|
|
270
|
-
return;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
handler(evt);
|
|
274
|
-
};
|
|
275
|
-
}
|
|
276
|
-
/**
|
|
277
|
-
* Handle button key pressed (Enter + Space).
|
|
278
|
-
*
|
|
279
|
-
* @param handler The handler to call.
|
|
280
|
-
* @return The decorated function.
|
|
281
|
-
*/
|
|
282
|
-
|
|
283
|
-
function onButtonPressed(handler) {
|
|
284
|
-
return function (evt) {
|
|
285
|
-
if (evt.key !== 'Enter' && evt.key !== ' ') {
|
|
286
|
-
return;
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
handler(evt);
|
|
290
|
-
};
|
|
291
|
-
}
|
|
292
148
|
|
|
293
149
|
/**
|
|
294
150
|
* The prefix to use for the CSS classes.
|
|
@@ -301,6 +157,24 @@ var CSS_PREFIX = 'lumx';
|
|
|
301
157
|
|
|
302
158
|
var DIALOG_TRANSITION_DURATION = 400;
|
|
303
159
|
var NOTIFICATION_TRANSITION_DURATION = 200;
|
|
160
|
+
/**
|
|
161
|
+
* Delay on hover after which we open or close the tooltip.
|
|
162
|
+
* Only applies to devices supporting pointer hover.
|
|
163
|
+
*/
|
|
164
|
+
|
|
165
|
+
var TOOLTIP_HOVER_DELAY = {
|
|
166
|
+
openDelay: 500,
|
|
167
|
+
closeDelay: 0
|
|
168
|
+
};
|
|
169
|
+
/**
|
|
170
|
+
* Delay on long press after which we open or close the tooltip.
|
|
171
|
+
* Only applies to devices not supporting pointer hover.
|
|
172
|
+
*/
|
|
173
|
+
|
|
174
|
+
var TOOLTIP_LONG_PRESS_DELAY = {
|
|
175
|
+
openDelay: 250,
|
|
176
|
+
closeDelay: 3000
|
|
177
|
+
};
|
|
304
178
|
|
|
305
179
|
var LAST_PART_CLASSNAME = /^(.*)-(.+)$/gi;
|
|
306
180
|
/**
|
|
@@ -324,5 +198,5 @@ function getRootClassName(componentName, subComponent) {
|
|
|
324
198
|
return formattedClassName;
|
|
325
199
|
}
|
|
326
200
|
|
|
327
|
-
export { CSS_PREFIX as C, DIALOG_TRANSITION_DURATION as D, NOTIFICATION_TRANSITION_DURATION as N, getBasicClass as a,
|
|
201
|
+
export { CSS_PREFIX as C, DIALOG_TRANSITION_DURATION as D, NOTIFICATION_TRANSITION_DURATION as N, TOOLTIP_HOVER_DELAY as T, getBasicClass as a, createCommonjsModule as b, classnames as c, TOOLTIP_LONG_PRESS_DELAY as d, getRootClassName as g, handleBasicClasses as h };
|
|
328
202
|
//# sourceMappingURL=getRootClassName.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRootClassName.js","sources":["../../../../../node_modules/classnames/index.js","../../../../lumx-core/src/js/utils.ts","../../../../lumx-core/src/js/constants/index.ts","../../../src/utils/getRootClassName.ts"],"sourcesContent":["/*!\n Copyright (c) 2017 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg) && arg.length) {\n\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\tif (inner) {\n\t\t\t\t\tclasses.push(inner);\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import classNames from 'classnames';\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport React from 'react';\n\nimport isBoolean from 'lodash/isBoolean';\nimport isEmpty from 'lodash/isEmpty';\nimport kebabCase from 'lodash/kebabCase';\nimport noop from 'lodash/noop';\n\n/**\n * Enhance isEmpty method to also works with numbers.\n *\n * @param value The value to check.\n * @return Whether the input value is empty or != 0.\n */\nconst _isEmpty = (value: any) => {\n if (typeof value === 'number') {\n return value === 0;\n }\n\n return isEmpty(value);\n};\n\n/**\n * Get the basic CSS class for the given type.\n *\n * @param prefix The class name prefix for the generated CSS class.\n * @param type The type of CSS class we want to generate (e.g.: 'color', 'variant', ...).\n * @param value The value of the type of the CSS class (e.g.: 'primary', 'button', ...).\n * @return The basic CSS class.\n */\nexport function getBasicClass({\n prefix,\n type,\n value,\n}: {\n prefix: string;\n type: string;\n value: string | number | boolean | undefined;\n}): string {\n if (isBoolean(value)) {\n if (!value) {\n // False value should not return a class.\n return '';\n }\n const booleanPrefixes = ['has', 'is'];\n\n if (booleanPrefixes.some((booleanPrefix) => type.toString().startsWith(booleanPrefix))) {\n return `${prefix}--${kebabCase(type)}`;\n }\n\n return `${prefix}--is-${kebabCase(type)}`;\n }\n\n return `${prefix}--${kebabCase(type)}-${value}`;\n}\n\n/**\n * Return all basic LumX CSS classes which are available for every components.\n *\n * @see {@link /src/components/index.d.ts} for the possible values of each parameter.\n *\n * @param prefix The class name prefix for the generated CSS class.\n * @param props All the other props you want to generate a class.\n * The rule of thumb: the key is the name of the prop in the class, the value a string that will\n * be used in the classname to represent the value of the given prop.\n * @return All LumX basic CSS classes.\n */\nexport function handleBasicClasses({ prefix, ...props }: { prefix: string; [prop: string]: any }): string {\n const otherClasses: any = {};\n if (!isEmpty(props)) {\n Object.keys(props).forEach((prop) => {\n otherClasses[getBasicClass({ prefix, type: prop, value: props[prop] })] = isBoolean(props[prop])\n ? props[prop]\n : !_isEmpty(props[prop]);\n });\n }\n\n return classNames(prefix, otherClasses);\n}\n\ndeclare type SwipeDirection = 'none' | 'up' | 'down' | 'left' | 'right';\n\n/**\n * Detects swipe direction.\n * Credits: http://javascriptkit.com/javatutors/touchevents2.shtml.\n *\n * @deprecated use `detectHorizontalSwipe` instead if possible (better performance and does not block scroll)\n * @param touchSurface Element that will hold touch events.\n * @param handleSwipe Callback function.\n * @return Function to remove listeners.\n */\nexport function detectSwipe(touchSurface: Element, handleSwipe: (direction: SwipeDirection) => void = noop) {\n let distX: number;\n let distY: number;\n let startX: number;\n let startY: number;\n let direction: SwipeDirection;\n // Required min distance traveled to be considered swipe.\n const threshold = 150;\n // Maximum distance allowed at the same time in perpendicular direction.\n const restraint = 100;\n // Maximum time allowed to travel that distance.\n const allowedTime = 300;\n let elapsedTime: number;\n let startTime: number;\n\n const onTouchStart = (evt: Event) => {\n const [touch] = Array.from((evt as TouchEvent).changedTouches);\n direction = 'none';\n // Const dist = 0;\n startX = touch.pageX;\n startY = touch.pageY;\n // Record time when finger first makes contact with surface.\n startTime = new Date().getTime();\n evt.preventDefault();\n };\n\n const onTouchMove = (evt: Event) => {\n // Prevent scrolling when inside DIV.\n evt.preventDefault();\n };\n\n const onTouchEnd = (evt: Event) => {\n const [touch] = Array.from((evt as TouchEvent).changedTouches);\n // Get horizontal dist traveled by finger while in contact with surface.\n distX = touch.pageX - startX;\n // Get vertical dist traveled by finger while in contact with surface.\n distY = touch.pageY - startY;\n // Get time elapsed.\n elapsedTime = new Date().getTime() - startTime;\n if (elapsedTime <= allowedTime) {\n // First condition for awipe met.\n if (Math.abs(distX) >= threshold && Math.abs(distY) <= restraint) {\n // 2nd condition for horizontal swipe met.\n // If dist traveled is negative, it indicates left swipe.\n direction = distX < 0 ? 'left' : 'right';\n } else if (Math.abs(distY) >= threshold && Math.abs(distX) <= restraint) {\n // 2nd condition for vertical swipe met.\n // If dist traveled is negative, it indicates up swipe.\n direction = distY < 0 ? 'up' : 'down';\n }\n }\n handleSwipe(direction);\n evt.preventDefault();\n };\n\n touchSurface.addEventListener('touchstart', onTouchStart, false);\n touchSurface.addEventListener('touchmove', onTouchMove, false);\n touchSurface.addEventListener('touchend', onTouchEnd, false);\n\n return () => {\n touchSurface.removeEventListener('touchstart', onTouchStart, false);\n touchSurface.removeEventListener('touchmove', onTouchMove, false);\n touchSurface.removeEventListener('touchend', onTouchEnd, false);\n };\n}\n\n/**\n * Checks whether or not the browser support passive events.\n * @see https://github.com/Modernizr/Modernizr/blob/6d56d814b9682843313b16060adb25a58d83a317/feature-detects/dom/passiveeventlisteners.js\n */\nfunction isPassiveEventAvailable() {\n let supportsPassiveOption = false;\n try {\n const opts = Object.defineProperty({}, 'passive', {\n get() {\n supportsPassiveOption = true;\n },\n });\n window.addEventListener('testPassiveEventSupport', noop, opts);\n window.removeEventListener('testPassiveEventSupport', noop, opts);\n } catch (e) {\n // ignored\n }\n return supportsPassiveOption;\n}\n\n/**\n * Detects horizontal swipe direction without blocking the browser scroll using passive event.\n * @see http://javascriptkit.com/javatutors/touchevents2.shtml\n * @see https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md\n */\nexport function detectHorizontalSwipe(touchSurface: Element, handleSwipe: (direction: 'right' | 'left') => void) {\n let startX: number;\n let startY: number;\n // Required min distance traveled to be considered swipe.\n const threshold = 150;\n // Maximum distance allowed at the same time in perpendicular direction.\n const restraint = 150;\n // Maximum time allowed to travel that distance.\n const allowedTime = 300;\n let elapsedTime: number;\n let startTime: number;\n let finished: boolean;\n\n const onTouchStart = (evt: Event) => {\n const [touch] = Array.from((evt as TouchEvent).changedTouches);\n startX = touch.pageX;\n startY = touch.pageY;\n // Record time when finger first makes contact with surface.\n startTime = new Date().getTime();\n finished = false;\n };\n\n const onTouchMove = (evt: Event) => {\n if (finished) {\n return;\n }\n\n elapsedTime = new Date().getTime() - startTime;\n if (elapsedTime > allowedTime) {\n // Touch swipe too long to be considered.\n return;\n }\n\n const [touch] = Array.from((evt as TouchEvent).changedTouches);\n // Get horizontal dist traveled by finger while in contact with surface.\n const distX = touch.pageX - startX;\n // Get vertical dist traveled by finger while in contact with surface.\n const distY = touch.pageY - startY;\n\n if (!(Math.abs(distX) >= threshold && Math.abs(distY) <= restraint)) {\n // Swipe is not horizontal.\n return;\n }\n // Swipe direction.\n const direction = distX < 0 ? 'left' : 'right';\n\n handleSwipe(direction);\n finished = true;\n };\n\n // Activate passive event if possible for better scrolling performance.\n const eventOptions: any = isPassiveEventAvailable() ? { passive: true } : false;\n touchSurface.addEventListener('touchstart', onTouchStart, eventOptions);\n touchSurface.addEventListener('touchmove', onTouchMove, eventOptions);\n\n return () => {\n touchSurface.removeEventListener('touchstart', onTouchStart, eventOptions);\n touchSurface.removeEventListener('touchmove', onTouchMove, eventOptions);\n };\n}\n\ntype KeyboardEventHandler<E extends KeyboardEvent | React.KeyboardEvent> = (event: E) => void;\n\n/**\n * Make sure the pressed key is the enter key before calling the callback.\n *\n * @param handler The handler to call on enter/return press.\n * @return The decorated function.\n */\nexport function onEnterPressed<E extends KeyboardEvent | React.KeyboardEvent>(\n handler: KeyboardEventHandler<E>,\n): KeyboardEventHandler<E> {\n return (evt) => {\n if (evt.key !== 'Enter') {\n return;\n }\n handler(evt);\n };\n}\n\n/**\n * Make sure the pressed key is the escape key before calling the callback.\n *\n * @param handler The handler to call on enter/return press.\n * @return The decorated function.\n */\nexport function onEscapePressed<E extends KeyboardEvent | React.KeyboardEvent>(\n handler: KeyboardEventHandler<E>,\n): KeyboardEventHandler<E> {\n return (evt) => {\n if (evt.key !== 'Escape') {\n return;\n }\n handler(evt);\n };\n}\n\n/**\n * Handle button key pressed (Enter + Space).\n *\n * @param handler The handler to call.\n * @return The decorated function.\n */\nexport function onButtonPressed<E extends KeyboardEvent | React.KeyboardEvent>(\n handler: KeyboardEventHandler<E>,\n): KeyboardEventHandler<E> {\n return (evt) => {\n if (evt.key !== 'Enter' && evt.key !== ' ') {\n return;\n }\n handler(evt);\n };\n}\n","/**\n * The prefix to use for the CSS classes.\n */\nexport const CSS_PREFIX = 'lumx';\n\n/**\n * Key codes.\n */\nexport * from './keycodes';\n\n/**\n * Animation duration constants. Take into consideration that if you change one of these variables,\n * you need to update their scss counterpart as well\n */\nexport const DIALOG_TRANSITION_DURATION = 400;\nexport const NOTIFICATION_TRANSITION_DURATION = 200;\n","import { CSS_PREFIX } from '@lumx/react/constants';\n\nimport kebabCase from 'lodash/kebabCase';\n\n// See https://regex101.com/r/YjS1uI/3\nconst LAST_PART_CLASSNAME = /^(.*)-(.+)$/gi;\n\n/**\n * Get the name of the root CSS class of a component based on its name.\n *\n * @param componentName The name of the component. This name should contains the component prefix and be\n * written in PascalCase.\n * @param subComponent Whether the current component is a sub component, if true, define the class according\n * to BEM standards.\n * @return The name of the root CSS class. This classname include the CSS classname prefix and is written in\n * lower-snake-case.\n */\nexport function getRootClassName(componentName: string, subComponent?: boolean): string {\n const formattedClassName = `${CSS_PREFIX}-${kebabCase(componentName)}`;\n\n if (subComponent) {\n return formattedClassName.replace(LAST_PART_CLASSNAME, '$1__$2');\n }\n return formattedClassName;\n}\n"],"names":["_isEmpty","value","isEmpty","getBasicClass","prefix","type","isBoolean","booleanPrefixes","some","booleanPrefix","toString","startsWith","kebabCase","handleBasicClasses","props","otherClasses","Object","keys","forEach","prop","classNames","isPassiveEventAvailable","supportsPassiveOption","opts","defineProperty","get","window","addEventListener","noop","removeEventListener","e","detectHorizontalSwipe","touchSurface","handleSwipe","startX","startY","threshold","restraint","allowedTime","elapsedTime","startTime","finished","onTouchStart","evt","Array","from","changedTouches","touch","pageX","pageY","Date","getTime","onTouchMove","distX","distY","Math","abs","direction","eventOptions","passive","onEnterPressed","handler","key","onEscapePressed","onButtonPressed","CSS_PREFIX","DIALOG_TRANSITION_DURATION","NOTIFICATION_TRANSITION_DURATION","LAST_PART_CLASSNAME","getRootClassName","componentName","subComponent","formattedClassName","replace"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AAC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iDC,YAAjD,EAAiF;AACpF,MAAMC,kBAAkB,aAAMP,UAAN,cAAoBrD,SAAS,CAAC0D,aAAD,CAA7B,CAAxB;;AAEA,MAAIC,YAAJ,EAAkB;AACd,WAAOC,kBAAkB,CAACC,OAAnB,CAA2BL,mBAA3B,EAAgD,QAAhD,CAAP;AACH;;AACD,SAAOI,kBAAP;AACH;;;;"}
|
|
1
|
+
{"version":3,"file":"getRootClassName.js","sources":["../../../../../node_modules/classnames/index.js","../../../../lumx-core/src/js/utils/getBasicClass.ts","../../../../lumx-core/src/js/utils/handleBasicClasses.ts","../../../../lumx-core/src/js/constants/index.ts","../../../src/utils/getRootClassName.ts"],"sourcesContent":["/*!\n Copyright (c) 2017 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg) && arg.length) {\n\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\tif (inner) {\n\t\t\t\t\tclasses.push(inner);\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import isBoolean from 'lodash/isBoolean';\nimport kebabCase from 'lodash/kebabCase';\n\n/**\n * Get the basic CSS class for the given type.\n *\n * @param prefix The class name prefix for the generated CSS class.\n * @param type The type of CSS class we want to generate (e.g.: 'color', 'variant', ...).\n * @param value The value of the type of the CSS class (e.g.: 'primary', 'button', ...).\n * @return The basic CSS class.\n */\nexport function getBasicClass({\n prefix,\n type,\n value,\n}: {\n prefix: string;\n type: string;\n value: string | number | boolean | undefined;\n}): string {\n if (isBoolean(value)) {\n if (!value) {\n // False value should not return a class.\n return '';\n }\n const booleanPrefixes = ['has', 'is'];\n\n if (booleanPrefixes.some((booleanPrefix) => type.toString().startsWith(booleanPrefix))) {\n return `${prefix}--${kebabCase(type)}`;\n }\n\n return `${prefix}--is-${kebabCase(type)}`;\n }\n\n return `${prefix}--${kebabCase(type)}-${value}`;\n}\n","import isEmpty from 'lodash/isEmpty';\nimport isBoolean from 'lodash/isBoolean';\nimport classNames from 'classnames';\nimport { getBasicClass } from './getBasicClass';\n\n/**\n * Enhance isEmpty method to also works with numbers.\n *\n * @param value The value to check.\n * @return Whether the input value is empty or != 0.\n */\nconst _isEmpty = (value: any) => {\n if (typeof value === 'number') {\n return value === 0;\n }\n\n return isEmpty(value);\n};\n/**\n * Return all basic LumX CSS classes which are available for every components.\n *\n * @see {@link /src/components/index.d.ts} for the possible values of each parameter.\n *\n * @param prefix The class name prefix for the generated CSS class.\n * @param props All the other props you want to generate a class.\n * The rule of thumb: the key is the name of the prop in the class, the value a string that will\n * be used in the classname to represent the value of the given prop.\n * @return All LumX basic CSS classes.\n */\nexport function handleBasicClasses({ prefix, ...props }: { prefix: string; [prop: string]: any }): string {\n const otherClasses: any = {};\n if (!isEmpty(props)) {\n Object.keys(props).forEach((prop) => {\n otherClasses[getBasicClass({ prefix, type: prop, value: props[prop] })] = isBoolean(props[prop])\n ? props[prop]\n : !_isEmpty(props[prop]);\n });\n }\n\n return classNames(prefix, otherClasses);\n}\n","/**\n * The prefix to use for the CSS classes.\n */\nexport const CSS_PREFIX = 'lumx';\n\n/**\n * Key codes.\n */\nexport * from './keycodes';\n\n/**\n * Animation duration constants. Take into consideration that if you change one of these variables,\n * you need to update their scss counterpart as well\n */\nexport const DIALOG_TRANSITION_DURATION = 400;\nexport const NOTIFICATION_TRANSITION_DURATION = 200;\n\n/**\n * Delay on hover after which we open or close the tooltip.\n * Only applies to devices supporting pointer hover.\n */\nexport const TOOLTIP_HOVER_DELAY = {\n openDelay: 500,\n closeDelay: 0,\n};\n\n/**\n * Delay on long press after which we open or close the tooltip.\n * Only applies to devices not supporting pointer hover.\n */\nexport const TOOLTIP_LONG_PRESS_DELAY = {\n openDelay: 250,\n closeDelay: 3000,\n};\n","import { CSS_PREFIX } from '@lumx/react/constants';\n\nimport kebabCase from 'lodash/kebabCase';\n\n// See https://regex101.com/r/YjS1uI/3\nconst LAST_PART_CLASSNAME = /^(.*)-(.+)$/gi;\n\n/**\n * Get the name of the root CSS class of a component based on its name.\n *\n * @param componentName The name of the component. This name should contains the component prefix and be\n * written in PascalCase.\n * @param subComponent Whether the current component is a sub component, if true, define the class according\n * to BEM standards.\n * @return The name of the root CSS class. This classname include the CSS classname prefix and is written in\n * lower-snake-case.\n */\nexport function getRootClassName(componentName: string, subComponent?: boolean): string {\n const formattedClassName = `${CSS_PREFIX}-${kebabCase(componentName)}`;\n\n if (subComponent) {\n return formattedClassName.replace(LAST_PART_CLASSNAME, '$1__$2');\n }\n return formattedClassName;\n}\n"],"names":["getBasicClass","prefix","type","value","isBoolean","booleanPrefixes","some","booleanPrefix","toString","startsWith","kebabCase","_isEmpty","isEmpty","handleBasicClasses","props","otherClasses","Object","keys","forEach","prop","classNames","CSS_PREFIX","DIALOG_TRANSITION_DURATION","NOTIFICATION_TRANSITION_DURATION","TOOLTIP_HOVER_DELAY","openDelay","closeDelay","TOOLTIP_LONG_PRESS_DELAY","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GED
|
@@ -3,8 +3,7 @@ import './components.js';
|
|
|
3
3
|
import 'react';
|
|
4
4
|
import './getRootClassName.js';
|
|
5
5
|
import 'lodash/isBoolean';
|
|
6
|
-
import 'lodash/isEmpty';
|
|
7
6
|
import 'lodash/kebabCase';
|
|
8
|
-
import 'lodash/
|
|
7
|
+
import 'lodash/isEmpty';
|
|
9
8
|
export { G as Grid, a as GridItem } from './GridItem.js';
|
|
10
9
|
//# sourceMappingURL=grid.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grid.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"grid.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
package/esm/_internal/icon.js
CHANGED
|
@@ -3,8 +3,7 @@ import './components.js';
|
|
|
3
3
|
import 'react';
|
|
4
4
|
import './getRootClassName.js';
|
|
5
5
|
import 'lodash/isBoolean';
|
|
6
|
-
import 'lodash/isEmpty';
|
|
7
6
|
import 'lodash/kebabCase';
|
|
8
|
-
import 'lodash/
|
|
7
|
+
import 'lodash/isEmpty';
|
|
9
8
|
export { I as Icon } from './Icon2.js';
|
|
10
9
|
//# sourceMappingURL=icon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"icon.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -4,9 +4,8 @@ import 'react';
|
|
|
4
4
|
import './getRootClassName.js';
|
|
5
5
|
import './mdi.js';
|
|
6
6
|
import 'lodash/isBoolean';
|
|
7
|
-
import 'lodash/isEmpty';
|
|
8
7
|
import 'lodash/kebabCase';
|
|
9
|
-
import 'lodash/
|
|
8
|
+
import 'lodash/isEmpty';
|
|
10
9
|
import './mergeRefs.js';
|
|
11
10
|
import './Icon2.js';
|
|
12
11
|
import 'lodash/isObject';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-block.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"image-block.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../node_modules/uid/dist/index.mjs"],"sourcesContent":["var IDX=256, HEX=[], SIZE=256, BUFFER;\nwhile (IDX--) HEX[IDX] = (IDX + 256).toString(16).substring(1);\n\nexport function uid(len) {\n\tvar i=0, tmp=(len || 11);\n\tif (!BUFFER || ((IDX + tmp) > SIZE*2)) {\n\t\tfor (BUFFER='',IDX=0; i < SIZE; i++) {\n\t\t\tBUFFER += HEX[Math.random() * 256 | 0];\n\t\t}\n\t}\n\n\treturn BUFFER.substring(IDX, IDX++ + tmp);\n}\n"],"names":[],"mappings":"AAAA,IAAI,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC;AACtC,OAAO,GAAG,EAAE,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AAC/D;AACO,SAAS,GAAG,CAAC,GAAG,EAAE;AACzB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;AAC1B,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,GAAG,GAAG,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE;AACxC,EAAE,KAAK,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,EAAE;AACvC,GAAG,MAAM,IAAI,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC;AAC1C,GAAG;AACH,EAAE;AACF;AACA,CAAC,OAAO,MAAM,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC,CAAC;AAC3C;;;;"}
|
|
@@ -3,8 +3,7 @@ import './components.js';
|
|
|
3
3
|
import 'react';
|
|
4
4
|
import './getRootClassName.js';
|
|
5
5
|
import 'lodash/isBoolean';
|
|
6
|
-
import 'lodash/isEmpty';
|
|
7
6
|
import 'lodash/kebabCase';
|
|
8
|
-
import 'lodash/
|
|
7
|
+
import 'lodash/isEmpty';
|
|
9
8
|
export { I as InputHelper } from './InputHelper.js';
|
|
10
9
|
//# sourceMappingURL=input-helper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-helper.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"input-helper.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -3,8 +3,7 @@ import './components.js';
|
|
|
3
3
|
import 'react';
|
|
4
4
|
import './getRootClassName.js';
|
|
5
5
|
import 'lodash/isBoolean';
|
|
6
|
-
import 'lodash/isEmpty';
|
|
7
6
|
import 'lodash/kebabCase';
|
|
8
|
-
import 'lodash/
|
|
7
|
+
import 'lodash/isEmpty';
|
|
9
8
|
export { I as InputLabel } from './InputLabel.js';
|
|
10
9
|
//# sourceMappingURL=input-label.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-label.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"input-label.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -3,11 +3,11 @@ import './components.js';
|
|
|
3
3
|
import 'react';
|
|
4
4
|
import './getRootClassName.js';
|
|
5
5
|
import './mdi.js';
|
|
6
|
-
import '
|
|
6
|
+
import './index.js';
|
|
7
7
|
import 'lodash/isBoolean';
|
|
8
|
-
import 'lodash/isEmpty';
|
|
9
8
|
import 'lodash/kebabCase';
|
|
10
|
-
import 'lodash/
|
|
9
|
+
import 'lodash/isEmpty';
|
|
10
|
+
import './onEscapePressed.js';
|
|
11
11
|
import './constants.js';
|
|
12
12
|
import 'lodash/get';
|
|
13
13
|
import './Popover2.js';
|
|
@@ -23,6 +23,6 @@ import './useDelayedVisibility.js';
|
|
|
23
23
|
import './useDisableBodyScroll.js';
|
|
24
24
|
import './Icon2.js';
|
|
25
25
|
export { L as Lightbox } from './Lightbox2.js';
|
|
26
|
+
import '../hooks/useOpenHoverOrLongPress.js';
|
|
26
27
|
import './Tooltip2.js';
|
|
27
|
-
import 'lodash/debounce';
|
|
28
28
|
//# sourceMappingURL=lightbox.js.map
|
|
@@ -4,9 +4,8 @@ import 'react';
|
|
|
4
4
|
import './getRootClassName.js';
|
|
5
5
|
import './mdi.js';
|
|
6
6
|
import 'lodash/isBoolean';
|
|
7
|
-
import 'lodash/isEmpty';
|
|
8
7
|
import 'lodash/kebabCase';
|
|
9
|
-
import 'lodash/
|
|
8
|
+
import 'lodash/isEmpty';
|
|
10
9
|
import './mergeRefs.js';
|
|
11
10
|
import './renderLink.js';
|
|
12
11
|
import './Icon2.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link-preview.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"link-preview.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
|
package/esm/_internal/link.js
CHANGED
|
@@ -3,9 +3,8 @@ import './components.js';
|
|
|
3
3
|
import 'react';
|
|
4
4
|
import './getRootClassName.js';
|
|
5
5
|
import 'lodash/isBoolean';
|
|
6
|
-
import 'lodash/isEmpty';
|
|
7
6
|
import 'lodash/kebabCase';
|
|
8
|
-
import 'lodash/
|
|
7
|
+
import 'lodash/isEmpty';
|
|
9
8
|
import './renderLink.js';
|
|
10
9
|
import './Icon2.js';
|
|
11
10
|
export { L as Link } from './Link2.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"link.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
|
package/esm/_internal/list.js
CHANGED
|
@@ -3,13 +3,13 @@ import './components.js';
|
|
|
3
3
|
import 'react';
|
|
4
4
|
import './getRootClassName.js';
|
|
5
5
|
import 'lodash/isBoolean';
|
|
6
|
-
import 'lodash/isEmpty';
|
|
7
6
|
import 'lodash/kebabCase';
|
|
8
|
-
import 'lodash/
|
|
7
|
+
import 'lodash/isEmpty';
|
|
8
|
+
export { L as List, a as ListItem, i as isClickable } from './List2.js';
|
|
9
|
+
import './onEnterPressed.js';
|
|
9
10
|
import 'lodash/get';
|
|
10
11
|
import './type.js';
|
|
11
12
|
import './mergeRefs.js';
|
|
12
13
|
import './renderLink.js';
|
|
13
|
-
export { L as List, a as ListItem, i as isClickable } from './List2.js';
|
|
14
14
|
export { L as ListDivider, a as ListSubheader } from './ListSubheader.js';
|
|
15
15
|
//# sourceMappingURL=list.js.map
|
package/esm/_internal/message.js
CHANGED
|
@@ -4,9 +4,8 @@ import 'react';
|
|
|
4
4
|
import './getRootClassName.js';
|
|
5
5
|
import './mdi.js';
|
|
6
6
|
import 'lodash/isBoolean';
|
|
7
|
-
import 'lodash/isEmpty';
|
|
8
7
|
import 'lodash/kebabCase';
|
|
9
|
-
import 'lodash/
|
|
8
|
+
import 'lodash/isEmpty';
|
|
10
9
|
import './Icon2.js';
|
|
11
10
|
export { M as Message } from './Message2.js';
|
|
12
11
|
//# sourceMappingURL=message.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"message.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
|
package/esm/_internal/mosaic.js
CHANGED
|
@@ -4,9 +4,8 @@ import 'react';
|
|
|
4
4
|
import './getRootClassName.js';
|
|
5
5
|
import './mdi.js';
|
|
6
6
|
import 'lodash/isBoolean';
|
|
7
|
-
import 'lodash/isEmpty';
|
|
8
7
|
import 'lodash/kebabCase';
|
|
9
|
-
import 'lodash/
|
|
8
|
+
import 'lodash/isEmpty';
|
|
10
9
|
import './mergeRefs.js';
|
|
11
10
|
import './Icon2.js';
|
|
12
11
|
import 'lodash/take';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mosaic.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mosaic.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|
|
@@ -4,9 +4,8 @@ import 'react';
|
|
|
4
4
|
import './getRootClassName.js';
|
|
5
5
|
import './mdi.js';
|
|
6
6
|
import 'lodash/isBoolean';
|
|
7
|
-
import 'lodash/isEmpty';
|
|
8
7
|
import 'lodash/kebabCase';
|
|
9
|
-
import 'lodash/
|
|
8
|
+
import 'lodash/isEmpty';
|
|
10
9
|
import './constants.js';
|
|
11
10
|
import './renderLink.js';
|
|
12
11
|
import './ButtonRoot.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notification.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"notification.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Make sure the pressed key is the enter key before calling the callback.
|
|
5
|
+
*
|
|
6
|
+
* @param handler The handler to call on enter/return press.
|
|
7
|
+
* @return The decorated function.
|
|
8
|
+
*/
|
|
9
|
+
function onEnterPressed(handler) {
|
|
10
|
+
return function (evt) {
|
|
11
|
+
if (evt.key !== 'Enter') {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
handler(evt);
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { onEnterPressed as o };
|
|
20
|
+
//# sourceMappingURL=onEnterPressed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onEnterPressed.js","sources":["../../../../lumx-core/src/js/utils/onEnterPressed.ts"],"sourcesContent":["// eslint-disable-next-line import/no-extraneous-dependencies\nimport React from 'react';\nimport { KeyboardEventHandler } from '@lumx/core/js/types';\n\n/**\n * Make sure the pressed key is the enter key before calling the callback.\n *\n * @param handler The handler to call on enter/return press.\n * @return The decorated function.\n */\nexport function onEnterPressed<E extends KeyboardEvent | React.KeyboardEvent>(\n handler: KeyboardEventHandler<E>,\n): KeyboardEventHandler<E> {\n return (evt) => {\n if (evt.key !== 'Enter') {\n return;\n }\n handler(evt);\n };\n}\n"],"names":["onEnterPressed","handler","evt","key"],"mappings":"AAAA;;AAIA;;;;;;AAMO,SAASA,cAAT,CACHC,OADG,EAEoB;AACvB,SAAO,UAACC,GAAD,EAAS;AACZ,QAAIA,GAAG,CAACC,GAAJ,KAAY,OAAhB,EAAyB;AACrB;AACH;;AACDF,IAAAA,OAAO,CAACC,GAAD,CAAP;AACH,GALD;AAMH;;;;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Make sure the pressed key is the escape key before calling the callback.
|
|
5
|
+
*
|
|
6
|
+
* @param handler The handler to call on enter/return press.
|
|
7
|
+
* @return The decorated function.
|
|
8
|
+
*/
|
|
9
|
+
function onEscapePressed(handler) {
|
|
10
|
+
return function (evt) {
|
|
11
|
+
if (evt.key !== 'Escape') {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
handler(evt);
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { onEscapePressed as o };
|
|
20
|
+
//# sourceMappingURL=onEscapePressed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onEscapePressed.js","sources":["../../../../lumx-core/src/js/utils/onEscapePressed.ts"],"sourcesContent":["// eslint-disable-next-line import/no-extraneous-dependencies\nimport React from 'react';\nimport { KeyboardEventHandler } from '@lumx/core/js/types';\n\n/**\n * Make sure the pressed key is the escape key before calling the callback.\n *\n * @param handler The handler to call on enter/return press.\n * @return The decorated function.\n */\nexport function onEscapePressed<E extends KeyboardEvent | React.KeyboardEvent>(\n handler: KeyboardEventHandler<E>,\n): KeyboardEventHandler<E> {\n return (evt) => {\n if (evt.key !== 'Escape') {\n return;\n }\n handler(evt);\n };\n}\n"],"names":["onEscapePressed","handler","evt","key"],"mappings":"AAAA;;AAIA;;;;;;AAMO,SAASA,eAAT,CACHC,OADG,EAEoB;AACvB,SAAO,UAACC,GAAD,EAAS;AACZ,QAAIA,GAAG,CAACC,GAAJ,KAAY,QAAhB,EAA0B;AACtB;AACH;;AACDF,IAAAA,OAAO,CAACC,GAAD,CAAP;AACH,GALD;AAMH;;;;"}
|
package/esm/_internal/popover.js
CHANGED
|
@@ -2,9 +2,9 @@ import './_rollupPluginBabelHelpers.js';
|
|
|
2
2
|
import 'react';
|
|
3
3
|
import './getRootClassName.js';
|
|
4
4
|
import 'lodash/isBoolean';
|
|
5
|
-
import 'lodash/isEmpty';
|
|
6
5
|
import 'lodash/kebabCase';
|
|
7
|
-
import 'lodash/
|
|
6
|
+
import 'lodash/isEmpty';
|
|
7
|
+
import './onEscapePressed.js';
|
|
8
8
|
import './constants.js';
|
|
9
9
|
export { P as Placement, a as Popover } from './Popover2.js';
|
|
10
10
|
import './mergeRefs.js';
|
|
@@ -4,9 +4,8 @@ import 'react';
|
|
|
4
4
|
import './getRootClassName.js';
|
|
5
5
|
import './mdi.js';
|
|
6
6
|
import 'lodash/isBoolean';
|
|
7
|
-
import 'lodash/isEmpty';
|
|
8
7
|
import 'lodash/kebabCase';
|
|
9
|
-
import 'lodash/
|
|
8
|
+
import 'lodash/isEmpty';
|
|
10
9
|
import './mergeRefs.js';
|
|
11
10
|
import './Icon2.js';
|
|
12
11
|
import 'lodash/isObject';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post-block.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"post-block.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
|