@limetech/lime-elements 39.17.0 → 39.17.2

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.
@@ -38,6 +38,26 @@ export declare class ArrayField extends React.Component<FieldProps> {
38
38
  private setWrapper;
39
39
  private handleReorder;
40
40
  private handleChange;
41
+ /**
42
+ * RJSF v6's built-in ArrayField shares one onChange handler across all
43
+ * descendants, so changes to leaves deep inside an array item bubble
44
+ * through here with the leaf value (not the full array) and a path that
45
+ * is deeper than this field's own path.
46
+ * @param path
47
+ */
48
+ private isDeepLeafChange;
49
+ /**
50
+ * Rebuild the affected item locally so we can (a) restore `undefined`
51
+ * when the leaf schema does not allow `null` — the built-in handler
52
+ * coerces `undefined` to `null`, which breaks field clearing for custom
53
+ * components — and (b) still run `resetDependentFields` at the item
54
+ * level so sibling fields that became obsolete for the new data are
55
+ * cleared.
56
+ * @param newData
57
+ * @param path
58
+ */
59
+ private handleDeepLeafChange;
60
+ private buildResetItem;
41
61
  render(): React.DetailedReactHTMLElement<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
42
62
  }
43
63
  //# sourceMappingURL=array-field.d.ts.map
@@ -1,3 +1,4 @@
1
+ import { JSONSchema7 } from 'json-schema';
1
2
  import { FormSchema } from '../form.types';
2
3
  /**
3
4
  * Given the data for the current SchemaField, detect if the changed data
@@ -18,4 +19,13 @@ export declare const resetDependentFields: (oldData: any, newData: any, schema:
18
19
  * @returns true if the schema is for a custom object
19
20
  */
20
21
  export declare function isCustomObjectSchema(schema: FormSchema): boolean;
22
+ /**
23
+ * Check whether a schema permits `null` as a valid value. Used to decide
24
+ * whether a cleared field value should be preserved as `null` or converted
25
+ * to `undefined` so the property can be removed from the form data.
26
+ *
27
+ * @param schema - the schema to check
28
+ * @returns true if the schema's type is `'null'` or includes `'null'`
29
+ */
30
+ export declare const schemaAllowsNull: (schema: JSONSchema7 | undefined) => boolean;
21
31
  //# sourceMappingURL=field-helpers.d.ts.map
@@ -21,6 +21,16 @@ export declare class SchemaField extends React.Component<FieldProps> {
21
21
  private getHelperText;
22
22
  private handleCustomComponentChange;
23
23
  private handleChange;
24
+ /**
25
+ * RJSF v6's built-in ArrayField shares one onChange handler across all
26
+ * descendants, so changes to leaves deep inside an array item bubble
27
+ * through this SchemaField with a path that is deeper than its own.
28
+ * The enclosing ArrayField rebuilds the affected item and runs
29
+ * `resetDependentFields` at the item level (see array-field.ts), so we
30
+ * must pass the partial leaf data through untouched here.
31
+ * @param path
32
+ */
33
+ private isDeepLeafChange;
24
34
  private buildCustomComponentProps;
25
35
  private renderCustomComponent;
26
36
  render(): React.FunctionComponentElement<any> | React.ReactElement<FieldProps<any, import("@rjsf/utils").RJSFSchema, any>, string | React.JSXElementConstructor<any>>;
@@ -27,4 +27,8 @@ export declare const arrayItemControlsSchema: FormSchema;
27
27
  export declare const rowLayoutSchema: FormSchema;
28
28
  export declare const rowLayoutWithCustomComponentSchema: FormSchema;
29
29
  export declare const nestedArrayObjectSchema: FormSchema;
30
+ export declare const topLevelStringCustomComponentSchema: FormSchema;
31
+ export declare const arrayItemWithDependenciesSchema: FormSchema;
32
+ export declare const arrayItemWithDependenciesAndCustomConfigSchema: FormSchema;
33
+ export declare const nestedStringCustomComponentSchema: FormSchema;
30
34
  //# sourceMappingURL=form.test-schemas.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limetech/lime-elements",
3
- "version": "39.17.0",
3
+ "version": "39.17.2",
4
4
  "description": "Lime Elements",
5
5
  "author": "Lime Technologies",
6
6
  "license": "Apache-2.0",
@@ -1 +0,0 @@
1
- import{r as e,c as r,h as i,H as t,a as o}from"./p-DBTJNfo7.js";import{i as s}from"./p-CrvUOVvg.js";import{g as a}from"./p-CgNJbSP4.js";import{g as n}from"./p-5eP2N9QI.js";const d=class{constructor(i){e(this,i),this.actionSelected=r(this,"actionSelected"),this.actions=[],this.clickable=!1,this.orientation="portrait",this.selected=!1,this.show3dEffect=!0,this.canScrollUp=!1,this.canScrollDown=!1,this.setMarkdownElement=e=>{var r;e!==this.markdownElement&&(this.markdownElement&&(null===(r=this.markdownResizeObserver)||void 0===r||r.disconnect(),this.markdownElement.removeEventListener("scroll",this.checkIfScrollable)),this.markdownElement=e,this.markdownElement&&(this.markdownResizeObserver=new ResizeObserver(this.checkIfScrollable),this.markdownResizeObserver.observe(this.markdownElement),this.markdownElement.addEventListener("scroll",this.checkIfScrollable,{passive:!0}),this.checkIfScrollable()))},this.checkIfScrollable=()=>{if(!this.markdownElement)return;const e=this.markdownElement.scrollHeight,r=this.markdownElement.clientHeight,i=this.markdownElement.scrollTop,t=e>r,o=t&&!(i+r>=e-2),s=t&&!(i<=1);this.canScrollDown!==o&&(this.canScrollDown=o),this.canScrollUp!==s&&(this.canScrollUp=s)},this.handleActionSelect=e=>{e.stopPropagation(),s(e.detail)&&this.actionSelected.emit(e.detail)},this.handleKeyDown=e=>{e.target===e.currentTarget&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.host.click()))}}componentWillLoad(){const{handleMouseEnter:e,handleMouseLeave:r}=n(this.host);this.handleMouseEnter=e,this.handleMouseLeave=r}disconnectedCallback(){var e,r;null===(e=this.markdownResizeObserver)||void 0===e||e.disconnect(),null===(r=this.markdownElement)||void 0===r||r.removeEventListener("scroll",this.checkIfScrollable)}componentDidLoad(){this.setMarkdownElement(this.markdownElement)}render(){return i(t,{key:"fbb3c4a47fe819511f56bf250b52a5effdf64f15",onMouseEnter:this.show3dEffect?this.handleMouseEnter:void 0,onMouseLeave:this.show3dEffect?this.handleMouseLeave:void 0},i("section",{key:"735df6ada728adabd822698395a280742a49cee2",tabindex:this.clickable?0:void 0,role:this.clickable?"button":void 0,"aria-pressed":this.clickable?String(this.selected):void 0,onKeyDown:this.clickable?this.handleKeyDown:void 0},this.renderImage(),i("div",{key:"2382833712ee8e01bbd702b30b10ea6d3a0f7dcb",class:"body"},this.renderHeader(),this.renderSlot(),this.renderValue(),this.renderActionBar()),this.show3dEffect&&i("limel-3d-hover-effect-glow",{key:"d13545dc6829b59bce0d870dfdeed409f2608529"})))}renderImage(){var e;if(null===(e=this.image)||void 0===e?void 0:e.src)return i("div",{class:"image-wrapper"},i("img",{src:this.image.src,alt:this.image.alt,loading:"lazy"}))}renderHeader(){if(this.heading||this.subheading||this.icon)return i("header",null,this.renderIcon(),i("div",{class:"headings"},this.renderHeading(),this.renderSubheading()))}renderIcon(){var e;const r=a(this.icon),t="string"==typeof this.icon||null===(e=this.icon)||void 0===e?void 0:e.color;if(r)return i("limel-icon",{style:{color:`${t}`},badge:!0,name:r})}renderHeading(){if(this.heading)return i("h1",{class:"title"},this.heading)}renderSubheading(){if(this.subheading)return i("h2",null,this.subheading)}renderSlot(){return i("slot",{name:"component"})}renderValue(){if(this.value)return i("div",{class:{"markdown-wrapper":!0,"can-scroll-up":this.canScrollUp,"can-scroll-down":this.canScrollDown}},i("limel-markdown",{class:"body-text",ref:this.setMarkdownElement,value:this.value}))}renderActionBar(){if(0!==this.actions.length)return i("limel-action-bar",{actions:this.actions,onItemSelected:this.handleActionSelect})}get host(){return o(this)}};d.style='@charset "UTF-8";*{box-sizing:border-box;min-width:0;min-height:0}:host(limel-card){display:flex;border-radius:var(--card-border-radius, 0.95rem)}section{box-sizing:border-box;display:flex;gap:0.5rem;flex-direction:column}:host(limel-card[orientation=landscape]) section{flex-direction:row}section{width:100%;border-radius:var(--card-border-radius, 0.95rem);border:1px solid rgb(var(--contrast-500));padding:0.25rem;background-color:var(--card-background-color, rgb(var(--contrast-300)))}section:hover{border-color:transparent;background-color:var(--card-background-color--hovered, var(--card-background-color, rgb(var(--contrast-200))))}.body{flex-grow:1;display:flex;flex-direction:column;gap:0.5rem}.image-wrapper{flex-shrink:0;display:flex;align-items:center;justify-content:center}:host(limel-card[orientation=portrait]) .image-wrapper{width:100%}:host(limel-card[orientation=landscape]) .image-wrapper{flex-shrink:0;max-width:40%;height:100%}:host(limel-card[orientation=landscape]) .image-wrapper img{height:100%}img{transition:filter 0.6s ease;object-fit:cover;border-radius:calc(var(--card-border-radius, 0.95rem) / 1.4);min-width:0.5rem;min-height:0.5rem;max-width:100%;max-height:100%}section:hover img,section:focus-visible img{transition-duration:0.2s;filter:saturate(1.3)}.markdown-wrapper{position:relative;flex-grow:1;display:flex;flex-direction:column}.markdown-wrapper limel-markdown{overflow-y:auto;flex-grow:1;padding:0.5rem 0.75rem}.markdown-wrapper::before{top:0;background:radial-gradient(farthest-side at 50% 0%, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0))}.markdown-wrapper::after{bottom:0;background:radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0))}.markdown-wrapper::before,.markdown-wrapper::after{content:"";pointer-events:none;position:absolute;right:0;left:0;height:0.75rem;opacity:0;transition:opacity 0.6s ease;background-repeat:no-repeat}.markdown-wrapper.can-scroll-up::before,.markdown-wrapper.can-scroll-down::after{opacity:1}header{flex-shrink:0;display:flex;justify-content:center;gap:0.5rem;padding:0.25rem 0.75rem}:host(limel-card[orientation=landscape]) header{padding-top:0.5rem}header:has(limel-icon){padding-left:0.25rem}header .headings{flex-grow:1;display:flex;flex-direction:column;gap:0.125rem}header .title{padding-right:1.25rem}header limel-icon{flex-shrink:0;width:2rem}header h1{font-size:1.125rem;font-weight:500;color:var(--card-heading-color, rgb(var(--contrast-1100)));letter-spacing:-0.03125rem}header h2{font-size:var(--limel-theme-default-font-size);font-weight:400;color:var(--card-subheading-color, rgb(var(--contrast-1000)))}header h1,header h2{word-break:break-word;hyphens:auto;-webkit-hyphens:auto;margin:0}limel-action-bar{flex-shrink:0;--action-bar-background-color:transparent;margin-left:auto}limel-3d-hover-effect-glow{border-radius:var(--card-border-radius, 0.95rem)}:host(limel-card[show-3d-effect]){isolation:isolate;transform-style:preserve-3d;perspective:1000px}@media (prefers-reduced-motion){:host(limel-card[show-3d-effect]){perspective:2000px}}section{position:relative;transition-duration:0.8s;transition-property:transform, box-shadow, background-color;transition-timing-function:ease-out;transform:scale3d(1, 1, 1) rotate3d(0, 0, 0, 0deg)}section:focus{outline:none}section:hover,section:focus,section:focus-visible,section:focus-within{will-change:background-color, box-shadow, transform}section:hover,section:focus,section:focus-visible,section:active{transition-duration:0.2s}section:hover,section:focus-visible{box-shadow:var(--button-shadow-hovered), var(--shadow-depth-16)}section:hover{transform:scale3d(1.01, 1.01, 1.01) rotate3d(var(--limel-3d-hover-effect-rotate3d))}section:focus-visible{outline:none;transform:scale3d(1.01, 1.01, 1.01)}section:hover limel-3d-hover-effect-glow{--limel-3d-hover-effect-glow-opacity:0.5}@media (prefers-reduced-motion){section:hover limel-3d-hover-effect-glow{--limel-3d-hover-effect-glow-opacity:0.2}}:host(limel-card[clickable]) section{cursor:pointer;box-shadow:var(--button-shadow-normal)}:host(limel-card[clickable]) section:hover,:host(limel-card[clickable]) section:focus-visible{box-shadow:var(--button-shadow-hovered), var(--shadow-depth-16)}:host(limel-card[clickable]) section:active{transform:scale3d(1, 1, 1) rotate3d(0, 0, 0, 0deg);box-shadow:var(--button-shadow-pressed)}:host(limel-card[clickable]) section:focus-visible{box-shadow:var(--shadow-depth-8-focused), var(--button-shadow-hovered)}:host(limel-card[clickable]) section:focus-visible:active{box-shadow:var(--shadow-depth-8-focused), var(--button-shadow-pressed)}:host(limel-card[selected]) section,:host(limel-card[selected]) section:hover,:host(limel-card[selected]) section:focus-visible,:host(limel-card[selected]) section:active{box-shadow:var(--shadow-focused-state)}';export{d as limel_card}