@ncino/web-components 9.0.0-preview.15 → 9.0.0-preview.16
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.1/node_modules/@lit/reactive-element/reactive-element.js";import{html as
|
|
1
|
+
import"../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";import{html as n}from"../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";import"../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";import{property as p}from"../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";import{customElement as h}from"../../utils/decorators/custom-element-decorator.js";import{classMap as u}from"../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";import{generateRandomId as g,getElementId as c}from"../../utils/string-utils.js";import m from"../../packages/web-components/src/components/boolean/boolean.gator.scss.js";import{NgcInputText as b}from"../input/gator/input-text/input-text.gator.js";import"../radio-group/radio-group.gator.js";import{unsafeCSS as f}from"../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";var v=Object.defineProperty,_=Object.getOwnPropertyDescriptor,$=Object.getPrototypeOf,w=Reflect.get,d=(e,t,o,a)=>{for(var r=a>1?void 0:a?_(t,o):t,i=e.length-1,l;i>=0;i--)(l=e[i])&&(r=(a?l(t,o,r):l(r))||r);return a&&r&&v(t,o,r),r},y=(e,t,o)=>w($(e),o,t);let s=class extends b{constructor(){super(...arguments),this.options=[{label:"Yes",value:!0},{label:"No",value:!1}],this._randomId=g()}firstUpdated(){this.handleResize(),window.addEventListener("resize",()=>this.handleResize())}render(){return n`
|
|
2
2
|
<ngc-radio-group
|
|
3
3
|
class=${u(this.booleanClasses)}
|
|
4
4
|
id=${this.elementId}
|
|
@@ -8,14 +8,17 @@ import"../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/re
|
|
|
8
8
|
error-text=${this.errorText}
|
|
9
9
|
?skeleton=${this.skeleton}
|
|
10
10
|
?disabled="${this.disabled}"
|
|
11
|
+
?optional="${this.optional}"
|
|
12
|
+
?required="${this.required}"
|
|
13
|
+
?hide-required="${this.hideRequired}"
|
|
11
14
|
@change=${this.handleChange}
|
|
12
15
|
>
|
|
13
16
|
${this.booleanOptions}
|
|
14
|
-
</ngc-radio-group>`}get elementId(){return c(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)=>
|
|
17
|
+
</ngc-radio-group>`}get elementId(){return c(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
18
|
<ngc-radio
|
|
16
19
|
id="${this.elementId}-option-${o}"
|
|
17
20
|
class="gator-boolean-option-${o}${this.selectedClass(t)}"
|
|
18
21
|
.value=${t.value}
|
|
19
22
|
title-text=${t.label}
|
|
20
23
|
></ngc-radio>
|
|
21
|
-
`);return
|
|
24
|
+
`);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.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:t.detail}))}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=[...y(s,s,"styles"),f(m)];d([p({type:Array})],s.prototype,"options",2);s=d([h("ngc-boolean")],s);export{s as NgcBoolean};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ncino/web-components",
|
|
3
3
|
"author": "nCino",
|
|
4
|
-
"version": "9.0.0-preview.
|
|
4
|
+
"version": "9.0.0-preview.16",
|
|
5
5
|
"license": "(c) Copyright 2023 nCino, Inc., all rights reserved",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
"vite-plugin-static-copy": "^3.1.4",
|
|
108
108
|
"vitest": "^4.0.15",
|
|
109
109
|
"yaml-eslint-parser": "^1.3.2",
|
|
110
|
-
"@ncino/styles": "9.0.0-preview.
|
|
110
|
+
"@ncino/styles": "9.0.0-preview.16"
|
|
111
111
|
},
|
|
112
112
|
"peerDependencies": {
|
|
113
113
|
"@ncino/styles": ">=8.0.0-preview.0"
|
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": "9.0.0-preview.
|
|
4
|
+
"version": "9.0.0-preview.15",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|