@omegagrid/form 0.8.4 → 0.9.0

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.
@@ -42,6 +42,7 @@ declare const _default: {
42
42
  DEFAULT_NUMBER_FORMAT: string;
43
43
  BUTTON_HEIGHT: number;
44
44
  FONT_SIZE: number;
45
+ FLOATING_WINDOW_MAX_WIDTH: number;
45
46
  FORM_CONTROL_HEIGHT: number;
46
47
  BUTTON_CONFIG: Map<FormButtonType, FormButtonConfig>;
47
48
  };
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,wBAUC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,wBAUC"}
@@ -1 +1 @@
1
- {"version":3,"file":"textInput.d.ts","sourceRoot":"","sources":["../../../src/ui/controls/textInput.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,qBACa,aAAc,SAAQ,WAAW,CAAC,MAAM,CAAC;IAErD,MAAM,CAAC,MAAM,4BAYV;IAEH,QAAQ;IAQR,SAAS,GAAI,GAAG,UAAU,UAEzB;IAED,UAAU,GAAI,GAAG,aAAa,UAI7B;IAED,MAAM,6CAQJ;CAEF"}
1
+ {"version":3,"file":"textInput.d.ts","sourceRoot":"","sources":["../../../src/ui/controls/textInput.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,qBACa,aAAc,SAAQ,WAAW,CAAC,MAAM,CAAC;IAErD,MAAM,CAAC,MAAM,4BAgBV;IAEH,QAAQ;IAQR,SAAS,GAAI,GAAG,UAAU,UAEzB;IAED,UAAU,GAAI,GAAG,aAAa,UAI7B;IAED,MAAM,6CAQJ;CAEF"}
@@ -50,6 +50,10 @@ FormTextInput.styles = [...BaseControl.styles, css `
50
50
  width: 100%;
51
51
  border-radius: var(--og-base-radius);
52
52
  }
53
+
54
+ :host([required]) input {
55
+ border: none;
56
+ }
53
57
  `];
54
58
  FormTextInput = __decorate([
55
59
  customElement('og-form-textinput')
@@ -1 +1 @@
1
- {"version":3,"file":"textInput.js","sourceRoot":"","sources":["../../../src/ui/controls/textInput.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGrC,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,WAAmB;IAA/C;;QAwBN,cAAS,GAAG,CAAC,CAAa,EAAE,EAAE;YAC7B,IAAI,CAAC,WAAW,CAAE,CAAC,CAAC,MAA2B,CAAC,KAAK,CAAC,CAAC;QACxD,CAAC,CAAA;QAED,eAAU,GAAG,CAAC,CAAgB,EAAE,EAAE;YACjC,IAAI,CAAC,CAAC,GAAG,IAAI,OAAO,EAAE,CAAC;gBACtB,IAAI,CAAC,WAAW,CAAE,CAAC,CAAC,MAA2B,CAAC,KAAK,CAAC,CAAC;YACxD,CAAC;QACF,CAAC,CAAA;QAED,WAAM,GAAG,GAAG,EAAE,CAAC,IAAI,CAAA;;;aAGP,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK;kBAC/B,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,IAAI,EAAE;cACvC,IAAI,CAAC,SAAS;eACb,IAAI,CAAC,UAAU;;EAE5B,CAAC;IAEH,CAAC;IA5BA,QAAQ;QACP,KAAK,CAAC,QAAQ,EAAE,CAAC;QACjB,IAAI,CAAC,IAAI,CAAC,KAAK;YAAE,OAAO;QACxB,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,CAAC;YAClF,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QACzC,CAAC;IACF,CAAC;;AApBM,oBAAM,GAAG,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,GAAG,CAAA;;;;;;aAM/B,SAAS,CAAC,mBAAmB;kBACxB,SAAS,CAAC,mBAAmB;;;;;EAK7C,CAAC,AAZW,CAYV;AAdS,aAAa;IADzB,aAAa,CAAC,mBAAmB,CAAC;GACtB,aAAa,CA4CzB","sourcesContent":["import constants from \"../../constants\";\nimport { css, html } from \"lit\";\nimport { customElement } from \"lit/decorators.js\";\nimport { BaseControl } from \"./baseControl\";\n\n@customElement('og-form-textinput')\nexport class FormTextInput extends BaseControl<string> {\n\n\tstatic styles = [...BaseControl.styles, css`\n\t\tinput {\n\t\t\tborder: 1px solid var(--og-accent-color);\n\t\t\tbackground-color: var(--og-form-background-color);\n\t\t\tcolor: var(--og-text-color);\n\t\t\tfont-size: var(--og-font-size);\n\t\t\theight: ${constants.FORM_CONTROL_HEIGHT}px;\n\t\t\tline-height: ${constants.FORM_CONTROL_HEIGHT}px;\n\t\t\toutline: none;\n\t\t\twidth: 100%;\n\t\t\tborder-radius: var(--og-base-radius);\n\t\t}\n\t`];\n\n\tvalidate() {\n\t\tsuper.validate();\n\t\tif (!this.model) return;\n\t\tif (this.model.props.pattern && !this.model.props.pattern.test(this.value ?? \"\")) {\n\t\t\tthis.model.errors.push('invalid value');\n\t\t}\n\t}\n\n\t_onChange = (e: InputEvent) => {\n\t\tthis.updateValue((e.target as HTMLInputElement).value);\n\t}\n\n\t_onKeyDown = (e: KeyboardEvent) => {\n\t\tif (e.key == 'Enter') {\n\t\t\tthis.updateValue((e.target as HTMLInputElement).value);\n\t\t}\n\t}\n\n\trender = () => html`\n\t\t<input\n\t\t\ttype=\"text\"\n\t\t\t.value=\"${this.value == null ? '' : this.value}\"\n\t\t\tplaceholder=\"${this.model?.props.placeholder ?? ''}\"\n\t\t\t@change=\"${this._onChange}\"\n\t\t\t@keydown=\"${this._onKeyDown}\"\n\t\t>\n\t`;\n\t\n}"]}
1
+ {"version":3,"file":"textInput.js","sourceRoot":"","sources":["../../../src/ui/controls/textInput.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGrC,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,WAAmB;IAA/C;;QA4BN,cAAS,GAAG,CAAC,CAAa,EAAE,EAAE;YAC7B,IAAI,CAAC,WAAW,CAAE,CAAC,CAAC,MAA2B,CAAC,KAAK,CAAC,CAAC;QACxD,CAAC,CAAA;QAED,eAAU,GAAG,CAAC,CAAgB,EAAE,EAAE;YACjC,IAAI,CAAC,CAAC,GAAG,IAAI,OAAO,EAAE,CAAC;gBACtB,IAAI,CAAC,WAAW,CAAE,CAAC,CAAC,MAA2B,CAAC,KAAK,CAAC,CAAC;YACxD,CAAC;QACF,CAAC,CAAA;QAED,WAAM,GAAG,GAAG,EAAE,CAAC,IAAI,CAAA;;;aAGP,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK;kBAC/B,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,IAAI,EAAE;cACvC,IAAI,CAAC,SAAS;eACb,IAAI,CAAC,UAAU;;EAE5B,CAAC;IAEH,CAAC;IA5BA,QAAQ;QACP,KAAK,CAAC,QAAQ,EAAE,CAAC;QACjB,IAAI,CAAC,IAAI,CAAC,KAAK;YAAE,OAAO;QACxB,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,CAAC;YAClF,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QACzC,CAAC;IACF,CAAC;;AAxBM,oBAAM,GAAG,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,GAAG,CAAA;;;;;;aAM/B,SAAS,CAAC,mBAAmB;kBACxB,SAAS,CAAC,mBAAmB;;;;;;;;;EAS7C,CAAC,AAhBW,CAgBV;AAlBS,aAAa;IADzB,aAAa,CAAC,mBAAmB,CAAC;GACtB,aAAa,CAgDzB","sourcesContent":["import constants from \"../../constants\";\nimport { css, html } from \"lit\";\nimport { customElement } from \"lit/decorators.js\";\nimport { BaseControl } from \"./baseControl\";\n\n@customElement('og-form-textinput')\nexport class FormTextInput extends BaseControl<string> {\n\n\tstatic styles = [...BaseControl.styles, css`\n\t\tinput {\n\t\t\tborder: 1px solid var(--og-accent-color);\n\t\t\tbackground-color: var(--og-form-background-color);\n\t\t\tcolor: var(--og-text-color);\n\t\t\tfont-size: var(--og-font-size);\n\t\t\theight: ${constants.FORM_CONTROL_HEIGHT}px;\n\t\t\tline-height: ${constants.FORM_CONTROL_HEIGHT}px;\n\t\t\toutline: none;\n\t\t\twidth: 100%;\n\t\t\tborder-radius: var(--og-base-radius);\n\t\t}\n\n\t\t:host([required]) input {\n\t\t\tborder: none;\n\t\t}\n\t`];\n\n\tvalidate() {\n\t\tsuper.validate();\n\t\tif (!this.model) return;\n\t\tif (this.model.props.pattern && !this.model.props.pattern.test(this.value ?? \"\")) {\n\t\t\tthis.model.errors.push('invalid value');\n\t\t}\n\t}\n\n\t_onChange = (e: InputEvent) => {\n\t\tthis.updateValue((e.target as HTMLInputElement).value);\n\t}\n\n\t_onKeyDown = (e: KeyboardEvent) => {\n\t\tif (e.key == 'Enter') {\n\t\t\tthis.updateValue((e.target as HTMLInputElement).value);\n\t\t}\n\t}\n\n\trender = () => html`\n\t\t<input\n\t\t\ttype=\"text\"\n\t\t\t.value=\"${this.value == null ? '' : this.value}\"\n\t\t\tplaceholder=\"${this.model?.props.placeholder ?? ''}\"\n\t\t\t@change=\"${this._onChange}\"\n\t\t\t@keydown=\"${this._onKeyDown}\"\n\t\t>\n\t`;\n\t\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"form.style.d.ts","sourceRoot":"","sources":["../../src/ui/form.style.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK,yBAsCjB,CAAC"}
1
+ {"version":3,"file":"form.style.d.ts","sourceRoot":"","sources":["../../src/ui/form.style.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK,yBAqCjB,CAAC"}
@@ -2,7 +2,6 @@ import { css } from "lit";
2
2
  export const style = css `
3
3
  :host {
4
4
  display: block;
5
- background-color: var(--og-form-background-color);
6
5
  font-size: var(--og-font-size);
7
6
  position: relative;
8
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"form.style.js","sourceRoot":"","sources":["../../src/ui/form.style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,KAAK,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCvB,CAAC","sourcesContent":["import { css } from \"lit\";\n\nexport const style = css`\n\t:host {\n\t\tdisplay: block;\n\t\tbackground-color: var(--og-form-background-color);\n\t\tfont-size: var(--og-font-size);\n\t\tposition: relative;\n\t}\n\n\t* {\n\t\tbox-sizing: border-box;\n\t}\n\n\t.body {\n\t\tpadding: 11px;\n\t}\n\n\ttable {\n\t\tborder-collapse: collapse;\n\t\twidth: 100%;\n\t\ttable-layout: fixed;\n\t}\n\n\ttable tr {\n\t\theight: 20px;\n\t}\n\n\ttable td {\n\t\tpadding: 2px 0;\n\t\toverflow: hidden;\n\t}\n\n\t.error {\n\t\tcolor: red;\n\t}\n\n\tog-overlay {\n\t\tmin-height: 200px;\n\t}\n`;"]}
1
+ {"version":3,"file":"form.style.js","sourceRoot":"","sources":["../../src/ui/form.style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,KAAK,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqCvB,CAAC","sourcesContent":["import { css } from \"lit\";\n\nexport const style = css`\n\t:host {\n\t\tdisplay: block;\n\t\tfont-size: var(--og-font-size);\n\t\tposition: relative;\n\t}\n\n\t* {\n\t\tbox-sizing: border-box;\n\t}\n\n\t.body {\n\t\tpadding: 11px;\n\t}\n\n\ttable {\n\t\tborder-collapse: collapse;\n\t\twidth: 100%;\n\t\ttable-layout: fixed;\n\t}\n\n\ttable tr {\n\t\theight: 20px;\n\t}\n\n\ttable td {\n\t\tpadding: 2px 0;\n\t\toverflow: hidden;\n\t}\n\n\t.error {\n\t\tcolor: red;\n\t}\n\n\tog-overlay {\n\t\tmin-height: 200px;\n\t}\n`;"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omegagrid/form",
3
- "version": "0.8.4",
3
+ "version": "0.9.0",
4
4
  "license": "UNLICENSED",
5
5
  "description": "Universal form component",
6
6
  "main": "./dist/index.js",
@@ -27,10 +27,10 @@
27
27
  "_prepublish": "yarn test && yarn lint"
28
28
  },
29
29
  "dependencies": {
30
- "@omegagrid/calendar": "^0.8.4",
31
- "@omegagrid/core": "^0.8.4",
32
- "@omegagrid/localize": "^0.8.4",
33
- "@omegagrid/tree": "^0.8.4",
30
+ "@omegagrid/calendar": "^0.9.0",
31
+ "@omegagrid/core": "^0.9.0",
32
+ "@omegagrid/localize": "^0.9.0",
33
+ "@omegagrid/tree": "^0.9.0",
34
34
  "lit": "^3.1.1",
35
35
  "lit-html": "^3.1.1",
36
36
  "ts-debounce": "^4.0.0"