@devtron-labs/devtron-fe-common-lib 0.0.6-beta-21 → 0.0.6-beta-22

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.
@@ -0,0 +1,18 @@
1
+ import { Component } from 'react';
2
+ export declare enum CHECKBOX_VALUE {
3
+ CHECKED = "CHECKED",
4
+ INTERMEDIATE = "INTERMEDIATE"
5
+ }
6
+ export interface CheckboxProps {
7
+ onChange: (event: any) => void;
8
+ isChecked: boolean;
9
+ value: 'CHECKED' | 'INTERMEDIATE';
10
+ disabled?: boolean;
11
+ tabIndex?: number;
12
+ rootClassName?: string;
13
+ onClick?: (event: any) => void;
14
+ id?: string;
15
+ }
16
+ export declare class Checkbox extends Component<CheckboxProps> {
17
+ render(): JSX.Element;
18
+ }
@@ -23,3 +23,4 @@ export * from './Dialogs';
23
23
  export * from './MultiSelectCustomization';
24
24
  export { default as InfoColourBar } from './InfoColorBar/InfoColourbar';
25
25
  export * from './Common.service';
26
+ export * from './Checkbox';
package/dist/index.js CHANGED
@@ -16314,8 +16314,36 @@ var getTeamListMin = function () {
16314
16314
  });
16315
16315
  };
16316
16316
 
16317
+ exports.CHECKBOX_VALUE = void 0;
16318
+ (function (CHECKBOX_VALUE) {
16319
+ CHECKBOX_VALUE["CHECKED"] = "CHECKED";
16320
+ CHECKBOX_VALUE["INTERMEDIATE"] = "INTERMEDIATE";
16321
+ })(exports.CHECKBOX_VALUE || (exports.CHECKBOX_VALUE = {}));
16322
+ /*
16323
+ Valid States of Checkbox:
16324
+ 1. disabled: true, checked: false, value: XXX
16325
+ 2. disabled: true, checked: true, value: INTERMIDIATE
16326
+ 3. disabled: true, checked: true, value: CHECKED
16327
+ 4. disabled: true, checked: false, value: XXX
16328
+ 5. disabled: false, checked: true, value: INTERMIDIATE
16329
+ 6. disabled: false, checked: true, value: CHECKED
16330
+ */
16331
+ var Checkbox = /** @class */ (function (_super) {
16332
+ __extends(Checkbox, _super);
16333
+ function Checkbox() {
16334
+ return _super !== null && _super.apply(this, arguments) || this;
16335
+ }
16336
+ Checkbox.prototype.render = function () {
16337
+ var _a;
16338
+ var rootClassName = "".concat(this.props.rootClassName ? this.props.rootClassName : '');
16339
+ return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs("label", __assign({ className: "dc__position-rel flex left cursor ".concat(rootClassName), onClick: (_a = this.props) === null || _a === void 0 ? void 0 : _a.onClick }, { children: [jsxRuntime.jsx("input", { type: "checkbox", className: 'form__checkbox', disabled: this.props.disabled, value: this.props.value, onChange: this.props.onChange, tabIndex: this.props.tabIndex, checked: this.props.isChecked, id: this.props.id }), jsxRuntime.jsx("span", { className: "form__checkbox-container" }), jsxRuntime.jsx("span", __assign({ className: "form__checkbox-label" }, { children: this.props.children }))] })) }));
16340
+ };
16341
+ return Checkbox;
16342
+ }(React.Component));
16343
+
16317
16344
  exports.BreadCrumb = BreadCrumb;
16318
16345
  exports.BreadcrumbStore = Store;
16346
+ exports.Checkbox = Checkbox;
16319
16347
  exports.ClearIndicator = ClearIndicator;
16320
16348
  exports.ConditionalWrap = ConditionalWrap;
16321
16349
  exports.ConfirmationDialog = ConfirmationDialog;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devtron-labs/devtron-fe-common-lib",
3
- "version": "0.0.6-beta-21",
3
+ "version": "0.0.6-beta-22",
4
4
  "description": "Supporting common component library",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -0,0 +1,49 @@
1
+ import React, { Component } from 'react'
2
+
3
+ export enum CHECKBOX_VALUE {
4
+ CHECKED = 'CHECKED',
5
+ INTERMEDIATE = 'INTERMEDIATE',
6
+ }
7
+ export interface CheckboxProps {
8
+ onChange: (event) => void
9
+ isChecked: boolean
10
+ value: 'CHECKED' | 'INTERMEDIATE'
11
+ disabled?: boolean
12
+ tabIndex?: number
13
+ rootClassName?: string
14
+ onClick?: (event) => void
15
+ id?: string
16
+ }
17
+
18
+ /*
19
+ Valid States of Checkbox:
20
+ 1. disabled: true, checked: false, value: XXX
21
+ 2. disabled: true, checked: true, value: INTERMIDIATE
22
+ 3. disabled: true, checked: true, value: CHECKED
23
+ 4. disabled: true, checked: false, value: XXX
24
+ 5. disabled: false, checked: true, value: INTERMIDIATE
25
+ 6. disabled: false, checked: true, value: CHECKED
26
+ */
27
+ export class Checkbox extends Component<CheckboxProps> {
28
+ render() {
29
+ let rootClassName = `${this.props.rootClassName ? this.props.rootClassName : ''}`
30
+ return (
31
+ <>
32
+ <label className={`dc__position-rel flex left cursor ${rootClassName}`} onClick={this.props?.onClick}>
33
+ <input
34
+ type="checkbox"
35
+ className={'form__checkbox'}
36
+ disabled={this.props.disabled}
37
+ value={this.props.value}
38
+ onChange={this.props.onChange}
39
+ tabIndex={this.props.tabIndex}
40
+ checked={this.props.isChecked}
41
+ id={this.props.id}
42
+ />
43
+ <span className="form__checkbox-container"></span>
44
+ <span className={`form__checkbox-label`}>{this.props.children}</span>
45
+ </label>
46
+ </>
47
+ )
48
+ }
49
+ }
@@ -22,4 +22,5 @@ export * from './CustomTagSelector'
22
22
  export * from './Dialogs'
23
23
  export * from './MultiSelectCustomization'
24
24
  export {default as InfoColourBar} from './InfoColorBar/InfoColourbar'
25
- export * from './Common.service'
25
+ export * from './Common.service'
26
+ export * from './Checkbox'