@archduck/gst-forms 0.1.0 → 0.1.1

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/README.md CHANGED
@@ -346,10 +346,10 @@ import { loadJsonConfig, createLiveConfig } from '@archduck/gst-forms'
346
346
  const form = await loadJsonConfig('./UserView')
347
347
 
348
348
  // With variant overlays
349
- const form = await loadJsonConfig('./UserView', ['uchealth', 'admin'])
349
+ const form = await loadJsonConfig('./UserView', { patches: ['uchealth', 'admin'] })
350
350
 
351
351
  // With translation map
352
- const form = await loadJsonConfig('./UserView', ['uchealth'], { map: 'es' })
352
+ const form = await loadJsonConfig('./UserView', { patches: ['uchealth'], map: 'es' })
353
353
  ```
354
354
 
355
355
  File naming: `property[-variant][~map].{json|js}`. Variants stack left to right. Maps are applied after all variants have merged.
@@ -405,7 +405,7 @@ window.gst.listFunctions()
405
405
  ### Functions
406
406
 
407
407
  - **`mountForm(container, config, options)`** -- Mount a form. Returns controller with `update`, `executeAction`, `checkGuards`, `unmount`, `store`.
408
- - **`loadJsonConfig(path, variants?, options?)`** -- Load form config with form schema. Options include `map` for translations.
408
+ - **`loadJsonConfig(path, options?)`** -- Load form config with form schema. Options include `patches` (variant array) and `map` for translations.
409
409
  - **`createLiveConfig(options?)`** -- Create LiveConfig with form schema.
410
410
 
411
411
  ### Defaults
@@ -1 +1 @@
1
- @layer gst{.gst{container-type:inline-size;container-name:gst;display:flex;flex-direction:column}.gst,.gst *,.gst *:before,.gst *:after{box-sizing:border-box;gap:1em}.gst .field{width:100%}.gst .field label{display:block;width:100%}.gst .field.component-checkboxfield{align-self:center}.gst .field.component-checkboxfield label{display:flex;align-items:center}.gst .option label{display:flex;align-items:center}.gst .group{display:flex;flex-direction:column;width:100%}.gst .row{display:flex;flex-direction:column}.gst .row:empty,.gst .group:empty,.gst .group-buttons:empty,.gst .form-actions:empty{display:none}.gst .form-actions,.gst .group-buttons,.gst .field.button-row{display:flex;align-items:end;flex-wrap:wrap;justify-content:end}.gst .buttonset{display:flex;flex-direction:row;flex-wrap:wrap;width:100%;justify-content:end}.gst .button-group{display:flex;justify-content:center}.gst .contents{display:contents}.gst h1{font-size:2em}.gst h2{font-size:1.5em}.gst h3{font-size:1.17em}.gst h4{font-size:1em}.gst h5{font-size:.83em}.gst h6{font-size:.67em}.gst .btn,.gst button,.gst input,.gst select,.gst textarea{font-family:inherit;font-size:inherit;line-height:inherit}.gst .option,.gst .btn,.gst button,.gst input,.gst select,.gst textarea{touch-action:manipulation}.gst .btn,.gst button{width:fit-content;cursor:pointer}.gst input:not([type=checkbox]):not([type=radio]),.gst select,.gst textarea{width:100%;-webkit-tap-highlight-color:transparent}.gst input[type=date],.gst input[type=time],.gst input[type=datetime-local],.gst input[type=month],.gst input[type=week]{max-width:100%}.gst input[type=date][data-empty]::-webkit-datetime-edit-fields-wrapper,.gst input[type=time][data-empty]::-webkit-datetime-edit-fields-wrapper,.gst input[type=datetime-local][data-empty]::-webkit-datetime-edit-fields-wrapper,.gst input[type=month][data-empty]::-webkit-datetime-edit-fields-wrapper,.gst input[type=week][data-empty]::-webkit-datetime-edit-fields-wrapper{color:var(--gst-text-placeholder, #999)}.gst input[type=date]:focus::-webkit-datetime-edit-fields-wrapper,.gst input[type=time]:focus::-webkit-datetime-edit-fields-wrapper,.gst input[type=datetime-local]:focus::-webkit-datetime-edit-fields-wrapper,.gst input[type=month]:focus::-webkit-datetime-edit-fields-wrapper,.gst input[type=week]:focus::-webkit-datetime-edit-fields-wrapper{color:inherit}@supports (-webkit-touch-callout: none){.gst input[type=date],.gst input[type=time],.gst input[type=datetime-local],.gst input[type=month],.gst input[type=week]{-moz-appearance:none;appearance:none;-webkit-appearance:none;text-align:left;text-align-last:left;-webkit-text-align:left}.gst input[type=date]::-webkit-date-and-time-value,.gst input[type=time]::-webkit-date-and-time-value,.gst input[type=datetime-local]::-webkit-date-and-time-value,.gst input[type=month]::-webkit-date-and-time-value,.gst input[type=week]::-webkit-date-and-time-value{text-align:left}.gst label:has(input[data-empty]){position:relative}.gst label:has(input[data-empty]):after{position:absolute;bottom:.1625em;left:.0625em;right:.0625em;padding:var(--gst-padding-sm, .5em);line-height:1;color:var(--gst-text-placeholder, #999);font-weight:400;pointer-events:none;background:var(--gst-bg-input, #fff)}.gst label:has(input[data-empty]):focus-within:after{display:none}.gst label:has(input[data-empty]):has(input[type=date]):after{content:"mm/dd/yyyy"}.gst label:has(input[data-empty]):has(input[type=time]):after{content:"hh:mm"}.gst label:has(input[data-empty]):has(input[type=datetime-local]):after{content:"mm/dd/yyyy hh:mm"}.gst label:has(input[data-empty]):has(input[type=month]):after{content:"mm/yyyy"}.gst label:has(input[data-empty]):has(input[type=week]):after{content:"Week"}}.gst .error-message,.gst .field-error{display:block}.gst .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.gst .skip-link{position:absolute;left:-9999px;z-index:100;padding:.5em 1em;background:Canvas;color:CanvasText;text-decoration:underline}.gst .skip-link:focus{position:static;left:auto}@container gst (min-width: 30em){.gst .row{flex-direction:row}}}
1
+ @layer gst{.gst{container-type:inline-size;container-name:gst;display:flex;flex-direction:column}.gst,.gst *,.gst *:before,.gst *:after{box-sizing:border-box;gap:1em}.gst .field{width:100%}.gst .field label{display:block;width:100%}.gst .field.component-checkboxfield{align-self:center}.gst .field.component-checkboxfield label{display:flex;align-items:center}.gst .option label{display:flex;align-items:center}.gst .group{display:flex;flex-direction:column;width:100%}.gst .row{display:flex;flex-direction:column}.gst .row:empty,.gst .group:empty,.gst .group-buttons:empty,.gst .form-actions:empty{display:none}.gst .form-actions,.gst .group-buttons,.gst .field.button-row{display:flex;align-items:end;flex-wrap:wrap;justify-content:end}.gst .buttonset{display:flex;flex-direction:row;flex-wrap:wrap;width:100%;justify-content:end}.gst .button-group{display:flex;justify-content:center}.gst .contents{display:contents}.gst h1{font-size:2em}.gst h2{font-size:1.5em}.gst h3{font-size:1.17em}.gst h4{font-size:1em}.gst h5{font-size:.83em}.gst h6{font-size:.67em}.gst .btn,.gst button,.gst input,.gst select,.gst textarea{font-family:inherit;font-size:inherit;line-height:inherit}.gst .option,.gst .btn,.gst button,.gst input,.gst select,.gst textarea{touch-action:manipulation}.gst .btn,.gst button{width:fit-content;cursor:pointer}.gst input:not([type=checkbox]):not([type=radio]),.gst select,.gst textarea{width:100%;-webkit-tap-highlight-color:transparent}.gst input[type=date],.gst input[type=time],.gst input[type=datetime-local],.gst input[type=month],.gst input[type=week]{max-width:100%}.gst input[type=date][data-empty]::-webkit-datetime-edit-fields-wrapper,.gst input[type=time][data-empty]::-webkit-datetime-edit-fields-wrapper,.gst input[type=datetime-local][data-empty]::-webkit-datetime-edit-fields-wrapper,.gst input[type=month][data-empty]::-webkit-datetime-edit-fields-wrapper,.gst input[type=week][data-empty]::-webkit-datetime-edit-fields-wrapper{color:var(--gst-text-placeholder, #999)}.gst input[type=date]:focus::-webkit-datetime-edit-fields-wrapper,.gst input[type=time]:focus::-webkit-datetime-edit-fields-wrapper,.gst input[type=datetime-local]:focus::-webkit-datetime-edit-fields-wrapper,.gst input[type=month]:focus::-webkit-datetime-edit-fields-wrapper,.gst input[type=week]:focus::-webkit-datetime-edit-fields-wrapper{color:inherit}@supports (-webkit-touch-callout: none){.gst input[type=date],.gst input[type=time],.gst input[type=datetime-local],.gst input[type=month],.gst input[type=week]{-moz-appearance:none;appearance:none;-webkit-appearance:none;text-align:left;text-align-last:left;-webkit-text-align:left}.gst input[type=date]::-webkit-date-and-time-value,.gst input[type=time]::-webkit-date-and-time-value,.gst input[type=datetime-local]::-webkit-date-and-time-value,.gst input[type=month]::-webkit-date-and-time-value,.gst input[type=week]::-webkit-date-and-time-value{text-align:left}.gst label:has(input[data-empty]){position:relative}.gst label:has(input[data-empty]):after{position:absolute;bottom:.1625em;left:.0625em;right:.0625em;padding:var(--gst-padding-sm, .5em);line-height:1;color:var(--gst-text-placeholder, #999);font-weight:400;pointer-events:none;background:var(--gst-bg-input, #fff)}.gst label:has(input[data-empty]):focus-within:after{display:none}.gst label:has(input[data-empty]):has(input[type=date]):after{content:"mm/dd/yyyy"}.gst label:has(input[data-empty]):has(input[type=time]):after{content:"hh:mm"}.gst label:has(input[data-empty]):has(input[type=datetime-local]):after{content:"mm/dd/yyyy hh:mm"}.gst label:has(input[data-empty]):has(input[type=month]):after{content:"mm/yyyy"}.gst label:has(input[data-empty]):has(input[type=week]):after{content:"Week"}}.gst .error-message{display:block}.gst .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.gst .skip-link{position:absolute;left:-9999px;z-index:100;padding:.5em 1em;background:Canvas;color:CanvasText;text-decoration:underline}.gst .skip-link:focus{position:static;left:auto}@container gst (min-width: 30em){.gst .row{flex-direction:row}}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@archduck/gst-forms",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
5
  "description": "Form plugin for gst-core: field definitions, actions, validation, and lifecycle hooks",
6
6
  "keywords": [
@@ -34,7 +34,17 @@
34
34
  "README.md",
35
35
  "LICENSE"
36
36
  ],
37
+ "scripts": {
38
+ "build": "vite build",
39
+ "dev": "vite build --watch",
40
+ "test": "vitest",
41
+ "test:run": "vitest run",
42
+ "test:coverage": "vitest run --coverage"
43
+ },
37
44
  "dependencies": {
38
45
  "@archduck/gst-core": "^0.1.0"
46
+ },
47
+ "devDependencies": {
48
+ "vite": "^6.0.0"
39
49
  }
40
50
  }