@ncino/web-components 7.0.0-preview.5 → 7.0.0-preview.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import"../../node_modules/.pnpm/@lit_reactive-element@2.1.0/node_modules/@lit/reactive-element/reactive-element.js";import{html as l}from"../../node_modules/.pnpm/lit-html@3.3.0/node_modules/lit-html/lit-html.js";import"../../node_modules/.pnpm/lit-element@4.2.0/node_modules/lit-element/lit-element.js";import{customElement as h}from"../../node_modules/.pnpm/@lit_reactive-element@2.1.0/node_modules/@lit/reactive-element/decorators/custom-element.js";import{property as g}from"../../node_modules/.pnpm/@lit_reactive-element@2.1.0/node_modules/@lit/reactive-element/decorators/property.js";import u from"../../packages/web-components/src/components/boolean/boolean.gator.scss.js";import m from"../../packages/web-components/src/components/boolean/boolean.gator.tokens.scss.js";import{generateRandomId as c,getElementId as b}from"../../utils/string-utils.js";import"../radio-group/radio-group.gator.js";import{NgcInputText as f}from"../input/gator/input-text/input-text.gator.js";import{classMap as v}from"../../node_modules/.pnpm/lit-html@3.3.0/node_modules/lit-html/directives/class-map.js";import{unsafeCSS as p}from"../../node_modules/.pnpm/@lit_reactive-element@2.1.0/node_modules/@lit/reactive-element/css-tag.js";var _=Object.defineProperty,$=Object.getOwnPropertyDescriptor,w=Object.getPrototypeOf,y=Reflect.get,d=(e,t,o,a)=>{for(var r=a>1?void 0:a?$(t,o):t,i=e.length-1,n;i>=0;i--)(n=e[i])&&(r=(a?n(t,o,r):n(r))||r);return a&&r&&_(t,o,r),r},x=(e,t,o)=>y(w(e),o,t);let s=class extends f{constructor(){super(...arguments),this.options=[],this._randomId=c()}firstUpdated(){this.handleResize(),window.addEventListener("resize",()=>this.handleResize())}render(){return l`
1
+ import"../../node_modules/.pnpm/@lit_reactive-element@2.1.0/node_modules/@lit/reactive-element/reactive-element.js";import{html as n}from"../../node_modules/.pnpm/lit-html@3.3.0/node_modules/lit-html/lit-html.js";import"../../node_modules/.pnpm/lit-element@4.2.0/node_modules/lit-element/lit-element.js";import{customElement as h}from"../../node_modules/.pnpm/@lit_reactive-element@2.1.0/node_modules/@lit/reactive-element/decorators/custom-element.js";import{property as u}from"../../node_modules/.pnpm/@lit_reactive-element@2.1.0/node_modules/@lit/reactive-element/decorators/property.js";import g from"../../packages/web-components/src/components/boolean/boolean.gator.scss.js";import m from"../../packages/web-components/src/components/boolean/boolean.gator.tokens.scss.js";import{generateRandomId as c,getElementId as b}from"../../utils/string-utils.js";import"../radio-group/radio-group.gator.js";import{NgcInputText as f}from"../input/gator/input-text/input-text.gator.js";import{classMap as v}from"../../node_modules/.pnpm/lit-html@3.3.0/node_modules/lit-html/directives/class-map.js";import{unsafeCSS as p}from"../../node_modules/.pnpm/@lit_reactive-element@2.1.0/node_modules/@lit/reactive-element/css-tag.js";var _=Object.defineProperty,$=Object.getOwnPropertyDescriptor,w=Object.getPrototypeOf,y=Reflect.get,d=(e,t,o,a)=>{for(var r=a>1?void 0:a?$(t,o):t,l=e.length-1,i;l>=0;l--)(i=e[l])&&(r=(a?i(t,o,r):i(r))||r);return a&&r&&_(t,o,r),r},x=(e,t,o)=>y(w(e),o,t);let s=class extends f{constructor(){super(...arguments),this.options=[{label:"Yes",value:!0},{label:"No",value:!1}],this._randomId=c()}firstUpdated(){this.handleResize(),window.addEventListener("resize",()=>this.handleResize())}render(){return n`
2
2
  <ngc-radio-group
3
3
  class=${v(this.booleanClasses)}
4
4
  id=${this.elementId}
@@ -11,11 +11,11 @@ import"../../node_modules/.pnpm/@lit_reactive-element@2.1.0/node_modules/@lit/re
11
11
  ?skeleton=${this.skeleton}
12
12
  >
13
13
  ${this.booleanOptions}
14
- </ngc-radio-group>`}get elementId(){return b(this.id,this._randomId)}get booleanClasses(){return{"gator-boolean":!0,"gator-boolean_wrapped":this.isWrapped,"gator-boolean_error":!!this.errorText,"gator-boolean_disabled":this.disabled,"gator-boolean_skeleton":this.skeleton}}get booleanOptions(){if(!this.options)return null;const e=this.options.map((t,o)=>l`
14
+ </ngc-radio-group>`}get elementId(){return b(this.id,this._randomId)}get booleanClasses(){return{"gator-boolean":!0,"gator-boolean_wrapped":this.isWrapped,"gator-boolean_error":!!this.errorText,"gator-boolean_disabled":this.disabled,"gator-boolean_skeleton":this.skeleton}}get booleanOptions(){if(!this.options)return null;const e=this.options.map((t,o)=>n`
15
15
  <ngc-radio
16
16
  id="${this.elementId}-option-${o}"
17
17
  class="gator-boolean-option-${o}${this.selectedClass(t)}"
18
18
  value=${t.value}
19
19
  title-text=${t.label}
20
20
  ></ngc-radio>
21
- `);return l`${e}`}get isWrapped(){const e=this.shadowRoot?.querySelectorAll("ngc-radio");return e&&e.length>1?e[0].offsetTop<e[1].offsetTop:window.innerWidth<475}handleChange(e){const t=e;t.stopImmediatePropagation(),this.value=t.detail,this.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:this.value}))}handleResize(){const e=this.shadowRoot?.querySelector("ngc-radio-group");this.isWrapped?e?.classList.add("gator-boolean_wrapped"):e?.classList.remove("gator-boolean_wrapped")}selectedClass(e){return this.value===e.value?" gator-boolean-option_selected":""}};s.styles=[...x(s,s,"styles"),p(u),p(m)];d([g({type:Array})],s.prototype,"options",2);s=d([h("ngc-boolean")],s);export{s as NgcBoolean};
21
+ `);return n`${e}`}get isWrapped(){const e=this.shadowRoot?.querySelectorAll("ngc-radio");return e&&e.length>1?e[0].offsetTop<e[1].offsetTop:window.innerWidth<475}handleChange(e){const t=e;t.stopImmediatePropagation(),this.value=t.detail,this.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:this.value}))}handleResize(){const e=this.shadowRoot?.querySelector("ngc-radio-group");this.isWrapped?e?.classList.add("gator-boolean_wrapped"):e?.classList.remove("gator-boolean_wrapped")}selectedClass(e){return this.value===e.value?" gator-boolean-option_selected":""}};s.styles=[...x(s,s,"styles"),p(g),p(m)];d([u({type:Array})],s.prototype,"options",2);s=d([h("ngc-boolean")],s);export{s as NgcBoolean};
@@ -1,14 +1,14 @@
1
1
  import { NgcInputText } from '../input/gator/input-text/input-text.gator.ts';
2
2
  export type NGC_BOOLEAN_OPTION = {
3
3
  label: string;
4
- value: string;
4
+ value: string | boolean;
5
5
  };
6
6
  export declare class NgcBoolean extends NgcInputText {
7
7
  static styles: import('lit').CSSResult[];
8
8
  /**
9
9
  * @property {NGC_BOOLEAN_OPTION[]} options - Options to render as boolean options. Each option must have a label and value property.
10
10
  */
11
- options: NGC_BOOLEAN_OPTION[];
11
+ options: NGC_BOOLEAN_OPTION[] | undefined;
12
12
  private _randomId;
13
13
  firstUpdated(): void;
14
14
  render(): import('lit').TemplateResult<1>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ncino/web-components",
3
3
  "author": "nCino",
4
- "version": "7.0.0-preview.5",
4
+ "version": "7.0.0-preview.6",
5
5
  "license": "(c) Copyright 2023 nCino, Inc., all rights reserved",
6
6
  "publishConfig": {
7
7
  "registry": "https://registry.npmjs.org/"
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "name": "@ncino/web-components",
4
- "version": "7.0.0-preview.4",
4
+ "version": "7.0.0-preview.5",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -1351,7 +1351,10 @@
1351
1351
  "attributes": [
1352
1352
  {
1353
1353
  "name": "options",
1354
- "value": { "type": "NGC_BOOLEAN_OPTION[]", "default": "[]" }
1354
+ "value": {
1355
+ "type": "NGC_BOOLEAN_OPTION[] | undefined",
1356
+ "default": "[ { label: 'Yes', value: true }, { label: 'No', value: false } ]"
1357
+ }
1355
1358
  },
1356
1359
  { "name": "for", "value": { "type": "string", "default": "''" } },
1357
1360
  { "name": "min", "value": { "type": "string" } },
@@ -1438,7 +1441,7 @@
1438
1441
  ],
1439
1442
  "js": {
1440
1443
  "properties": [
1441
- { "name": "options", "type": "NGC_BOOLEAN_OPTION[]" },
1444
+ { "name": "options", "type": "NGC_BOOLEAN_OPTION[] | undefined" },
1442
1445
  { "name": "elementId" },
1443
1446
  { "name": "booleanClasses" },
1444
1447
  { "name": "booleanOptions" },