@everymatrix/general-input 1.55.0 → 1.56.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/cjs/checkbox-group-input_10.cjs.entry.js +17680 -17641
  2. package/dist/cjs/general-input.cjs.entry.js +17 -18
  3. package/dist/cjs/general-input.cjs.js +2 -2
  4. package/dist/cjs/{index-01420a64.js → index-a91d7bcb.js} +177 -76
  5. package/dist/cjs/loader.cjs.js +1 -1
  6. package/dist/cjs/toggle-checkbox-input.cjs.entry.js +12 -16
  7. package/dist/collection/collection-manifest.json +1 -1
  8. package/dist/collection/components/checkbox-group-input/checkbox-group-input.js +33 -17
  9. package/dist/collection/components/checkbox-input/checkbox-input.js +29 -14
  10. package/dist/collection/components/date-input/date-input.js +35 -17
  11. package/dist/collection/components/email-input/email-input.js +29 -16
  12. package/dist/collection/components/general-input/general-input.js +51 -18
  13. package/dist/collection/components/number-input/number-input.js +27 -15
  14. package/dist/collection/components/password-input/password-input.js +34 -19
  15. package/dist/collection/components/radio-input/radio-input.js +24 -14
  16. package/dist/collection/components/select-input/select-input.js +39 -17
  17. package/dist/collection/components/tel-input/tel-input.js +31 -17
  18. package/dist/collection/components/text-input/text-input.js +36 -17
  19. package/dist/collection/components/toggle-checkbox-input/toggle-checkbox-input.js +33 -17
  20. package/dist/esm/checkbox-group-input_10.entry.js +17680 -17641
  21. package/dist/esm/general-input.entry.js +17 -18
  22. package/dist/esm/general-input.js +3 -3
  23. package/dist/esm/{index-542cff81.js → index-3bab966c.js} +177 -76
  24. package/dist/esm/loader.js +2 -2
  25. package/dist/esm/toggle-checkbox-input.entry.js +12 -16
  26. package/dist/general-input/general-input.esm.js +1 -1
  27. package/dist/general-input/p-5ab8d194.js +2 -0
  28. package/dist/general-input/p-8ce07665.entry.js +1 -0
  29. package/dist/general-input/p-9ad71153.entry.js +1 -0
  30. package/dist/general-input/p-a708ec0e.entry.js +4465 -0
  31. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/general-input/.stencil/packages/stencil/general-input/stencil.config.d.ts +2 -0
  32. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/general-input/.stencil/packages/stencil/general-input/stencil.config.dev.d.ts +2 -0
  33. package/package.json +1 -1
  34. package/dist/general-input/p-3cab3b95.entry.js +0 -1
  35. package/dist/general-input/p-3ce1e382.js +0 -2
  36. package/dist/general-input/p-e5532cb1.entry.js +0 -1
  37. package/dist/general-input/p-ff2306f9.entry.js +0 -5909
  38. package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/general-input/.stencil/packages/stencil/general-input/stencil.config.d.ts +0 -2
  39. package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/general-input/.stencil/packages/stencil/general-input/stencil.config.dev.d.ts +0 -2
  40. /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/general-input/.stencil/tools/plugins/index.d.ts +0 -0
  41. /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/general-input/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +0 -0
  42. /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/general-input/.stencil/tools/plugins/vite-chunk-plugin.d.ts +0 -0
  43. /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/general-input/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +0 -0
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h, H as Host } from './index-542cff81.js';
1
+ import { r as registerInstance, h, H as Host } from './index-3bab966c.js';
2
2
  import { g as getTranslations } from './locale.utils-0883d9a6.js';
3
3
 
4
4
  const generalInputCss = ":host{display:block;height:100%}";
@@ -7,29 +7,28 @@ const GeneralInputStyle0 = generalInputCss;
7
7
  const GeneralInput = class {
8
8
  constructor(hostRef) {
9
9
  registerInstance(this, hostRef);
10
+ /**
11
+ * Type the general-input should take. Can take the default HTML input values.
12
+ */
13
+ this.type = 'text';
14
+ /**
15
+ * Client custom styling via inline style
16
+ */
17
+ this.clientStyling = '';
18
+ /**
19
+ * Translations via URL
20
+ */
21
+ this.translationUrl = '';
22
+ /**
23
+ * Emit event on click
24
+ */
25
+ this.emitOnClick = false;
10
26
  this.handleClick = (event) => {
11
27
  if (this.emitOnClick) {
12
28
  event.stopPropagation();
13
29
  window.postMessage({ type: `registration${this.name}Clicked` }, window.location.href);
14
30
  }
15
31
  };
16
- this.type = 'text';
17
- this.name = undefined;
18
- this.displayName = undefined;
19
- this.placeholder = undefined;
20
- this.action = undefined;
21
- this.validation = undefined;
22
- this.options = undefined;
23
- this.language = undefined;
24
- this.autofilled = undefined;
25
- this.tooltip = undefined;
26
- this.defaultValue = undefined;
27
- this.emitValue = undefined;
28
- this.isDuplicateInput = undefined;
29
- this.clientStyling = '';
30
- this.dateFormat = undefined;
31
- this.translationUrl = '';
32
- this.emitOnClick = false;
33
32
  }
34
33
  connectedCallback() {
35
34
  if (this.translationUrl) {
@@ -1,9 +1,9 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-542cff81.js';
2
- export { s as setNonce } from './index-542cff81.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-3bab966c.js';
2
+ export { s as setNonce } from './index-3bab966c.js';
3
3
  import { g as globalScripts } from './app-globals-0f993ce5.js';
4
4
 
5
5
  /*
6
- Stencil Client Patch Browser v4.22.3 | MIT Licensed | https://stenciljs.com
6
+ Stencil Client Patch Browser v4.26.0 | MIT Licensed | https://stenciljs.com
7
7
  */
8
8
  var patchBrowser = () => {
9
9
  const importMeta = import.meta.url;
@@ -1,17 +1,21 @@
1
1
  const NAMESPACE = 'general-input';
2
- const BUILD = /* general-input */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: true, hostListenerTargetDocument: true, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: false, propNumber: false, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: false, vdomText: true, vdomXlink: false, watchCallback: true };
2
+ const BUILD = /* general-input */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: true, hostListenerTargetDocument: true, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, modernPropertyDecls: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: false, propNumber: false, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: false, vdomText: true, vdomXlink: false, watchCallback: true };
3
3
 
4
4
  /*
5
- Stencil Client Platform v4.22.3 | MIT Licensed | https://stenciljs.com
5
+ Stencil Client Platform v4.26.0 | MIT Licensed | https://stenciljs.com
6
6
  */
7
7
  var __defProp = Object.defineProperty;
8
8
  var __export = (target, all) => {
9
9
  for (var name in all)
10
10
  __defProp(target, name, { get: all[name], enumerable: true });
11
11
  };
12
+
13
+ // src/client/client-host-ref.ts
12
14
  var hostRefs = /* @__PURE__ */ new WeakMap();
13
15
  var getHostRef = (ref) => hostRefs.get(ref);
14
- var registerInstance = (lazyInstance, hostRef) => hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
16
+ var registerInstance = (lazyInstance, hostRef) => {
17
+ hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
18
+ };
15
19
  var registerHost = (hostElement, cmpMeta) => {
16
20
  const hostRef = {
17
21
  $flags$: 0,
@@ -24,7 +28,8 @@ var registerHost = (hostElement, cmpMeta) => {
24
28
  hostElement["s-p"] = [];
25
29
  hostElement["s-rc"] = [];
26
30
  }
27
- return hostRefs.set(hostElement, hostRef);
31
+ const ref = hostRefs.set(hostElement, hostRef);
32
+ return ref;
28
33
  };
29
34
  var isMemberInElement = (elm, memberName) => memberName in elm;
30
35
  var consoleError = (e, el) => (0, console.error)(e, el);
@@ -69,16 +74,22 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
69
74
  /* webpackExclude: /\.system\.entry\.js$/ */
70
75
  /* webpackMode: "lazy" */
71
76
  `./${bundleId}.entry.js${""}`
72
- ).then((importedModule) => {
73
- {
74
- cmpModules.set(bundleId, importedModule);
77
+ ).then(
78
+ (importedModule) => {
79
+ {
80
+ cmpModules.set(bundleId, importedModule);
81
+ }
82
+ return importedModule[exportName];
83
+ },
84
+ (e) => {
85
+ consoleError(e, hostRef.$hostElement$);
75
86
  }
76
- return importedModule[exportName];
77
- }, consoleError);
87
+ );
78
88
  };
79
89
 
80
90
  // src/client/client-style.ts
81
91
  var styles = /* @__PURE__ */ new Map();
92
+ var HYDRATED_STYLE_ID = "sty-id";
82
93
  var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
83
94
  var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
84
95
  var win = typeof window !== "undefined" ? window : {};
@@ -152,12 +163,6 @@ var flush = () => {
152
163
  };
153
164
  var nextTick = (cb) => promiseResolve().then(cb);
154
165
  var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
155
-
156
- // src/utils/constants.ts
157
- var EMPTY_OBJ = {};
158
-
159
- // src/utils/helpers.ts
160
- var isDef = (v) => v != null;
161
166
  var isComplexType = (o) => {
162
167
  o = typeof o;
163
168
  return o === "object" || o === "function";
@@ -358,7 +363,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
358
363
  }
359
364
  if (!appliedStyles.has(scopeId2)) {
360
365
  {
361
- styleElm = doc.createElement("style");
366
+ styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || doc.createElement("style");
362
367
  styleElm.innerHTML = style;
363
368
  const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
364
369
  if (nonce != null) {
@@ -368,7 +373,10 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
368
373
  if (styleContainerNode.nodeName === "HEAD") {
369
374
  const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
370
375
  const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
371
- styleContainerNode.insertBefore(styleElm, referenceNode2);
376
+ styleContainerNode.insertBefore(
377
+ styleElm,
378
+ (referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
379
+ );
372
380
  } else if ("host" in styleContainerNode) {
373
381
  if (supportsConstructableStylesheets) {
374
382
  const stylesheet = new CSSStyleSheet();
@@ -386,7 +394,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
386
394
  styleContainerNode.append(styleElm);
387
395
  }
388
396
  }
389
- if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */ && styleContainerNode.nodeName !== "HEAD") {
397
+ if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
390
398
  styleContainerNode.insertBefore(styleElm, null);
391
399
  }
392
400
  }
@@ -411,23 +419,25 @@ var attachStyles = (hostRef) => {
411
419
  const scopeId2 = addStyle(
412
420
  elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
413
421
  cmpMeta);
414
- if (flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
422
+ if ((flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */ || flags & 128 /* shadowNeedsScopedCss */)) {
415
423
  elm["s-sc"] = scopeId2;
416
424
  elm.classList.add(scopeId2 + "-h");
417
425
  }
418
426
  endAttachStyles();
419
427
  };
420
428
  var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
421
- var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
429
+ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
422
430
  if (oldValue !== newValue) {
423
431
  let isProp = isMemberInElement(elm, memberName);
424
432
  let ln = memberName.toLowerCase();
425
433
  if (memberName === "class") {
426
434
  const classList = elm.classList;
427
435
  const oldClasses = parseClassList(oldValue);
428
- const newClasses = parseClassList(newValue);
429
- classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
430
- classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
436
+ let newClasses = parseClassList(newValue);
437
+ {
438
+ classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
439
+ classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
440
+ }
431
441
  } else if (memberName === "key") ; else if (memberName === "ref") {
432
442
  if (newValue) {
433
443
  newValue(elm);
@@ -465,7 +475,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
465
475
  elm.setAttribute(memberName, n);
466
476
  }
467
477
  }
468
- } else {
478
+ } else if (elm[memberName] !== newValue) {
469
479
  elm[memberName] = newValue;
470
480
  }
471
481
  } catch (e) {
@@ -487,24 +497,44 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
487
497
  }
488
498
  };
489
499
  var parseClassListRegex = /\s/;
490
- var parseClassList = (value) => !value ? [] : value.split(parseClassListRegex);
500
+ var parseClassList = (value) => {
501
+ if (typeof value === "object" && value && "baseVal" in value) {
502
+ value = value.baseVal;
503
+ }
504
+ if (!value || typeof value !== "string") {
505
+ return [];
506
+ }
507
+ return value.split(parseClassListRegex);
508
+ };
491
509
  var CAPTURE_EVENT_SUFFIX = "Capture";
492
510
  var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
493
511
 
494
512
  // src/runtime/vdom/update-element.ts
495
- var updateElement = (oldVnode, newVnode, isSvgMode2) => {
513
+ var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
496
514
  const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
497
- const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || EMPTY_OBJ;
498
- const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
515
+ const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
516
+ const newVnodeAttrs = newVnode.$attrs$ || {};
499
517
  {
500
518
  for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
501
519
  if (!(memberName in newVnodeAttrs)) {
502
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], void 0, isSvgMode2, newVnode.$flags$);
520
+ setAccessor(
521
+ elm,
522
+ memberName,
523
+ oldVnodeAttrs[memberName],
524
+ void 0,
525
+ isSvgMode2,
526
+ newVnode.$flags$);
503
527
  }
504
528
  }
505
529
  }
506
530
  for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
507
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode2, newVnode.$flags$);
531
+ setAccessor(
532
+ elm,
533
+ memberName,
534
+ oldVnodeAttrs[memberName],
535
+ newVnodeAttrs[memberName],
536
+ isSvgMode2,
537
+ newVnode.$flags$);
508
538
  }
509
539
  };
510
540
  function sortedAttrNames(attrNames) {
@@ -516,13 +546,10 @@ function sortedAttrNames(attrNames) {
516
546
  attrNames
517
547
  );
518
548
  }
519
-
520
- // src/runtime/vdom/vdom-render.ts
521
- var scopeId;
522
549
  var hostTagName;
523
550
  var useNativeShadowDom = false;
524
551
  var isSvgMode = false;
525
- var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
552
+ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
526
553
  const newVNode2 = newParentVNode.$children$[childIndex];
527
554
  let i2 = 0;
528
555
  let elm;
@@ -536,11 +563,6 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
536
563
  {
537
564
  updateElement(null, newVNode2, isSvgMode);
538
565
  }
539
- const rootNode = elm.getRootNode();
540
- const isElementWithinShadowRoot = !rootNode.querySelector("body");
541
- if (!isElementWithinShadowRoot && BUILD.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
542
- elm.classList.add(elm["s-si"] = scopeId);
543
- }
544
566
  if (newVNode2.$children$) {
545
567
  for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
546
568
  childNode = createElm(oldParentVNode, newVNode2, i2);
@@ -670,6 +692,9 @@ var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
670
692
  if (!isInitialRender) {
671
693
  return leftVNode.$key$ === rightVNode.$key$;
672
694
  }
695
+ if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
696
+ leftVNode.$key$ = rightVNode.$key$;
697
+ }
673
698
  return true;
674
699
  }
675
700
  return false;
@@ -709,8 +734,9 @@ var nullifyVNodeRefs = (vNode) => {
709
734
  }
710
735
  };
711
736
  var insertBefore = (parent, newNode, reference) => {
712
- const inserted = parent == null ? void 0 : parent.insertBefore(newNode, reference);
713
- return inserted;
737
+ {
738
+ return parent == null ? void 0 : parent.insertBefore(newNode, reference);
739
+ }
714
740
  };
715
741
  var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
716
742
  const hostElm = hostRef.$hostElement$;
@@ -735,17 +761,21 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
735
761
  rootVnode.$flags$ |= 4 /* isHost */;
736
762
  hostRef.$vnode$ = rootVnode;
737
763
  rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
738
- {
739
- scopeId = hostElm["s-sc"];
740
- }
741
- useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
764
+ useNativeShadowDom = !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && !(cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */);
742
765
  patch(oldVNode, rootVnode, isInitialLoad);
743
766
  };
744
767
 
745
768
  // src/runtime/update-component.ts
746
769
  var attachToAncestor = (hostRef, ancestorComponent) => {
747
770
  if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
748
- ancestorComponent["s-p"].push(new Promise((r) => hostRef.$onRenderResolve$ = r));
771
+ const index = ancestorComponent["s-p"].push(
772
+ new Promise(
773
+ (r) => hostRef.$onRenderResolve$ = () => {
774
+ ancestorComponent["s-p"].splice(index - 1, 1);
775
+ r();
776
+ }
777
+ )
778
+ );
749
779
  }
750
780
  };
751
781
  var scheduleUpdate = (hostRef, isInitialLoad) => {
@@ -774,12 +804,12 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
774
804
  {
775
805
  hostRef.$flags$ |= 256 /* isListenReady */;
776
806
  if (hostRef.$queuedListeners$) {
777
- hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
807
+ hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event, elm));
778
808
  hostRef.$queuedListeners$ = void 0;
779
809
  }
780
810
  }
781
811
  {
782
- maybePromise = safeCall(instance, "componentWillLoad");
812
+ maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
783
813
  }
784
814
  }
785
815
  endSchedule();
@@ -848,7 +878,7 @@ var postUpdateComponent = (hostRef) => {
848
878
  const instance = hostRef.$lazyInstance$ ;
849
879
  const ancestorComponent = hostRef.$ancestorComponent$;
850
880
  {
851
- safeCall(instance, "componentDidRender");
881
+ safeCall(instance, "componentDidRender", void 0, elm);
852
882
  }
853
883
  if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
854
884
  hostRef.$flags$ |= 64 /* hasLoadedComponent */;
@@ -856,7 +886,7 @@ var postUpdateComponent = (hostRef) => {
856
886
  addHydratedFlag(elm);
857
887
  }
858
888
  {
859
- safeCall(instance, "componentDidLoad");
889
+ safeCall(instance, "componentDidLoad", void 0, elm);
860
890
  }
861
891
  endPostUpdate();
862
892
  {
@@ -880,17 +910,14 @@ var postUpdateComponent = (hostRef) => {
880
910
  }
881
911
  };
882
912
  var appDidLoad = (who) => {
883
- {
884
- addHydratedFlag(doc.documentElement);
885
- }
886
913
  nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
887
914
  };
888
- var safeCall = (instance, method, arg) => {
915
+ var safeCall = (instance, method, arg, elm) => {
889
916
  if (instance && instance[method]) {
890
917
  try {
891
918
  return instance[method](arg);
892
919
  } catch (e) {
893
- consoleError(e);
920
+ consoleError(e, elm);
894
921
  }
895
922
  }
896
923
  return void 0;
@@ -949,15 +976,68 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
949
976
  const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
950
977
  members.map(([memberName, [memberFlags]]) => {
951
978
  if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
979
+ const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
980
+ if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
981
+ if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
982
+ if (flags & 1 /* isElementConstructor */ || !origGetter) {
983
+ Object.defineProperty(prototype, memberName, {
984
+ get() {
985
+ {
986
+ if ((cmpMeta.$members$[memberName][0] & 2048 /* Getter */) === 0) {
987
+ return getValue(this, memberName);
988
+ }
989
+ const ref = getHostRef(this);
990
+ const instance = ref ? ref.$lazyInstance$ : prototype;
991
+ if (!instance) return;
992
+ return instance[memberName];
993
+ }
994
+ },
995
+ configurable: true,
996
+ enumerable: true
997
+ });
998
+ }
952
999
  Object.defineProperty(prototype, memberName, {
953
- get() {
954
- return getValue(this, memberName);
955
- },
956
1000
  set(newValue) {
957
- setValue(this, memberName, newValue, cmpMeta);
958
- },
959
- configurable: true,
960
- enumerable: true
1001
+ const ref = getHostRef(this);
1002
+ if (origSetter) {
1003
+ const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
1004
+ if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
1005
+ newValue = ref.$instanceValues$.get(memberName);
1006
+ } else if (!ref.$instanceValues$.get(memberName) && currentValue) {
1007
+ ref.$instanceValues$.set(memberName, currentValue);
1008
+ }
1009
+ origSetter.apply(this, [parsePropertyValue(newValue, memberFlags)]);
1010
+ newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
1011
+ setValue(this, memberName, newValue, cmpMeta);
1012
+ return;
1013
+ }
1014
+ {
1015
+ if ((flags & 1 /* isElementConstructor */) === 0 || (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0) {
1016
+ setValue(this, memberName, newValue, cmpMeta);
1017
+ if (flags & 1 /* isElementConstructor */ && !ref.$lazyInstance$) {
1018
+ ref.$onReadyPromise$.then(() => {
1019
+ if (cmpMeta.$members$[memberName][0] & 4096 /* Setter */ && ref.$lazyInstance$[memberName] !== ref.$instanceValues$.get(memberName)) {
1020
+ ref.$lazyInstance$[memberName] = newValue;
1021
+ }
1022
+ });
1023
+ }
1024
+ return;
1025
+ }
1026
+ const setterSetVal = () => {
1027
+ const currentValue = ref.$lazyInstance$[memberName];
1028
+ if (!ref.$instanceValues$.get(memberName) && currentValue) {
1029
+ ref.$instanceValues$.set(memberName, currentValue);
1030
+ }
1031
+ ref.$lazyInstance$[memberName] = parsePropertyValue(newValue, memberFlags);
1032
+ setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
1033
+ };
1034
+ if (ref.$lazyInstance$) {
1035
+ setterSetVal();
1036
+ } else {
1037
+ ref.$onReadyPromise$.then(() => setterSetVal());
1038
+ }
1039
+ }
1040
+ }
961
1041
  });
962
1042
  }
963
1043
  });
@@ -967,7 +1047,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
967
1047
  plt.jmp(() => {
968
1048
  var _a2;
969
1049
  const propName = attrNameToPropName.get(attrName);
970
- if (this.hasOwnProperty(propName)) {
1050
+ if (this.hasOwnProperty(propName) && BUILD.lazyLoad) {
971
1051
  newValue = this[propName];
972
1052
  delete this[propName];
973
1053
  } else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
@@ -987,7 +1067,11 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
987
1067
  }
988
1068
  return;
989
1069
  }
990
- this[propName] = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
1070
+ const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
1071
+ newValue = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
1072
+ if (newValue !== this[propName] && (!propDesc.get || !!propDesc.set)) {
1073
+ this[propName] = newValue;
1074
+ }
991
1075
  });
992
1076
  };
993
1077
  Cstr.observedAttributes = Array.from(
@@ -1016,7 +1100,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1016
1100
  hostRef.$flags$ |= 32 /* hasInitializedComponent */;
1017
1101
  const bundleId = cmpMeta.$lazyBundleId$;
1018
1102
  if (bundleId) {
1019
- const CstrImport = loadModule(cmpMeta);
1103
+ const CstrImport = loadModule(cmpMeta, hostRef);
1020
1104
  if (CstrImport && "then" in CstrImport) {
1021
1105
  const endLoad = uniqueTime();
1022
1106
  Cstr = await CstrImport;
@@ -1041,7 +1125,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1041
1125
  try {
1042
1126
  new Cstr(hostRef);
1043
1127
  } catch (e) {
1044
- consoleError(e);
1128
+ consoleError(e, elm);
1045
1129
  }
1046
1130
  {
1047
1131
  hostRef.$flags$ &= ~8 /* isConstructingInstance */;
@@ -1050,7 +1134,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1050
1134
  hostRef.$flags$ |= 128 /* isWatchReady */;
1051
1135
  }
1052
1136
  endNewInstance();
1053
- fireConnectedCallback(hostRef.$lazyInstance$);
1137
+ fireConnectedCallback(hostRef.$lazyInstance$, elm);
1054
1138
  } else {
1055
1139
  Cstr = elm.constructor;
1056
1140
  const cmpTag = elm.localName;
@@ -1077,9 +1161,9 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1077
1161
  schedule();
1078
1162
  }
1079
1163
  };
1080
- var fireConnectedCallback = (instance) => {
1164
+ var fireConnectedCallback = (instance, elm) => {
1081
1165
  {
1082
- safeCall(instance, "connectedCallback");
1166
+ safeCall(instance, "connectedCallback", void 0, elm);
1083
1167
  }
1084
1168
  };
1085
1169
 
@@ -1115,17 +1199,17 @@ var connectedCallback = (elm) => {
1115
1199
  } else {
1116
1200
  addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
1117
1201
  if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
1118
- fireConnectedCallback(hostRef.$lazyInstance$);
1202
+ fireConnectedCallback(hostRef.$lazyInstance$, elm);
1119
1203
  } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
1120
- hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$));
1204
+ hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$, elm));
1121
1205
  }
1122
1206
  }
1123
1207
  endConnected();
1124
1208
  }
1125
1209
  };
1126
- var disconnectInstance = (instance) => {
1210
+ var disconnectInstance = (instance, elm) => {
1127
1211
  {
1128
- safeCall(instance, "disconnectedCallback");
1212
+ safeCall(instance, "disconnectedCallback", void 0, elm || instance);
1129
1213
  }
1130
1214
  };
1131
1215
  var disconnectedCallback = async (elm) => {
@@ -1138,11 +1222,17 @@ var disconnectedCallback = async (elm) => {
1138
1222
  }
1139
1223
  }
1140
1224
  if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
1141
- disconnectInstance(hostRef.$lazyInstance$);
1225
+ disconnectInstance(hostRef.$lazyInstance$, elm);
1142
1226
  } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
1143
- hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$));
1227
+ hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$, elm));
1144
1228
  }
1145
1229
  }
1230
+ if (rootAppliedStyles.has(elm)) {
1231
+ rootAppliedStyles.delete(elm);
1232
+ }
1233
+ if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) {
1234
+ rootAppliedStyles.delete(elm.shadowRoot);
1235
+ }
1146
1236
  };
1147
1237
 
1148
1238
  // src/runtime/bootstrap-lazy.ts
@@ -1227,6 +1317,17 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1227
1317
  }
1228
1318
  disconnectedCallback() {
1229
1319
  plt.jmp(() => disconnectedCallback(this));
1320
+ plt.raf(() => {
1321
+ var _a3;
1322
+ const hostRef = getHostRef(this);
1323
+ const i2 = deferredConnectedCallbacks.findIndex((host) => host === this);
1324
+ if (i2 > -1) {
1325
+ deferredConnectedCallbacks.splice(i2, 1);
1326
+ }
1327
+ if (((_a3 = hostRef == null ? void 0 : hostRef.$vnode$) == null ? void 0 : _a3.$elm$) instanceof Node && !hostRef.$vnode$.$elm$.isConnected) {
1328
+ delete hostRef.$vnode$.$elm$;
1329
+ }
1330
+ });
1230
1331
  }
1231
1332
  componentOnReady() {
1232
1333
  return getHostRef(this).$onReadyPromise$;
@@ -1290,7 +1391,7 @@ var hostListenerProxy = (hostRef, methodName) => (ev) => {
1290
1391
  }
1291
1392
  }
1292
1393
  } catch (e) {
1293
- consoleError(e);
1394
+ consoleError(e, hostRef.$hostElement$);
1294
1395
  }
1295
1396
  };
1296
1397
  var getHostListenerTarget = (elm, flags) => {
@@ -1,5 +1,5 @@
1
- import { b as bootstrapLazy } from './index-542cff81.js';
2
- export { s as setNonce } from './index-542cff81.js';
1
+ import { b as bootstrapLazy } from './index-3bab966c.js';
2
+ export { s as setNonce } from './index-3bab966c.js';
3
3
  import { g as globalScripts } from './app-globals-0f993ce5.js';
4
4
 
5
5
  const defineCustomElements = async (win, options) => {
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h } from './index-542cff81.js';
1
+ import { r as registerInstance, c as createEvent, h } from './index-3bab966c.js';
2
2
  import { t as translate } from './locale.utils-0883d9a6.js';
3
3
  import { t as tooltipIconSvg } from './tooltipIcon-0a5a06a2.js';
4
4
 
@@ -10,27 +10,23 @@ const ToggleCheckboxInput = class {
10
10
  registerInstance(this, hostRef);
11
11
  this.sendValidityState = createEvent(this, "sendValidityState", 7);
12
12
  this.sendInputValue = createEvent(this, "sendInputValue", 7);
13
+ /**
14
+ * Default value for the input.
15
+ */
16
+ this.defaultValue = '';
17
+ /**
18
+ * Client custom styling via inline style
19
+ */
20
+ this.clientStyling = '';
21
+ this.limitStylingAppends = false;
22
+ this.showTooltip = false;
23
+ this.showFields = this.defaultValue === 'true';
13
24
  this.value = '';
14
25
  this.setClientStyling = () => {
15
26
  let sheet = document.createElement('style');
16
27
  sheet.innerHTML = this.clientStyling;
17
28
  this.stylingContainer.prepend(sheet);
18
29
  };
19
- this.name = undefined;
20
- this.displayName = undefined;
21
- this.defaultValue = '';
22
- this.options = undefined;
23
- this.autofilled = undefined;
24
- this.tooltip = undefined;
25
- this.validation = undefined;
26
- this.language = undefined;
27
- this.emitValue = undefined;
28
- this.clientStyling = '';
29
- this.errorMessage = undefined;
30
- this.isValid = undefined;
31
- this.limitStylingAppends = false;
32
- this.showTooltip = false;
33
- this.showFields = this.defaultValue === 'true';
34
30
  }
35
31
  validityStateHandler(inputStateEvent) {
36
32
  this.sendValidityState.emit(inputStateEvent);