-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from jadmsaadaot/add-postal-code
Add postalcode component
- Loading branch information
Showing
29 changed files
with
471 additions
and
47 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
var Constants = /** @class */ (function () { | ||
function Constants() { | ||
} | ||
Constants.DEFAULT_HELP_LINK = 'https://github.com/bcgov/common-hosted-form-service/wiki'; | ||
Constants.DEFAULT_HELP_LINK = ""; | ||
return Constants; | ||
}()); | ||
export { Constants }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import editForm from './Component.form'; | ||
declare const Component_base: any; | ||
export default class Component extends Component_base { | ||
static schema(...extend: any[]): any; | ||
static editForm: typeof editForm; | ||
static get builderInfo(): { | ||
title: string; | ||
group: string; | ||
icon: string; | ||
weight: number; | ||
documentation: string; | ||
schema: any; | ||
}; | ||
} | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default function (...extend: any[]): any; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { | ||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { | ||
if (ar || !(i in from)) { | ||
if (!ar) ar = Array.prototype.slice.call(from, 0, i); | ||
ar[i] = from[i]; | ||
} | ||
} | ||
return to.concat(ar || Array.prototype.slice.call(from)); | ||
}; | ||
import baseEditForm from 'formiojs/components/_classes/component/Component.form'; | ||
import EditDisplay from './editForm/Component.edit.display'; | ||
import SimpleConditional from '../Common/Simple.edit.conditional'; | ||
import SimpleValidation from '../Common/Simple.edit.validation'; | ||
export default function () { | ||
var extend = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
extend[_i] = arguments[_i]; | ||
} | ||
return baseEditForm.apply(void 0, __spreadArray([[ | ||
EditDisplay, | ||
{ | ||
key: 'data', | ||
ignore: true, | ||
}, | ||
{ | ||
key: 'api', | ||
ignore: true, | ||
}, | ||
{ | ||
key: 'layout', | ||
ignore: true, | ||
}, | ||
{ | ||
key: 'conditional', | ||
ignore: true, | ||
}, | ||
{ | ||
key: 'validation', | ||
ignore: true, | ||
}, | ||
{ | ||
key: 'logic', | ||
ignore: true, | ||
}, | ||
{ | ||
key: 'addons', | ||
ignore: true, | ||
}, | ||
{ | ||
label: 'Validation', | ||
key: 'customValidation', | ||
weight: 20, | ||
components: SimpleValidation, | ||
}, | ||
{ | ||
label: 'Conditional', | ||
key: 'customConditional', | ||
weight: 40, | ||
components: SimpleConditional, | ||
}, | ||
]], extend, false)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
if (typeof b !== "function" && b !== null) | ||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { | ||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { | ||
if (ar || !(i in from)) { | ||
if (!ar) ar = Array.prototype.slice.call(from, 0, i); | ||
ar[i] = from[i]; | ||
} | ||
} | ||
return to.concat(ar || Array.prototype.slice.call(from)); | ||
}; | ||
/* tslint:disable */ | ||
import { Components } from 'formiojs'; | ||
var ParentComponent = Components.components.phoneNumber; | ||
import editForm from './Component.form'; | ||
import { Constants } from '../Common/Constants'; | ||
var ID = 'simplepostalcode'; | ||
var DISPLAY = 'Postal Code'; | ||
var Component = /** @class */ (function (_super) { | ||
__extends(Component, _super); | ||
function Component() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
Component.schema = function () { | ||
var extend = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
extend[_i] = arguments[_i]; | ||
} | ||
return ParentComponent.schema.apply(ParentComponent, __spreadArray([{ | ||
type: ID, | ||
label: DISPLAY, | ||
key: ID, | ||
inputType: 'postalcode', | ||
inputFormat: 'plain', | ||
inputMask: '***', | ||
}], extend, false)); | ||
}; | ||
Object.defineProperty(Component, "builderInfo", { | ||
get: function () { | ||
return { | ||
title: DISPLAY, | ||
group: 'simple', | ||
icon: 'map', | ||
weight: 11, | ||
documentation: Constants.DEFAULT_HELP_LINK, | ||
schema: Component.schema(), | ||
}; | ||
}, | ||
enumerable: false, | ||
configurable: true | ||
}); | ||
Component.editForm = editForm; | ||
return Component; | ||
}(ParentComponent)); | ||
export default Component; |
18 changes: 18 additions & 0 deletions
18
lib/components/SimplePostalCode/editForm/Component.edit.data.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
declare const _default: ({ | ||
weight: number; | ||
type: string; | ||
label: string; | ||
tooltip: string; | ||
key: string; | ||
input: boolean; | ||
placeholder?: undefined; | ||
} | { | ||
type: string; | ||
label: string; | ||
key: string; | ||
weight: number; | ||
placeholder: string; | ||
tooltip: string; | ||
input: boolean; | ||
})[]; | ||
export default _default; |
11 changes: 11 additions & 0 deletions
11
lib/components/SimplePostalCode/editForm/Component.edit.data.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { | ||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { | ||
if (ar || !(i in from)) { | ||
if (!ar) ar = Array.prototype.slice.call(from, 0, i); | ||
ar[i] = from[i]; | ||
} | ||
} | ||
return to.concat(ar || Array.prototype.slice.call(from)); | ||
}; | ||
import common from '../../Common/Simple.edit.data'; | ||
export default __spreadArray([], common, true); |
15 changes: 15 additions & 0 deletions
15
lib/components/SimplePostalCode/editForm/Component.edit.display.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
declare const _default: { | ||
key: string; | ||
components: ({ | ||
key: string; | ||
ignore: boolean; | ||
} | { | ||
weight: number; | ||
type: string; | ||
input: boolean; | ||
key: string; | ||
label: string; | ||
tooltip: string; | ||
})[]; | ||
}; | ||
export default _default; |
43 changes: 43 additions & 0 deletions
43
lib/components/SimplePostalCode/editForm/Component.edit.display.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { | ||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { | ||
if (ar || !(i in from)) { | ||
if (!ar) ar = Array.prototype.slice.call(from, 0, i); | ||
ar[i] = from[i]; | ||
} | ||
} | ||
return to.concat(ar || Array.prototype.slice.call(from)); | ||
}; | ||
import common from '../../Common/Simple.edit.display'; | ||
export default { | ||
key: 'display', | ||
components: __spreadArray(__spreadArray([], common, true), [ | ||
{ | ||
key: 'refreshOnChange', | ||
ignore: true, | ||
}, | ||
{ | ||
key: 'className', | ||
ignore: true, | ||
}, | ||
{ | ||
key: 'prefix', | ||
ignore: true, | ||
}, | ||
{ | ||
key: 'suffix', | ||
ignore: true, | ||
}, | ||
{ | ||
key: 'placeholder', | ||
ignore: true, | ||
}, | ||
{ | ||
weight: 410, | ||
type: 'textfield', | ||
input: true, | ||
key: 'inputMask', | ||
label: 'Input Mask', | ||
tooltip: "An input mask helps the user with input by ensuring a predefined format.<br><br>9: numeric<br>a: alphabetical<br>*: alphanumeric<br><br>Example telephone mask: (999) 999-9999<br><br>See the <a target='_blank' href='https://github.com/RobinHerbots/jquery.inputmask'>jquery.inputmask documentation</a> for more information.</a>", | ||
}, | ||
], false), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.