@dreamcommerce/aurora 3.0.0-192 → 3.0.0-194

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 (33) hide show
  1. package/build/cjs/packages/aurora/src/components/select/components/select_content.js +4 -5
  2. package/build/cjs/packages/aurora/src/components/select/components/select_content.js.map +1 -1
  3. package/build/cjs/packages/aurora/src/components/select/select.js +7 -2
  4. package/build/cjs/packages/aurora/src/components/select/select.js.map +1 -1
  5. package/build/cjs/packages/aurora/src/components/select/select_constants.js +8 -0
  6. package/build/esm/packages/aurora/src/components/select/components/select_content.js +4 -5
  7. package/build/esm/packages/aurora/src/components/select/components/select_content.js.map +1 -1
  8. package/build/esm/packages/aurora/src/components/select/select.d.ts +1 -1
  9. package/build/esm/packages/aurora/src/components/select/select.js +7 -2
  10. package/build/esm/packages/aurora/src/components/select/select.js.map +1 -1
  11. package/build/esm/packages/aurora/src/components/select/select_constants.d.ts +1 -0
  12. package/build/esm/packages/aurora/src/components/select/select_constants.js +4 -0
  13. package/package.json +1 -1
  14. package/build/cjs/external/uuid/dist/esm-browser/regex.js +0 -8
  15. package/build/cjs/external/uuid/dist/esm-browser/rng.js +0 -26
  16. package/build/cjs/external/uuid/dist/esm-browser/rng.js.map +0 -1
  17. package/build/cjs/external/uuid/dist/esm-browser/stringify.js +0 -36
  18. package/build/cjs/external/uuid/dist/esm-browser/stringify.js.map +0 -1
  19. package/build/cjs/external/uuid/dist/esm-browser/v4.js +0 -29
  20. package/build/cjs/external/uuid/dist/esm-browser/v4.js.map +0 -1
  21. package/build/cjs/external/uuid/dist/esm-browser/validate.js +0 -12
  22. package/build/cjs/external/uuid/dist/esm-browser/validate.js.map +0 -1
  23. package/build/esm/external/uuid/dist/esm-browser/regex.js +0 -4
  24. package/build/esm/external/uuid/dist/esm-browser/rng.js +0 -22
  25. package/build/esm/external/uuid/dist/esm-browser/rng.js.map +0 -1
  26. package/build/esm/external/uuid/dist/esm-browser/stringify.js +0 -32
  27. package/build/esm/external/uuid/dist/esm-browser/stringify.js.map +0 -1
  28. package/build/esm/external/uuid/dist/esm-browser/v4.js +0 -25
  29. package/build/esm/external/uuid/dist/esm-browser/v4.js.map +0 -1
  30. package/build/esm/external/uuid/dist/esm-browser/validate.js +0 -8
  31. package/build/esm/external/uuid/dist/esm-browser/validate.js.map +0 -1
  32. /package/build/cjs/{external/uuid/dist/esm-browser/regex.js.map → packages/aurora/src/components/select/select_constants.js.map} +0 -0
  33. /package/build/esm/{external/uuid/dist/esm-browser/regex.js.map → packages/aurora/src/components/select/select_constants.js.map} +0 -0
@@ -7,11 +7,11 @@ var _rollupPluginBabelHelpers = require('../../../../../../_virtual/_rollupPlugi
7
7
  var cn = require('../../../utilities/cn.js');
8
8
  var input = require('../../input/input.js');
9
9
  var SelectPrimitive = require('@radix-ui/react-select');
10
+ var select_constants = require('../select_constants.js');
10
11
  var index = require('../../../../../../external/@radix-ui/react-scroll-area/dist/index.mjs.js');
11
12
  var search_icon = require('../../../assets/icons/search_icon.js');
12
13
  var select_group_label = require('./select_group_label.js');
13
14
  var select_item = require('./select_item.js');
14
- var v4 = require('../../../../../../external/uuid/dist/esm-browser/v4.js');
15
15
 
16
16
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
17
17
 
@@ -45,7 +45,6 @@ var SelectContent = /*#__PURE__*/React__default['default'].forwardRef(function (
45
45
  setTriggerWidth(triggerRef.current.getBoundingClientRect().width);
46
46
  }
47
47
  }, [triggerRef]);
48
- console.log('uuidv4()', v4['default']());
49
48
  return /*#__PURE__*/React__default['default'].createElement(SelectPrimitive.Portal, null, /*#__PURE__*/React__default['default'].createElement(SelectPrimitive.Content, _rollupPluginBabelHelpers.objectSpread2({
50
49
  ref: ref,
51
50
  style: {
@@ -87,10 +86,10 @@ var SelectContent = /*#__PURE__*/React__default['default'].forwardRef(function (
87
86
  ref: inputRef
88
87
  }))), options === null || options === void 0 ? void 0 : options.map(function (option, index) {
89
88
  return option.isHeader ? (/*#__PURE__*/React__default['default'].createElement(select_group_label.SelectGroupLabel, {
90
- key: "select-label-".concat(option.text, "-").concat(v4['default']())
89
+ key: "select-label-".concat(option.text, "-").concat(index)
91
90
  }, option.text)) : (/*#__PURE__*/React__default['default'].createElement(select_item.SelectItem, {
92
- key: "select-item-".concat(option.value, "-").concat(v4['default']()),
93
- value: option.value,
91
+ key: "select-item-".concat(option.value, "-").concat(index),
92
+ value: "".concat(select_constants.SELECT_VALUE_PREFIX).concat(option.value),
94
93
  isDisabled: option.isDisabled,
95
94
  isReadonly: option.isReadonly
96
95
  }, option.text));
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,0EAA8E;AAClG;AACA;AACA;AACA,iBAAiB,wDAA4D;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,0EAA8E;AAClG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -6,6 +6,7 @@ var React = require('react');
6
6
  var _rollupPluginBabelHelpers = require('../../../../../_virtual/_rollupPluginBabelHelpers.js');
7
7
  var SelectPrimitive = require('@radix-ui/react-select');
8
8
  var close_circle_fill_icon = require('../../assets/icons/close_circle_fill_icon.js');
9
+ var select_constants = require('./select_constants.js');
9
10
  var select_content = require('./components/select_content.js');
10
11
  var select_trigger = require('./components/select_trigger.js');
11
12
  var select_value = require('./components/select_value.js');
@@ -57,10 +58,14 @@ var Select = function Select(_ref) {
57
58
  return opt.value === selectedValue;
58
59
  })) === null || _options$find === void 0 ? void 0 : _options$find.text) || '';
59
60
  };
61
+ var handleChange = function handleChange(prefixedValue) {
62
+ var cleanValue = prefixedValue.replace(select_constants.SELECT_VALUE_PREFIX, '');
63
+ setSelectedValue(cleanValue);
64
+ };
60
65
  return /*#__PURE__*/React__default['default'].createElement(SelectPrimitive.Root, _rollupPluginBabelHelpers.objectSpread2({
61
- value: selectedValue,
66
+ value: selectedValue ? "".concat(select_constants.SELECT_VALUE_PREFIX).concat(selectedValue) : '',
62
67
  defaultValue: defaultValue,
63
- onValueChange: setSelectedValue,
68
+ onValueChange: handleChange,
64
69
  disabled: disabled,
65
70
  onOpenChange: function onOpenChange(openState) {
66
71
  return clearFilterInputOnClose(openState);
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var SELECT_VALUE_PREFIX = 'select-value-';
6
+
7
+ exports.SELECT_VALUE_PREFIX = SELECT_VALUE_PREFIX;
8
+ //# sourceMappingURL=select_constants.js.map
@@ -3,11 +3,11 @@ import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _
3
3
  import { cn } from '../../../utilities/cn.js';
4
4
  import { Input } from '../../input/input.js';
5
5
  import { Portal, Content, Viewport } from '@radix-ui/react-select';
6
+ import { SELECT_VALUE_PREFIX } from '../select_constants.js';
6
7
  import { Root, Viewport as Viewport$1, Scrollbar, Thumb } from '../../../../../../external/@radix-ui/react-scroll-area/dist/index.mjs.js';
7
8
  import { SearchLineIcon } from '../../../assets/icons/search_icon.js';
8
9
  import { SelectGroupLabel } from './select_group_label.js';
9
10
  import { SelectItem } from './select_item.js';
10
- import v4 from '../../../../../../external/uuid/dist/esm-browser/v4.js';
11
11
 
12
12
  var _excluded = ["className", "options", "hasSearch", "searchPlaceholder", "filterTerm", "setFilterTerm", "innerAdditionalContent", "triggerRef", "position", "onScroll"];
13
13
  var SelectContent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
@@ -37,7 +37,6 @@ var SelectContent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
37
37
  setTriggerWidth(triggerRef.current.getBoundingClientRect().width);
38
38
  }
39
39
  }, [triggerRef]);
40
- console.log('uuidv4()', v4());
41
40
  return /*#__PURE__*/React.createElement(Portal, null, /*#__PURE__*/React.createElement(Content, _objectSpread2({
42
41
  ref: ref,
43
42
  style: {
@@ -79,10 +78,10 @@ var SelectContent = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
79
78
  ref: inputRef
80
79
  }))), options === null || options === void 0 ? void 0 : options.map(function (option, index) {
81
80
  return option.isHeader ? (/*#__PURE__*/React.createElement(SelectGroupLabel, {
82
- key: "select-label-".concat(option.text, "-").concat(v4())
81
+ key: "select-label-".concat(option.text, "-").concat(index)
83
82
  }, option.text)) : (/*#__PURE__*/React.createElement(SelectItem, {
84
- key: "select-item-".concat(option.value, "-").concat(v4()),
85
- value: option.value,
83
+ key: "select-item-".concat(option.value, "-").concat(index),
84
+ value: "".concat(SELECT_VALUE_PREFIX).concat(option.value),
86
85
  isDisabled: option.isDisabled,
87
86
  isReadonly: option.isReadonly
88
87
  }, option.text));
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA,+DAA+D,0EAA8E;AAC7I;AACA;AACA;AACA,eAAe,wDAA4D;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D,0EAA8E;AAC7I;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -1,5 +1,5 @@
1
- import { TSelectProps } from './select_types';
2
1
  import React, { PropsWithChildren } from 'react';
2
+ import { TSelectProps } from './select_types';
3
3
  export declare const Select: {
4
4
  ({ children, id, defaultValue, options, disabled, placeholder, hasSearch, searchPlaceholder, hasClearValueButton, innerAdditionalContent, hasError, onValueChange, onScroll, ...props }: PropsWithChildren<TSelectProps>): React.JSX.Element;
5
5
  displayName: string | undefined;
@@ -2,6 +2,7 @@ import React, { useState, useRef, useEffect } from 'react';
2
2
  import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, objectSpread2 as _objectSpread2 } from '../../../../../_virtual/_rollupPluginBabelHelpers.js';
3
3
  import { Root } from '@radix-ui/react-select';
4
4
  import { CloseCircleFillIcon } from '../../assets/icons/close_circle_fill_icon.js';
5
+ import { SELECT_VALUE_PREFIX } from './select_constants.js';
5
6
  import { SelectContent } from './components/select_content.js';
6
7
  import { SelectTrigger } from './components/select_trigger.js';
7
8
  import { SelectValue } from './components/select_value.js';
@@ -49,10 +50,14 @@ var Select = function Select(_ref) {
49
50
  return opt.value === selectedValue;
50
51
  })) === null || _options$find === void 0 ? void 0 : _options$find.text) || '';
51
52
  };
53
+ var handleChange = function handleChange(prefixedValue) {
54
+ var cleanValue = prefixedValue.replace(SELECT_VALUE_PREFIX, '');
55
+ setSelectedValue(cleanValue);
56
+ };
52
57
  return /*#__PURE__*/React.createElement(Root, _objectSpread2({
53
- value: selectedValue,
58
+ value: selectedValue ? "".concat(SELECT_VALUE_PREFIX).concat(selectedValue) : '',
54
59
  defaultValue: defaultValue,
55
- onValueChange: setSelectedValue,
60
+ onValueChange: handleChange,
56
61
  disabled: disabled,
57
62
  onOpenChange: function onOpenChange(openState) {
58
63
  return clearFilterInputOnClose(openState);
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -0,0 +1 @@
1
+ export declare const SELECT_VALUE_PREFIX = "select-value-";
@@ -0,0 +1,4 @@
1
+ var SELECT_VALUE_PREFIX = 'select-value-';
2
+
3
+ export { SELECT_VALUE_PREFIX };
4
+ //# sourceMappingURL=select_constants.js.map
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@dreamcommerce/aurora",
3
3
  "packageManager": "yarn@3.2.0",
4
4
  "sideEffects": false,
5
- "version": "3.0.0-192",
5
+ "version": "3.0.0-194",
6
6
  "description": "aurora",
7
7
  "author": "zefirek",
8
8
  "license": "MIT",
@@ -1,8 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
6
-
7
- exports.default = REGEX;
8
- //# sourceMappingURL=regex.js.map
@@ -1,26 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- // Unique ID creation requires a high quality random # generator. In the browser we therefore
6
- // require the crypto API and do not support built-in fallback to lower quality random number
7
- // generators (like Math.random()).
8
- var getRandomValues;
9
- var rnds8 = new Uint8Array(16);
10
- function rng() {
11
- // lazy load so that environments that need to polyfill have a chance to do so
12
- if (!getRandomValues) {
13
- // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
14
- // find the complete implementation of crypto (msCrypto) on IE11.
15
- getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);
16
-
17
- if (!getRandomValues) {
18
- throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
19
- }
20
- }
21
-
22
- return getRandomValues(rnds8);
23
- }
24
-
25
- exports.default = rng;
26
- //# sourceMappingURL=rng.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -1,36 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var validate = require('./validate.js');
6
-
7
- /**
8
- * Convert array of 16 byte values to UUID string format of the form:
9
- * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
10
- */
11
-
12
- var byteToHex = [];
13
-
14
- for (var i = 0; i < 256; ++i) {
15
- byteToHex.push((i + 0x100).toString(16).substr(1));
16
- }
17
-
18
- function stringify(arr) {
19
- var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
20
- // Note: Be careful editing this code! It's been tuned for performance
21
- // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
22
- var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one
23
- // of the following:
24
- // - One or more input array values don't map to a hex octet (leading to
25
- // "undefined" in the uuid)
26
- // - Invalid input values for the RFC `version` or `variant` fields
27
-
28
- if (!validate['default'](uuid)) {
29
- throw TypeError('Stringified UUID is invalid');
30
- }
31
-
32
- return uuid;
33
- }
34
-
35
- exports.default = stringify;
36
- //# sourceMappingURL=stringify.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -1,29 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var rng = require('./rng.js');
6
- var stringify = require('./stringify.js');
7
-
8
- function v4(options, buf, offset) {
9
- options = options || {};
10
- var rnds = options.random || (options.rng || rng['default'])(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
11
-
12
- rnds[6] = rnds[6] & 0x0f | 0x40;
13
- rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
14
-
15
- if (buf) {
16
- offset = offset || 0;
17
-
18
- for (var i = 0; i < 16; ++i) {
19
- buf[offset + i] = rnds[i];
20
- }
21
-
22
- return buf;
23
- }
24
-
25
- return stringify['default'](rnds);
26
- }
27
-
28
- exports.default = v4;
29
- //# sourceMappingURL=v4.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -1,12 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var regex = require('./regex.js');
6
-
7
- function validate(uuid) {
8
- return typeof uuid === 'string' && regex['default'].test(uuid);
9
- }
10
-
11
- exports.default = validate;
12
- //# sourceMappingURL=validate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -1,4 +0,0 @@
1
- var REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
2
-
3
- export default REGEX;
4
- //# sourceMappingURL=regex.js.map
@@ -1,22 +0,0 @@
1
- // Unique ID creation requires a high quality random # generator. In the browser we therefore
2
- // require the crypto API and do not support built-in fallback to lower quality random number
3
- // generators (like Math.random()).
4
- var getRandomValues;
5
- var rnds8 = new Uint8Array(16);
6
- function rng() {
7
- // lazy load so that environments that need to polyfill have a chance to do so
8
- if (!getRandomValues) {
9
- // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
10
- // find the complete implementation of crypto (msCrypto) on IE11.
11
- getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);
12
-
13
- if (!getRandomValues) {
14
- throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
15
- }
16
- }
17
-
18
- return getRandomValues(rnds8);
19
- }
20
-
21
- export default rng;
22
- //# sourceMappingURL=rng.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -1,32 +0,0 @@
1
- import validate from './validate.js';
2
-
3
- /**
4
- * Convert array of 16 byte values to UUID string format of the form:
5
- * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
6
- */
7
-
8
- var byteToHex = [];
9
-
10
- for (var i = 0; i < 256; ++i) {
11
- byteToHex.push((i + 0x100).toString(16).substr(1));
12
- }
13
-
14
- function stringify(arr) {
15
- var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
16
- // Note: Be careful editing this code! It's been tuned for performance
17
- // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
18
- var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one
19
- // of the following:
20
- // - One or more input array values don't map to a hex octet (leading to
21
- // "undefined" in the uuid)
22
- // - Invalid input values for the RFC `version` or `variant` fields
23
-
24
- if (!validate(uuid)) {
25
- throw TypeError('Stringified UUID is invalid');
26
- }
27
-
28
- return uuid;
29
- }
30
-
31
- export default stringify;
32
- //# sourceMappingURL=stringify.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -1,25 +0,0 @@
1
- import rng from './rng.js';
2
- import stringify from './stringify.js';
3
-
4
- function v4(options, buf, offset) {
5
- options = options || {};
6
- var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
7
-
8
- rnds[6] = rnds[6] & 0x0f | 0x40;
9
- rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
10
-
11
- if (buf) {
12
- offset = offset || 0;
13
-
14
- for (var i = 0; i < 16; ++i) {
15
- buf[offset + i] = rnds[i];
16
- }
17
-
18
- return buf;
19
- }
20
-
21
- return stringify(rnds);
22
- }
23
-
24
- export default v4;
25
- //# sourceMappingURL=v4.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -1,8 +0,0 @@
1
- import REGEX from './regex.js';
2
-
3
- function validate(uuid) {
4
- return typeof uuid === 'string' && REGEX.test(uuid);
5
- }
6
-
7
- export default validate;
8
- //# sourceMappingURL=validate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;"}