@simai-studio/ui 5.20261023.214 → 5.20261025.207

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 (50) hide show
  1. package/README.md +4 -4
  2. package/distr/component/button-group/css/button-group.min.css +1 -1
  3. package/distr/core/contracts/public-variables.v1.json +88 -0
  4. package/distr/core/contracts/third-party-notices.v1.json +1 -1
  5. package/distr/core/css/core.css +3 -2
  6. package/distr/core/js/composition/overlay.mjs +472 -24
  7. package/distr/core/js/composition/sortable-inserter.mjs +534 -0
  8. package/distr/core/js/core-loader.js +1 -1
  9. package/distr/core/js/core-loader.min.js +1 -1
  10. package/distr/core/js/core-rules.js +242 -185
  11. package/distr/core/js/core-rules.min.js +1 -1
  12. package/distr/core/js/open-surface-mark.js +88 -0
  13. package/distr/core/js/template-utilities.generated.json +3 -0
  14. package/distr/rule/js/rule.min.js +1 -1
  15. package/distr/rule/rule.json +47 -1
  16. package/distr/smart/color/css/color.min.css +1 -0
  17. package/distr/smart/color/js/color.min.js +36 -17
  18. package/distr/smart/color/smart.manifest.json +45 -4
  19. package/distr/smart/color/template/default.js +13 -2
  20. package/distr/smart/composition-overlay/css/composition-overlay.min.css +1 -1
  21. package/distr/smart/composition-overlay/js/composition-overlay.min.js +1 -1
  22. package/distr/smart/composition-overlay/smart.manifest.json +178 -11
  23. package/distr/smart/dropdown/css/dropdown.min.css +1 -0
  24. package/distr/smart/dropdown/js/dropdown.min.js +41 -21
  25. package/distr/smart/dropdown/smart.manifest.json +62 -3
  26. package/distr/smart/dropdown/template/default.js +5 -1
  27. package/distr/smart/field-renderers/js/field-renderers.min.js +54 -42
  28. package/distr/smart/image-field/css/image-field.min.css +1 -0
  29. package/distr/smart/image-field/js/image-field.min.js +62 -0
  30. package/distr/smart/image-field/smart.manifest.json +519 -0
  31. package/distr/smart/image-field/studio.fixture.json +15 -0
  32. package/distr/smart/image-field/studio.scenario.json +22 -0
  33. package/distr/smart/image-field/template/default.js +125 -0
  34. package/distr/smart/inputs/css/inputs.min.css +1 -0
  35. package/distr/smart/inputs/js/inputs.min.js +93 -75
  36. package/distr/smart/inputs/smart.manifest.json +62 -3
  37. package/distr/smart/inputs/template/default.js +8 -2
  38. package/distr/smart/sortable/css/sortable.min.css +1 -1
  39. package/distr/smart/sortable/js/sortable.min.js +1 -1
  40. package/distr/smart/sortable/smart.manifest.json +101 -14
  41. package/distr/smart/switch/css/switch.min.css +1 -0
  42. package/distr/smart/switch/js/switch.min.js +31 -13
  43. package/distr/smart/switch/smart.manifest.json +62 -3
  44. package/distr/smart/switch/template/default.js +2 -0
  45. package/distr/smart/textarea/css/textarea.min.css +1 -0
  46. package/distr/smart/textarea/js/textarea.min.js +51 -32
  47. package/distr/smart/textarea/smart.manifest.json +62 -3
  48. package/distr/smart/textarea/template/default.js +8 -1
  49. package/package-manifest.json +50 -39
  50. package/package.json +5 -4
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schema_version": 2,
3
3
  "id": "smart.switch",
4
- "version": "1.0.0",
4
+ "version": "1.1.0",
5
5
  "title": "Switch",
6
6
  "summary": "An on/off control for a setting that applies at once: a native checkbox with role=\"switch\", a track and a moving thumb, with a label, description and help text.",
7
7
  "kind": "smart",
@@ -77,6 +77,21 @@
77
77
  "type": "string",
78
78
  "default": "",
79
79
  "description": "Accessible name for a switch rendered without a visible label, as in a record panel that draws the label itself."
80
+ },
81
+ "inherited-value": {
82
+ "type": "string",
83
+ "default": "",
84
+ "description": "Whether the switch is on while it holds no value of its own: true/on or false/off. The knob stands where it says, quieter, with an «inherited» marker, and the checkbox submits nothing. With it set, «off» chosen by a person is kept as checked=\"false\" -- a value of its own -- and no `checked` at all means the inherited state; a reset button returns there."
85
+ },
86
+ "inherited-text": {
87
+ "type": "string",
88
+ "default": "",
89
+ "description": "The words of the marker shown while the inherited value applies. Unset, it follows the page's language («inherited», «наследуется»)."
90
+ },
91
+ "reset-label": {
92
+ "type": "string",
93
+ "default": "",
94
+ "description": "The accessible name of the button that returns the field to the inherited value. Unset, it follows the page's language («Reset to inherited», «Сбросить к наследуемому»)."
80
95
  }
81
96
  },
82
97
  "additionalProperties": false
@@ -210,6 +225,14 @@
210
225
  "type": "object",
211
226
  "description": "The element, for chaining."
212
227
  }
228
+ },
229
+ "resetToInherited": {
230
+ "summary": "Returns the field to its inherited value, as the reset button does: fires the cancellable sf-field:reset, then empties the own value and focuses the control. Returns whether it was reset (false without an inherited value, without an own value, while disabled or readonly, or when the event was prevented).",
231
+ "arguments": [],
232
+ "returns": {
233
+ "type": "boolean",
234
+ "description": "Whether the field was reset."
235
+ }
213
236
  }
214
237
  },
215
238
  "events": {
@@ -219,6 +242,26 @@
219
242
  "type": "object"
220
243
  },
221
244
  "canonical": true
245
+ },
246
+ "sf-field:reset": {
247
+ "summary": "The person pressed the reset back to the inherited value. Fired before the field is emptied and cancellable: preventDefault keeps the value. When it is not prevented the field empties, says so with its ordinary change, shows the inherited value again and takes focus back.",
248
+ "payload": {
249
+ "type": "object",
250
+ "properties": {
251
+ "value": {
252
+ "type": "string",
253
+ "description": "The field's own value before the reset."
254
+ },
255
+ "inheritedValue": {
256
+ "type": "string",
257
+ "description": "The inherited value it returns to."
258
+ },
259
+ "name": {
260
+ "type": "string",
261
+ "description": "The form name, empty when the field has none."
262
+ }
263
+ }
264
+ }
222
265
  }
223
266
  },
224
267
  "state": {
@@ -259,7 +302,7 @@
259
302
  "Tab",
260
303
  "Space"
261
304
  ],
262
- "focus": "Keep visible focus on the active control."
305
+ "focus": "Keep visible focus on the active control. After a reset back to the inherited value, focus returns to the control; while the value is inherited, the control carries it as aria-description and the visible marker is aria-hidden."
263
306
  },
264
307
  "presentation": {
265
308
  "themes": [
@@ -321,7 +364,23 @@
321
364
  "source_artifacts": [
322
365
  {
323
366
  "path": "src/smart/switch/index.js",
324
- "sha256": "fc5cfbd84feb24cd6fac4a9d492e62cb0908dfeb77fca17f68e052f6cb1db777"
367
+ "sha256": "723a1d29d51937a06e5f38d1601232709b06a7c02f3dac192fffa1e62dae1782"
368
+ },
369
+ {
370
+ "path": "src/smart/switch/rule.js",
371
+ "sha256": "c2235953a04aafc36207326d0ce146dd7d97fbaecbb32eeacb045ff1301d5119"
372
+ },
373
+ {
374
+ "path": "src/smart/switch/js/templates/default.js",
375
+ "sha256": "1ae5f62efa31e5ab80e763d416e0b57d4a861a8d1e117921b849b70f6afaa0af"
376
+ },
377
+ {
378
+ "path": "src/smart/helpers/inherited-value.js",
379
+ "sha256": "0c8658ab61678cd5f89badea902be244b92ba96240fb802c60438227f8f9faa9"
380
+ },
381
+ {
382
+ "path": "src/smart/helpers/inherited-value.css",
383
+ "sha256": "2a10b6d5c8e26c7d1541511c99257e9474b16d30c6e8352e96ed9b47f70b6a2a"
325
384
  }
326
385
  ],
327
386
  "generated_runtime": [
@@ -1,4 +1,5 @@
1
1
  import { html, nothing } from 'lit';
2
+ import { renderInheritedSlot } from '../../../helpers/inherited-value';
2
3
 
3
4
  export function renderSwitchTemplate(context) {
4
5
  const { size, label, description, help, checked, disabled, name, value, ariaLabel } = context;
@@ -64,6 +65,7 @@ export function renderSwitchTemplate(context) {
64
65
  </span>
65
66
  `
66
67
  : ''}
68
+ ${renderInheritedSlot(context.component, { size, disabled, className: 'sf-switch-inherited' })}
67
69
  </label>
68
70
  `;
69
71
  }
@@ -0,0 +1 @@
1
+ @layer sf.components{.sf-field-inherited-slot{flex:none;gap:var(--sf-space-1\/4);min-width:0;min-inline-size:0}.sf-field-inherited-slot--size-1\/2{--sf-field-inherited-slot--inset: calc((var(--sf-ui-1\/2--control-height) - var(--sf-ui-1\/3--control-height)) / 2 - var(--sf-px))}.sf-field-inherited-slot--size-1{--sf-field-inherited-slot--inset: calc((var(--sf-ui-1--control-height) - var(--sf-ui-1\/2--control-height)) / 2 - var(--sf-px))}.sf-field-inherited-slot--size-2{--sf-field-inherited-slot--inset: calc((var(--sf-ui-2--control-height) - var(--sf-ui-1--control-height)) / 2 - var(--sf-px))}_:-ms-input-placeholder, html:not([dir="rtl"]) .sf-field-inherited{padding-right:0px;padding-right:var(--sf-field-inherited-slot--inset, 0px)}@supports not (padding-inline-end: initial){html:not([dir="rtl"]) .sf-field-inherited{padding-right:0px;padding-right:var(--sf-field-inherited-slot--inset, 0px)}}.sf-field-inherited:where(:dir(ltr)){padding-right:0px;padding-right:var(--sf-field-inherited-slot--inset, 0px)}_:-ms-input-placeholder, [dir="rtl"] .sf-field-inherited{padding-left:0px;padding-left:var(--sf-field-inherited-slot--inset, 0px)}@supports not (padding-inline-end: initial){[dir="rtl"] .sf-field-inherited{padding-left:0px;padding-left:var(--sf-field-inherited-slot--inset, 0px)}}.sf-field-inherited:where(:dir(rtl)){padding-left:0px;padding-left:var(--sf-field-inherited-slot--inset, 0px)}.sf-field-inherited{color:var(--sf-on-surface-variant);white-space:nowrap;-webkit-padding-end:0px;padding-inline-end:0px;-webkit-padding-end:var(--sf-field-inherited-slot--inset, 0px);padding-inline-end:var(--sf-field-inherited-slot--inset, 0px)}.sf-field-inherited--size-1\/3{font-size:var(--sf-text-size-1\/3);line-height:var(--sf-text-height-1\/3)}.sf-field-inherited--size-1\/2{font-size:var(--sf-text-size-1\/2);line-height:var(--sf-text-height-1\/2)}.sf-field-inherited--size-1{font-size:var(--sf-text-size-1);line-height:var(--sf-text-height-1)}_:-ms-input-placeholder, html:not([dir="rtl"]) .sf-field-inherited-slot>.sf-field-reset{margin-right:0px;margin-right:var(--sf-field-inherited-slot--inset, 0px)}@supports not (margin-inline-end: initial){html:not([dir="rtl"]) .sf-field-inherited-slot>.sf-field-reset{margin-right:0px;margin-right:var(--sf-field-inherited-slot--inset, 0px)}}.sf-field-inherited-slot>.sf-field-reset:where(:dir(ltr)){margin-right:0px;margin-right:var(--sf-field-inherited-slot--inset, 0px)}_:-ms-input-placeholder, [dir="rtl"] .sf-field-inherited-slot>.sf-field-reset{margin-left:0px;margin-left:var(--sf-field-inherited-slot--inset, 0px)}@supports not (margin-inline-end: initial){[dir="rtl"] .sf-field-inherited-slot>.sf-field-reset{margin-left:0px;margin-left:var(--sf-field-inherited-slot--inset, 0px)}}.sf-field-inherited-slot>.sf-field-reset:where(:dir(rtl)){margin-left:0px;margin-left:var(--sf-field-inherited-slot--inset, 0px)}.sf-field-inherited-slot>.sf-field-reset{flex:none;-webkit-margin-end:0px;margin-inline-end:0px;-webkit-margin-end:var(--sf-field-inherited-slot--inset, 0px);margin-inline-end:var(--sf-field-inherited-slot--inset, 0px)}_:-ms-input-placeholder, html:not([dir="rtl"]) .sf-input-field>.sf-field-inherited-slot{margin-right:calc(-1*0px);margin-right:calc(-1*var(--sf-input-field--padding-inline-end, 0px))}@supports not (margin-inline-end: initial){html:not([dir="rtl"]) .sf-input-field>.sf-field-inherited-slot{margin-right:calc(-1*0px);margin-right:calc(-1*var(--sf-input-field--padding-inline-end, 0px))}}.sf-input-field>.sf-field-inherited-slot:where(:dir(ltr)){margin-right:calc(-1*0px);margin-right:calc(-1*var(--sf-input-field--padding-inline-end, 0px))}_:-ms-input-placeholder, [dir="rtl"] .sf-input-field>.sf-field-inherited-slot{margin-left:calc(-1*0px);margin-left:calc(-1*var(--sf-input-field--padding-inline-end, 0px))}@supports not (margin-inline-end: initial){[dir="rtl"] .sf-input-field>.sf-field-inherited-slot{margin-left:calc(-1*0px);margin-left:calc(-1*var(--sf-input-field--padding-inline-end, 0px))}}.sf-input-field>.sf-field-inherited-slot:where(:dir(rtl)){margin-left:calc(-1*0px);margin-left:calc(-1*var(--sf-input-field--padding-inline-end, 0px))}.sf-input-field>.sf-field-inherited-slot{align-self:center;-webkit-margin-end:calc(-1*0px);margin-inline-end:calc(-1*0px);-webkit-margin-end:calc(-1*var(--sf-input-field--padding-inline-end, 0px));margin-inline-end:calc(-1*var(--sf-input-field--padding-inline-end, 0px))}_:-ms-input-placeholder, html:not([dir="rtl"]) .sf-input-field>.sf-field-inherited-slot>.sf-field-inherited{padding-right:0px;padding-right:var(--sf-input-field--padding-inline-end, 0px)}@supports not (padding-inline-end: initial){html:not([dir="rtl"]) .sf-input-field>.sf-field-inherited-slot>.sf-field-inherited{padding-right:0px;padding-right:var(--sf-input-field--padding-inline-end, 0px)}}.sf-input-field>.sf-field-inherited-slot>.sf-field-inherited:where(:dir(ltr)){padding-right:0px;padding-right:var(--sf-input-field--padding-inline-end, 0px)}_:-ms-input-placeholder, [dir="rtl"] .sf-input-field>.sf-field-inherited-slot>.sf-field-inherited{padding-left:0px;padding-left:var(--sf-input-field--padding-inline-end, 0px)}@supports not (padding-inline-end: initial){[dir="rtl"] .sf-input-field>.sf-field-inherited-slot>.sf-field-inherited{padding-left:0px;padding-left:var(--sf-input-field--padding-inline-end, 0px)}}.sf-input-field>.sf-field-inherited-slot>.sf-field-inherited:where(:dir(rtl)){padding-left:0px;padding-left:var(--sf-input-field--padding-inline-end, 0px)}.sf-input-field>.sf-field-inherited-slot>.sf-field-inherited{-webkit-padding-end:0px;padding-inline-end:0px;-webkit-padding-end:var(--sf-input-field--padding-inline-end, 0px);padding-inline-end:var(--sf-input-field--padding-inline-end, 0px)}.sf-dropdown .sf-dropdown-field[\:has\(\%3E.sf-field-inherited-slot\)]>input{--sf-dropdown-input--padding-inline-end: 0px;min-width:0;min-inline-size:0}.sf-dropdown .sf-dropdown-field[\:has\(\%3E.sf-field-inherited-slot\)]>input{--sf-dropdown-input--padding-inline-end: 0px;min-width:0;min-width:0;min-inline-size:0}.sf-dropdown .sf-dropdown-field:has(>.sf-field-inherited-slot)>input{--sf-dropdown-input--padding-inline-end: 0px;min-width:0;min-inline-size:0}_:-ms-input-placeholder, html:not([dir="rtl"]) .sf-dropdown .sf-dropdown-field[\:has\(\%3E.sf-field-inherited-slot\)]>button{margin-right:calc(-1*0px);margin-right:calc(-1*var(--sf-icon-button--padding-inline-end, 0px))}@supports not (margin-inline-end: initial){html:not([dir="rtl"]) .sf-dropdown .sf-dropdown-field[\:has\(\%3E.sf-field-inherited-slot\)]>button{margin-right:calc(-1*0px);margin-right:calc(-1*var(--sf-icon-button--padding-inline-end, 0px))}}.sf-dropdown .sf-dropdown-field[\:has\(\%3E.sf-field-inherited-slot\)]>button:where(:dir(ltr)){margin-right:calc(-1*0px);margin-right:calc(-1*var(--sf-icon-button--padding-inline-end, 0px))}_:-ms-input-placeholder, [dir="rtl"] .sf-dropdown .sf-dropdown-field[\:has\(\%3E.sf-field-inherited-slot\)]>button{margin-left:calc(-1*0px);margin-left:calc(-1*var(--sf-icon-button--padding-inline-end, 0px))}@supports not (margin-inline-end: initial){[dir="rtl"] .sf-dropdown .sf-dropdown-field[\:has\(\%3E.sf-field-inherited-slot\)]>button{margin-left:calc(-1*0px);margin-left:calc(-1*var(--sf-icon-button--padding-inline-end, 0px))}}.sf-dropdown .sf-dropdown-field[\:has\(\%3E.sf-field-inherited-slot\)]>button:where(:dir(rtl)){margin-left:calc(-1*0px);margin-left:calc(-1*var(--sf-icon-button--padding-inline-end, 0px))}.sf-dropdown .sf-dropdown-field[\:has\(\%3E.sf-field-inherited-slot\)]>button{position:static;flex:none;margin-top:calc(-1*0px);margin-bottom:calc(-1*0px);margin-block:calc(-1*0px) calc(-1*0px);margin-top:calc(-1*0px);margin-top:calc(-1*var(--sf-dropdown-field--padding-top, 0px));margin-bottom:calc(-1*0px);margin-bottom:calc(-1*var(--sf-dropdown-field--padding-bottom, 0px));margin-block:calc(-1*var(--sf-dropdown-field--padding-top, 0px)) calc(-1*var(--sf-dropdown-field--padding-bottom, 0px));-webkit-margin-end:calc(-1*0px);margin-inline-end:calc(-1*0px);-webkit-margin-end:calc(-1*var(--sf-icon-button--padding-inline-end, 0px));margin-inline-end:calc(-1*var(--sf-icon-button--padding-inline-end, 0px))}_:-ms-input-placeholder, html:not([dir="rtl"]) .sf-dropdown .sf-dropdown-field[\:has\(\%3E.sf-field-inherited-slot\)]>button{margin-right:calc(-1*0px);margin-right:calc(-1*var(--sf-icon-button--padding-inline-end, 0px))}@supports not (margin-inline-end: initial){html:not([dir="rtl"]) .sf-dropdown .sf-dropdown-field[\:has\(\%3E.sf-field-inherited-slot\)]>button{margin-right:calc(-1*0px);margin-right:calc(-1*var(--sf-icon-button--padding-inline-end, 0px))}}.sf-dropdown .sf-dropdown-field[\:has\(\%3E.sf-field-inherited-slot\)]>button:where(:dir(ltr)){margin-right:calc(-1*0px);margin-right:calc(-1*var(--sf-icon-button--padding-inline-end, 0px))}_:-ms-input-placeholder, html:not([dir="rtl"]) .sf-dropdown .sf-dropdown-field[\:has\(\%3E.sf-field-inherited-slot\)]>button{margin-right:calc(-1*0px);margin-right:calc(-1*0px);margin-right:calc(-1*var(--sf-icon-button--padding-inline-end, 0px))}@supports not (margin-inline-end: initial){html:not([dir="rtl"]) .sf-dropdown .sf-dropdown-field[\:has\(\%3E.sf-field-inherited-slot\)]>button{margin-right:calc(-1*0px);margin-right:calc(-1*0px);margin-right:calc(-1*var(--sf-icon-button--padding-inline-end, 0px))}}.sf-dropdown .sf-dropdown-field[\:has\(\%3E.sf-field-inherited-slot\)]>button:where(:dir(ltr)){margin-right:calc(-1*0px);margin-right:calc(-1*0px);margin-right:calc(-1*var(--sf-icon-button--padding-inline-end, 0px))}_:-ms-input-placeholder, html:not([dir="rtl"]) .sf-dropdown .sf-dropdown-field:has(>.sf-field-inherited-slot)>button{margin-right:calc(-1*0px);margin-right:calc(-1*var(--sf-icon-button--padding-inline-end, 0px))}@supports not (margin-inline-end: initial){html:not([dir="rtl"]) .sf-dropdown .sf-dropdown-field:has(>.sf-field-inherited-slot)>button{margin-right:calc(-1*0px);margin-right:calc(-1*var(--sf-icon-button--padding-inline-end, 0px))}}.sf-dropdown .sf-dropdown-field:has(>.sf-field-inherited-slot)>button:where(:dir(ltr)){margin-right:calc(-1*0px);margin-right:calc(-1*var(--sf-icon-button--padding-inline-end, 0px))}_:-ms-input-placeholder, [dir="rtl"] .sf-dropdown .sf-dropdown-field[\:has\(\%3E.sf-field-inherited-slot\)]>button{margin-left:calc(-1*0px);margin-left:calc(-1*var(--sf-icon-button--padding-inline-end, 0px))}@supports not (margin-inline-end: initial){[dir="rtl"] .sf-dropdown .sf-dropdown-field[\:has\(\%3E.sf-field-inherited-slot\)]>button{margin-left:calc(-1*0px);margin-left:calc(-1*var(--sf-icon-button--padding-inline-end, 0px))}}.sf-dropdown .sf-dropdown-field[\:has\(\%3E.sf-field-inherited-slot\)]>button:where(:dir(rtl)){margin-left:calc(-1*0px);margin-left:calc(-1*var(--sf-icon-button--padding-inline-end, 0px))}_:-ms-input-placeholder, [dir="rtl"] .sf-dropdown .sf-dropdown-field[\:has\(\%3E.sf-field-inherited-slot\)]>button{margin-left:calc(-1*0px);margin-left:calc(-1*0px);margin-left:calc(-1*var(--sf-icon-button--padding-inline-end, 0px))}@supports not (margin-inline-end: initial){[dir="rtl"] .sf-dropdown .sf-dropdown-field[\:has\(\%3E.sf-field-inherited-slot\)]>button{margin-left:calc(-1*0px);margin-left:calc(-1*0px);margin-left:calc(-1*var(--sf-icon-button--padding-inline-end, 0px))}}.sf-dropdown .sf-dropdown-field[\:has\(\%3E.sf-field-inherited-slot\)]>button:where(:dir(rtl)){margin-left:calc(-1*0px);margin-left:calc(-1*0px);margin-left:calc(-1*var(--sf-icon-button--padding-inline-end, 0px))}_:-ms-input-placeholder, [dir="rtl"] .sf-dropdown .sf-dropdown-field:has(>.sf-field-inherited-slot)>button{margin-left:calc(-1*0px);margin-left:calc(-1*var(--sf-icon-button--padding-inline-end, 0px))}@supports not (margin-inline-end: initial){[dir="rtl"] .sf-dropdown .sf-dropdown-field:has(>.sf-field-inherited-slot)>button{margin-left:calc(-1*0px);margin-left:calc(-1*var(--sf-icon-button--padding-inline-end, 0px))}}.sf-dropdown .sf-dropdown-field:has(>.sf-field-inherited-slot)>button:where(:dir(rtl)){margin-left:calc(-1*0px);margin-left:calc(-1*var(--sf-icon-button--padding-inline-end, 0px))}_:-ms-input-placeholder, html:not([dir="rtl"]) .sf-dropdown .sf-dropdown-field[\:has\(\%3E.sf-field-inherited-slot\)]>button{margin-right:calc(-1*0px);margin-right:calc(-1*var(--sf-icon-button--padding-inline-end, 0px))}@supports not (margin-inline-end: initial){html:not([dir="rtl"]) .sf-dropdown .sf-dropdown-field[\:has\(\%3E.sf-field-inherited-slot\)]>button{margin-right:calc(-1*0px);margin-right:calc(-1*var(--sf-icon-button--padding-inline-end, 0px))}}.sf-dropdown .sf-dropdown-field[\:has\(\%3E.sf-field-inherited-slot\)]>button:where(:dir(ltr)){margin-right:calc(-1*0px);margin-right:calc(-1*var(--sf-icon-button--padding-inline-end, 0px))}_:-ms-input-placeholder, [dir="rtl"] .sf-dropdown .sf-dropdown-field[\:has\(\%3E.sf-field-inherited-slot\)]>button{margin-left:calc(-1*0px);margin-left:calc(-1*var(--sf-icon-button--padding-inline-end, 0px))}@supports not (margin-inline-end: initial){[dir="rtl"] .sf-dropdown .sf-dropdown-field[\:has\(\%3E.sf-field-inherited-slot\)]>button{margin-left:calc(-1*0px);margin-left:calc(-1*var(--sf-icon-button--padding-inline-end, 0px))}}.sf-dropdown .sf-dropdown-field[\:has\(\%3E.sf-field-inherited-slot\)]>button:where(:dir(rtl)){margin-left:calc(-1*0px);margin-left:calc(-1*var(--sf-icon-button--padding-inline-end, 0px))}.sf-dropdown .sf-dropdown-field[\:has\(\%3E.sf-field-inherited-slot\)]>button{position:static;flex:none;margin-top:calc(-1*0px);margin-bottom:calc(-1*0px);margin-block:calc(-1*0px) calc(-1*0px);margin-top:calc(-1*0px);margin-top:calc(-1*var(--sf-dropdown-field--padding-top, 0px));margin-bottom:calc(-1*0px);margin-bottom:calc(-1*var(--sf-dropdown-field--padding-bottom, 0px));margin-top:calc(-1*0px);margin-bottom:calc(-1*0px);margin-block:calc(-1*0px) calc(-1*0px);margin-top:calc(-1*0px);margin-top:calc(-1*var(--sf-dropdown-field--padding-top, 0px));margin-bottom:calc(-1*0px);margin-bottom:calc(-1*var(--sf-dropdown-field--padding-bottom, 0px));margin-block:calc(-1*var(--sf-dropdown-field--padding-top, 0px)) calc(-1*var(--sf-dropdown-field--padding-bottom, 0px));-webkit-margin-end:calc(-1*0px);margin-inline-end:calc(-1*0px);margin-inline-end:calc(-1*0px);-webkit-margin-end:calc(-1*var(--sf-icon-button--padding-inline-end, 0px));margin-inline-end:calc(-1*var(--sf-icon-button--padding-inline-end, 0px))}_:-ms-input-placeholder, html:not([dir="rtl"]) .sf-dropdown .sf-dropdown-field[\:has\(\%3E.sf-field-inherited-slot\)]>button{margin-right:calc(-1*0px);margin-right:calc(-1*var(--sf-icon-button--padding-inline-end, 0px))}@supports not (margin-inline-end: initial){html:not([dir="rtl"]) .sf-dropdown .sf-dropdown-field[\:has\(\%3E.sf-field-inherited-slot\)]>button{margin-right:calc(-1*0px);margin-right:calc(-1*var(--sf-icon-button--padding-inline-end, 0px))}}.sf-dropdown .sf-dropdown-field[\:has\(\%3E.sf-field-inherited-slot\)]>button:where(:dir(ltr)){margin-right:calc(-1*0px);margin-right:calc(-1*var(--sf-icon-button--padding-inline-end, 0px))}_:-ms-input-placeholder, [dir="rtl"] .sf-dropdown .sf-dropdown-field[\:has\(\%3E.sf-field-inherited-slot\)]>button{margin-left:calc(-1*0px);margin-left:calc(-1*var(--sf-icon-button--padding-inline-end, 0px))}@supports not (margin-inline-end: initial){[dir="rtl"] .sf-dropdown .sf-dropdown-field[\:has\(\%3E.sf-field-inherited-slot\)]>button{margin-left:calc(-1*0px);margin-left:calc(-1*var(--sf-icon-button--padding-inline-end, 0px))}}.sf-dropdown .sf-dropdown-field[\:has\(\%3E.sf-field-inherited-slot\)]>button:where(:dir(rtl)){margin-left:calc(-1*0px);margin-left:calc(-1*var(--sf-icon-button--padding-inline-end, 0px))}.sf-dropdown .sf-dropdown-field[\:has\(\%3E.sf-field-inherited-slot\)]>button{position:static;flex:none;margin-top:calc(-1*0px);margin-bottom:calc(-1*0px);margin-top:calc(-1*0px);margin-bottom:calc(-1*0px);margin-block:calc(-1*0px) calc(-1*0px);margin-top:calc(-1*0px);margin-top:calc(-1*0px);margin-top:calc(-1*var(--sf-dropdown-field--padding-top, 0px));margin-bottom:calc(-1*0px);margin-bottom:calc(-1*0px);margin-bottom:calc(-1*var(--sf-dropdown-field--padding-bottom, 0px));margin-top:calc(-1*0px);margin-bottom:calc(-1*0px);margin-block:calc(-1*0px) calc(-1*0px);margin-top:calc(-1*0px);margin-top:calc(-1*var(--sf-dropdown-field--padding-top, 0px));margin-bottom:calc(-1*0px);margin-bottom:calc(-1*var(--sf-dropdown-field--padding-bottom, 0px));margin-block:calc(-1*var(--sf-dropdown-field--padding-top, 0px)) calc(-1*var(--sf-dropdown-field--padding-bottom, 0px));-webkit-margin-end:calc(-1*0px);margin-inline-end:calc(-1*0px);margin-inline-end:calc(-1*0px);-webkit-margin-end:calc(-1*var(--sf-icon-button--padding-inline-end, 0px));margin-inline-end:calc(-1*var(--sf-icon-button--padding-inline-end, 0px))}.sf-dropdown .sf-dropdown-field:has(>.sf-field-inherited-slot)>button{position:static;flex:none;margin-top:calc(-1*0px);margin-bottom:calc(-1*0px);margin-block:calc(-1*0px) calc(-1*0px);margin-top:calc(-1*0px);margin-top:calc(-1*var(--sf-dropdown-field--padding-top, 0px));margin-bottom:calc(-1*0px);margin-bottom:calc(-1*var(--sf-dropdown-field--padding-bottom, 0px));margin-block:calc(-1*var(--sf-dropdown-field--padding-top, 0px)) calc(-1*var(--sf-dropdown-field--padding-bottom, 0px));-webkit-margin-end:calc(-1*0px);margin-inline-end:calc(-1*0px);-webkit-margin-end:calc(-1*var(--sf-icon-button--padding-inline-end, 0px));margin-inline-end:calc(-1*var(--sf-icon-button--padding-inline-end, 0px))}.sf-dropdown .sf-dropdown-field>.sf-field-inherited-slot{margin-top:calc(-1*0px);margin-bottom:calc(-1*0px);margin-block:calc(-1*0px) calc(-1*0px);margin-top:calc(-1*0px);margin-top:calc(-1*var(--sf-dropdown-field--padding-top, 0px));margin-bottom:calc(-1*0px);margin-bottom:calc(-1*var(--sf-dropdown-field--padding-bottom, 0px));margin-block:calc(-1*var(--sf-dropdown-field--padding-top, 0px)) calc(-1*var(--sf-dropdown-field--padding-bottom, 0px))}_:-ms-input-placeholder, html:not([dir="rtl"]) .sf-dropdown .sf-dropdown-field>.sf-field-inherited-slot>.sf-field-inherited{padding-right:var(--sf-space-1\/4)}@supports not (padding-inline-end: initial){html:not([dir="rtl"]) .sf-dropdown .sf-dropdown-field>.sf-field-inherited-slot>.sf-field-inherited{padding-right:var(--sf-space-1\/4)}}.sf-dropdown .sf-dropdown-field>.sf-field-inherited-slot>.sf-field-inherited:where(:dir(ltr)){padding-right:var(--sf-space-1\/4)}_:-ms-input-placeholder, [dir="rtl"] .sf-dropdown .sf-dropdown-field>.sf-field-inherited-slot>.sf-field-inherited{padding-left:var(--sf-space-1\/4)}@supports not (padding-inline-end: initial){[dir="rtl"] .sf-dropdown .sf-dropdown-field>.sf-field-inherited-slot>.sf-field-inherited{padding-left:var(--sf-space-1\/4)}}.sf-dropdown .sf-dropdown-field>.sf-field-inherited-slot>.sf-field-inherited:where(:dir(rtl)){padding-left:var(--sf-space-1\/4)}.sf-dropdown .sf-dropdown-field>.sf-field-inherited-slot>.sf-field-inherited{-webkit-padding-end:var(--sf-space-1\/4);padding-inline-end:var(--sf-space-1\/4)}_:-ms-input-placeholder, html:not([dir="rtl"]) .sf-dropdown .sf-dropdown-field>.sf-field-inherited-slot>.sf-field-reset{margin-right:0}@supports not (margin-inline-end: initial){html:not([dir="rtl"]) .sf-dropdown .sf-dropdown-field>.sf-field-inherited-slot>.sf-field-reset{margin-right:0}}.sf-dropdown .sf-dropdown-field>.sf-field-inherited-slot>.sf-field-reset:where(:dir(ltr)){margin-right:0}_:-ms-input-placeholder, [dir="rtl"] .sf-dropdown .sf-dropdown-field>.sf-field-inherited-slot>.sf-field-reset{margin-left:0}@supports not (margin-inline-end: initial){[dir="rtl"] .sf-dropdown .sf-dropdown-field>.sf-field-inherited-slot>.sf-field-reset{margin-left:0}}.sf-dropdown .sf-dropdown-field>.sf-field-inherited-slot>.sf-field-reset:where(:dir(rtl)){margin-left:0}.sf-dropdown .sf-dropdown-field>.sf-field-inherited-slot>.sf-field-reset{-webkit-margin-end:0;margin-inline-end:0}.sf-dropdown.sf-dropdown--size-1\/2 .sf-dropdown-field>.sf-field-inherited-slot>.sf-field-reset{--sf-field-reset--padding: var(--sf-ui-1\/3--space-y-tightness-default)}.sf-dropdown.sf-dropdown--size-1 .sf-dropdown-field>.sf-field-inherited-slot>.sf-field-reset{--sf-field-reset--padding: var(--sf-ui-1\/2--space-y-tightness-default)}.sf-dropdown.sf-dropdown--size-2 .sf-dropdown-field>.sf-field-inherited-slot>.sf-field-reset{--sf-field-reset--padding: var(--sf-ui-1--space-y-tightness-default)}.sf-dropdown .sf-dropdown-field>.sf-field-inherited-slot>.sf-field-reset{--sf-icon-button--padding-top: var(--sf-field-reset--padding);--sf-icon-button--padding-bottom: var(--sf-field-reset--padding);--sf-icon-button--padding-inline-start: var(--sf-field-reset--padding);--sf-icon-button--padding-inline-end: var(--sf-field-reset--padding)}.sf-textarea-inherited,.sf-switch-inherited,.sf-color-inherited-slot{--sf-field-inherited-slot--inset: 0px}.sf-textarea-inherited{justify-content:flex-end}sf-switch[data-inherited] .sf-switch-toggler{opacity:.64}}
@@ -1,13 +1,30 @@
1
- (()=>{"use strict";var e={e138a730fd7c(e,t,r){r.d(t,{U:()=>o,h:()=>s});let a=0;const n=new WeakMap;function s(e,{prefix:t="sf-field",required:r=!1,invalid:s=!1,hint:o="",errorMessage:i=""}={}){const l=function(e,t){if(e&&n.has(e))return n.get(e);const r=(e?.id?String(e.id).trim():"")||`${t}-${++a}`,s={controlId:`${r}-control`,messageId:`${r}-message`};return!e||"object"!=typeof e&&"function"!=typeof e||n.set(e,s),s}(e,t),u=Boolean(s),d=u&&i?i:o;return{...l,required:Boolean(r),invalid:u,message:d,describedBy:d?l.messageId:"",errorMessageId:u&&i?l.messageId:""}}function o(e,t,{prefix:r="sf-field",required:a=!1,invalid:n=!1,messageNode:o=null,labelNode:i=null,errorMessage:l=""}={}){if(!e||!t)return null;const u=s(e,{prefix:r,required:a,invalid:n,hint:o?.textContent?.trim()||"",errorMessage:l});var d,c;return t.id||(t.id=u.controlId),"LABEL"!==e.tagName||e.hasAttribute("for")||e.setAttribute("for",t.id),!i?.textContent?.trim()||t.hasAttribute("aria-label")||t.hasAttribute("aria-labelledby")||(i.id||(i.id=`${t.id}-label`),t.setAttribute("aria-labelledby",i.id)),t.required=u.required,e.classList.toggle("error",u.invalid),t.classList.toggle("error",u.invalid),u.invalid?t.setAttribute("aria-invalid","true"):t.removeAttribute("aria-invalid"),o&&(o.id||(o.id=u.messageId),t.setAttribute("aria-describedby",(d=t.getAttribute("aria-describedby"),c=[o.id],[...new Set([...String(d||"").split(/\s+/).filter(Boolean),...c.filter(Boolean)])].join(" ")))),u.errorMessageId&&o?t.setAttribute("aria-errormessage",o.id):t.removeAttribute("aria-errormessage"),u}},"98e26702f55a"(e,t,r){function a(){const e=globalThis.SF=globalThis.SF||{};return e.__deprecationNotes instanceof Map||Object.defineProperty(e,"__deprecationNotes",{value:new Map,configurable:!0}),e.__deprecationNotes}function n({component:e="",kind:t="attribute",attribute:r="",from:n,to:s=null}={}){if(!n)return;const o=[e,t,r,n].join("|"),i=a(),l=i.get(o);if(l)l.count+=1;else if(i.set(o,{component:e,kind:t,attribute:r,from:n,to:s,count:1}),function(){const e=globalThis.document?.documentElement;return"warn"===e?.dataset?.sfDeprecations||!0===globalThis.SF?.deprecations?.warn}()){const a=e?`${e}: `:"",o="value"===t?`${r}="${n}"`:`${t} ${n}`;globalThis.console?.warn?.(`[SIMAI Framework] ${a}${o} is a legacy name${s?`; write ${s}`:""}. See contracts/changes/journal.json.`)}}if(r.d(t,{id:()=>l,vl:()=>u}),"undefined"!=typeof globalThis){globalThis.SF=globalThis.SF||{};const e=globalThis.SF.deprecations||{};e.list=function(){return[...a().values()].map(e=>({...e}))},e.clear=function(){a().clear()},e.note=n,globalThis.SF.deprecations=e}const s=Object.freeze(["1/2","1","2"]),o=Object.freeze({"1/3":"1/2",3:"2"}),i=new Set;function l(e,t="field",r="1"){const a=String(e??"").trim().toLowerCase();if(s.includes(a))return a;if(Object.hasOwn(o,a)){const e=o[a];n({component:t,kind:"value",attribute:"size",from:a,to:e});const r=`${t}:${a}`;return i.has(r)||"undefined"==typeof console||(i.add(r),console.warn(`[SIMAI Framework] ${t}: size ${a} is retired for form fields; rendering size ${e}.`)),e}return r}function u(e,t){if(e?.classList)for(const[r,a]of Object.entries(o)){const a=`${t}--size-${r}`;e.classList.contains(a)&&e.classList.replace(a,`${t}--size-${l(r,t)}`)}}},"01398f3e8009"(e,t,r){r.d(t,{sd:()=>$,aJ:()=>A,TO:()=>M});class a{lifecycleName(){return this.componentName??this.constructor.componentName}constructor(e){this.props=e,this.id=e?.id,this.params=e?.param,this.attrs=e?.attrs||{},this.template=null,window.dispatchEvent(new CustomEvent(`${this.lifecycleName()}:beforeRender`,{detail:this}))}getUtilityMap(){return this.constructor.utilityMap||null}extractUtilityClasses(e){if(!Array.isArray(e))return[];const t=new Set;return e.forEach(e=>{if("string"!=typeof e)return;const r=e.match(/\(([^)]+)\)/g);r&&r.forEach(e=>{e.slice(1,-1).split(/\s+/).filter(Boolean).forEach(e=>{e.startsWith(".")&&e.length>1&&t.add(e.slice(1))})})}),Array.from(t)}applyLayoutUtilities(e,t){if(!e||!t)return;const r=this.getUtilityMap();if(!r||!r[t])return;this.extractUtilityClasses(r[t]).forEach(t=>e.classList.add(t))}render(){return this.html=this.template,"function"==typeof this.init&&this.init(),this.html&&window.dispatchEvent(new CustomEvent(`${this.lifecycleName()}:render`,{detail:this})),this.html}destroy(){this.destroyInternal?.(),this.props=null,this.id=null,this.params=null,this.template=null,this.html&&(this.html.remove(),this.html=null),window.dispatchEvent(new CustomEvent(`${this.lifecycleName()}:destroy`,{detail:this}))}destroyInternal(){}}const n=function(e,t){if(e&&t)if("undefined"==typeof window||"function"!=typeof window.registerSfComponent){if("undefined"!=typeof window&&window.SF?.Loader?.registerComponent)window.SF.Loader.registerComponent(e,t);else if("undefined"!=typeof window){(window.SF_PENDING_COMPONENTS=window.SF_PENDING_COMPONENTS||[]).push([e,t])}}else window.registerSfComponent(e,t)},s=JSON.parse('{".sf-textarea":["display/flex (.flex)","flex-direction/column (.flex-col)","flex-wrap/nowrap (.flex-nowrap)","gap/var(--sf-space-1\\\\/4)","justify-content/flex-start (.justify-start)"],".sf-textarea .sf-textarea-label":["display/flex (.flex)","flex-direction/row (.flex-row)","flex-wrap/nowrap (.flex-nowrap)","gap/var(--sf-space-1\\\\/4)","justify-content/flex-start (.justify-start)","align-items/flex-start (.items-start)"],".sf-textarea textarea":[],".sf-textarea .sf-textarea-hint-text-wrap":["flex/1 (.flex-1)","display/flex (.flex)","flex-direction/row (.flex-row)","flex-wrap/nowrap (.flex-nowrap)","gap/var(--sf-b0)","justify-content/flex-start (.justify-start)","align-items/center (.items-center)"]}');var o=r("e138a730fd7c"),i=r("98e26702f55a");const l=new WeakMap,u=new WeakSet;let d=null;const c="label.sf-textarea",f="sfTextareaBound",m=new Set(["bordered","filled","flush"]),p=new Set(["","none","text","tel","url","email","numeric","decimal","search"]),h=new Set(["soft","hard"]);function g(e){if(""===e||null==e)return null;const t=Number(e);return Number.isInteger(t)&&t>=0?t:null}function x(e,t=!1){return null==e||""===e?t:"boolean"==typeof e?e:["1","true","yes","on"].includes(String(e).toLowerCase())}function b(e){return e?.querySelector?.("textarea")||null}function w(e){return e?.querySelector?.(".sf-textarea-hint-text-wrap")||null}function y(e){const t=w(e);return{messageNode:t,errorMessage:"error"===t?.dataset.fieldMessage&&t.textContent?.trim()||""}}function v(e){if(!e||"string"!=typeof e)return null;const t=e.trim();if(!t)return null;try{const e=JSON.parse(t);return e&&"object"==typeof e?e:null}catch{return null}}const S="sf-textarea--auto-grow";function _(e){if(""===e||null==e)return null;const t=Math.trunc(Number(e));return Number.isFinite(t)&&t>0?t:null}function k(e,t){var r,a;if(!(r=t.dataset.autoGrow??e.dataset.autoGrow,a=e.classList.contains(S),null==r?a:""===r||x(r,a)))return null;const n=_(t.dataset.minRows??e.dataset.minRows)??1,s=_(t.dataset.maxRows??e.dataset.maxRows);return{minRows:n,maxRows:null===s?null:Math.max(s,n)}}function L(e,t){const r=k(e,t);if(!r)return;const a=!e.classList.contains(S);e.classList.add(S),t.rows=r.minRows,t.style.setProperty("--sf-textarea--min-rows",String(r.minRows)),null===r.maxRows?t.style.removeProperty("--sf-textarea--max-rows"):t.style.setProperty("--sf-textarea--max-rows",String(r.maxRows));const n={addedClass:a,fallback:null};if(e.__sfTextareaAutoGrow=n,"undefined"!=typeof CSS&&!0===CSS.supports?.("field-sizing","content"))return;let s=!1,o=-1;const i=()=>{s||function(e,t){if(!t.isConnected||0===t.clientWidth)return;const r=e.style.minBlockSize;e.style.minBlockSize=`${e.getBoundingClientRect().height}px`;const{scrollTop:a}=t;t.style.blockSize="auto";const n=getComputedStyle(t),s=(parseFloat(n.borderTopWidth)||0)+(parseFloat(n.borderBottomWidth)||0);t.style.blockSize=`${t.scrollHeight+s}px`,t.scrollTop!==a&&(t.scrollTop=a),e.style.minBlockSize=r}(e,t)},l=e=>{e.isComposing||i()},u=()=>{s=!0},d=()=>{s=!1,i()};t.addEventListener("input",l),t.addEventListener("compositionstart",u),t.addEventListener("compositionend",d);const c=Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype,"value");Object.defineProperty(t,"value",{configurable:!0,enumerable:!0,get(){return c.get.call(this)},set(e){c.set.call(this,e),i()}});const f="undefined"==typeof ResizeObserver?null:new ResizeObserver(e=>{const t=Math.round(e[e.length-1].contentRect.width);t!==o&&(o=t,i())});f?.observe(t),i(),n.fallback={grow:i,onInput:l,onCompositionStart:u,onCompositionEnd:d,observer:f}}async function T(e,t){const r=function(e,t){if(!x(t.dataset.mask??e.dataset.mask,!1))return null;const r=v(t.dataset.maskOptions),a=v(e.dataset.maskOptions);if(r)return r;if(a)return a;const n=t.dataset.maskPattern??e.dataset.maskPattern;return n?{mask:String(n)}:null}(e,t);if(!r)return;const a={};e.__sfTextareaMaskRequest=a;try{const n=await function(){const e=()=>window.SF?.Mask?.create?window.SF.Mask:null,t=e();return t?Promise.resolve(t):d||(d=new Promise(t=>{const r=[[window,"sf-mask-ready"],[window,"sf-loader-ready"],[window,"load"],[document,"DOMContentLoaded"]],a=()=>{const n=e();n&&(r.forEach(([e,t])=>e.removeEventListener(t,a)),d=null,t(n))};r.forEach(([e,t])=>e.addEventListener(t,a))}),d)}();if(e.__sfTextareaMaskRequest!==a)return;const s=await n.create(t,r);if(!s)return;if("1"!==e.dataset[f]||e.__sfTextareaMaskRequest!==a||b(e)!==t)return void n.destroy(s);e.__sfTextareaMask=s}catch(e){console.warn("SF.Textarea mask init failed",e)}}function $(e){if((0,i.vl)(e,"sf-textarea"),!e||"1"===e.dataset[f])return;const t=b(e);if(!t)return;const r=()=>{},a=()=>e.classList.add("sf-textarea--pointer-focus"),n=()=>e.classList.remove("sf-textarea--pointer-focus");t.addEventListener("input",r),t.addEventListener("pointerdown",a),t.addEventListener("blur",n),e.__sfTextareaNoopHandler=r,e.__sfTextareaPointerFocusHandler=a,e.__sfTextareaBlurHandler=n,e.dataset[f]="1";const s=y(e);(0,o.U)(e,t,{prefix:"sf-textarea",labelNode:e.querySelector(".sf-textarea-text"),required:t.required||Boolean(e.querySelector(".sf-textarea-required")),invalid:e.classList.contains("error")||t.classList.contains("error"),...s}),e.__sfTextareaReleaseReset=function(e,t){const r=e.ownerDocument;u.has(r)||(r.addEventListener("reset",e=>{const t=e.target;if("FORM"!==t?.tagName)return;const r=Array.from(t.elements);setTimeout(()=>{if(!e.defaultPrevented)for(const e of r)if(e.isConnected&&e.form===t)for(const t of l.get(e)||[])t()},0)},!0),u.add(r));let a=l.get(e);return a||l.set(e,a=new Set),a.add(t),()=>a.delete(t)}(t,()=>{e.__sfTextareaMask&&(e.__sfTextareaMask.value=t.value),e.__sfTextareaAutoGrow?.fallback?.grow()}),L(e,t),T(e,t)}function M(e){if(!e||"1"!==e.dataset[f])return;delete e.__sfTextareaMaskRequest;const t=b(e);t&&e.__sfTextareaNoopHandler&&t.removeEventListener("input",e.__sfTextareaNoopHandler),t&&e.__sfTextareaPointerFocusHandler&&t.removeEventListener("pointerdown",e.__sfTextareaPointerFocusHandler),t&&e.__sfTextareaBlurHandler&&t.removeEventListener("blur",e.__sfTextareaBlurHandler),function(e,t){const r=e.__sfTextareaAutoGrow;if(!r)return;if(delete e.__sfTextareaAutoGrow,r.addedClass&&e.classList.remove(S),!t)return;t.style.removeProperty("--sf-textarea--min-rows"),t.style.removeProperty("--sf-textarea--max-rows");const{fallback:a}=r;a&&(t.removeEventListener("input",a.onInput),t.removeEventListener("compositionstart",a.onCompositionStart),t.removeEventListener("compositionend",a.onCompositionEnd),a.observer?.disconnect(),delete t.value,t.style.removeProperty("block-size"))}(e,t),e.__sfTextareaMask&&window.SF?.Mask?.destroy?.(e.__sfTextareaMask),e.__sfTextareaReleaseReset?.(),delete e.__sfTextareaReleaseReset,delete e.__sfTextareaMask,delete e.__sfTextareaNoopHandler,delete e.__sfTextareaPointerFocusHandler,delete e.__sfTextareaBlurHandler,e.classList.remove("sf-textarea--pointer-focus"),delete e.dataset[f]}function E(e=document){e.querySelectorAll(c).forEach($)}function A(e,t={}){const r=e instanceof HTMLElement?e.closest(c)||e:null;if(!r)return!1;const a=b(r);if(!a)return!1;if(Object.prototype.hasOwnProperty.call(t,"disabled")&&(a.disabled=x(t.disabled)),Object.prototype.hasOwnProperty.call(t,"error")){const e=x(t.error);r.classList.toggle("error",e),a.classList.toggle("error",e)}if(Object.prototype.hasOwnProperty.call(t,"invalid")){const e=x(t.invalid);r.classList.toggle("error",e),a.classList.toggle("error",e)}if(Object.prototype.hasOwnProperty.call(t,"errorMessage")){const e=String(t.errorMessage??""),n=e?function(e){const t=w(e);if(t)return t;const r=document.createElement("span");return r.classList.add("sf-textarea-hint-text-wrap"),e.append(r),r}(r):w(r);if(n){n.textContent=e;const t=r.classList.contains("error")||a.classList.contains("error");n.dataset.fieldMessage=e&&t?"error":"hint"}}return Object.prototype.hasOwnProperty.call(t,"value")&&(a.value=String(t.value??""),a.dispatchEvent(new Event("input",{bubbles:!0}))),(0,o.U)(r,a,{prefix:"sf-textarea",labelNode:r.querySelector(".sf-textarea-text"),required:a.required||Boolean(r.querySelector(".sf-textarea-required")),invalid:r.classList.contains("error")||a.classList.contains("error"),...y(r)}),!0}class R extends a{static componentName="Textarea";html=null;constructor(e){super(e);const{size:t="1",type:r="bordered",label:a="",required:n=!1,placeholder:s="",autocomplete:o="",inputMode:l="",minLength:u="",maxLength:d="",spellcheck:c=!0,wrap:f="soft",hint:b="",value:w="",name:y="",rows:v=3,disabled:S=!1,readonly:k=!1,error:L=!1,invalid:T=!1,errorMessage:$="",mask:M=!1,maskOptions:E,maskPattern:A,autoGrow:R=!1,minRows:N,maxRows:O}=this.params||{},C=this.attrs.class||this.attrs.className,q=(0,i.id)(t,"sf-textarea"),P=function(e,t,r){const a=String(e||r);return t.has(a)?a:r}(r,m,"bordered");this.template=document.createElement("label"),this.id&&(this.template.id=this.id),this.template.classList.add("sf-textarea",`sf-textarea--size-${q}`,`sf-textarea--${P}`),this.template.classList.toggle("error",x(T||L,!1)),C&&this.template.classList.add(...`${C}`.split(" ").filter(Boolean));const F=document.createElement("span");F.classList.add("sf-textarea-label");const B=document.createElement("span");if(B.classList.add("sf-textarea-text"),B.textContent=String(a),F.append(B),x(n,!0)){const e=document.createElement("span");e.classList.add("sf-textarea-required"),e.textContent="*",F.append(e)}const j=document.createElement("textarea");j.placeholder=String(s??""),o&&(j.autocomplete=String(o)),j.inputMode=function(e){const t=String(e||"").toLowerCase();return p.has(t)?t:""}(l);const I=g(u),z=g(d);if(null!==I&&(j.minLength=I),null!==z&&(j.maxLength=z),j.spellcheck=x(c,!0),j.wrap=function(e){const t=String(e||"soft").toLowerCase();return h.has(t)?t:"soft"}(f),j.value=String(w??""),j.defaultValue=String(w??""),j.rows=Number(v)>0?Number(v):3,y&&(j.name=String(y)),j.disabled=x(S,!1),j.readOnly=x(k,!1),j.required=x(n,!0),j.classList.toggle("error",x(T||L,!1)),j.dataset.mask=String(Boolean(M)),A&&(j.dataset.maskPattern=String(A)),E&&"object"==typeof E&&(j.dataset.maskOptions=JSON.stringify(E)),x(R,!1)){j.dataset.autoGrow="true";const e=_(N),t=_(O);null!==e&&(j.dataset.minRows=String(e)),null!==t&&(j.dataset.maxRows=String(t))}this.template.append(F,j);const G=x(T||L,!1)&&$?$:b;if(G){const e=document.createElement("span");e.classList.add("sf-textarea-hint-text-wrap"),e.textContent=String(G),e.dataset.fieldMessage=x(T||L,!1)&&$?"error":"hint",this.template.append(e)}this.applyLayoutUtilities(this.template,".sf-textarea"),this.applyLayoutUtilities(F,".sf-textarea .sf-textarea-label"),this.applyLayoutUtilities(j,".sf-textarea textarea")}init(){$(this.template)}destroyInternal(){M(this.template)}}R.utilityMap=s,n("Textarea",R),"undefined"!=typeof window&&(window.SF=window.SF||{},window.SF.Textarea=window.SF.Textarea||{},window.SF.Textarea.setState=A),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>E()):E();new MutationObserver(e=>{e.forEach(e=>{e.addedNodes.forEach(e=>{e instanceof Element&&(e.matches?.(c)&&$(e),E(e))})})}).observe(document.documentElement,{childList:!0,subtree:!0})},c6ddd1585553(e,t,r){r.a(e,async(e,t)=>{try{var a=r("01398f3e8009"),n=r("fbe0570fcc69"),s=r("98e26702f55a"),o=r("943b9fa4bc95"),i=e([n,o]);[n,o]=i.then?(await i)():i;var l=r.n(n);new Set(["bordered","filled","flush"]);const u=new Set(["","none","text","tel","url","email","numeric","decimal","search"]),d=new Set(["soft","hard"]);function c(e,t,r){const a=String(e||r);return t.has(a)?a:r}class f extends(l()){static get props(){return{size:{default:"1"},appearance:{default:"bordered",values:["bordered","filled","flush"],aliases:["type"]},label:{default:""},required:{type:Boolean,default:!1},placeholder:{default:""},autocomplete:{default:""},inputmode:{default:""},minlength:{type:Number,default:null},maxlength:{type:Number,default:null},spellcheck:{type:Boolean,default:!0},wrap:{default:"soft"},hint:{default:""},value:{default:""},name:{default:""},rows:{type:Number,default:3},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},error:{type:Boolean,default:!1},invalid:{type:Boolean,default:!1},errorMessage:{default:""},mask:{type:Boolean,default:!1},maskPattern:{default:""},maskOptions:{default:""},autoGrow:{type:Boolean,default:!1},minRows:{type:Number,default:1},maxRows:{type:Number,default:null}}}constructor(){super(),this._boundRoot=null}get size(){return(0,s.id)(this.getAttribute("size")||"1","sf-textarea")}get appearance(){return this.getProp("appearance")}get type(){return this.appearance}get label(){return this.getAttribute("label")||""}get required(){return this.getBooleanAttr("required",!1)}get placeholder(){return this.getAttribute("placeholder")||""}get autocomplete(){return this.getAttribute("autocomplete")||""}get inputmode(){return c(this.getAttribute("inputmode"),u,"")}get minlength(){const e=this.getNumberAttr("minlength",null);return Number.isInteger(e)&&e>=0?e:null}get maxlength(){const e=this.getNumberAttr("maxlength",null);return Number.isInteger(e)&&e>=0?e:null}get spellcheck(){return this.getBooleanAttr("spellcheck",!0)}get wrap(){return c(this.getAttribute("wrap"),d,"soft")}get hint(){return this.getAttribute("hint")||""}get value(){const e=this.querySelector(".sf-textarea textarea");return e?e.value:this.getAttribute("value")||""}set value(e){const t=String(e??"");null==e?this.removeAttribute("value"):this.setAttribute("value",t);const r=this.querySelector(".sf-textarea"),a=r?.querySelector("textarea");r?.__sfTextareaMask?r.__sfTextareaMask.value=t:a&&(a.value=t)}get name(){return this.getAttribute("name")||""}get rows(){const e=Math.trunc(this.getNumberAttr("rows",3));return e>0?e:3}get autoGrow(){return this.getBooleanAttr("auto-grow",!1)}get minRows(){const e=Math.trunc(this.getNumberAttr("minRows",1));return e>0?e:1}get maxRows(){const e=Math.trunc(this.getNumberAttr("maxRows",null));return e>0?Math.max(e,this.minRows):null}get disabled(){return this.getBooleanAttr("disabled",!1)}get readonly(){return this.getBooleanAttr("readonly",!1)}get error(){return this.getBooleanAttr("error",!1)}get invalid(){return this.getBooleanAttr("invalid",!1)}get errorMessage(){return this.getAttribute("error-message")||""}get mask(){return this.getBooleanAttr("mask",!1)}get maskPattern(){return this.getAttribute("mask-pattern")||""}get maskOptions(){return this.getAttribute("mask-options")||""}templateContext(){const e=this.getPropsContext(),t=this.querySelector("textarea");return this.createTemplateContext({...e,value:this.hasAttribute("value")||!t?e.value:t.value,type:this.type,minlength:this.minlength,maxlength:this.maxlength,autoGrow:this.autoGrow,minRows:this.minRows,maxRows:this.maxRows})}onDisconnected(){this._boundRoot&&((0,a.TO)(this._boundRoot),this._boundRoot=null)}afterRender(){this._boundRoot&&((0,a.TO)(this._boundRoot),this._boundRoot=null),this._boundRoot=this.querySelector(".sf-textarea"),this._boundRoot&&(0,a.sd)(this._boundRoot)}template(){return(0,o.F)(this.templateContext())}get state(){const e=this.querySelector(".sf-textarea"),t=e?.querySelector?.("textarea")||null;return{value:t?.value||"",disabled:!!t?.disabled,invalid:"true"===t?.getAttribute("aria-invalid"),error:e?.classList?.contains("error")||t?.classList?.contains("error")||!1}}setState(e={}){const t=this.querySelector(".sf-textarea");return(0,a.aJ)(t,e)}}f.define("sf-textarea"),t()}catch(m){t(m)}})},"943b9fa4bc95"(e,t,r){r.a(e,async(e,a)=>{try{r.d(t,{F:()=>l});var n=r("ddf1cdb42ecc"),s=r("e138a730fd7c"),o=e([n]),i=o.then?(await o)():o;n=i[0];function l(e){const{size:t,appearance:r,type:a,label:o,required:i,placeholder:l,autocomplete:u,inputmode:d,minlength:c,maxlength:f,spellcheck:m,wrap:p,hint:h,value:g,name:x,rows:b,disabled:w,readonly:y,error:v,invalid:S,errorMessage:_,mask:k,maskPattern:L,maskOptions:T,autoGrow:$,minRows:M,maxRows:E}=e,A=(0,s.h)(e.component,{prefix:"sf-textarea",required:i,invalid:S||v,hint:h,errorMessage:_}),R=e.component?.hasSlotContent?.("error")?e.component.getSlotContent("error"):_,N=e.component?.hasSlotContent?.("hint")?e.component.getSlotContent("hint"):h,O=A.invalid&&R?R:N,C=["sf-textarea",`sf-textarea--size-${t}`,`sf-textarea--${r??a}`,A.invalid?"error":"",$?"sf-textarea--auto-grow":"","flex","flex-col",e.rootClass].filter(Boolean),q=o?n.html`
1
+ (()=>{"use strict";var e={e138a730fd7c(e,t,r){r.d(t,{U:()=>i,h:()=>s});let a=0;const n=new WeakMap;function s(e,{prefix:t="sf-field",required:r=!1,invalid:s=!1,hint:i="",errorMessage:o=""}={}){const l=function(e,t){if(e&&n.has(e))return n.get(e);const r=(e?.id?String(e.id).trim():"")||`${t}-${++a}`,s={controlId:`${r}-control`,messageId:`${r}-message`};return!e||"object"!=typeof e&&"function"!=typeof e||n.set(e,s),s}(e,t),d=Boolean(s),u=d&&o?o:i;return{...l,required:Boolean(r),invalid:d,message:u,describedBy:u?l.messageId:"",errorMessageId:d&&o?l.messageId:""}}function i(e,t,{prefix:r="sf-field",required:a=!1,invalid:n=!1,messageNode:i=null,labelNode:o=null,errorMessage:l=""}={}){if(!e||!t)return null;const d=s(e,{prefix:r,required:a,invalid:n,hint:i?.textContent?.trim()||"",errorMessage:l});var u,c;return t.id||(t.id=d.controlId),"LABEL"!==e.tagName||e.hasAttribute("for")||e.setAttribute("for",t.id),!o?.textContent?.trim()||t.hasAttribute("aria-label")||t.hasAttribute("aria-labelledby")||(o.id||(o.id=`${t.id}-label`),t.setAttribute("aria-labelledby",o.id)),t.required=d.required,e.classList.toggle("error",d.invalid),t.classList.toggle("error",d.invalid),d.invalid?t.setAttribute("aria-invalid","true"):t.removeAttribute("aria-invalid"),i&&(i.id||(i.id=d.messageId),t.setAttribute("aria-describedby",(u=t.getAttribute("aria-describedby"),c=[i.id],[...new Set([...String(u||"").split(/\s+/).filter(Boolean),...c.filter(Boolean)])].join(" ")))),d.errorMessageId&&i?t.setAttribute("aria-errormessage",i.id):t.removeAttribute("aria-errormessage"),d}},"98e26702f55a"(e,t,r){function a(){const e=globalThis.SF=globalThis.SF||{};return e.__deprecationNotes instanceof Map||Object.defineProperty(e,"__deprecationNotes",{value:new Map,configurable:!0}),e.__deprecationNotes}function n({component:e="",kind:t="attribute",attribute:r="",from:n,to:s=null}={}){if(!n)return;const i=[e,t,r,n].join("|"),o=a(),l=o.get(i);if(l)l.count+=1;else if(o.set(i,{component:e,kind:t,attribute:r,from:n,to:s,count:1}),function(){const e=globalThis.document?.documentElement;return"warn"===e?.dataset?.sfDeprecations||!0===globalThis.SF?.deprecations?.warn}()){const a=e?`${e}: `:"",i="value"===t?`${r}="${n}"`:`${t} ${n}`;globalThis.console?.warn?.(`[SIMAI Framework] ${a}${i} is a legacy name${s?`; write ${s}`:""}. See contracts/changes/journal.json.`)}}if(r.d(t,{id:()=>l,vl:()=>d}),"undefined"!=typeof globalThis){globalThis.SF=globalThis.SF||{};const e=globalThis.SF.deprecations||{};e.list=function(){return[...a().values()].map(e=>({...e}))},e.clear=function(){a().clear()},e.note=n,globalThis.SF.deprecations=e}const s=Object.freeze(["1/2","1","2"]),i=Object.freeze({"1/3":"1/2",3:"2"}),o=new Set;function l(e,t="field",r="1"){const a=String(e??"").trim().toLowerCase();if(s.includes(a))return a;if(Object.hasOwn(i,a)){const e=i[a];n({component:t,kind:"value",attribute:"size",from:a,to:e});const r=`${t}:${a}`;return o.has(r)||"undefined"==typeof console||(o.add(r),console.warn(`[SIMAI Framework] ${t}: size ${a} is retired for form fields; rendering size ${e}.`)),e}return r}function d(e,t){if(e?.classList)for(const[r,a]of Object.entries(i)){const a=`${t}--size-${r}`;e.classList.contains(a)&&e.classList.replace(a,`${t}--size-${l(r,t)}`)}}},"01398f3e8009"(e,t,r){r.d(t,{sd:()=>L,aJ:()=>M,TO:()=>A});class a{lifecycleName(){return this.componentName??this.constructor.componentName}constructor(e){this.props=e,this.id=e?.id,this.params=e?.param,this.attrs=e?.attrs||{},this.template=null,window.dispatchEvent(new CustomEvent(`${this.lifecycleName()}:beforeRender`,{detail:this}))}getUtilityMap(){return this.constructor.utilityMap||null}extractUtilityClasses(e){if(!Array.isArray(e))return[];const t=new Set;return e.forEach(e=>{if("string"!=typeof e)return;const r=e.match(/\(([^)]+)\)/g);r&&r.forEach(e=>{e.slice(1,-1).split(/\s+/).filter(Boolean).forEach(e=>{e.startsWith(".")&&e.length>1&&t.add(e.slice(1))})})}),Array.from(t)}applyLayoutUtilities(e,t){if(!e||!t)return;const r=this.getUtilityMap();if(!r||!r[t])return;this.extractUtilityClasses(r[t]).forEach(t=>e.classList.add(t))}render(){return this.html=this.template,"function"==typeof this.init&&this.init(),this.html&&window.dispatchEvent(new CustomEvent(`${this.lifecycleName()}:render`,{detail:this})),this.html}destroy(){this.destroyInternal?.(),this.props=null,this.id=null,this.params=null,this.template=null,this.html&&(this.html.remove(),this.html=null),window.dispatchEvent(new CustomEvent(`${this.lifecycleName()}:destroy`,{detail:this}))}destroyInternal(){}}const n=function(e,t){if(e&&t)if("undefined"==typeof window||"function"!=typeof window.registerSfComponent){if("undefined"!=typeof window&&window.SF?.Loader?.registerComponent)window.SF.Loader.registerComponent(e,t);else if("undefined"!=typeof window){(window.SF_PENDING_COMPONENTS=window.SF_PENDING_COMPONENTS||[]).push([e,t])}}else window.registerSfComponent(e,t)},s=JSON.parse('{".sf-textarea":["display/flex (.flex)","flex-direction/column (.flex-col)","flex-wrap/nowrap (.flex-nowrap)","gap/var(--sf-space-1\\\\/4)","justify-content/flex-start (.justify-start)"],".sf-textarea .sf-textarea-label":["display/flex (.flex)","flex-direction/row (.flex-row)","flex-wrap/nowrap (.flex-nowrap)","gap/var(--sf-space-1\\\\/4)","justify-content/flex-start (.justify-start)","align-items/flex-start (.items-start)"],".sf-textarea textarea":[],".sf-textarea .sf-textarea-hint-text-wrap":["flex/1 (.flex-1)","display/flex (.flex)","flex-direction/row (.flex-row)","flex-wrap/nowrap (.flex-nowrap)","gap/var(--sf-b0)","justify-content/flex-start (.justify-start)","align-items/center (.items-center)"]}');var i=r("e138a730fd7c"),o=r("98e26702f55a");const l=new WeakMap,d=new WeakSet;let u=null;const c="label.sf-textarea",f="sfTextareaBound",h=new Set(["bordered","filled","flush"]),p=new Set(["","none","text","tel","url","email","numeric","decimal","search"]),m=new Set(["soft","hard"]);function g(e){if(""===e||null==e)return null;const t=Number(e);return Number.isInteger(t)&&t>=0?t:null}function b(e,t=!1){return null==e||""===e?t:"boolean"==typeof e?e:["1","true","yes","on"].includes(String(e).toLowerCase())}function x(e){return e?.querySelector?.("textarea")||null}function w(e){return e?.querySelector?.(".sf-textarea-hint-text-wrap")||null}function y(e){const t=w(e);return{messageNode:t,errorMessage:"error"===t?.dataset.fieldMessage&&t.textContent?.trim()||""}}function v(e){if(!e||"string"!=typeof e)return null;const t=e.trim();if(!t)return null;try{const e=JSON.parse(t);return e&&"object"==typeof e?e:null}catch{return null}}const S="sf-textarea--auto-grow";function _(e){if(""===e||null==e)return null;const t=Math.trunc(Number(e));return Number.isFinite(t)&&t>0?t:null}function T(e,t){var r,a;if(!(r=t.dataset.autoGrow??e.dataset.autoGrow,a=e.classList.contains(S),null==r?a:""===r||b(r,a)))return null;const n=_(t.dataset.minRows??e.dataset.minRows)??1,s=_(t.dataset.maxRows??e.dataset.maxRows);return{minRows:n,maxRows:null===s?null:Math.max(s,n)}}function k(e,t){const r=T(e,t);if(!r)return;const a=!e.classList.contains(S);e.classList.add(S),t.rows=r.minRows,t.style.setProperty("--sf-textarea--min-rows",String(r.minRows)),null===r.maxRows?t.style.removeProperty("--sf-textarea--max-rows"):t.style.setProperty("--sf-textarea--max-rows",String(r.maxRows));const n={addedClass:a,fallback:null};if(e.__sfTextareaAutoGrow=n,"undefined"!=typeof CSS&&!0===CSS.supports?.("field-sizing","content"))return;let s=!1,i=-1;const o=()=>{s||function(e,t){if(!t.isConnected||0===t.clientWidth)return;const r=e.style.minBlockSize;e.style.minBlockSize=`${e.getBoundingClientRect().height}px`;const{scrollTop:a}=t;t.style.blockSize="auto";const n=getComputedStyle(t),s=(parseFloat(n.borderTopWidth)||0)+(parseFloat(n.borderBottomWidth)||0);t.style.blockSize=`${t.scrollHeight+s}px`,t.scrollTop!==a&&(t.scrollTop=a),e.style.minBlockSize=r}(e,t)},l=e=>{e.isComposing||o()},d=()=>{s=!0},u=()=>{s=!1,o()};t.addEventListener("input",l),t.addEventListener("compositionstart",d),t.addEventListener("compositionend",u);const c=Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype,"value");Object.defineProperty(t,"value",{configurable:!0,enumerable:!0,get(){return c.get.call(this)},set(e){c.set.call(this,e),o()}});const f="undefined"==typeof ResizeObserver?null:new ResizeObserver(e=>{const t=Math.round(e[e.length-1].contentRect.width);t!==i&&(i=t,o())});f?.observe(t),o(),n.fallback={grow:o,onInput:l,onCompositionStart:d,onCompositionEnd:u,observer:f}}async function $(e,t){const r=function(e,t){if(!b(t.dataset.mask??e.dataset.mask,!1))return null;const r=v(t.dataset.maskOptions),a=v(e.dataset.maskOptions);if(r)return r;if(a)return a;const n=t.dataset.maskPattern??e.dataset.maskPattern;return n?{mask:String(n)}:null}(e,t);if(!r)return;const a={};e.__sfTextareaMaskRequest=a;try{const n=await function(){const e=()=>window.SF?.Mask?.create?window.SF.Mask:null,t=e();return t?Promise.resolve(t):u||(u=new Promise(t=>{const r=[[window,"sf-mask-ready"],[window,"sf-loader-ready"],[window,"load"],[document,"DOMContentLoaded"]],a=()=>{const n=e();n&&(r.forEach(([e,t])=>e.removeEventListener(t,a)),u=null,t(n))};r.forEach(([e,t])=>e.addEventListener(t,a))}),u)}();if(e.__sfTextareaMaskRequest!==a)return;const s=await n.create(t,r);if(!s)return;if("1"!==e.dataset[f]||e.__sfTextareaMaskRequest!==a||x(e)!==t)return void n.destroy(s);e.__sfTextareaMask=s}catch(e){console.warn("SF.Textarea mask init failed",e)}}function L(e){if((0,o.vl)(e,"sf-textarea"),!e||"1"===e.dataset[f])return;const t=x(e);if(!t)return;const r=()=>{},a=()=>e.classList.add("sf-textarea--pointer-focus"),n=()=>e.classList.remove("sf-textarea--pointer-focus");t.addEventListener("input",r),t.addEventListener("pointerdown",a),t.addEventListener("blur",n),e.__sfTextareaNoopHandler=r,e.__sfTextareaPointerFocusHandler=a,e.__sfTextareaBlurHandler=n,e.dataset[f]="1";const s=y(e);(0,i.U)(e,t,{prefix:"sf-textarea",labelNode:e.querySelector(".sf-textarea-text"),required:t.required||Boolean(e.querySelector(".sf-textarea-required")),invalid:e.classList.contains("error")||t.classList.contains("error"),...s}),e.__sfTextareaReleaseReset=function(e,t){const r=e.ownerDocument;d.has(r)||(r.addEventListener("reset",e=>{const t=e.target;if("FORM"!==t?.tagName)return;const r=Array.from(t.elements);setTimeout(()=>{if(!e.defaultPrevented)for(const e of r)if(e.isConnected&&e.form===t)for(const t of l.get(e)||[])t()},0)},!0),d.add(r));let a=l.get(e);return a||l.set(e,a=new Set),a.add(t),()=>a.delete(t)}(t,()=>{e.__sfTextareaMask&&(e.__sfTextareaMask.value=t.value),e.__sfTextareaAutoGrow?.fallback?.grow()}),k(e,t),$(e,t)}function A(e){if(!e||"1"!==e.dataset[f])return;delete e.__sfTextareaMaskRequest;const t=x(e);t&&e.__sfTextareaNoopHandler&&t.removeEventListener("input",e.__sfTextareaNoopHandler),t&&e.__sfTextareaPointerFocusHandler&&t.removeEventListener("pointerdown",e.__sfTextareaPointerFocusHandler),t&&e.__sfTextareaBlurHandler&&t.removeEventListener("blur",e.__sfTextareaBlurHandler),function(e,t){const r=e.__sfTextareaAutoGrow;if(!r)return;if(delete e.__sfTextareaAutoGrow,r.addedClass&&e.classList.remove(S),!t)return;t.style.removeProperty("--sf-textarea--min-rows"),t.style.removeProperty("--sf-textarea--max-rows");const{fallback:a}=r;a&&(t.removeEventListener("input",a.onInput),t.removeEventListener("compositionstart",a.onCompositionStart),t.removeEventListener("compositionend",a.onCompositionEnd),a.observer?.disconnect(),delete t.value,t.style.removeProperty("block-size"))}(e,t),e.__sfTextareaMask&&window.SF?.Mask?.destroy?.(e.__sfTextareaMask),e.__sfTextareaReleaseReset?.(),delete e.__sfTextareaReleaseReset,delete e.__sfTextareaMask,delete e.__sfTextareaNoopHandler,delete e.__sfTextareaPointerFocusHandler,delete e.__sfTextareaBlurHandler,e.classList.remove("sf-textarea--pointer-focus"),delete e.dataset[f]}function E(e=document){e.querySelectorAll(c).forEach(L)}function M(e,t={}){const r=e instanceof HTMLElement?e.closest(c)||e:null;if(!r)return!1;const a=x(r);if(!a)return!1;if(Object.prototype.hasOwnProperty.call(t,"disabled")&&(a.disabled=b(t.disabled)),Object.prototype.hasOwnProperty.call(t,"error")){const e=b(t.error);r.classList.toggle("error",e),a.classList.toggle("error",e)}if(Object.prototype.hasOwnProperty.call(t,"invalid")){const e=b(t.invalid);r.classList.toggle("error",e),a.classList.toggle("error",e)}if(Object.prototype.hasOwnProperty.call(t,"errorMessage")){const e=String(t.errorMessage??""),n=e?function(e){const t=w(e);if(t)return t;const r=document.createElement("span");return r.classList.add("sf-textarea-hint-text-wrap"),e.append(r),r}(r):w(r);if(n){n.textContent=e;const t=r.classList.contains("error")||a.classList.contains("error");n.dataset.fieldMessage=e&&t?"error":"hint"}}return Object.prototype.hasOwnProperty.call(t,"value")&&(a.value=String(t.value??""),a.dispatchEvent(new Event("input",{bubbles:!0}))),(0,i.U)(r,a,{prefix:"sf-textarea",labelNode:r.querySelector(".sf-textarea-text"),required:a.required||Boolean(r.querySelector(".sf-textarea-required")),invalid:r.classList.contains("error")||a.classList.contains("error"),...y(r)}),!0}class O extends a{static componentName="Textarea";html=null;constructor(e){super(e);const{size:t="1",type:r="bordered",label:a="",required:n=!1,placeholder:s="",autocomplete:i="",inputMode:l="",minLength:d="",maxLength:u="",spellcheck:c=!0,wrap:f="soft",hint:x="",value:w="",name:y="",rows:v=3,disabled:S=!1,readonly:T=!1,error:k=!1,invalid:$=!1,errorMessage:L="",mask:A=!1,maskOptions:E,maskPattern:M,autoGrow:O=!1,minRows:R,maxRows:N}=this.params||{},F=this.attrs.class||this.attrs.className,I=(0,o.id)(t,"sf-textarea"),q=function(e,t,r){const a=String(e||r);return t.has(a)?a:r}(r,h,"bordered");this.template=document.createElement("label"),this.id&&(this.template.id=this.id),this.template.classList.add("sf-textarea",`sf-textarea--size-${I}`,`sf-textarea--${q}`),this.template.classList.toggle("error",b($||k,!1)),F&&this.template.classList.add(...`${F}`.split(" ").filter(Boolean));const C=document.createElement("span");C.classList.add("sf-textarea-label");const P=document.createElement("span");if(P.classList.add("sf-textarea-text"),P.textContent=String(a),C.append(P),b(n,!0)){const e=document.createElement("span");e.classList.add("sf-textarea-required"),e.textContent="*",C.append(e)}const B=document.createElement("textarea");B.placeholder=String(s??""),i&&(B.autocomplete=String(i)),B.inputMode=function(e){const t=String(e||"").toLowerCase();return p.has(t)?t:""}(l);const j=g(d),z=g(u);if(null!==j&&(B.minLength=j),null!==z&&(B.maxLength=z),B.spellcheck=b(c,!0),B.wrap=function(e){const t=String(e||"soft").toLowerCase();return m.has(t)?t:"soft"}(f),B.value=String(w??""),B.defaultValue=String(w??""),B.rows=Number(v)>0?Number(v):3,y&&(B.name=String(y)),B.disabled=b(S,!1),B.readOnly=b(T,!1),B.required=b(n,!0),B.classList.toggle("error",b($||k,!1)),B.dataset.mask=String(Boolean(A)),M&&(B.dataset.maskPattern=String(M)),E&&"object"==typeof E&&(B.dataset.maskOptions=JSON.stringify(E)),b(O,!1)){B.dataset.autoGrow="true";const e=_(R),t=_(N);null!==e&&(B.dataset.minRows=String(e)),null!==t&&(B.dataset.maxRows=String(t))}this.template.append(C,B);const V=b($||k,!1)&&L?L:x;if(V){const e=document.createElement("span");e.classList.add("sf-textarea-hint-text-wrap"),e.textContent=String(V),e.dataset.fieldMessage=b($||k,!1)&&L?"error":"hint",this.template.append(e)}this.applyLayoutUtilities(this.template,".sf-textarea"),this.applyLayoutUtilities(C,".sf-textarea .sf-textarea-label"),this.applyLayoutUtilities(B,".sf-textarea textarea")}init(){L(this.template)}destroyInternal(){A(this.template)}}O.utilityMap=s,n("Textarea",O),"undefined"!=typeof window&&(window.SF=window.SF||{},window.SF.Textarea=window.SF.Textarea||{},window.SF.Textarea.setState=M),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>E()):E();new MutationObserver(e=>{e.forEach(e=>{e.addedNodes.forEach(e=>{e instanceof Element&&(e.matches?.(c)&&L(e),E(e))})})}).observe(document.documentElement,{childList:!0,subtree:!0})},"778671c79fa6"(e,t,r){r.a(e,async(e,a)=>{try{r.d(t,{vZ:()=>f});var n=r("ddf1cdb42ecc"),s=r("0d662e4d7d63"),i=e([n,s]);[n,s]=i.then?(await i)():i;const o="sf-field:reset",l={en:{inherited:"inherited",reset:"Reset to inherited",described:"Inherited: {value}"},ru:{inherited:"наследуется",reset:"Сбросить к наследуемому",described:"Наследуется: {value}"}},d=Object.freeze({"1/2":"1/3",1:"1/2",2:"1"}),u=e=>d[String(e)]||"1/2",c=e=>class extends e{constructor(){super(),this.__sfInheritedSync=()=>this.syncInheritedState(),this.addEventListener("input",this.__sfInheritedSync),this.addEventListener("change",this.__sfInheritedSync)}get inheritedValue(){return this.getAttribute("inherited-value")||""}set inheritedValue(e){null==e||""===e?this.removeAttribute("inherited-value"):this.setAttribute("inherited-value",String(e))}get inheritedText(){return this.getAttribute("inherited-text")||(0,s.pageText)(l,"inherited",this)}get resetLabel(){return this.getAttribute("reset-label")||(0,s.pageText)(l,"reset",this)}get hasInheritedValue(){return""!==this.inheritedValue}get isInherited(){return this.hasInheritedValue&&""===this.inheritedOwnValue()}inheritedOwnValue(){return String(this.value??"")}inheritedDisplayValue(){return this.inheritedValue}inheritedFocusTarget(){return null}clearOwnValue(){this.value=""}inheritedDescription(){return(0,s.pageText)(l,"described",this).replace("{value}",this.inheritedDisplayValue())}resetToInherited(){if(!this.hasInheritedValue||""===this.inheritedOwnValue())return!1;if(this.hasAttribute("disabled")||this.hasAttribute("readonly"))return!1;const e=new CustomEvent(o,{bubbles:!0,composed:!0,cancelable:!0,detail:{value:this.inheritedOwnValue(),inheritedValue:this.inheritedValue,name:this.getAttribute("name")||""}});if(!this.dispatchEvent(e))return!1;this.clearOwnValue(),this.syncInheritedState();const t=()=>this.inheritedFocusTarget()?.focus?.({preventScroll:!0});return t(),this.contains(document.activeElement)||requestAnimationFrame(t),!0}syncInheritedState(){if(!this.hasInheritedValue&&!this.__sfInheritedDescribed)return void this.removeAttribute("data-inherited");const e=this.isInherited,t=this.hasInheritedValue&&!e;e?this.setAttribute("data-inherited","true"):this.removeAttribute("data-inherited"),this.querySelectorAll(":scope [data-inherited-marker]").forEach(t=>{t.hidden=!e}),this.querySelectorAll(":scope [data-inherited-reset]").forEach(e=>{e.hidden=!t});const r=this.inheritedFocusTarget();r&&(e?(r.setAttribute("aria-description",this.inheritedDescription()),this.__sfInheritedDescribed=r):this.__sfInheritedDescribed===r&&(r.removeAttribute("aria-description"),this.__sfInheritedDescribed=null))}};function f(e,{size:t="1",disabled:r=!1,className:a=""}={}){if(!e?.hasInheritedValue)return n.nothing;const s=u(t),i=e.isInherited;return n.html`
2
+ <span class="sf-field-inherited-slot sf-field-inherited-slot--size-${t} flex items-cross-center ${a}">
3
+ <span class="sf-field-inherited sf-field-inherited--size-${s}"
4
+ data-inherited-marker
5
+ aria-hidden="true"
6
+ ?hidden=${!i}>${e.inheritedText}</span>
7
+ <button
8
+ type="button"
9
+ class="sf-field-reset sf-icon-button sf-icon-button--icon sf-icon-button--on-surface sf-icon-button--link sf-icon-button--size-${s}"
10
+ data-inherited-reset
11
+ aria-label=${e.resetLabel}
12
+ title=${e.resetLabel}
13
+ ?hidden=${i}
14
+ ?disabled=${r}
15
+ @click=${t=>{t.preventDefault(),t.stopPropagation(),e.resetToInherited()}}
16
+ ><i class="sf-icon" aria-hidden="true">restart_alt</i></button>
17
+ </span>
18
+ `}r.d(t,["kU",0,c]),a()}catch(h){a(h)}})},c6ddd1585553(e,t,r){r.a(e,async(e,t)=>{try{var a=r("01398f3e8009"),n=r("fbe0570fcc69"),s=r("98e26702f55a"),i=r("778671c79fa6"),o=r("943b9fa4bc95"),l=e([n,i,o]);[n,i,o]=l.then?(await l)():l;var d=r.n(n);new Set(["bordered","filled","flush"]);const u=new Set(["","none","text","tel","url","email","numeric","decimal","search"]),c=new Set(["soft","hard"]);function f(e,t,r){const a=String(e||r);return t.has(a)?a:r}class h extends((0,i.kU)(d())){static get props(){return{size:{default:"1"},appearance:{default:"bordered",values:["bordered","filled","flush"],aliases:["type"]},label:{default:""},required:{type:Boolean,default:!1},placeholder:{default:""},autocomplete:{default:""},inputmode:{default:""},minlength:{type:Number,default:null},maxlength:{type:Number,default:null},spellcheck:{type:Boolean,default:!0},wrap:{default:"soft"},hint:{default:""},value:{default:""},name:{default:""},rows:{type:Number,default:3},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},error:{type:Boolean,default:!1},invalid:{type:Boolean,default:!1},errorMessage:{default:""},mask:{type:Boolean,default:!1},maskPattern:{default:""},maskOptions:{default:""},autoGrow:{type:Boolean,default:!1},minRows:{type:Number,default:1},maxRows:{type:Number,default:null},inheritedValue:{attribute:"inherited-value",default:""},inheritedText:{attribute:"inherited-text",default:""},resetLabel:{attribute:"reset-label",default:""}}}constructor(){super(),this._boundRoot=null}get size(){return(0,s.id)(this.getAttribute("size")||"1","sf-textarea")}get appearance(){return this.getProp("appearance")}get type(){return this.appearance}get label(){return this.getAttribute("label")||""}get required(){return this.getBooleanAttr("required",!1)}get placeholder(){return this.getAttribute("placeholder")||""}get autocomplete(){return this.getAttribute("autocomplete")||""}get inputmode(){return f(this.getAttribute("inputmode"),u,"")}get minlength(){const e=this.getNumberAttr("minlength",null);return Number.isInteger(e)&&e>=0?e:null}get maxlength(){const e=this.getNumberAttr("maxlength",null);return Number.isInteger(e)&&e>=0?e:null}get spellcheck(){return this.getBooleanAttr("spellcheck",!0)}get wrap(){return f(this.getAttribute("wrap"),c,"soft")}get hint(){return this.getAttribute("hint")||""}get value(){const e=this.querySelector(".sf-textarea textarea");return e?e.value:this.getAttribute("value")||""}set value(e){const t=String(e??"");null==e?this.removeAttribute("value"):this.setAttribute("value",t);const r=this.querySelector(".sf-textarea"),a=r?.querySelector("textarea");r?.__sfTextareaMask?r.__sfTextareaMask.value=t:a&&(a.value=t)}get name(){return this.getAttribute("name")||""}get rows(){const e=Math.trunc(this.getNumberAttr("rows",3));return e>0?e:3}get autoGrow(){return this.getBooleanAttr("auto-grow",!1)}get minRows(){const e=Math.trunc(this.getNumberAttr("minRows",1));return e>0?e:1}get maxRows(){const e=Math.trunc(this.getNumberAttr("maxRows",null));return e>0?Math.max(e,this.minRows):null}get disabled(){return this.getBooleanAttr("disabled",!1)}get readonly(){return this.getBooleanAttr("readonly",!1)}get error(){return this.getBooleanAttr("error",!1)}get invalid(){return this.getBooleanAttr("invalid",!1)}get errorMessage(){return this.getAttribute("error-message")||""}get mask(){return this.getBooleanAttr("mask",!1)}get maskPattern(){return this.getAttribute("mask-pattern")||""}get maskOptions(){return this.getAttribute("mask-options")||""}inheritedFocusTarget(){return this.querySelector(".sf-textarea textarea")}clearOwnValue(){this.value="";const e=this.inheritedFocusTarget();e?.dispatchEvent(new Event("input",{bubbles:!0})),e?.dispatchEvent(new Event("change",{bubbles:!0}))}templateContext(){const e=this.getPropsContext(),t=this.querySelector("textarea");return this.createTemplateContext({...e,value:this.hasAttribute("value")||!t?e.value:t.value,type:this.type,minlength:this.minlength,maxlength:this.maxlength,autoGrow:this.autoGrow,minRows:this.minRows,maxRows:this.maxRows,inheritedValue:this.inheritedValue,inheritedText:this.inheritedText,resetLabel:this.resetLabel,component:this})}onDisconnected(){this._boundRoot&&((0,a.TO)(this._boundRoot),this._boundRoot=null)}afterRender(){this._boundRoot&&((0,a.TO)(this._boundRoot),this._boundRoot=null),this._boundRoot=this.querySelector(".sf-textarea"),this._boundRoot&&(0,a.sd)(this._boundRoot),this.syncInheritedState()}template(){return(0,o.F)(this.templateContext())}get state(){const e=this.querySelector(".sf-textarea"),t=e?.querySelector?.("textarea")||null;return{value:t?.value||"",disabled:!!t?.disabled,invalid:"true"===t?.getAttribute("aria-invalid"),error:e?.classList?.contains("error")||t?.classList?.contains("error")||!1}}setState(e={}){const t=this.querySelector(".sf-textarea");return(0,a.aJ)(t,e)}}h.define("sf-textarea"),t()}catch(p){t(p)}})},"943b9fa4bc95"(e,t,r){r.a(e,async(e,a)=>{try{r.d(t,{F:()=>l});var n=r("ddf1cdb42ecc"),s=r("e138a730fd7c"),i=r("778671c79fa6"),o=e([n,i]);[n,i]=o.then?(await o)():o;function l(e){const{size:t,appearance:r,type:a,label:o,required:l,placeholder:d,autocomplete:u,inputmode:c,minlength:f,maxlength:h,spellcheck:p,wrap:m,hint:g,value:b,name:x,rows:w,disabled:y,readonly:v,error:S,invalid:_,errorMessage:T,mask:k,maskPattern:$,maskOptions:L,autoGrow:A,minRows:E,maxRows:M}=e,O=(0,s.h)(e.component,{prefix:"sf-textarea",required:l,invalid:_||S,hint:g,errorMessage:T}),R=e.component?.hasSlotContent?.("error")?e.component.getSlotContent("error"):T,N=e.component?.hasSlotContent?.("hint")?e.component.getSlotContent("hint"):g,F=O.invalid&&R?R:N,I=["sf-textarea",`sf-textarea--size-${t}`,`sf-textarea--${r??a}`,O.invalid?"error":"",A?"sf-textarea--auto-grow":"","flex","flex-col",e.rootClass].filter(Boolean),q=o?n.html`
2
19
  <span class="sf-textarea-text">${o}</span>
3
- ${i?n.html`<span class="sf-textarea-required">*</span>`:""}
20
+ ${l?n.html`<span class="sf-textarea-required">*</span>`:""}
4
21
  `:"";return n.html`
5
22
  <label
6
- class=${C.join(" ")}
23
+ class=${I.join(" ")}
7
24
  style=${e.rootStyle||n.nothing}
8
25
  data-mask=${String(k)}
9
- data-mask-pattern=${L||""}
10
- data-mask-options=${T||""}
26
+ data-mask-pattern=${$||""}
27
+ data-mask-options=${L||""}
11
28
  >
12
29
  ${q?n.html`
13
30
  <span class="sf-textarea-label flex">
@@ -16,37 +33,39 @@
16
33
  `:""}
17
34
 
18
35
  <textarea
19
- id=${A.controlId}
20
- class=${"transition"+(A.invalid?" error":"")}
21
- placeholder=${l}
36
+ id=${O.controlId}
37
+ class=${"transition"+(O.invalid?" error":"")}
38
+ placeholder=${e.inheritedValue||d}
22
39
  autocomplete=${u||n.nothing}
23
- inputmode=${d||n.nothing}
24
- minlength=${c??n.nothing}
25
- maxlength=${f??n.nothing}
26
- .spellcheck=${m}
27
- wrap=${p}
28
- .value=${g}
29
- .defaultValue=${g}
40
+ inputmode=${c||n.nothing}
41
+ minlength=${f??n.nothing}
42
+ maxlength=${h??n.nothing}
43
+ .spellcheck=${p}
44
+ wrap=${m}
45
+ .value=${b}
46
+ .defaultValue=${b}
30
47
  name=${x||""}
31
- rows=${$?M:b}
32
- ?disabled=${w}
33
- ?readonly=${y}
34
- ?required=${A.required}
35
- aria-invalid=${A.invalid?"true":n.nothing}
36
- aria-describedby=${O?A.messageId:n.nothing}
37
- aria-errormessage=${A.invalid&&R?A.messageId:n.nothing}
48
+ rows=${A?E:w}
49
+ ?disabled=${y}
50
+ ?readonly=${v}
51
+ ?required=${O.required}
52
+ aria-invalid=${O.invalid?"true":n.nothing}
53
+ aria-describedby=${F?O.messageId:n.nothing}
54
+ aria-errormessage=${O.invalid&&R?O.messageId:n.nothing}
38
55
  data-mask=${String(k)}
39
- data-mask-pattern=${L||""}
40
- data-mask-options=${T||""}
41
- data-auto-grow=${$?"true":n.nothing}
42
- data-min-rows=${$?M:n.nothing}
43
- data-max-rows=${$&&E?E:n.nothing}
56
+ data-mask-pattern=${$||""}
57
+ data-mask-options=${L||""}
58
+ data-auto-grow=${A?"true":n.nothing}
59
+ data-min-rows=${A?E:n.nothing}
60
+ data-max-rows=${A&&M?M:n.nothing}
44
61
  ></textarea>
45
62
 
46
- ${O?n.html`<span
47
- id=${A.messageId}
63
+ ${(0,i.vZ)(e.component,{size:t,disabled:y||v,className:"sf-textarea-inherited"})}
64
+
65
+ ${F?n.html`<span
66
+ id=${O.messageId}
48
67
  class="sf-textarea-hint-text-wrap"
49
- data-field-message=${A.invalid&&R?"error":"hint"}
50
- >${O}</span>`:""}
68
+ data-field-message=${O.invalid&&R?"error":"hint"}
69
+ >${F}</span>`:""}
51
70
  </label>
52
- `}a()}catch(u){a(u)}})},ddf1cdb42ecc(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("lit"):new Promise(e=>globalThis.addEventListener("sf-runtime-ready",()=>e(globalThis.SF.runtimeModule("lit")),{once:!0}))},fbe0570fcc69(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("smart-base"):new Promise(e=>globalThis.addEventListener("sf-runtime-ready",()=>e(globalThis.SF.runtimeModule("smart-base")),{once:!0}))}};const t={};function r(a){const n=t[a];if(void 0!==n)return n.exports;const s=t[a]={exports:{}};return e[a](s,s.exports,r),s.exports}(()=>{const e="function"==typeof Symbol,t=e?Symbol("webpack queues"):"__webpack_queues__",a=e?Symbol("webpack exports"):"__webpack_exports__",n=e?Symbol("webpack error"):"__webpack_error__",s=e=>{e?.d<1&&(e.d=1,e.forEach(e=>e.r--),e.forEach(e=>e.r--?e.r++:e()))};r.a=(e,r,o)=>{let i;o&&((i=[]).d=-1);const l=new Set,u=e.exports;let d,c,f;const m=new Promise((e,t)=>{f=t,c=e});m[a]=u,m[t]=e=>(i&&e(i),l.forEach(e),m.catch(e=>{})),e.exports=m;r(e=>{let r;d=(e=>e.map(e=>{if(null!==e&&"object"==typeof e){if(e[t])return e;if(e.then){const r=[];r.d=0,e.then(e=>{o[a]=e,s(r)},e=>{o[n]=e,s(r)});const o={};return o[t]=e=>e(r),o}}const r={};return r[t]=e=>{},r[a]=e,r}))(e);const o=()=>d.map(e=>{if(e[n])throw e[n];return e[a]}),u=new Promise(e=>{r=()=>e(o),r.r=0;const a=e=>e!==i&&!l.has(e)&&(l.add(e),e&&!e.d&&(r.r++,e.push(r)));d.map(e=>e[t](a))});return r.r?u:o()},e=>(e?f(m[n]=e):c(u),s(i))),i?.d<0&&(i.d=0)}})(),r.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{if(Array.isArray(t))for(var a=0;a<t.length;){var n=t[a++],s=t[a++];r.o(e,n)?0===s&&a++:0===s?Object.defineProperty(e,n,{enumerable:!0,value:t[a++]}):Object.defineProperty(e,n,{enumerable:!0,get:s})}else for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);r("c6ddd1585553")})();
71
+ `}a()}catch(d){a(d)}})},ddf1cdb42ecc(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("lit"):new Promise(e=>globalThis.addEventListener("sf-runtime-ready",()=>e(globalThis.SF.runtimeModule("lit")),{once:!0}))},"0d662e4d7d63"(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("page-language"):new Promise(e=>globalThis.addEventListener("sf-runtime-ready",()=>e(globalThis.SF.runtimeModule("page-language")),{once:!0}))},fbe0570fcc69(e){e.exports=globalThis.SF&&globalThis.SF.runtimeModule?globalThis.SF.runtimeModule("smart-base"):new Promise(e=>globalThis.addEventListener("sf-runtime-ready",()=>e(globalThis.SF.runtimeModule("smart-base")),{once:!0}))}};const t={};function r(a){const n=t[a];if(void 0!==n)return n.exports;const s=t[a]={exports:{}};return e[a](s,s.exports,r),s.exports}(()=>{const e="function"==typeof Symbol,t=e?Symbol("webpack queues"):"__webpack_queues__",a=e?Symbol("webpack exports"):"__webpack_exports__",n=e?Symbol("webpack error"):"__webpack_error__",s=e=>{e?.d<1&&(e.d=1,e.forEach(e=>e.r--),e.forEach(e=>e.r--?e.r++:e()))};r.a=(e,r,i)=>{let o;i&&((o=[]).d=-1);const l=new Set,d=e.exports;let u,c,f;const h=new Promise((e,t)=>{f=t,c=e});h[a]=d,h[t]=e=>(o&&e(o),l.forEach(e),h.catch(e=>{})),e.exports=h;r(e=>{let r;u=(e=>e.map(e=>{if(null!==e&&"object"==typeof e){if(e[t])return e;if(e.then){const r=[];r.d=0,e.then(e=>{i[a]=e,s(r)},e=>{i[n]=e,s(r)});const i={};return i[t]=e=>e(r),i}}const r={};return r[t]=e=>{},r[a]=e,r}))(e);const i=()=>u.map(e=>{if(e[n])throw e[n];return e[a]}),d=new Promise(e=>{r=()=>e(i),r.r=0;const a=e=>e!==o&&!l.has(e)&&(l.add(e),e&&!e.d&&(r.r++,e.push(r)));u.map(e=>e[t](a))});return r.r?d:i()},e=>(e?f(h[n]=e):c(d),s(o))),o?.d<0&&(o.d=0)}})(),r.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{if(Array.isArray(t))for(var a=0;a<t.length;){var n=t[a++],s=t[a++];r.o(e,n)?0===s&&a++:0===s?Object.defineProperty(e,n,{enumerable:!0,value:t[a++]}):Object.defineProperty(e,n,{enumerable:!0,get:s})}else for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);r("c6ddd1585553")})();
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schema_version": 2,
3
3
  "id": "smart.textarea",
4
- "version": "1.3.0",
4
+ "version": "1.4.0",
5
5
  "title": "Textarea",
6
6
  "summary": "A native multiline form control with Framework presentation, validation messaging and safe vertical resizing.",
7
7
  "kind": "smart",
@@ -175,6 +175,21 @@
175
175
  "filled",
176
176
  "flush"
177
177
  ]
178
+ },
179
+ "inherited-value": {
180
+ "type": "string",
181
+ "default": "",
182
+ "description": "What the field falls back to while it holds no value of its own. Shown as inherited, in the placeholder's ink with an «inherited» marker under the field, never as the value: the form value stays empty. Once the field holds a value of its own, a reset button returns it here."
183
+ },
184
+ "inherited-text": {
185
+ "type": "string",
186
+ "default": "",
187
+ "description": "The words of the marker shown while the inherited value applies. Unset, it follows the page's language («inherited», «наследуется»)."
188
+ },
189
+ "reset-label": {
190
+ "type": "string",
191
+ "default": "",
192
+ "description": "The accessible name of the button that returns the field to the inherited value. Unset, it follows the page's language («Reset to inherited», «Сбросить к наследуемому»)."
178
193
  }
179
194
  },
180
195
  "additionalProperties": false
@@ -228,6 +243,14 @@
228
243
  "returns": {
229
244
  "type": "boolean"
230
245
  }
246
+ },
247
+ "resetToInherited": {
248
+ "summary": "Returns the field to its inherited value, as the reset button does: fires the cancellable sf-field:reset, then empties the own value and focuses the control. Returns whether it was reset (false without an inherited value, without an own value, while disabled or readonly, or when the event was prevented).",
249
+ "arguments": [],
250
+ "returns": {
251
+ "type": "boolean",
252
+ "description": "Whether the field was reset."
253
+ }
231
254
  }
232
255
  },
233
256
  "events": {
@@ -243,6 +266,26 @@
243
266
  "payload": {
244
267
  "type": "object"
245
268
  }
269
+ },
270
+ "sf-field:reset": {
271
+ "summary": "The person pressed the reset back to the inherited value. Fired before the field is emptied and cancellable: preventDefault keeps the value. When it is not prevented the field empties, says so with its ordinary change, shows the inherited value again and takes focus back.",
272
+ "payload": {
273
+ "type": "object",
274
+ "properties": {
275
+ "value": {
276
+ "type": "string",
277
+ "description": "The field's own value before the reset."
278
+ },
279
+ "inheritedValue": {
280
+ "type": "string",
281
+ "description": "The inherited value it returns to."
282
+ },
283
+ "name": {
284
+ "type": "string",
285
+ "description": "The form name, empty when the field has none."
286
+ }
287
+ }
288
+ }
246
289
  }
247
290
  },
248
291
  "state": {
@@ -284,7 +327,7 @@
284
327
  "Tab",
285
328
  "native multiline text editing"
286
329
  ],
287
- "focus": "Keep visible focus on the active control."
330
+ "focus": "Keep visible focus on the active control. After a reset back to the inherited value, focus returns to the control; while the value is inherited, the control carries it as aria-description and the visible marker is aria-hidden."
288
331
  },
289
332
  "presentation": {
290
333
  "themes": [
@@ -346,7 +389,23 @@
346
389
  "source_artifacts": [
347
390
  {
348
391
  "path": "src/smart/textarea/index.js",
349
- "sha256": "aff702ba06b47bef148c3c528b84c632a5a6e248b0b4bebdd746d8300c8bb2cd"
392
+ "sha256": "c0e7b46498b182b12d3fceaf5205aecf7a2291b9836455fefa4610df809e39de"
393
+ },
394
+ {
395
+ "path": "src/smart/textarea/rule.js",
396
+ "sha256": "493eef5df1b45606866ef7339b874a2045ee05d6dfaf56521e33859e96048911"
397
+ },
398
+ {
399
+ "path": "src/smart/textarea/js/templates/default.js",
400
+ "sha256": "8f5dd660e67cfa97caa2fdf2ac06d369d2217a151de53f9c1674e1632f5115d1"
401
+ },
402
+ {
403
+ "path": "src/smart/helpers/inherited-value.js",
404
+ "sha256": "0c8658ab61678cd5f89badea902be244b92ba96240fb802c60438227f8f9faa9"
405
+ },
406
+ {
407
+ "path": "src/smart/helpers/inherited-value.css",
408
+ "sha256": "2a10b6d5c8e26c7d1541511c99257e9474b16d30c6e8352e96ed9b47f70b6a2a"
350
409
  }
351
410
  ],
352
411
  "generated_runtime": [
@@ -1,5 +1,6 @@
1
1
  import { html, nothing } from 'lit';
2
2
  import { createFieldContract } from '../../../../component/field-contract';
3
+ import { renderInheritedSlot } from '../../../helpers/inherited-value';
3
4
 
4
5
  export function renderTextareaTemplate(context) {
5
6
  const {
@@ -86,7 +87,7 @@ export function renderTextareaTemplate(context) {
86
87
  <textarea
87
88
  id=${field.controlId}
88
89
  class=${`transition${field.invalid ? ' error' : ''}`}
89
- placeholder=${placeholder}
90
+ placeholder=${context.inheritedValue || placeholder}
90
91
  autocomplete=${autocomplete || nothing}
91
92
  inputmode=${inputmode || nothing}
92
93
  minlength=${minlength ?? nothing}
@@ -111,6 +112,12 @@ export function renderTextareaTemplate(context) {
111
112
  data-max-rows=${autoGrow && maxRows ? maxRows : nothing}
112
113
  ></textarea>
113
114
 
115
+ ${renderInheritedSlot(context.component, {
116
+ size,
117
+ disabled: disabled || readonly,
118
+ className: 'sf-textarea-inherited',
119
+ })}
120
+
114
121
  ${messageContent
115
122
  ? html`<span
116
123
  id=${field.messageId}