@descope-ui/descope-address-field 0.0.13 → 0.0.15

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/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [0.0.15](https://github.com/descope/web-components-ui/compare/@descope-ui/descope-address-field-0.0.14...@descope-ui/descope-address-field-0.0.15) (2025-06-26)
6
+
7
+ ### Dependency Updates
8
+
9
+ * `@descope-ui/common` updated to version `0.0.14`
10
+ * `@descope-ui/theme-input-wrapper` updated to version `0.1.3`
11
+ * `@descope-ui/descope-autocomplete-field` updated to version `0.0.16`
12
+ ## [0.0.14](https://github.com/descope/web-components-ui/compare/@descope-ui/descope-address-field-0.0.13...@descope-ui/descope-address-field-0.0.14) (2025-06-09)
13
+
14
+ ### Dependency Updates
15
+
16
+ * `@descope-ui/common` updated to version `0.0.13`
17
+ * `@descope-ui/theme-input-wrapper` updated to version `0.1.2`
18
+ * `@descope-ui/descope-autocomplete-field` updated to version `0.0.15`
5
19
  ## [0.0.13](https://github.com/descope/web-components-ui/compare/@descope-ui/descope-address-field-0.0.12...@descope-ui/descope-address-field-0.0.13) (2025-05-28)
6
20
 
7
21
  ### Dependency Updates
@@ -462,3 +462,19 @@ test.describe('logic', () => {
462
462
  await expect(item).toHaveAttribute('disabled', 'true');
463
463
  });
464
464
  });
465
+
466
+ test.describe('custom error message', () => {
467
+ loopPresets({
468
+ 'value missing: default': { required: 'true', defaultErrorMessageValueMissing: 'true' },
469
+ 'value missing: custom': { required: 'true', 'data-errormessage-value-missing': 'custom message' },
470
+ 'value missing: empty': { required: 'true', 'data-errormessage-value-missing': '' },
471
+ }, (preset, name) => {
472
+ test(name, async({ page, browserName }) => {
473
+ test.skip(browserName === 'webkit');
474
+ await page.goto(getStoryUrl(storyName, preset));
475
+ const component = createAddressFieldTestDriver(page.locator(componentName));
476
+ await page.getByRole('button').getByText('Submit').click();
477
+ expect(await component.screenshot({ animations: 'disabled', delay: 6000 })).toMatchSnapshot();
478
+ });
479
+ });
480
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@descope-ui/descope-address-field",
3
- "version": "0.0.13",
3
+ "version": "0.0.15",
4
4
  "exports": {
5
5
  ".": {
6
6
  "import": "./src/component/index.js"
@@ -19,9 +19,9 @@
19
19
  },
20
20
  "dependencies": {
21
21
  "@vaadin/custom-field": "24.3.4",
22
- "@descope-ui/common": "0.0.12",
23
- "@descope-ui/theme-input-wrapper": "0.1.1",
24
- "@descope-ui/descope-autocomplete-field": "0.0.14"
22
+ "@descope-ui/common": "0.0.14",
23
+ "@descope-ui/theme-input-wrapper": "0.1.3",
24
+ "@descope-ui/descope-autocomplete-field": "0.0.16"
25
25
  },
26
26
  "publishConfig": {
27
27
  "link-workspace-packages": false
@@ -1,5 +1,8 @@
1
1
  import { componentName } from '../src/component';
2
- import { withForm } from '@descope-ui/common/sb-helpers';
2
+ import {
3
+ toggleDefaultErrorMessageValueMissingDecorator,
4
+ withForm,
5
+ } from '@descope-ui/common/sb-helpers';
3
6
  import {
4
7
  labelControl,
5
8
  placeholderControl,
@@ -14,6 +17,7 @@ import {
14
17
  inputLabelTypeControl,
15
18
  errorMessageIconControl,
16
19
  errorMessageIconAttrs,
20
+ defaultValueMissingControl,
17
21
  } from '@descope-ui/common/sb-controls';
18
22
  import { MockConnector, MOCK_CONNECTOR_TEMPLATE } from './mockConnector';
19
23
 
@@ -40,7 +44,6 @@ const Template = ({
40
44
  'address-limit': addressLimit,
41
45
  errorMsgIcon,
42
46
  }) => {
43
-
44
47
  return `
45
48
  <descope-address-field
46
49
  size="${size}"
@@ -57,8 +60,9 @@ const Template = ({
57
60
  data-errormessage-value-missing="${customErrorMessage || ''}"
58
61
  allow-custom-value="${allowCustomValue || false}"
59
62
  min-search-length="${minSearchLength || ''}"
60
- connector-template="${connectorTemplate !== MOCK_CONNECTOR_TEMPLATE ? connectorTemplate : ''
61
- }"
63
+ connector-template="${
64
+ connectorTemplate !== MOCK_CONNECTOR_TEMPLATE ? connectorTemplate : ''
65
+ }"
62
66
  public-api-key="${apiKey || ''}"
63
67
  address-types="${addressTypes || ''}"
64
68
  address-language="${addressLanguage || ''}"
@@ -72,24 +76,29 @@ const Template = ({
72
76
  export default {
73
77
  component: componentName,
74
78
  title: 'descope-address-field',
75
- decorators: [(story, { args }) => {
76
- if (args['connector-template'] === MOCK_CONNECTOR_TEMPLATE) {
77
- setTimeout(() => {
78
- const addressField = document.querySelector("descope-address-field");
79
+ decorators: [
80
+ (story, { args }) => {
81
+ if (args['connector-template'] === MOCK_CONNECTOR_TEMPLATE) {
82
+ setTimeout(() => {
83
+ const addressField = document.querySelector('descope-address-field');
79
84
  if (addressField) {
80
85
  addressField.connectorClasses = {
81
86
  ...addressField.connectorClasses,
82
- [MOCK_CONNECTOR_TEMPLATE]: MockConnector
87
+ [MOCK_CONNECTOR_TEMPLATE]: MockConnector,
83
88
  };
84
- addressField.setAttribute("connector-template", MOCK_CONNECTOR_TEMPLATE);
89
+ addressField.setAttribute(
90
+ 'connector-template',
91
+ MOCK_CONNECTOR_TEMPLATE,
92
+ );
85
93
  }
86
- });
87
- }
94
+ });
95
+ }
88
96
 
89
- return story();
90
- },
91
- withForm
92
- ],
97
+ return story();
98
+ },
99
+ toggleDefaultErrorMessageValueMissingDecorator,
100
+ withForm,
101
+ ],
93
102
  argTypes: {
94
103
  ...labelControl,
95
104
  ...placeholderControl,
@@ -102,6 +111,7 @@ export default {
102
111
  ...borderedControl,
103
112
  ...errorMissingValueControl,
104
113
  ...directionControl,
114
+ ...defaultValueMissingControl,
105
115
  'min-search-length': {
106
116
  name: 'Min Search Length',
107
117
  control: { type: 'number' },
@@ -148,6 +158,7 @@ Default.args = {
148
158
  bordered: true,
149
159
  size: 'md',
150
160
  'connector-template': MOCK_CONNECTOR_TEMPLATE,
161
+ 'data-errormessage-value-missing': 'Please fill out this field.',
151
162
  };
152
163
 
153
164
  export const GoogleMapsPlaces = Template.bind({});