@things-factory/id-rule-base 7.0.0-alpha.0 → 7.0.0-alpha.18

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.
@@ -143,18 +143,20 @@ export class GristCodeInputPopup extends LitElement {
143
143
  rule: `return ''`
144
144
  }
145
145
 
146
- return await client.mutate({
147
- mutation: gql`
148
- mutation createIdRule($idRule: NewIdRule!) {
149
- createIdRule(idRule: $idRule) {
150
- type
151
- rule
146
+ return (
147
+ await client.mutate({
148
+ mutation: gql`
149
+ mutation createIdRule($idRule: NewIdRule!) {
150
+ createIdRule(idRule: $idRule) {
151
+ type
152
+ rule
153
+ }
152
154
  }
153
- }
154
- `,
155
- variables: { idRule },
156
- context: gqlContext()
157
- })
155
+ `,
156
+ variables: { idRule },
157
+ context: gqlContext()
158
+ })
159
+ ).data?.createIdRule
158
160
  }
159
161
 
160
162
  async updateIdRule() {
@@ -44,6 +44,16 @@ export class GristCodeInput extends OxGristEditor {
44
44
  display: flex;
45
45
  overflow: hidden;
46
46
  }
47
+
48
+ input {
49
+ border: none;
50
+ background-color: transparent;
51
+ }
52
+
53
+ input:focus {
54
+ outline: none;
55
+ border: none;
56
+ }
47
57
  `
48
58
  }
49
59
 
@@ -57,13 +67,14 @@ export class GristCodeInput extends OxGristEditor {
57
67
 
58
68
  render() {
59
69
  return html`
60
- <text-input
70
+ <input
71
+ type="text"
61
72
  .value=${this.value}
62
73
  .record=${this.record}
63
74
  .column=${this.column}
64
75
  .field=${this.column}
65
76
  .row=${this.row}
66
- ></text-input>
77
+ ></input>
67
78
  <mwc-icon id="more" @click=${e => this.openPopup()}>more_vert</mwc-icon>
68
79
  `
69
80
  }
@@ -49,77 +49,77 @@ tslib_1.__decorate([
49
49
  tslib_1.__metadata("design:type", String)
50
50
  ], DocNumber.prototype, "id", void 0);
51
51
  tslib_1.__decorate([
52
- (0, typeorm_1.Column)({ name: 'code', type: 'character varying', nullable: false }),
53
- (0, type_graphql_1.Field)({ nullable: false }),
52
+ (0, typeorm_1.Column)(),
53
+ (0, type_graphql_1.Field)(),
54
54
  tslib_1.__metadata("design:type", String)
55
55
  ], DocNumber.prototype, "code", void 0);
56
56
  tslib_1.__decorate([
57
- (0, typeorm_1.Column)({ name: 'description', type: 'character varying', nullable: false }),
58
- (0, type_graphql_1.Field)({ nullable: false }),
57
+ (0, typeorm_1.Column)(),
58
+ (0, type_graphql_1.Field)(),
59
59
  tslib_1.__metadata("design:type", String)
60
60
  ], DocNumber.prototype, "description", void 0);
61
61
  tslib_1.__decorate([
62
- (0, typeorm_1.Column)({ name: 'prefix', type: 'character varying', nullable: true }),
62
+ (0, typeorm_1.Column)({ nullable: true }),
63
63
  (0, type_graphql_1.Field)({ nullable: true }),
64
64
  tslib_1.__metadata("design:type", String)
65
65
  ], DocNumber.prototype, "prefix", void 0);
66
66
  tslib_1.__decorate([
67
- (0, typeorm_1.Column)({ name: 'suffix', type: 'character varying', nullable: true }),
67
+ (0, typeorm_1.Column)({ nullable: true }),
68
68
  (0, type_graphql_1.Field)({ nullable: true }),
69
69
  tslib_1.__metadata("design:type", String)
70
70
  ], DocNumber.prototype, "suffix", void 0);
71
71
  tslib_1.__decorate([
72
- (0, typeorm_1.Column)({ name: 'start_no', type: 'integer', nullable: true }),
72
+ (0, typeorm_1.Column)({ type: 'integer', nullable: true }),
73
73
  (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
74
74
  tslib_1.__metadata("design:type", Number)
75
75
  ], DocNumber.prototype, "startNo", void 0);
76
76
  tslib_1.__decorate([
77
- (0, typeorm_1.Column)({ name: 'end_no', type: 'integer', nullable: true }),
77
+ (0, typeorm_1.Column)({ type: 'integer', nullable: true }),
78
78
  (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
79
79
  tslib_1.__metadata("design:type", Number)
80
80
  ], DocNumber.prototype, "endNo", void 0);
81
81
  tslib_1.__decorate([
82
- (0, typeorm_1.Column)({ name: 'current_no', type: 'integer', nullable: true }),
82
+ (0, typeorm_1.Column)({ type: 'integer', nullable: true }),
83
83
  (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
84
84
  tslib_1.__metadata("design:type", Number)
85
85
  ], DocNumber.prototype, "currentNo", void 0);
86
86
  tslib_1.__decorate([
87
- (0, typeorm_1.Column)({ name: 'update_interval', type: 'character varying', nullable: true }),
87
+ (0, typeorm_1.Column)({ nullable: true }),
88
88
  (0, type_graphql_1.Field)({ nullable: true }),
89
89
  tslib_1.__metadata("design:type", String)
90
90
  ], DocNumber.prototype, "updateInterval", void 0);
91
91
  tslib_1.__decorate([
92
- (0, typeorm_1.Column)({ name: 'use_db_seq_flag', type: 'boolean', nullable: true, default: false }),
92
+ (0, typeorm_1.Column)({ nullable: true, default: false }),
93
93
  (0, type_graphql_1.Field)({ nullable: true }),
94
94
  tslib_1.__metadata("design:type", Boolean)
95
95
  ], DocNumber.prototype, "useDbSeqFlag", void 0);
96
96
  tslib_1.__decorate([
97
- (0, typeorm_1.Column)({ name: 'seq_name', type: 'character varying', nullable: true }),
97
+ (0, typeorm_1.Column)({ nullable: true }),
98
98
  (0, type_graphql_1.Field)({ nullable: true }),
99
99
  tslib_1.__metadata("design:type", String)
100
100
  ], DocNumber.prototype, "seqName", void 0);
101
101
  tslib_1.__decorate([
102
- (0, typeorm_1.Column)({ name: 'seq_digit_num', type: 'integer', nullable: false }),
102
+ (0, typeorm_1.Column)({ type: 'integer', nullable: false }),
103
103
  (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: false }),
104
104
  tslib_1.__metadata("design:type", Number)
105
105
  ], DocNumber.prototype, "seqDigitNum", void 0);
106
106
  tslib_1.__decorate([
107
- (0, typeorm_1.Column)({ name: 'separator', type: 'character varying', nullable: true }),
107
+ (0, typeorm_1.Column)({ nullable: true }),
108
108
  (0, type_graphql_1.Field)({ nullable: true }),
109
109
  tslib_1.__metadata("design:type", String)
110
110
  ], DocNumber.prototype, "separator", void 0);
111
111
  tslib_1.__decorate([
112
- (0, typeorm_1.Column)({ name: 'expression', type: 'character varying', nullable: true }),
112
+ (0, typeorm_1.Column)({ nullable: true }),
113
113
  (0, type_graphql_1.Field)({ nullable: true }),
114
114
  tslib_1.__metadata("design:type", String)
115
115
  ], DocNumber.prototype, "expression", void 0);
116
116
  tslib_1.__decorate([
117
- (0, typeorm_1.Column)({ name: 'last_doc_number', type: 'character varying', nullable: true }),
117
+ (0, typeorm_1.Column)({ nullable: true }),
118
118
  (0, type_graphql_1.Field)({ nullable: true }),
119
119
  tslib_1.__metadata("design:type", String)
120
120
  ], DocNumber.prototype, "lastDocNumber", void 0);
121
121
  tslib_1.__decorate([
122
- (0, typeorm_1.Column)({ name: 'active_flag', type: 'boolean', nullable: true, default: false }),
122
+ (0, typeorm_1.Column)({ type: 'boolean', nullable: true, default: false }),
123
123
  (0, type_graphql_1.Field)({ nullable: true }),
124
124
  tslib_1.__metadata("design:type", Boolean)
125
125
  ], DocNumber.prototype, "activeFlag", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"doc-number.js","sourceRoot":"","sources":["../../../server/service/doc-number/doc-number.ts"],"names":[],"mappings":";;;;AACA,qCAUgB;AAChB,+CAAyD;AAEzD,yDAAgD;AAChD,iDAA8C;AAKvC,IAAM,SAAS,GAAf,MAAM,SAAS;IAgGpB,gBAAgB;QACd,IAAG,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,IAAI,CAAC,EAAE;YAClD,IAAG,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,GAAG,CAAC,EAAE;gBACpC,IAAI,CAAC,OAAO,GAAG,CAAC,CAAA;aACjB;YAED,IAAG,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,IAAI,CAAC,EAAE;gBACjC,IAAI,KAAK,GAAG,EAAE,CAAA;gBACd,KAAI,IAAI,CAAC,GAAG,CAAC,EAAG,CAAC,GAAG,IAAI,CAAC,WAAW,EAAG,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OAAO,CAAC;;4CACtC;AAElB;IAAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACd,IAAI;4CAAA;AAEhB;IAAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACd,IAAI;4CAAA;AAEhB;IAAC,IAAA,sBAAY,GAAE;;;;iDA6Cd;AA5IU,SAAS;IAHrB,IAAA,gBAAM,EAAC,aAAa,CAAC;IACrB,IAAA,eAAK,EAAC,iBAAiB,EAAE,CAAC,SAAoB,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,MAAM,EAAC,SAAS,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACvG,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,sBAAsB,EAAE,CAAC;GACvC,SAAS,CA6IrB;AA7IY,8BAAS","sourcesContent":["\nimport {\n CreateDateColumn,\n UpdateDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n PrimaryGeneratedColumn,\n BeforeInsert\n} from 'typeorm'\nimport { ObjectType, Field, Int, ID } from 'type-graphql'\n\nimport { User } from '@things-factory/auth-base'\nimport { Domain } from '@things-factory/shell'\n\n@Entity('doc_numbers')\n@Index('ix_doc_number_0', (docNumber: DocNumber) => [docNumber.domain,docNumber.code], { unique: true })\n@ObjectType({ description: 'Entity for DocNumber' })\nexport class DocNumber {\n\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @Column({ name:'code', type:'character varying', nullable:false })\n @Field({ nullable:false })\n code: string\n\n @Column({ name:'description', type:'character varying', nullable:false })\n @Field({ nullable:false })\n description: string\n\n @Column({ name:'prefix', type:'character varying', nullable:true })\n @Field({ nullable:true })\n prefix?: string\n\n @Column({ name:'suffix', type:'character varying', nullable:true })\n @Field({ nullable:true })\n suffix?: string\n\n @Column({ name:'start_no', type:'integer', nullable:true })\n @Field(type =>Int, { nullable:true })\n startNo?: number\n\n @Column({ name:'end_no', type:'integer', nullable:true })\n @Field(type =>Int, { nullable:true })\n endNo?: number\n\n @Column({ name:'current_no', type:'integer', nullable:true })\n @Field(type =>Int, { nullable:true })\n currentNo?: number\n\n @Column({ name:'update_interval', type:'character varying', nullable:true })\n @Field({ nullable:true })\n updateInterval?: string\n\n @Column({ name:'use_db_seq_flag', type:'boolean', nullable:true, default: false})\n @Field({ nullable:true })\n useDbSeqFlag?: boolean\n\n @Column({ name:'seq_name', type:'character varying', nullable:true })\n @Field({ nullable:true })\n seqName?: string\n\n @Column({ name:'seq_digit_num', type:'integer', nullable:false })\n @Field(type =>Int, { nullable:false })\n seqDigitNum: number\n\n @Column({ name:'separator', type:'character varying', nullable:true })\n @Field({ nullable:true })\n separator?: string\n\n @Column({ name:'expression', type:'character varying', nullable:true })\n @Field({ nullable:true })\n expression?: string\n\n @Column({ name:'last_doc_number', type:'character varying', nullable:true })\n @Field({ nullable:true })\n lastDocNumber?: string\n\n @Column({ name:'active_flag', type:'boolean', nullable:true ,default:false})\n @Field({ nullable:true })\n activeFlag?: boolean\n\n @ManyToOne(type => Domain, {createForeignKeyConstraints: false, nullable: false})\n @Field({ nullable: false })\n domain: Domain\n\n @RelationId((docNumber: DocNumber) => docNumber.domain)\n domainId: string\n\n @ManyToOne(type => User, {createForeignKeyConstraints: false, nullable: true})\n @Field({ nullable: true })\n creator?: User\n\n @RelationId((docNumber: DocNumber) => docNumber.creator)\n creatorId?: string\n\n @ManyToOne(type => User, {createForeignKeyConstraints: false, nullable: true})\n @Field({ nullable: true })\n updater?: User\n\n @RelationId((docNumber: DocNumber) => docNumber.updater)\n updaterId?: string\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @BeforeInsert()\n updateExpression() {\n if(!this.expression || this.expression.length == 0) {\n if(!this.startNo || this.startNo < 1) {\n this.startNo = 1\n }\n\n if(!this.endNo || this.endNo <= 1) {\n let maxNo = ''\n for(let i = 0 ; i < this.seqDigitNum ; i++) {\n maxNo = maxNo + '9'\n }\n this.endNo = Number(maxNo)\n }\n\n let expr = ''\n\n if(this.prefix) {\n expr = this.prefix\n \n if(this.separator) {\n expr += this.separator\n } \n }\n\n if(this.updateInterval && this.updateInterval != 'NONE') {\n expr += '${' + this.updateInterval + '}'\n\n if(this.separator) {\n expr += this.separator\n }\n }\n\n expr += '${SEQ}'\n\n if(this.suffix) {\n if(this.separator) {\n expr += this.separator\n }\n \n expr += this.suffix\n }\n\n this.expression = expr\n }\n }\n}\n"]}
1
+ {"version":3,"file":"doc-number.js","sourceRoot":"","sources":["../../../server/service/doc-number/doc-number.ts"],"names":[],"mappings":";;;;AAAA,qCAAgJ;AAChJ,+CAAyD;AAEzD,yDAAgD;AAChD,iDAA8C;AAKvC,IAAM,SAAS,GAAf,MAAM,SAAS;IA+FpB,gBAAgB;QACd,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,IAAI,CAAC,EAAE;YACnD,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,GAAG,CAAC,EAAE;gBACrC,IAAI,CAAC,OAAO,GAAG,CAAC,CAAA;aACjB;YAED,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,IAAI,CAAC,EAAE;gBAClC,IAAI,KAAK,GAAG,EAAE,CAAA;gBACd,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,EAAE,EAAE;oBACzC,KAAK,GAAG,KAAK,GAAG,GAAG,CAAA;iBACpB;gBACD,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA;aAC3B;YAED,IAAI,IAAI,GAAG,EAAE,CAAA;YAEb,IAAI,IAAI,CAAC,MAAM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I,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,2BAA2B,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC/E,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAChB,gBAAI;0CAAA;AAEd;IAAC,IAAA,oBAAU,EAAC,CAAC,SAAoB,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC;;4CACtC;AAElB;IAAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACd,IAAI;4CAAA;AAEhB;IAAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACd,IAAI;4CAAA;AAEhB;IAAC,IAAA,sBAAY,GAAE;;;;iDA6Cd;AA3IU,SAAS;IAHrB,IAAA,gBAAM,EAAC,aAAa,CAAC;IACrB,IAAA,eAAK,EAAC,iBAAiB,EAAE,CAAC,SAAoB,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACxG,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,sBAAsB,EAAE,CAAC;GACvC,SAAS,CA4IrB;AA5IY,8BAAS","sourcesContent":["import { CreateDateColumn, UpdateDateColumn, Entity, Index, Column, RelationId, ManyToOne, PrimaryGeneratedColumn, BeforeInsert } from 'typeorm'\nimport { ObjectType, Field, Int, ID } from 'type-graphql'\n\nimport { User } from '@things-factory/auth-base'\nimport { Domain } from '@things-factory/shell'\n\n@Entity('doc_numbers')\n@Index('ix_doc_number_0', (docNumber: DocNumber) => [docNumber.domain, docNumber.code], { unique: true })\n@ObjectType({ description: 'Entity for DocNumber' })\nexport class DocNumber {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @Column()\n @Field()\n code: string\n\n @Column()\n @Field()\n description: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n prefix?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n suffix?: string\n\n @Column({ type: 'integer', nullable: true })\n @Field(type => Int, { nullable: true })\n startNo?: number\n\n @Column({ type: 'integer', nullable: true })\n @Field(type => Int, { nullable: true })\n endNo?: number\n\n @Column({ type: 'integer', nullable: true })\n @Field(type => Int, { nullable: true })\n currentNo?: number\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n updateInterval?: string\n\n @Column({ nullable: true, default: false })\n @Field({ nullable: true })\n useDbSeqFlag?: boolean\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n seqName?: string\n\n @Column({ type: 'integer', nullable: false })\n @Field(type => Int, { nullable: false })\n seqDigitNum: number\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n separator?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n expression?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n lastDocNumber?: string\n\n @Column({ type: 'boolean', nullable: true, default: false })\n @Field({ nullable: true })\n activeFlag?: boolean\n\n @ManyToOne(type => Domain, { createForeignKeyConstraints: false, nullable: false })\n @Field({ nullable: false })\n domain: Domain\n\n @RelationId((docNumber: DocNumber) => docNumber.domain)\n domainId: string\n\n @ManyToOne(type => User, { createForeignKeyConstraints: false, nullable: true })\n @Field({ nullable: true })\n creator?: User\n\n @RelationId((docNumber: DocNumber) => docNumber.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { createForeignKeyConstraints: false, nullable: true })\n @Field({ nullable: true })\n updater?: User\n\n @RelationId((docNumber: DocNumber) => docNumber.updater)\n updaterId?: string\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n\n @BeforeInsert()\n updateExpression() {\n if (!this.expression || this.expression.length == 0) {\n if (!this.startNo || this.startNo < 1) {\n this.startNo = 1\n }\n\n if (!this.endNo || this.endNo <= 1) {\n let maxNo = ''\n for (let i = 0; i < this.seqDigitNum; i++) {\n maxNo = maxNo + '9'\n }\n this.endNo = Number(maxNo)\n }\n\n let expr = ''\n\n if (this.prefix) {\n expr = this.prefix\n\n if (this.separator) {\n expr += this.separator\n }\n }\n\n if (this.updateInterval && this.updateInterval != 'NONE') {\n expr += '${' + this.updateInterval + '}'\n\n if (this.separator) {\n expr += this.separator\n }\n }\n\n expr += '${SEQ}'\n\n if (this.suffix) {\n if (this.separator) {\n expr += this.separator\n }\n\n expr += this.suffix\n }\n\n this.expression = expr\n }\n }\n}\n"]}