@pure-ds/core 0.4.19 → 0.4.21

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 +1 @@
1
- {"version":3,"file":"pds.d.ts","sourceRoot":"","sources":["../../../../../public/assets/js/pds.js"],"names":[],"mappings":"AA0oG6nS;;;;EAAQ;AAAsnF;;;;;;;;;;;;;;;EAA8sE"}
1
+ {"version":3,"file":"pds.d.ts","sourceRoot":"","sources":["../../../../../public/assets/js/pds.js"],"names":[],"mappings":"AAipG6nS;;;;EAAQ;AAAsnF;;;;;;;;;;;;;;;EAA8sE"}
@@ -1 +1 @@
1
- {"version":3,"file":"pds-form.d.ts","sourceRoot":"","sources":["../../../../../../public/assets/pds/components/pds-form.js"],"names":[],"mappings":"AAgCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAcE;IAGF,yBAEC;IAgBC,gBAA2B;IAC3B,cAAyB;IACzB,aAAwB;IACxB,YAAuB;IACvB,eAAoB;IACpB,qBAAwB;IACxB,oBAA2B;IAC3B,mBAAyB;IACzB,mBAAsB;IACtB,oBAAuB;IAiBzB,8CAEC;IACD,4BAEC;IAGD,oBAEC;IAkBD;;;MAIC;IAED,uBAEC;IAED,cAIC;IAED,0BAcC;IAGD,+BAyBC;IA4eD,cA4CC;;CAilDF"}
1
+ {"version":3,"file":"pds-form.d.ts","sourceRoot":"","sources":["../../../../../../public/assets/pds/components/pds-form.js"],"names":[],"mappings":"AAgCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAcE;IAGF,yBAEC;IAgBC,gBAA2B;IAC3B,cAAyB;IACzB,aAAwB;IACxB,YAAuB;IACvB,eAAoB;IACpB,qBAAwB;IACxB,oBAA2B;IAC3B,mBAAy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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAAmC;IA6BrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAgBC;IAycD;;;;OAIG;IACH,kDAyBC;IA0ED;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA6DC;IA2oGD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAEC;IAGD,oBAEC;IA8vBD,qBAEC;IACD,yBAEC;IACD,yBAEC;IACD,wBAEC;IACD,yBAMC;IAED;;;;;;OAMG;IACH,oBA6JC;IAGD,4BAEC;IACD,gCAEC;IACD,gCAEC;IACD,+BAEC;IAmBD;;;OAGG;IACH;;;;;;MAoBC;;CA2GF"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pure-ds/core",
3
3
  "shortname": "pds",
4
- "version": "0.4.19",
4
+ "version": "0.4.21",
5
5
  "description": "Pure Design System - Why develop a Design System when you can generate one?",
6
6
  "repository": {
7
7
  "type": "git",
@@ -645,6 +645,10 @@ fieldset {
645
645
  color: var(--color-primary-700);
646
646
  }
647
647
  }
648
+
649
+ input[type="checkbox"]{
650
+ border-radius: var(--radius-xs);
651
+ }
648
652
 
649
653
  input[type="radio"],
650
654
  input[type="checkbox"] {
@@ -653,18 +657,27 @@ fieldset {
653
657
  width: var(--spacing-5);
654
658
  height: var(--spacing-5);
655
659
  min-height: var(--spacing-5);
660
+ padding: var(--spacing-2);
656
661
  margin: 0;
657
662
  cursor: pointer;
658
663
  flex-shrink: 0;
659
664
  accent-color: var(--color-primary-600);
660
- appearance: auto;
661
- -webkit-appearance: auto;
662
- -moz-appearance: auto;
663
-
664
- &:focus {
665
- outline: 2px solid var(--color-primary-500);
666
- outline-offset: 2px;
665
+
666
+ &:focus-visible {
667
+ outline: none;
668
+
669
+ box-shadow:
670
+ 0 0 0 2px var(--color-primary-500),
671
+ 0 0 0 4px color-mix(in srgb,
672
+ var(--color-primary-500) 40%,
673
+ transparent
674
+ );
667
675
  }
676
+
677
+ &:checked {
678
+ background-color: var(--color-primary-600);
679
+ }
680
+
668
681
  }
669
682
  }
670
683
 
@@ -643,6 +643,10 @@ fieldset {
643
643
  color: var(--color-primary-700);
644
644
  }
645
645
  }
646
+
647
+ input[type="checkbox"]{
648
+ border-radius: var(--radius-xs);
649
+ }
646
650
 
647
651
  input[type="radio"],
648
652
  input[type="checkbox"] {
@@ -651,18 +655,27 @@ fieldset {
651
655
  width: var(--spacing-5);
652
656
  height: var(--spacing-5);
653
657
  min-height: var(--spacing-5);
658
+ padding: var(--spacing-2);
654
659
  margin: 0;
655
660
  cursor: pointer;
656
661
  flex-shrink: 0;
657
662
  accent-color: var(--color-primary-600);
658
- appearance: auto;
659
- -webkit-appearance: auto;
660
- -moz-appearance: auto;
661
-
662
- &:focus {
663
- outline: 2px solid var(--color-primary-500);
664
- outline-offset: 2px;
663
+
664
+ &:focus-visible {
665
+ outline: none;
666
+
667
+ box-shadow:
668
+ 0 0 0 2px var(--color-primary-500),
669
+ 0 0 0 4px color-mix(in srgb,
670
+ var(--color-primary-500) 40%,
671
+ transparent
672
+ );
665
673
  }
674
+
675
+ &:checked {
676
+ background-color: var(--color-primary-600);
677
+ }
678
+
666
679
  }
667
680
  }
668
681
 
@@ -1116,6 +1116,7 @@ export class SchemaForm extends LitElement {
1116
1116
  this.#deleteByPathPrefix(this.#data, path + "/");
1117
1117
  this.requestUpdate();
1118
1118
  this.#emit("pw:value-change", {
1119
+ path,
1119
1120
  name: path,
1120
1121
  value: i,
1121
1122
  validity: { valid: true },
@@ -1865,7 +1866,6 @@ export class SchemaForm extends LitElement {
1865
1866
  <select
1866
1867
  id=${id}
1867
1868
  name=${path}
1868
- .value=${value ?? ""}
1869
1869
  ?disabled=${!!attrs.disabled}
1870
1870
  ?required=${!!attrs.required}
1871
1871
  ?data-dropdown=${useDropdown}
@@ -1874,7 +1874,7 @@ export class SchemaForm extends LitElement {
1874
1874
  <option value="" ?selected=${value == null}>—</option>
1875
1875
  ${enumValues.map(
1876
1876
  (v, i) =>
1877
- html`<option value=${String(v)}>
1877
+ html`<option value=${String(v)} ?selected=${String(value) === String(v)}>
1878
1878
  ${String(enumLabels[i])}
1879
1879
  </option>`
1880
1880
  )}
@@ -2092,17 +2092,28 @@ export class SchemaForm extends LitElement {
2092
2092
  const withoutSlash = path.startsWith("/") ? path.substring(1) : path;
2093
2093
  if (this.uiSchema[withoutSlash]) return this.uiSchema[withoutSlash];
2094
2094
 
2095
- // Try nested navigation (e.g., userProfile/settings/preferences/theme)
2095
+ // Try nested navigation (e.g., /accountType/companyName)
2096
2096
  // Skip array indices (numeric parts and wildcard *) when navigating UI schema
2097
2097
  const parts = path.replace(/^\//, "").split("/");
2098
2098
  let current = this.uiSchema;
2099
- for (const part of parts) {
2099
+ for (let i = 0; i < parts.length; i++) {
2100
+ const part = parts[i];
2100
2101
  // Skip numeric array indices and wildcard in UI schema navigation
2101
2102
  if (/^\d+$/.test(part) || part === "*") continue;
2102
2103
 
2104
+ // Try both with and without leading slash for each segment
2103
2105
  if (current && typeof current === "object" && part in current) {
2104
2106
  current = current[part];
2107
+ } else if (current && typeof current === "object" && ("/" + part) in current) {
2108
+ current = current["/" + part];
2105
2109
  } else {
2110
+ // If this is the first segment, try looking up the full path from root
2111
+ if (i === 0) {
2112
+ const fullPath = "/" + parts.join("/");
2113
+ if (this.uiSchema[fullPath]) {
2114
+ return this.uiSchema[fullPath];
2115
+ }
2116
+ }
2106
2117
  return undefined;
2107
2118
  }
2108
2119
  }
@@ -2227,17 +2238,23 @@ export class SchemaForm extends LitElement {
2227
2238
  this.#setByPath(this.#data, path, val);
2228
2239
 
2229
2240
  // Apply calculated values for any dependent fields
2230
- this.#applyCalculatedValues(path);
2241
+ // This will call requestUpdate() if there are dependents
2242
+ const hadDependents = this.#applyCalculatedValues(path);
2243
+
2244
+ // Only request update here if there were no dependents
2245
+ // (to avoid double render)
2246
+ if (!hadDependents) {
2247
+ this.requestUpdate();
2248
+ }
2231
2249
 
2232
- this.requestUpdate();
2233
2250
  const validity = { valid: true };
2234
- this.#emit("pw:value-change", { name: path, value: val, validity });
2251
+ this.#emit("pw:value-change", { path, name: path, value: val, validity });
2235
2252
  }
2236
2253
 
2237
2254
  #applyCalculatedValues(changedPath) {
2238
2255
  // Find fields that depend on the changed path
2239
2256
  const dependents = this.#dependencies.get(changedPath);
2240
- if (!dependents) return;
2257
+ if (!dependents || dependents.size === 0) return false;
2241
2258
 
2242
2259
  for (const targetPath of dependents) {
2243
2260
  const ui = this.#uiFor(targetPath);
@@ -2255,6 +2272,11 @@ export class SchemaForm extends LitElement {
2255
2272
  }
2256
2273
  }
2257
2274
  }
2275
+
2276
+ // Force re-render since there were dependents
2277
+ // This ensures ui:visibleWhen, ui:requiredWhen, ui:disabledWhen get re-evaluated
2278
+ this.requestUpdate();
2279
+ return true; // Indicate that we triggered a re-render
2258
2280
  }
2259
2281
 
2260
2282
  #getByPath(obj, path) {
@@ -1838,6 +1838,10 @@ fieldset {
1838
1838
  color: var(--color-primary-700);
1839
1839
  }
1840
1840
  }
1841
+
1842
+ input[type="checkbox"]{
1843
+ border-radius: var(--radius-xs);
1844
+ }
1841
1845
 
1842
1846
  input[type="radio"],
1843
1847
  input[type="checkbox"] {
@@ -1846,18 +1850,27 @@ fieldset {
1846
1850
  width: var(--spacing-5);
1847
1851
  height: var(--spacing-5);
1848
1852
  min-height: var(--spacing-5);
1853
+ padding: var(--spacing-2);
1849
1854
  margin: 0;
1850
1855
  cursor: pointer;
1851
1856
  flex-shrink: 0;
1852
1857
  accent-color: var(--color-primary-600);
1853
- appearance: auto;
1854
- -webkit-appearance: auto;
1855
- -moz-appearance: auto;
1856
-
1857
- &:focus {
1858
- outline: 2px solid var(--color-primary-500);
1859
- outline-offset: 2px;
1858
+
1859
+ &:focus-visible {
1860
+ outline: none;
1861
+
1862
+ box-shadow:
1863
+ 0 0 0 2px var(--color-primary-500),
1864
+ 0 0 0 4px color-mix(in srgb,
1865
+ var(--color-primary-500) 40%,
1866
+ transparent
1867
+ );
1860
1868
  }
1869
+
1870
+ &:checked {
1871
+ background-color: var(--color-primary-600);
1872
+ }
1873
+
1861
1874
  }
1862
1875
  }
1863
1876