Best JavaScript code snippet using fast-check-monorepo
HdfsPermissionForm.js
Source:HdfsPermissionForm.js
1/*2 * Copyright 2012-2016 the Flamingo Community.3 *4 * Licensed under the Apache License, Version 2.0 (the "License");5 * you may not use this file except in compliance with the License.6 * You may obtain a copy of the License at7 *8 * http://www.apache.org/licenses/LICENSE-2.09 *10 * Unless required by applicable law or agreed to in writing, software11 * distributed under the License is distributed on an "AS IS" BASIS,12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.13 * See the License for the specific language governing permissions and14 * limitations under the License.15 */16Ext.define('Flamingo.view.hdfsbrowser.permission.HdfsPermissionForm', {17 extend: 'Ext.form.Panel',18 alias: 'widget.HdfsPermissionFormPanel',19 reference: 'hdfsPermission',20 bodyPadding: 10,21 items: [22 {23 border: false,24 layout: {25 type: 'vbox',26 align: 'stretch',27 pack: 'center'28 },29 items: [30 {31 xtype: 'fieldset',32 title: 'Owner and Group',33 reference: 'ownershipField',34 flex: 1,35 layout: {36 type: 'vbox',37 align: 'stretch',38 pack: 'center'39 },40 defaults: {41 labelAlign: 'right',42 anchor: '100%',43 labelWidth: 6044 },45 padding: '15 50 10 10',46 items: [47 {48 xtype: 'textfield',49 name: 'owner',50 reference: 'owner',51 value: '',52 fieldLabel: 'Owner'53 },54 {55 xtype: 'textfield',56 name: 'group',57 reference: 'group',58 value: '',59 fieldLabel: 'Group'60 },61 {62 xtype: 'checkboxfield',63 reference: 'recursiveOwner',64 name: 'recursiveOwner',65 boxLabel: 'Apply All',66 labelAlign: 'right',67 style: 'margin-left:65px;',68 uncheckedValue: 0,69 inputValue: 1,70 checked: false,71 tip: 'Changes the ownership of all sub-directories and files in the selected path.',72 listeners: {73 render: function (checkbox) {74 Ext.create('Ext.tip.ToolTip', {75 target: checkbox.getEl(),76 html: checkbox.tip77 });78 }79 }80 }81 ]82 },83 {84 xtype: 'fieldset',85 title: 'Authority',86 flex: 1,87 layout: {88 type: 'vbox',89 align: 'stretch',90 pack: 'center'91 },92 defaults: {93 labelAlign: 'right',94 anchor: '100%',95 labelWidth: 6096 },97 items: [98 {99 xtype: 'checkboxgroup',100 style: 'margin-top:10px;',101 fieldLabel: 'Owner',102 items: [103 {104 xtype: 'checkboxfield',105 name: 'ownerRead',106 reference: 'ownerRead',107 boxLabel: 'Read',108 uncheckedValue: 0,109 inputValue: 1110 },111 {112 xtype: 'checkboxfield',113 name: 'ownerWrite',114 reference: 'ownerWrite',115 boxLabel: 'Write',116 uncheckedValue: 0,117 inputValue: 1118 },119 {120 xtype: 'checkboxfield',121 name: 'ownerExecute',122 reference: 'ownerExecute',123 boxLabel: 'Execute',124 uncheckedValue: 0,125 inputValue: 1126 }127 ]128 },129 {130 xtype: 'checkboxgroup',131 fieldLabel: 'Group',132 items: [133 {134 xtype: 'checkboxfield',135 name: 'groupRead',136 reference: 'groupRead',137 boxLabel: 'Read',138 uncheckedValue: 0,139 inputValue: 1140 },141 {142 xtype: 'checkboxfield',143 name: 'groupWrite',144 reference: 'groupWrite',145 boxLabel: 'Write',146 uncheckedValue: 0,147 inputValue: 1148 },149 {150 xtype: 'checkboxfield',151 name: 'groupExecute',152 reference: 'groupExecute',153 boxLabel: 'Execute',154 uncheckedValue: 0,155 inputValue: 1156 }157 ]158 },159 {160 xtype: 'checkboxgroup',161 reference: 'otherCheckGroup',162 fieldLabel: 'Other',163 items: [164 {165 xtype: 'checkboxfield',166 name: 'otherRead',167 reference: 'otherRead',168 boxLabel: 'Read',169 uncheckedValue: 0,170 inputValue: 1171 },172 {173 xtype: 'checkboxfield',174 name: 'otherWrite',175 reference: 'otherWrite',176 boxLabel: 'Write',177 uncheckedValue: 0,178 inputValue: 1179 },180 {181 xtype: 'checkboxfield',182 name: 'otherExecute',183 reference: 'otherExecute',184 boxLabel: 'Execute',185 uncheckedValue: 0,186 inputValue: 1187 }188 ]189 },190 {191 xtype: 'checkboxfield',192 reference: 'recursivePermission',193 name: 'recursivePermission',194 boxLabel: 'Apply All',195 labelAlign: 'right',196 style: 'margin-left:69px;margin-bottom:15px;',197 uncheckedValue: 0,198 inputValue: 1,199 checked: false,200 tip: 'Changes permission of all sub-directories and files in the selected path.',201 listeners: {202 render: function (checkbox) {203 Ext.create('Ext.tip.ToolTip', {204 target: checkbox.getEl(),205 html: checkbox.tip206 });207 }208 }209 }210 ]211 }212 ]213 }214 ]...
FormPanel.js
Source:FormPanel.js
1(function () {2 Ext.define('CMDBuild.view.administration.userAndGroup.group.tabs.userInterface.FormPanel', {3 extend: 'Ext.form.Panel',4 requires: [5 'CMDBuild.core.constants.FieldWidths',6 'CMDBuild.core.constants.Proxy'7 ],8 mixins: ['CMDBuild.view.common.PanelFunctions'],9 /**10 * @cfg {CMDBuild.controller.administration.userAndGroup.group.tabs.UserInterface}11 */12 delegate: undefined,13 bodyCls: 'cmdb-gray-panel',14 border: false,15 frame: false,16 overflowY: 'auto',17 split: true,18 layout: {19 type: 'vbox',20 align: 'stretch'21 },22 /**23 * @returns {Void}24 *25 * @override26 */27 initComponent: function () {28 Ext.apply(this, {29 dockedItems: [30 Ext.create('Ext.toolbar.Toolbar', {31 dock: 'bottom',32 itemId: CMDBuild.core.constants.Proxy.TOOLBAR_BOTTOM,33 ui: 'footer',34 layout: {35 type: 'hbox',36 align: 'middle',37 pack: 'center'38 },39 items: [40 Ext.create('CMDBuild.core.buttons.text.Save', {41 scope: this,42 handler: function (button, e) {43 this.delegate.cmfg('onUserAndGroupGroupTabUserInterfaceSaveButtonClick');44 }45 }),46 Ext.create('CMDBuild.core.buttons.text.Abort', {47 scope: this,48 handler: function (button, e) {49 this.delegate.cmfg('onUserAndGroupGroupTabUserInterfaceAbortButtonClick');50 }51 })52 ]53 })54 ],55 items: [56 Ext.create('Ext.panel.Panel', {57 bodyCls: 'cmdb-gray-panel',58 cls: 'cmdb-border-bottom',59 frame: false,60 border: false,61 items: [62 Ext.create('Ext.form.CheckboxGroup', {63 fieldLabel: CMDBuild.Translation.disabledFeatures,64 labelWidth: CMDBuild.core.constants.FieldWidths.LABEL,65 columns: 1,66 items: [67 {68 boxLabel: CMDBuild.Translation.cards,69 name: CMDBuild.core.constants.Proxy.CLASS,70 inputValue: true,71 uncheckedValue: false72 },73 {74 boxLabel: CMDBuild.Translation.processes,75 name: CMDBuild.core.constants.Proxy.PROCESS,76 inputValue: true,77 uncheckedValue: false78 },79 {80 boxLabel: CMDBuild.Translation.views,81 name: CMDBuild.core.constants.Proxy.DATA_VIEW,82 inputValue: true,83 uncheckedValue: false84 },85 {86 boxLabel: CMDBuild.Translation.dashboard,87 name: CMDBuild.core.constants.Proxy.DASHBOARD,88 inputValue: true,89 uncheckedValue: false90 },91 {92 boxLabel: CMDBuild.Translation.report,93 name: CMDBuild.core.constants.Proxy.REPORT,94 inputValue: true,95 uncheckedValue: false96 },97 {98 boxLabel: CMDBuild.Translation.customPages,99 name: CMDBuild.core.constants.Proxy.CUSTOM_PAGES,100 inputValue: true,101 uncheckedValue: false102 },103 {104 boxLabel: CMDBuild.Translation.utilityChangePassword,105 name: CMDBuild.core.constants.Proxy.CHANGE_PASSWORD,106 inputValue: true,107 uncheckedValue: false108 },109 {110 boxLabel: CMDBuild.Translation.utilityMultipleUpdate,111 name: CMDBuild.core.constants.Proxy.BULK_UPDATE,112 inputValue: true,113 uncheckedValue: false114 },115 {116 boxLabel: CMDBuild.Translation.utilityImportCsv,117 name: CMDBuild.core.constants.Proxy.IMPORT_CSV,118 inputValue: true,119 uncheckedValue: false120 },121 {122 boxLabel: CMDBuild.Translation.utilityExportCsv,123 name: CMDBuild.core.constants.Proxy.EXPORT_CSV,124 inputValue: true,125 uncheckedValue: false126 }127 ]128 })129 ]130 }),131 Ext.create('Ext.panel.Panel', {132 bodyCls: 'cmdb-gray-panel',133 cls: 'cmdb-border-bottom',134 frame: false,135 border: false,136 items: [137 Ext.create('Ext.form.CheckboxGroup', {138 fieldLabel: CMDBuild.Translation.disabledTabsInClassesModule,139 labelWidth: CMDBuild.core.constants.FieldWidths.LABEL,140 columns: 1,141 items: [142 {143 boxLabel: CMDBuild.Translation.detail,144 name: CMDBuild.core.constants.Proxy.CLASS_DETAIL_TAB,145 inputValue: true,146 uncheckedValue: false147 },148 {149 boxLabel: CMDBuild.Translation.notes,150 name: CMDBuild.core.constants.Proxy.CLASS_NOTE_TAB,151 inputValue: true,152 uncheckedValue: false153 },154 {155 boxLabel: CMDBuild.Translation.relations,156 name: CMDBuild.core.constants.Proxy.CLASS_RELATION_TAB,157 inputValue: true,158 uncheckedValue: false159 },160 {161 boxLabel: CMDBuild.Translation.history,162 name: CMDBuild.core.constants.Proxy.CLASS_HISTORY_TAB,163 inputValue: true,164 uncheckedValue: false165 },166 {167 boxLabel: CMDBuild.Translation.email,168 name: CMDBuild.core.constants.Proxy.CLASS_EMAIL_TAB,169 inputValue: true,170 uncheckedValue: false171 },172 {173 boxLabel: CMDBuild.Translation.attachments,174 name: CMDBuild.core.constants.Proxy.CLASS_ATTACHMENT_TAB,175 inputValue: true,176 uncheckedValue: false177 }178 ]179 })180 ]181 }),182 Ext.create('Ext.panel.Panel', {183 bodyCls: 'cmdb-gray-panel',184 cls: 'cmdb-border-bottom',185 frame: false,186 border: false,187 items: [188 Ext.create('Ext.form.CheckboxGroup', {189 fieldLabel: CMDBuild.Translation.disabledTabsInProcessesModule,190 labelWidth: CMDBuild.core.constants.FieldWidths.LABEL,191 columns: 1,192 items: [193 {194 boxLabel: CMDBuild.Translation.notes,195 name: CMDBuild.core.constants.Proxy.PROCESS_NOTE_TAB,196 inputValue: true,197 uncheckedValue: false198 },199 {200 boxLabel: CMDBuild.Translation.relations,201 name: CMDBuild.core.constants.Proxy.PROCESS_RELATION_TAB,202 inputValue: true,203 uncheckedValue: false204 },205 {206 boxLabel: CMDBuild.Translation.history,207 name: CMDBuild.core.constants.Proxy.PROCESS_HISTORY_TAB,208 inputValue: true,209 uncheckedValue: false210 },211 {212 boxLabel: CMDBuild.Translation.email,213 name: CMDBuild.core.constants.Proxy.PROCESS_EMAIL_TAB,214 inputValue: true,215 uncheckedValue: false216 },217 {218 boxLabel: CMDBuild.Translation.attachments,219 name: CMDBuild.core.constants.Proxy.PROCESS_ATTACHMENT_TAB,220 inputValue: true,221 uncheckedValue: false222 }223 ]224 })225 ]226 }),227 Ext.create('Ext.panel.Panel', {228 bodyCls: 'cmdb-gray-panel',229 cls: 'cmdb-border-bottom',230 frame: false,231 border: false,232 items: [233 Ext.create('Ext.form.CheckboxGroup', {234 fieldLabel: CMDBuild.Translation.otherOptions,235 labelWidth: CMDBuild.core.constants.FieldWidths.LABEL,236 columns: 1,237 items: [238 {239 boxLabel: CMDBuild.Translation.hideSidePanel,240 name: CMDBuild.core.constants.Proxy.HIDE_SIDE_PANEL,241 inputValue: true,242 uncheckedValue: false243 },244 {245 boxLabel: CMDBuild.Translation.fullScreenNavigation,246 name: CMDBuild.core.constants.Proxy.FULL_SCREEN_MODE,247 inputValue: true,248 uncheckedValue: false249 },250 {251 boxLabel: CMDBuild.Translation.simpleHistoryForCards,252 name: CMDBuild.core.constants.Proxy.SIMPLE_HISTORY_MODE_FOR_CARD,253 inputValue: true,254 uncheckedValue: false255 },256 {257 boxLabel: CMDBuild.Translation.simpleHistoryForProcesses,258 name: CMDBuild.core.constants.Proxy.SIMPLE_HISTORY_MODE_FOR_PROCESS,259 inputValue: true,260 uncheckedValue: false261 },262 {263 boxLabel: CMDBuild.Translation.processWidgetsAlwaysEnabled,264 name: CMDBuild.core.constants.Proxy.PROCESS_WIDGET_ALWAYS_ENABLED,265 inputValue: true,266 uncheckedValue: false267 }268 ]269 })270 ]271 })272 ]273 });274 this.callParent(arguments);275 }276 });...
inputex-checkbox.js
Source:inputex-checkbox.js
1/**2 * @module inputex-checkbox3 */4YUI.add("inputex-checkbox",function(Y){5 var lang = Y.Lang,6 inputEx = Y.inputEx;7/**8 * Create a checkbox.9 * @class inputEx.CheckBox10 * @extends inputEx.Field11 * @constructor12 * @param {Object} options Added options for CheckBoxes:13 * <ul>14 * <li>sentValues: 2D vector of values for checked/unchecked states (default is [true, false])</li>15 * </ul>16 */17inputEx.CheckBox = function(options) {18 inputEx.CheckBox.superclass.constructor.call(this,options);19};20 21Y.extend(inputEx.CheckBox, inputEx.Field, {22 23 /**24 * Adds the CheckBox specific options25 * @method setOptions26 * @param {Object} options Options object as passed to the constructor27 */28 setOptions: function(options) {29 inputEx.CheckBox.superclass.setOptions.call(this, options);30 31 // Overwrite options:32 this.options.className = options.className ? options.className : 'inputEx-Field inputEx-CheckBox';33 34 this.options.rightLabel = options.rightLabel || '';35 36 // Added options37 this.sentValues = options.sentValues || [true, false];38 this.options.sentValues = this.sentValues; // for compatibility39 this.checkedValue = this.sentValues[0];40 this.uncheckedValue = this.sentValues[1];41 },42 43 /**44 * Render the checkbox and the hidden field45 * @method renderComponent46 */47 renderComponent: function() {48 49 var checkBoxId = this.divEl.id?this.divEl.id+'-field':Y.guid();50 this.el = inputEx.cn('input', { id: checkBoxId, type: 'checkbox' });51 this.fieldContainer.appendChild(this.el);52 53 this.rightLabelEl = inputEx.cn('label', {"for": checkBoxId, className: 'inputEx-CheckBox-rightLabel'}, null, this.options.rightLabel);54 this.fieldContainer.appendChild(this.rightLabelEl);55 56 // Keep state of checkbox in a hidden field (format : this.checkedValue or this.uncheckedValue)57 // This is useful for non-javascript form submit (it allows custom checked/unchecked values to be submitted)58 this.hiddenEl = inputEx.cn('input', {type: 'hidden', name: this.options.name || '', value: this.uncheckedValue});59 this.fieldContainer.appendChild(this.hiddenEl);60 },61 62 /**63 * Clear the previous events and listen for the "change" event64 * @method initEvents65 */66 initEvents: function() {67 68 // Awful Hack to work in IE6 and below (the checkbox doesn't fire the change event)69 // It seems IE 8 removed this behavior from IE7 so it only works with IE 7 ??70 if( Y.UA.ie ) {71 Y.one(this.el).on("click", function(e) { Y.later(10,this,function(){this.onChange(e);}); }, this);72 } else {73 Y.one(this.el).on("change", this.onChange, this, true);74 }75 76 Y.one(this.el).on("focus", this.onFocus, this, true);77 Y.one(this.el).on("blur", this.onBlur, this, true);78 },79 80 /**81 * Function called when the checkbox is toggled82 * @method onChange83 * @param {Event} e The original 'change' event84 */85 onChange: function(e) {86 this.hiddenEl.value = this.el.checked ? this.checkedValue : this.uncheckedValue;87 88 inputEx.CheckBox.superclass.onChange.call(this,e);89 },90 91 /**92 * Get the state value93 * @method getValue94 * @return {Any} one of [checkedValue,uncheckedValue]95 */96 getValue: function() {97 return this.el.checked ? this.checkedValue : this.uncheckedValue;98 },99 100 /**101 * Set the value of the checkedbox102 * @method setValue103 * @param {Any} value The value schould be one of [checkedValue,uncheckedValue]104 * @param {boolean} [sendUpdatedEvt] (optional) Wether this setValue should fire the 'updated' event or not (default is true, pass false to NOT send the event)105 */106 setValue: function(value, sendUpdatedEvt) {107 if (value===this.checkedValue || (typeof(value) == 'string' && typeof(this.checkedValue) == 'boolean' &&108 value === String(this.checkedValue))) {109 this.hiddenEl.value = this.checkedValue;110 111 // check checkbox (all browsers)112 this.el.checked = true;113 114 // hacks for IE6, because input is not operational at init, 115 // so "this.el.checked = true" would work for default values !116 // (but still work for later setValue calls)117 if (Y.UA.ie === 6) {118 this.el.setAttribute("defaultChecked","checked"); // for IE6119 }120 }121 else {122 // DEBUG :123 /*if (value!==this.uncheckedValue && lang.isObject(console) && lang.isFunction(console.log) ) {124 console.log("inputEx.CheckBox: value is *"+value+"*, schould be in ["+this.checkedValue+","+this.uncheckedValue+"]");125 }*/126 this.hiddenEl.value = this.uncheckedValue;127 128 // uncheck checkbox (all browsers)129 this.el.checked = false;130 131 // hacks for IE6, because input is not operational at init, 132 // so "this.el.checked = false" would work for default values !133 // (but still work for later setValue calls)134 if (Y.UA.ie === 6) {135 this.el.removeAttribute("defaultChecked"); // for IE6136 }137 }138 139 // Call Field.setValue to set class and fire updated event140 inputEx.CheckBox.superclass.setValue.call(this,value, sendUpdatedEvt);141 },142 143 /**144 * Disable the field145 * @method disable146 */147 disable: function() {148 this.el.disabled = true;149 },150 /**151 * Enable the field152 * @method enable153 */154 enable: function() {155 this.el.disabled = false;156 }157 158}); 159 160// Register this class as "boolean" type161inputEx.registerType("boolean", inputEx.CheckBox, [ 162 {type: 'string', label: 'Right Label', name: 'rightLabel'}163]);164 165}, '0.0.1',{166 requires: ["inputex-field"]...
Using AI Code Generation
1import { uncheckedValue } from 'fast-check-monorepo';2import { uncheckedValue } from 'fast-check';3import { uncheckedValue } from 'fast-check-monorepo';4import { uncheckedValue } from 'fast-check';5import { uncheckedValue } from 'fast-check-monorepo';6import { uncheckedValue } from 'fast-check';7import { uncheckedValue } from 'fast-check-monorepo';8import { uncheckedValue } from 'fast-check';9import { uncheckedValue } from 'fast-check-monorepo';10import { uncheckedValue } from 'fast-check';11import { uncheckedValue } from 'fast-check-monorepo';12import { uncheckedValue } from 'fast-check';13import { uncheckedValue } from 'fast-check-monorepo';14import { uncheckedValue } from 'fast-check';15import { uncheckedValue } from 'fast-check-monorepo';16import { uncheckedValue } from 'fast-check';17import { uncheckedValue } from 'fast-check-monorepo';18import { uncheckedValue } from 'fast-check';19import { uncheckedValue } from 'fast-check-monorepo';20import { uncheckedValue } from 'fast-check';21import { uncheckedValue } from 'fast-check-monorepo';
Using AI Code Generation
1const fc = require('fast-check')2const { uncheckedValue } = require('fast-check/lib/check/arbitrary/definition/UniverseArbitrary')3const { integer } = require('fast-check/lib/check/arbitrary/IntegerArbitrary')4const { array } = require('fast-check/lib/check/arbitrary/ArrayArbitrary')5const { tuple } = require('fast-check/lib/check/arbitrary/TupleArbitrary')6const a = array(integer())7const b = tuple(integer(), integer())8const c = tuple(a, b)9const d = tuple(c, b)10const e = uncheckedValue(d)11console.log(e)
Using AI Code Generation
1const { uncheckedValue } = require("fast-check");2const result = uncheckedValue(3 fc.integer({ min: 0, max: 1000 }),4 (v) => v % 3 === 05);6console.log(result);
Using AI Code Generation
1import { uncheckedValue } from 'fast-check-monorepo';2const value = uncheckedValue(3 .tuple(fc.integer(), fc.integer())4 .filter(([a, b]) => a + b > 0),5);6console.log(value);
Using AI Code Generation
1const fc = require('fast-check');2const arb = fc.array(fc.integer(), 5, 10).noShrink();3const shrinked = arb.shrinkableFor([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);4const shrinked2 = arb.shrinkableFor([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]);5const shrinked3 = arb.shrinkableFor([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]);6const shrinked4 = arb.shrinkableFor([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]);
Using AI Code Generation
1const { uncheckedValue } = require('fast-check');2const fc = require('fast-check');3const arb = fc.integer(0, 10);4const v = uncheckedValue(arb, 0);5const v2 = uncheckedValue(arb, 1);6const v3 = uncheckedValue(arb, 2);7const v4 = uncheckedValue(arb, 3);8const v5 = uncheckedValue(arb, 4);9const v6 = uncheckedValue(arb, 5);10const v7 = uncheckedValue(arb, 6);11const v8 = uncheckedValue(arb, 7);12const v9 = uncheckedValue(arb, 8);13const v10 = uncheckedValue(arb, 9);14const v11 = uncheckedValue(arb, 10);15const v12 = uncheckedValue(arb, 11);16const v13 = uncheckedValue(arb, 12);17const v14 = uncheckedValue(arb, 13);18const v15 = uncheckedValue(arb, 14);19const v16 = uncheckedValue(arb, 15);20const v17 = uncheckedValue(arb, 16);21const v18 = uncheckedValue(arb, 17);22const v19 = uncheckedValue(arb, 18);23const v20 = uncheckedValue(arb, 19);24const v21 = uncheckedValue(arb, 20);25const v22 = uncheckedValue(arb, 21);26const v23 = uncheckedValue(arb
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!