@descope/flow-components 2.0.436 → 2.0.438

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.
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { DescopeInputProps } from '../types';
3
3
  type Props = {
4
- connector?: string;
4
+ 'data-connector-id'?: string;
5
5
  'connector-template'?: string;
6
6
  'min-search-length'?: number;
7
7
  'allow-custom-value'?: boolean;
@@ -19,5 +19,6 @@ declare const Button: React.ForwardRefExoticComponent<Omit<React.ClassAttributes
19
19
  startIcon?: string;
20
20
  startIconColorText?: boolean;
21
21
  'full-width'?: boolean;
22
+ 'data-name'?: string;
22
23
  }, "ref"> & React.RefAttributes<HTMLButtonElement>>;
23
24
  export default Button;
package/dist/index.cjs.js CHANGED
@@ -76773,6 +76773,15 @@ function requireIndex_cjs () {
76773
76773
  `;
76774
76774
  }
76775
76775
 
76776
+ init() {
76777
+ super.init?.();
76778
+ this.toggleVisibility(this.src);
76779
+ }
76780
+
76781
+ toggleVisibility(isVisible) {
76782
+ this.style.display = isVisible ? '' : 'none';
76783
+ }
76784
+
76776
76785
  get src() {
76777
76786
  return this.getAttribute('src');
76778
76787
  }
@@ -76798,6 +76807,8 @@ function requireIndex_cjs () {
76798
76807
  if (oldValue === newValue) return;
76799
76808
 
76800
76809
  if (attrName === 'src') {
76810
+ this.toggleVisibility(newValue);
76811
+
76801
76812
  createIcon(this.src).then((res) => {
76802
76813
  this.innerHTML = '';
76803
76814
  if (res) {
@@ -80258,14 +80269,6 @@ descope-boolean-field-internal {
80258
80269
  );
80259
80270
 
80260
80271
  if (missingOrInvalidParams.length) {
80261
- // eslint-disable-next-line no-console
80262
- console.error(
80263
- `[${this.constructor.name}] Invalid configuration. Issues with parameters:`,
80264
- missingOrInvalidParams.map((param) => ({
80265
- param,
80266
- value: this.getAttribute(param),
80267
- })),
80268
- );
80269
80272
  return false;
80270
80273
  }
80271
80274
  return true;
@@ -80728,8 +80731,6 @@ descope-boolean-field-internal {
80728
80731
  const template = this.connectorTemplate;
80729
80732
 
80730
80733
  if (!this.connectorClasses[template]) {
80731
- // eslint-disable-next-line no-console
80732
- console.error(`Unsupported connector template: ${template}`);
80733
80734
  return;
80734
80735
  }
80735
80736
  const ConnectorClass = this.connectorClasses[template];
@@ -80739,7 +80740,9 @@ descope-boolean-field-internal {
80739
80740
  async fetchConnectorResults(query) {
80740
80741
  if (!this.connector) {
80741
80742
  // eslint-disable-next-line no-console
80742
- console.error('No connector initialized for the field');
80743
+ console.error(
80744
+ `No connector initialized for the field with template: ${this.connectorTemplate}`,
80745
+ );
80743
80746
  return { results: [] };
80744
80747
  }
80745
80748
 
@@ -89946,11 +89949,9 @@ descope-boolean-field-internal {
89946
89949
  <div>
89947
89950
  <nav class="nav top-nav">
89948
89951
  <div class="nav-prev">
89949
- <descope-icon></descope-icon>
89950
89952
  </div>
89951
89953
  <div class="selectors"></div>
89952
89954
  <div class="nav-next">
89953
- <descope-icon></descope-icon>
89954
89955
  </div>
89955
89956
  </nav>
89956
89957
  <div class="calendar"></div>
@@ -90078,8 +90079,8 @@ descope-boolean-field-internal {
90078
90079
  })
90079
90080
  );
90080
90081
 
90081
- this.shadowRoot.querySelector('.nav-next descope-icon').innerHTML = arrowRightIcon;
90082
- this.shadowRoot.querySelector('.nav-prev descope-icon').innerHTML = arrowLeftIcon;
90082
+ this.shadowRoot.querySelector('.nav-next').innerHTML = arrowRightIcon;
90083
+ this.shadowRoot.querySelector('.nav-prev').innerHTML = arrowLeftIcon;
90083
90084
  }
90084
90085
 
90085
90086
  onSubmit() {
@@ -90770,7 +90771,7 @@ descope-boolean-field-internal {
90770
90771
  <div>
90771
90772
  <descope-text-field>
90772
90773
  <span slot="suffix" class="toggle-calendar">
90773
- <descope-icon>${calendarIcon}</descope-icon>
90774
+ ${calendarIcon}
90774
90775
  </span>
90775
90776
  </descope-text-field>
90776
90777
  <vaadin-popover></vaadin-popover>
@@ -94567,18 +94568,16 @@ var icons = /*#__PURE__*/Object.freeze({
94567
94568
  });
94568
94569
 
94569
94570
  const Icon = ({ icon, noColor, ...props }) => {
94570
- if (!icon)
94571
- return undefined;
94572
94571
  if (icons[icon]) {
94573
94572
  return (React__default.default.createElement("descope-icon", { src: icons[icon], ...(noColor && { 'st-fill': 'currentColor' }), ...props }));
94574
94573
  }
94575
94574
  return React__default.default.createElement("descope-icon", { "fill-color": noColor, src: icon });
94576
94575
  };
94577
94576
 
94578
- const Button = React__default.default.forwardRef(({ children, startIcon, startIconColorText, color = 'primary', size = 'md', variant = 'contained', ...props }, ref) => {
94577
+ const Button = React__default.default.forwardRef(({ children, startIcon, startIconColorText, color = 'primary', size = 'md', variant = 'contained', 'data-name': dataName, ...props }, ref) => {
94579
94578
  const isSquare = React.useMemo(() => !!(startIcon && !children), [startIcon, children]);
94580
- return (React__default.default.createElement("descope-button", { ...props, size: size, variant: variant, mode: color, ref: ref, square: isSquare },
94581
- startIcon && React__default.default.createElement(Icon, { icon: startIcon, noColor: startIconColorText }),
94579
+ return (React__default.default.createElement("descope-button", { ...props, size: size, variant: variant, mode: color, ref: ref, square: isSquare, "data-name": dataName },
94580
+ startIcon != null && (React__default.default.createElement(Icon, { "data-name": `${dataName}-icon`, icon: startIcon, noColor: startIconColorText })),
94582
94581
  children));
94583
94582
  });
94584
94583
 
@@ -94923,7 +94922,7 @@ const HybridField = React__default.default.forwardRef(({ size = 'md', ...props }
94923
94922
 
94924
94923
  const Alert = React__default.default.forwardRef(({ children, ...props }, ref) => (React__default.default.createElement("descope-alert", { ...props, ref: ref }, children)));
94925
94924
 
94926
- const AddressField = React__default.default.forwardRef(({ size = 'md', connector, ...props }, ref) => (React__default.default.createElement("descope-address-field", { size: size, ...props, ref: ref })));
94925
+ const AddressField = React__default.default.forwardRef(({ size = 'md', ...props }, ref) => (React__default.default.createElement("descope-address-field", { size: size, ...props, ref: ref })));
94927
94926
 
94928
94927
  const globalsThemeToStyle = index_cjsExports.globalsThemeToStyle;
94929
94928
  const createComponentsTheme = index_cjsExports.createComponentsTheme;
package/dist/index.d.ts CHANGED
@@ -74,6 +74,7 @@ declare const Button: React.ForwardRefExoticComponent<Omit<React.ClassAttributes
74
74
  startIcon?: string;
75
75
  startIconColorText?: boolean;
76
76
  'full-width'?: boolean;
77
+ 'data-name'?: string;
77
78
  }, "ref"> & React.RefAttributes<HTMLButtonElement>>;
78
79
 
79
80
  type Props$E = {
@@ -921,7 +922,7 @@ declare global {
921
922
  declare const Alert: React.ForwardRefExoticComponent<Props$1 & React.RefAttributes<HTMLElement>>;
922
923
 
923
924
  type Props = {
924
- connector?: string;
925
+ 'data-connector-id'?: string;
925
926
  'connector-template'?: string;
926
927
  'min-search-length'?: number;
927
928
  'allow-custom-value'?: boolean;
package/dist/index.esm.js CHANGED
@@ -78,18 +78,16 @@ var icons = /*#__PURE__*/Object.freeze({
78
78
  });
79
79
 
80
80
  const Icon = ({ icon, noColor, ...props }) => {
81
- if (!icon)
82
- return undefined;
83
81
  if (icons[icon]) {
84
82
  return (React.createElement("descope-icon", { src: icons[icon], ...(noColor && { 'st-fill': 'currentColor' }), ...props }));
85
83
  }
86
84
  return React.createElement("descope-icon", { "fill-color": noColor, src: icon });
87
85
  };
88
86
 
89
- const Button = React.forwardRef(({ children, startIcon, startIconColorText, color = 'primary', size = 'md', variant = 'contained', ...props }, ref) => {
87
+ const Button = React.forwardRef(({ children, startIcon, startIconColorText, color = 'primary', size = 'md', variant = 'contained', 'data-name': dataName, ...props }, ref) => {
90
88
  const isSquare = useMemo(() => !!(startIcon && !children), [startIcon, children]);
91
- return (React.createElement("descope-button", { ...props, size: size, variant: variant, mode: color, ref: ref, square: isSquare },
92
- startIcon && React.createElement(Icon, { icon: startIcon, noColor: startIconColorText }),
89
+ return (React.createElement("descope-button", { ...props, size: size, variant: variant, mode: color, ref: ref, square: isSquare, "data-name": dataName },
90
+ startIcon != null && (React.createElement(Icon, { "data-name": `${dataName}-icon`, icon: startIcon, noColor: startIconColorText })),
93
91
  children));
94
92
  });
95
93
 
@@ -434,7 +432,7 @@ const HybridField = React.forwardRef(({ size = 'md', ...props }, ref) => (React.
434
432
 
435
433
  const Alert = React.forwardRef(({ children, ...props }, ref) => (React.createElement("descope-alert", { ...props, ref: ref }, children)));
436
434
 
437
- const AddressField = React.forwardRef(({ size = 'md', connector, ...props }, ref) => (React.createElement("descope-address-field", { size: size, ...props, ref: ref })));
435
+ const AddressField = React.forwardRef(({ size = 'md', ...props }, ref) => (React.createElement("descope-address-field", { size: size, ...props, ref: ref })));
438
436
 
439
437
  const globalsThemeToStyle = globalsThemeToStyle$1;
440
438
  const createComponentsTheme = createComponentsTheme$1;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { DescopeInputProps } from '../types';
3
3
  type Props = {
4
- connector?: string;
4
+ 'data-connector-id'?: string;
5
5
  'connector-template'?: string;
6
6
  'min-search-length'?: number;
7
7
  'allow-custom-value'?: boolean;
@@ -19,5 +19,6 @@ declare const Button: React.ForwardRefExoticComponent<Omit<React.ClassAttributes
19
19
  startIcon?: string;
20
20
  startIconColorText?: boolean;
21
21
  'full-width'?: boolean;
22
+ 'data-name'?: string;
22
23
  }, "ref"> & React.RefAttributes<HTMLButtonElement>>;
23
24
  export default Button;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@descope/flow-components",
3
- "version": "2.0.436",
3
+ "version": "2.0.438",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -104,7 +104,7 @@
104
104
  "typescript": "^5.7.2"
105
105
  },
106
106
  "dependencies": {
107
- "@descope/web-components-ui": "1.23.0"
107
+ "@descope/web-components-ui": "1.29.0"
108
108
  },
109
109
  "peerDependencies": {
110
110
  "react": ">= 18"