@idevs/corelib 0.0.35 → 0.0.36

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.
@@ -8,7 +8,6 @@ import { Decorators, SelectEditor } from '@serenity-is/corelib';
8
8
  let DateMonthEditor = class DateMonthEditor extends SelectEditor {
9
9
  constructor(hidden, opt) {
10
10
  super(hidden, opt);
11
- this.months = [];
12
11
  this.updateItems();
13
12
  }
14
13
  getItemsList() {
@@ -20,6 +19,7 @@ let DateMonthEditor = class DateMonthEditor extends SelectEditor {
20
19
  if (opt.items != null && opt.items.length >= 1) {
21
20
  return opt.items;
22
21
  }
22
+ this.months = [];
23
23
  const locale = (_a = opt.locale) !== null && _a !== void 0 ? _a : 'en';
24
24
  const options = { month: (_b = opt.display) !== null && _b !== void 0 ? _b : '2-digit' };
25
25
  for (let i = 11; i >= 0; i--) {
@@ -36,7 +36,7 @@ let DateMonthEditor = class DateMonthEditor extends SelectEditor {
36
36
  }
37
37
  };
38
38
  DateMonthEditor = __decorate([
39
- Decorators.registerEditor('Serenity.DateMonthEditor')
39
+ Decorators.registerEditor('DateMonthEditor')
40
40
  ], DateMonthEditor);
41
41
  export { DateMonthEditor };
42
42
  //# sourceMappingURL=dateMonthEditor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dateMonthEditor.js","sourceRoot":"","sources":["../../src/editors/dateMonthEditor.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAuB,MAAM,sBAAsB,CAAA;AAG7E,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,YAAY;IAG/C,YAAY,MAAc,EAAE,GAA2B;QACrD,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;QAHZ,WAAM,GAAa,EAAE,CAAA;QAK3B,IAAI,CAAC,WAAW,EAAE,CAAA;IACpB,CAAC;IAED,YAAY;QACV,OAAO,IAAI,CAAC,MAAM,CAAA;IACpB,CAAC;IAED,QAAQ;;QACN,MAAM,GAAG,GAAG,IAAI,CAAC,OAAiC,CAAA;QAElD,IAAI,GAAG,CAAC,KAAK,IAAI,IAAI,IAAI,GAAG,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,EAAE;YAC9C,OAAO,GAAG,CAAC,KAAK,CAAA;SACjB;QAED,MAAM,MAAM,GAAG,MAAA,GAAG,CAAC,MAAM,mCAAI,IAAI,CAAA;QACjC,MAAM,OAAO,GAAG,EAAE,KAAK,EAAE,MAAA,GAAG,CAAC,OAAO,mCAAI,SAAS,EAAE,CAAA;QAEnD,KAAK,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;YAC5B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;SAC3E;QAED,IAAI,GAAG,CAAC,UAAU,EAAE;YAClB,OAAO,IAAI,CAAC,MAAM,CAAA;SACnB;QAED,MAAM,MAAM,GAAa,EAAE,CAAA;QAC3B,KAAK,IAAI,EAAE,GAAG,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE;YAC/B,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;SACvE;QAED,OAAO,MAAM,CAAA;IACf,CAAC;CACF,CAAA;AAtCY,eAAe;IAD3B,UAAU,CAAC,cAAc,CAAC,0BAA0B,CAAC;GACzC,eAAe,CAsC3B;SAtCY,eAAe","sourcesContent":["import { Decorators, SelectEditor, SelectEditorOptions } from '@serenity-is/corelib'\n\n@Decorators.registerEditor('Serenity.DateMonthEditor')\nexport class DateMonthEditor extends SelectEditor {\n private months: string[] = []\n\n constructor(hidden: JQuery, opt: DateMonthEditorOptions) {\n super(hidden, opt)\n\n this.updateItems()\n }\n\n getItemsList() {\n return this.months\n }\n\n getItems() {\n const opt = this.options as DateMonthEditorOptions\n\n if (opt.items != null && opt.items.length >= 1) {\n return opt.items\n }\n\n const locale = opt.locale ?? 'en'\n const options = { month: opt.display ?? '2-digit' }\n\n for (let i = 11; i >= 0; i--) {\n this.months.push(new Date(2000, i, 1).toLocaleDateString(locale, options))\n }\n\n if (opt.descending) {\n return this.months\n }\n\n const months: string[] = []\n for (let i1 = 0; i1 <= 11; i1++) {\n months.push(new Date(2000, i1, 1).toLocaleDateString(locale, options))\n }\n\n return months\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\nexport interface DateMonthEditorOptions extends SelectEditorOptions {\n display?: '2-digit' | 'short' | 'long'\n locale?: 'en' | 'th'\n descending?: boolean\n}\n"]}
1
+ {"version":3,"file":"dateMonthEditor.js","sourceRoot":"","sources":["../../src/editors/dateMonthEditor.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAuB,MAAM,sBAAsB,CAAA;AAG7E,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,YAAY;IAG/C,YAAY,MAAc,EAAE,GAA2B;QACrD,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;QAElB,IAAI,CAAC,WAAW,EAAE,CAAA;IACpB,CAAC;IAED,YAAY;QACV,OAAO,IAAI,CAAC,MAAM,CAAA;IACpB,CAAC;IAED,QAAQ;;QACN,MAAM,GAAG,GAAG,IAAI,CAAC,OAAiC,CAAA;QAElD,IAAI,GAAG,CAAC,KAAK,IAAI,IAAI,IAAI,GAAG,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC,EAAE;YAC9C,OAAO,GAAG,CAAC,KAAK,CAAA;SACjB;QAED,IAAI,CAAC,MAAM,GAAG,EAAE,CAAA;QAChB,MAAM,MAAM,GAAG,MAAA,GAAG,CAAC,MAAM,mCAAI,IAAI,CAAA;QACjC,MAAM,OAAO,GAAG,EAAE,KAAK,EAAE,MAAA,GAAG,CAAC,OAAO,mCAAI,SAAS,EAAE,CAAA;QAEnD,KAAK,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;YAC5B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;SAC3E;QAED,IAAI,GAAG,CAAC,UAAU,EAAE;YAClB,OAAO,IAAI,CAAC,MAAM,CAAA;SACnB;QAED,MAAM,MAAM,GAAa,EAAE,CAAA;QAC3B,KAAK,IAAI,EAAE,GAAG,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE;YAC/B,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;SACvE;QAED,OAAO,MAAM,CAAA;IACf,CAAC;CACF,CAAA;AAvCY,eAAe;IAD3B,UAAU,CAAC,cAAc,CAAC,iBAAiB,CAAC;GAChC,eAAe,CAuC3B;SAvCY,eAAe","sourcesContent":["import { Decorators, SelectEditor, SelectEditorOptions } from '@serenity-is/corelib'\n\n@Decorators.registerEditor('DateMonthEditor')\nexport class DateMonthEditor extends SelectEditor {\n private months: string[]\n\n constructor(hidden: JQuery, opt: DateMonthEditorOptions) {\n super(hidden, opt)\n\n this.updateItems()\n }\n\n getItemsList() {\n return this.months\n }\n\n getItems() {\n const opt = this.options as DateMonthEditorOptions\n\n if (opt.items != null && opt.items.length >= 1) {\n return opt.items\n }\n\n this.months = []\n const locale = opt.locale ?? 'en'\n const options = { month: opt.display ?? '2-digit' }\n\n for (let i = 11; i >= 0; i--) {\n this.months.push(new Date(2000, i, 1).toLocaleDateString(locale, options))\n }\n\n if (opt.descending) {\n return this.months\n }\n\n const months: string[] = []\n for (let i1 = 0; i1 <= 11; i1++) {\n months.push(new Date(2000, i1, 1).toLocaleDateString(locale, options))\n }\n\n return months\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/consistent-type-definitions\nexport interface DateMonthEditorOptions extends SelectEditorOptions {\n display?: '2-digit' | 'short' | 'long'\n locale?: 'en' | 'th'\n descending?: boolean\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@idevs/corelib",
3
- "version": "0.0.35",
3
+ "version": "0.0.36",
4
4
  "description": "Extended library for Serenity Framework",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -1,8 +1,8 @@
1
1
  import { Decorators, SelectEditor, SelectEditorOptions } from '@serenity-is/corelib'
2
2
 
3
- @Decorators.registerEditor('Serenity.DateMonthEditor')
3
+ @Decorators.registerEditor('DateMonthEditor')
4
4
  export class DateMonthEditor extends SelectEditor {
5
- private months: string[] = []
5
+ private months: string[]
6
6
 
7
7
  constructor(hidden: JQuery, opt: DateMonthEditorOptions) {
8
8
  super(hidden, opt)
@@ -21,6 +21,7 @@ export class DateMonthEditor extends SelectEditor {
21
21
  return opt.items
22
22
  }
23
23
 
24
+ this.months = []
24
25
  const locale = opt.locale ?? 'en'
25
26
  const options = { month: opt.display ?? '2-digit' }
26
27