PageSourceSearch

https://seedlang.com/assets/in_place_checkbox-CCWkFhmu.js

js seedlang.com collected 2026-09-25 20:52:12 UTC 6,374 bytes, 31 lines download raw bytes

1(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`82e4baa6c68c429597a8dcf8c86fc75e13a47707`};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`65dde614-5213-4e0a-9bf5-d86c9cf3f82b`,e._sentryDebugIdIdentifier=`sentry-dbid-65dde614-5213-4e0a-9bf5-d86c9cf3f82b`)}catch{}})();import{o as e}from"./chunk-BYEayUvb.js";import{t}from"./react-C0i5OX_v.js";import{n,t as r}from"./dist-ntKyVnt_.js";import{_ as i,c as a,f as o}from"./mobx.module-DfEgZCOa.js";import{t as s}from"./dist-BA6ueOYS.js";import{t as c}from"./mobxreact.esm-7FYUMTHz.js";import{t as l}from"./prop-types-0EVDBpg9.js";import{t as u}from"./classnames-B2EK-TqM.js";import{t as d}from"./emotion-styled.browser.esm-BZwDHoh3.js";import{t as f}from"./jsx-runtime-DU0S17m4.js";import{t as p}from"./v4-D7nNz3c1.js";import{t as m}from"./fa-3UK5Zrbg.js";import{t as h}from"./pluralize-Dfp0CJEz.js";import{t as g}from"./with_legend-ClIBzCff.js";import{t as _}from"./confirmation-D1FzzGVo.js";var v=f(),y=e(t()),b=e(l());o();var x=e(u()),S=r(),C=e(h()),w=s(),T=n(),E,D,O,k,A;function j(e,t,n,r){n&&Object.defineProperty(e,t,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(r):void 0})}function M(e,t,n,r,i){var a={};return Object.keys(r).forEach(function(e){a[e]=r[e]}),a.enumerable=!!a.enumerable,a.configurable=!!a.configurable,(`value`in a||a.initializer)&&(a.writable=!0),a=n.slice().reverse().reduce(function(n,r){return r(e,t,n)||n},a),i&&a.initializer!==void 0&&(a.value=a.initializer?a.initializer.call(i):void 0,a.initializer=void 0),a.initializer===void 0?(Object.defineProperty(e,t,a),null):a}var N=d.div`
2  display: ${e=>e.display};
3  align-items: center;
4  position:relative;
5  border: ${e=>e.border};
6  border-radius: ${e=>e.borderRadius};
7  font-size: ${e=>e.fontSize};
8  background: ${e=>e.background};
9  padding: ${e=>e.padding};
10  margin: ${e=>e.margin};
11  width: ${e=>e.width};
12  text-align: ${e=>e.textAlign};
13  cursor: ${e=>e.canClick?`pointer`:`not-allowed`};
14  i {
15    color: ${e=>e.selectedColor};
16    margin-right: 5px;
17  }
18  i.disabled {
19    color: ${e=>e.disabledIconColor};
20  }
21  
22`,P=d.label`
23  display: inline-block;
24  text-align: ${e=>e.textAlign};
25  color: ${e=>e.color};
26  flex: 1;
27  cursor: ${e=>e.canClick?`pointer`:`not-allowed`};
28  margin: ${e=>e.margin};
29  font-size: ${e=>e.fontSize};
30`,F=g(c(E=(D=(A=class extends y.Component{constructor(e){super(e),j(this,`value`,O,this),j(this,`showConfirmation`,k,this),this.toggleValue=()=>{if(!(this.props.disabled&&!this.props.allowUncheck)){if((T.AppUI.user.canUpdateRecords||this.props.allowUpdate)&&(this.value=this.props.icon||this.props.hideCheckbox?!this.value:this.checkboxRef.current.checked),this.props.onChange&&!this.props.locked)this.props.onChange(this.value);else if(!this.props.locked&&(T.AppUI.user.canUpdateRecords||this.props.allowUpdate)){let e={};e.data={},e.data[this.props.field]=this.value,S.Api.put({url:`/api/${(0,C.default)(this.props.model)}/${this.props.id}`,data:e,successCallback:()=>{this.props.afterChange&&this.props.afterChange(this.value)}})}}},this.onConfirm=()=>{this.showConfirmation=!1,this.toggleValue()},this.onClick=()=>{!this.value&&this.props.withConfirmation?this.showConfirmation=!0:this.toggleValue()},this.checkboxRef=y.createRef(),this.id=p()}componentDidUpdate(e){e.value!==this.props.value&&(this.value=this.props.value,this.checkboxRef.current&&(this.checkboxRef.current.value=this.props.value))}get disabled(){return this.props.disabled&&(!this.props.allowUncheck||!this.value)}get canClick(){return!(this.disabled||this.props.locked||!T.AppUI.user.canUpdateRecords&&!this.props.allowUpdate)}get labelColor(){return this.props.color?this.props.color:this.disabled?`#CCC`:this.props.hideCheckbox&&this.value?`#FFF`:`#000`}render(){return(0,v.jsxs)(N,{margin:this.props.wrapperMargin,padding:this.props.hideCheckbox?`1px 3px`:0,borderRadius:this.props.hideCheckbox?`5px`:`0px`,background:this.props.hideCheckbox&&this.value?w.Theme.green:`transparent`,disabled:this.disabled,width:this.props.width,display:this.props.display,border:this.props.hideCheckbox?`1px solid gray`:null,selectedColor:this.props.selectedColor,disabledIconColor:this.props.disabledIconColor,canClick:this.canClick,children:[this.props.withConfirmation&&this.showConfirmation&&(0,v.jsx)(_,{left:this.props.left,right:this.props.right,floatsRight:this.props.confirmationMessageFloatsRight,close:()=>this.showConfirmation=!1,onConfirm:()=>this.onConfirm(),message:this.props.message}),this.props.icon&&(0,v.jsx)(m,{i:this.props.icon,className:(0,x.default)({"fa-2x":this.props.bigIcon,disabled:!this.value}),onClick:this.props.locked?void 0:this.onClick,style:{cursor:`inherit`,color:this.value?void 0:this.props.disabledIconColor||`#ccc`,...this.props.iconStyle}}),!this.props.icon&&!this.props.hideCheckbox&&(0,v.jsx)(`input`,{type:`checkbox`,disabled:this.props.disabled,onChange:this.onClick,value:this.value,checked:this.value,id:this.id,ref:this.checkboxRef}
30),this.props.children&&(0,v.jsx)(P,{htmlFor:this.id,color:this.labelColor,margin:this.props.hideCheckbox?`0`:`0 0 0 5px`,textAlign:this.props.hideCheckbox?`center`:`left`,fontSize:this.props.hideCheckbox?`11px`:`14px`,onClick:this.onClick,disabled:this.disabled,canClick:this.canClick,children:this.props.children})]})}},A.propTypes={onChange:b.default.func,afterChange:b.default.func,model:b.default.string,field:b.default.string,id:b.default.oneOfType([b.default.string,b.default.number]),icon:b.default.string},A.defaultProps={selectedColor:`#000`,wrapperMargin:`0 0 0 0`,display:`inline-block`,withConfirmation:!1,icon:`check`},A),O=M(D.prototype,`value`,[i],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return this.props.value||!1}}),k=M(D.prototype,`showConfirmation`,[i],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),M(D.prototype,`disabled`,[a],Object.getOwnPropertyDescriptor(D.prototype,`disabled`),D.prototype),M(D.prototype,`canClick`,[a],Object.getOwnPropertyDescriptor(D.prototype,`canClick`),D.prototype),M(D.prototype,`labelColor`,[a],Object.getOwnPropertyDescriptor(D.prototype,`labelColor`),D.prototype),D))||E);export{F as t};
31//# sourceMappingURL=in_place_checkbox-CCWkFhmu.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.