@dbmx/toasts 0.0.18 → 0.0.19

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.
@@ -379,6 +379,28 @@ function _asyncToGenerator(fn) {
379
379
  });
380
380
  };
381
381
  }
382
+ function _classCallCheck(instance, Constructor) {
383
+ if (!(instance instanceof Constructor)) {
384
+ throw new TypeError("Cannot call a class as a function");
385
+ }
386
+ }
387
+ function _defineProperties(target, props) {
388
+ for (var i = 0; i < props.length; i++) {
389
+ var descriptor = props[i];
390
+ descriptor.enumerable = descriptor.enumerable || false;
391
+ descriptor.configurable = true;
392
+ if ("value" in descriptor) descriptor.writable = true;
393
+ Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
394
+ }
395
+ }
396
+ function _createClass(Constructor, protoProps, staticProps) {
397
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
398
+ if (staticProps) _defineProperties(Constructor, staticProps);
399
+ Object.defineProperty(Constructor, "prototype", {
400
+ writable: false
401
+ });
402
+ return Constructor;
403
+ }
382
404
  function _defineProperty(obj, key, value) {
383
405
  key = _toPropertyKey(key);
384
406
  if (key in obj) {
@@ -393,6 +415,122 @@ function _defineProperty(obj, key, value) {
393
415
  }
394
416
  return obj;
395
417
  }
418
+ function _inherits(subClass, superClass) {
419
+ if (typeof superClass !== "function" && superClass !== null) {
420
+ throw new TypeError("Super expression must either be null or a function");
421
+ }
422
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
423
+ constructor: {
424
+ value: subClass,
425
+ writable: true,
426
+ configurable: true
427
+ }
428
+ });
429
+ Object.defineProperty(subClass, "prototype", {
430
+ writable: false
431
+ });
432
+ if (superClass) _setPrototypeOf(subClass, superClass);
433
+ }
434
+ function _getPrototypeOf(o) {
435
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
436
+ return o.__proto__ || Object.getPrototypeOf(o);
437
+ };
438
+ return _getPrototypeOf(o);
439
+ }
440
+ function _setPrototypeOf(o, p) {
441
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
442
+ o.__proto__ = p;
443
+ return o;
444
+ };
445
+ return _setPrototypeOf(o, p);
446
+ }
447
+ function _isNativeReflectConstruct() {
448
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
449
+ if (Reflect.construct.sham) return false;
450
+ if (typeof Proxy === "function") return true;
451
+ try {
452
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
453
+ return true;
454
+ } catch (e) {
455
+ return false;
456
+ }
457
+ }
458
+ function _construct(Parent, args, Class) {
459
+ if (_isNativeReflectConstruct()) {
460
+ _construct = Reflect.construct.bind();
461
+ } else {
462
+ _construct = function _construct(Parent, args, Class) {
463
+ var a = [null];
464
+ a.push.apply(a, args);
465
+ var Constructor = Function.bind.apply(Parent, a);
466
+ var instance = new Constructor();
467
+ if (Class) _setPrototypeOf(instance, Class.prototype);
468
+ return instance;
469
+ };
470
+ }
471
+ return _construct.apply(null, arguments);
472
+ }
473
+ function _isNativeFunction(fn) {
474
+ try {
475
+ return Function.toString.call(fn).indexOf("[native code]") !== -1;
476
+ } catch (e) {
477
+ return typeof fn === "function";
478
+ }
479
+ }
480
+ function _wrapNativeSuper(Class) {
481
+ var _cache = typeof Map === "function" ? new Map() : undefined;
482
+ _wrapNativeSuper = function _wrapNativeSuper(Class) {
483
+ if (Class === null || !_isNativeFunction(Class)) return Class;
484
+ if (typeof Class !== "function") {
485
+ throw new TypeError("Super expression must either be null or a function");
486
+ }
487
+ if (typeof _cache !== "undefined") {
488
+ if (_cache.has(Class)) return _cache.get(Class);
489
+ _cache.set(Class, Wrapper);
490
+ }
491
+ function Wrapper() {
492
+ return _construct(Class, arguments, _getPrototypeOf(this).constructor);
493
+ }
494
+ Wrapper.prototype = Object.create(Class.prototype, {
495
+ constructor: {
496
+ value: Wrapper,
497
+ enumerable: false,
498
+ writable: true,
499
+ configurable: true
500
+ }
501
+ });
502
+ return _setPrototypeOf(Wrapper, Class);
503
+ };
504
+ return _wrapNativeSuper(Class);
505
+ }
506
+ function _assertThisInitialized(self) {
507
+ if (self === void 0) {
508
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
509
+ }
510
+ return self;
511
+ }
512
+ function _possibleConstructorReturn(self, call) {
513
+ if (call && (typeof call === "object" || typeof call === "function")) {
514
+ return call;
515
+ } else if (call !== void 0) {
516
+ throw new TypeError("Derived constructors may only return object or undefined");
517
+ }
518
+ return _assertThisInitialized(self);
519
+ }
520
+ function _createSuper(Derived) {
521
+ var hasNativeReflectConstruct = _isNativeReflectConstruct();
522
+ return function _createSuperInternal() {
523
+ var Super = _getPrototypeOf(Derived),
524
+ result;
525
+ if (hasNativeReflectConstruct) {
526
+ var NewTarget = _getPrototypeOf(this).constructor;
527
+ result = Reflect.construct(Super, arguments, NewTarget);
528
+ } else {
529
+ result = Super.apply(this, arguments);
530
+ }
531
+ return _possibleConstructorReturn(this, result);
532
+ };
533
+ }
396
534
  function _slicedToArray(arr, i) {
397
535
  return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
398
536
  }
@@ -496,17 +634,29 @@ function _toPropertyKey(arg) {
496
634
  exports.arrayLikeToArray = _arrayLikeToArray;
497
635
  exports.arrayWithHoles = _arrayWithHoles;
498
636
  exports.arrayWithoutHoles = _arrayWithoutHoles;
637
+ exports.assertThisInitialized = _assertThisInitialized;
499
638
  exports.asyncToGenerator = _asyncToGenerator;
639
+ exports.classCallCheck = _classCallCheck;
640
+ exports.construct = _construct;
641
+ exports.createClass = _createClass;
500
642
  exports.createForOfIteratorHelper = _createForOfIteratorHelper;
643
+ exports.createSuper = _createSuper;
501
644
  exports.defineProperty = _defineProperty;
645
+ exports.getPrototypeOf = _getPrototypeOf;
646
+ exports.inherits = _inherits;
647
+ exports.isNativeFunction = _isNativeFunction;
648
+ exports.isNativeReflectConstruct = _isNativeReflectConstruct;
502
649
  exports.iterableToArray = _iterableToArray;
503
650
  exports.iterableToArrayLimit = _iterableToArrayLimit;
504
651
  exports.nonIterableRest = _nonIterableRest;
505
652
  exports.nonIterableSpread = _nonIterableSpread;
506
653
  exports.objectSpread2 = _objectSpread2;
654
+ exports.possibleConstructorReturn = _possibleConstructorReturn;
507
655
  exports.regeneratorRuntime = _regeneratorRuntime;
656
+ exports.setPrototypeOf = _setPrototypeOf;
508
657
  exports.slicedToArray = _slicedToArray;
509
658
  exports.toConsumableArray = _toConsumableArray;
510
659
  exports.toPrimitive = _toPrimitive;
511
660
  exports.toPropertyKey = _toPropertyKey;
512
661
  exports.unsupportedIterableToArray = _unsupportedIterableToArray;
662
+ exports.wrapNativeSuper = _wrapNativeSuper;
package/cjs/index.cjs CHANGED
@@ -14,6 +14,7 @@ var toasts = [{
14
14
  type: type,
15
15
  tag: tag,
16
16
  name: 'SDMX Datagrid',
17
+ tech: 'react',
17
18
  description: 'SDMX, which stands for Statistical Data and Metadata eXchange, is an international initiative that aims at standardising and modernising ("industrialising") the mechanisms and processes for the exchange of statistical data and metadata among international organisations and their member countries.',
18
19
  component: /*#__PURE__*/React.lazy( /*#__PURE__*/_rollupPluginBabelHelpers.asyncToGenerator( /*#__PURE__*/_rollupPluginBabelHelpers.regeneratorRuntime().mark(function _callee() {
19
20
  var obj;
@@ -68,6 +69,25 @@ var toasts = [{
68
69
  defaultValue: '~'
69
70
  }
70
71
  }
72
+ }, {
73
+ id: 'helloWorld',
74
+ importPath: '@dbmx/webComponents',
75
+ type: '@dbmx/webComponents',
76
+ tag: 'hello-world',
77
+ name: 'Hello World',
78
+ tech: 'web-component',
79
+ description: 'web component demonstration',
80
+ component: function component() {
81
+ return Promise.resolve().then(function () { return require('./webComponents/HelloWorld/index.cjs'); });
82
+ },
83
+ image: 'https://ui.mantine.dev/_next/static/media/comments-light.9c0747c0.svg',
84
+ props: {
85
+ name: {
86
+ type: 'string',
87
+ required: true,
88
+ "default": 'test'
89
+ }
90
+ }
71
91
  }];
72
92
 
73
93
  module.exports = toasts;
@@ -0,0 +1,18 @@
1
+ 'use strict';
2
+
3
+ var require$$0 = require('react-dom');
4
+
5
+ exports.createRoot = void 0;
6
+
7
+ var m = require$$0;
8
+ {
9
+ var i = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
10
+ exports.createRoot = function (c, o) {
11
+ i.usingClientEntryPoint = true;
12
+ try {
13
+ return m.createRoot(c, o);
14
+ } finally {
15
+ i.usingClientEntryPoint = false;
16
+ }
17
+ };
18
+ }
@@ -0,0 +1,73 @@
1
+ 'use strict';
2
+
3
+ var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.cjs');
4
+ var React = require('react');
5
+ var client = require('../../node_modules/react-dom/client.cjs');
6
+
7
+ var Component = function Component(_ref) {
8
+ var name = _ref.name;
9
+ return /*#__PURE__*/React.createElement("div", {
10
+ style: {
11
+ backgroundColor: '#cfe8ff60',
12
+ padding: 15
13
+ }
14
+ }, /*#__PURE__*/React.createElement("h2", null, "testing react component"), /*#__PURE__*/React.createElement("p", null, "Your name is: ", /*#__PURE__*/React.createElement("i", {
15
+ style: {
16
+ color: '#9c9c9c'
17
+ }
18
+ }, name)), /*#__PURE__*/React.createElement("input", {
19
+ type: "text",
20
+ placeholder: "filter"
21
+ }));
22
+ };
23
+ var HelloWorld = /*#__PURE__*/function (_HTMLElement) {
24
+ _rollupPluginBabelHelpers.inherits(HelloWorld, _HTMLElement);
25
+ var _super = _rollupPluginBabelHelpers.createSuper(HelloWorld);
26
+ function HelloWorld() {
27
+ var _this;
28
+ _rollupPluginBabelHelpers.classCallCheck(this, HelloWorld);
29
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
30
+ args[_key] = arguments[_key];
31
+ }
32
+ _this = _super.call.apply(_super, [this].concat(args));
33
+ _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.assertThisInitialized(_this), "setName", void 0);
34
+ _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.assertThisInitialized(_this), "HelloWorldContainer", function () {
35
+ var _useState = React.useState(_this.getAttribute('name')),
36
+ _useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
37
+ name = _useState2[0],
38
+ updateName = _useState2[1];
39
+ _this.setName = updateName;
40
+ return /*#__PURE__*/React.createElement(Component, {
41
+ name: name
42
+ });
43
+ });
44
+ return _this;
45
+ }
46
+ _rollupPluginBabelHelpers.createClass(HelloWorld, [{
47
+ key: "connectedCallback",
48
+ value: function connectedCallback() {
49
+ var mountPoint = document.createElement('div');
50
+ this.attachShadow({
51
+ mode: 'open'
52
+ }).appendChild(mountPoint);
53
+ var root = client.createRoot(mountPoint);
54
+ root.render( /*#__PURE__*/React.createElement(this.HelloWorldContainer, null));
55
+ }
56
+ }, {
57
+ key: "attributeChangedCallback",
58
+ value: function attributeChangedCallback(attrName, oldValue, newValue) {
59
+ if (attrName === 'name') {
60
+ if (typeof this.setName === 'function') {
61
+ this.setName(newValue);
62
+ }
63
+ }
64
+ }
65
+ }], [{
66
+ key: "observedAttributes",
67
+ get: function get() {
68
+ return ['name'];
69
+ }
70
+ }]);
71
+ return HelloWorld;
72
+ }( /*#__PURE__*/_rollupPluginBabelHelpers.wrapNativeSuper(HTMLElement));
73
+ customElements.define('hello-world', HelloWorld);