@indigina/ui-kit 1.0.80 → 1.0.84

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.
@@ -2279,6 +2279,143 @@
2279
2279
  { type: core.RendererFactory2 }
2280
2280
  ]; };
2281
2281
 
2282
+ exports.KitDaterangeType = void 0;
2283
+ (function (KitDaterangeType) {
2284
+ KitDaterangeType["DEFAULT"] = "default";
2285
+ KitDaterangeType["BUTTON"] = "button";
2286
+ })(exports.KitDaterangeType || (exports.KitDaterangeType = {}));
2287
+ exports.KitDaterangeIconPosition = void 0;
2288
+ (function (KitDaterangeIconPosition) {
2289
+ KitDaterangeIconPosition["LEFT"] = "left";
2290
+ KitDaterangeIconPosition["RIGHT"] = "right";
2291
+ })(exports.KitDaterangeIconPosition || (exports.KitDaterangeIconPosition = {}));
2292
+ var KitDaterangeComponent = /** @class */ (function () {
2293
+ function KitDaterangeComponent() {
2294
+ this.type = exports.KitDaterangeType.DEFAULT;
2295
+ /**
2296
+ * Defines a value that is going to be applied as a daterange format
2297
+ */
2298
+ this.format = 'dd MMM yyyy';
2299
+ /**
2300
+ * Defines a state whether the component will be valid or not
2301
+ */
2302
+ this.isValid = true;
2303
+ /**
2304
+ * Defines a value which used to set position of the calendar icon
2305
+ */
2306
+ this.iconPosition = exports.KitDaterangeIconPosition.RIGHT;
2307
+ /**
2308
+ * Defines a value that is going to be applied as a start date form control
2309
+ */
2310
+ this.startDateControl = new forms.FormControl();
2311
+ /**
2312
+ * Defines a value that is going to be applied as an end date form control
2313
+ */
2314
+ this.endDateControl = new forms.FormControl();
2315
+ /**
2316
+ * An action which is emitted when start date changed
2317
+ */
2318
+ this.startDateChanged = new core.EventEmitter();
2319
+ /**
2320
+ * An action which is emitted when daterange popup closed
2321
+ */
2322
+ this.closed = new core.EventEmitter();
2323
+ /**
2324
+ * An action which is emitted when end date changed
2325
+ */
2326
+ this.endDateChanged = new core.EventEmitter();
2327
+ /**
2328
+ * An icon which will be used in a daterange input icon
2329
+ */
2330
+ this.icon = exports.KitSvgIcon.CALENDAR;
2331
+ this.KitDaterangeType = exports.KitDaterangeType;
2332
+ }
2333
+ KitDaterangeComponent.prototype.openCalendarPopup = function () {
2334
+ this.popup.activate();
2335
+ };
2336
+ KitDaterangeComponent.prototype.onStartDateChange = function (value) {
2337
+ this.startDateControl.patchValue(value);
2338
+ this.startDateControl.markAsDirty();
2339
+ this.startDateChanged.emit(value);
2340
+ };
2341
+ KitDaterangeComponent.prototype.onEndDateChange = function (value) {
2342
+ this.endDateControl.patchValue(value);
2343
+ this.endDateControl.markAsDirty();
2344
+ this.endDateChanged.emit(value);
2345
+ };
2346
+ KitDaterangeComponent.prototype.onBlur = function () {
2347
+ this.startDateControl.markAsTouched();
2348
+ this.endDateControl.markAsTouched();
2349
+ };
2350
+ KitDaterangeComponent.prototype.onClose = function () {
2351
+ var rangeValue = {
2352
+ start: this.startDateControl.value || this.defaultStartDate || null,
2353
+ end: this.endDateControl.value || this.defaultEndDate || null,
2354
+ };
2355
+ this.closed.emit(rangeValue);
2356
+ };
2357
+ return KitDaterangeComponent;
2358
+ }());
2359
+ KitDaterangeComponent.decorators = [
2360
+ { type: core.Component, args: [{
2361
+ selector: 'kit-daterange',
2362
+ template: "<div class=\"kit-daterange\"\n [class.disabled]=\"disabled\"\n [class.invalid]=\"!isValid\"\n [ngClass]=\"[iconPosition, type]\">\n <button #anchor\n class=\"daterange-button\"\n [disabled]=\"disabled\"\n (click)=\"openCalendarPopup()\">\n <div class=\"button-text\">{{ label }}</div>\n <kit-svg-icon *ngIf=\"icon\"\n class=\"button-icon\"\n [icon]=\"icon\"\n ></kit-svg-icon>\n </button>\n <kendo-daterange class=\"daterange-wrapper\">\n <div class=\"daterange-input-wrapper\">\n <kendo-label *ngIf=\"startLabel\" class=\"label display-block\"\n [text]=\"startLabel\"\n [for]=\"startInput\"\n ></kendo-label>\n <div class=\"daterange-input\">\n <kendo-dateinput #startInput\n kendoDateRangeStartInput\n [placeholder]=\"startPlaceholder\"\n [format]=\"format\"\n [value]=\"startDateControl.value || defaultStartDate\"\n [min]=\"min\"\n [disabled]=\"disabled\"\n (blur)=\"onBlur()\"\n (valueChange)=\"onStartDateChange($event)\"\n ></kendo-dateinput>\n <button class=\"daterange-input-button\"\n (click)=\"openCalendarPopup()\">\n <kit-svg-icon *ngIf=\"icon\"\n class=\"button-icon\"\n [icon]=\"icon\"\n ></kit-svg-icon>\n </button>\n </div>\n </div>\n <div class=\"daterange-input-wrapper\">\n <kendo-label *ngIf=\"endLabel\" class=\"label display-block\"\n [text]=\"endLabel\"\n [for]=\"endInput\"\n ></kendo-label>\n <div class=\"daterange-input\">\n <kendo-dateinput #endInput\n kendoDateRangeEndInput\n [placeholder]=\"endPlaceholder\"\n [format]=\"format\"\n [value]=\"endDateControl.value || defaultEndDate\"\n [max]=\"max\"\n [disabled]=\"disabled\"\n (blur)=\"onBlur()\"\n (valueChange)=\"onEndDateChange($event)\"\n ></kendo-dateinput>\n <button class=\"daterange-input-button\"\n (click)=\"openCalendarPopup()\">\n <kit-svg-icon *ngIf=\"icon\"\n class=\"button-icon\"\n [icon]=\"icon\"\n ></kit-svg-icon>\n </button>\n </div>\n </div>\n <kendo-daterange-popup *ngIf=\"type === KitDaterangeType.DEFAULT\"\n #popup appendTo=\"component\"\n (close)=\"onClose()\"></kendo-daterange-popup>\n <kendo-daterange-popup *ngIf=\"type === KitDaterangeType.BUTTON\"\n #popup appendTo=\"component\"\n [anchor]=\"$any(anchor)\"\n (close)=\"onClose()\"></kendo-daterange-popup>\n </kendo-daterange>\n <kit-input-message *ngIf=\"messageText\"\n [icon]=\"messageIcon\"\n [message]=\"messageText\"\n ></kit-input-message>\n</div>\n",
2363
+ changeDetection: core.ChangeDetectionStrategy.OnPush,
2364
+ encapsulation: core.ViewEncapsulation.None,
2365
+ styles: ["@charset \"UTF-8\";.display-flex{display:flex}.flex-align-items-center{align-items:center}.flex-justify-content-center{justify-content:center}.flex-justify-content-end{justify-content:flex-end}.display-block{display:block}.kit-daterange.button .daterange-button{display:flex}.kit-daterange.button .daterange-input-wrapper{display:none}.kit-daterange.invalid .daterange-button{border-color:#ef3e42;background-color:#f8e0e0}.kit-daterange.invalid .daterange-button .button-text{color:#27282a}.kit-daterange.invalid .k-input{color:#27282a;border-color:#ef3e42;background-color:#f8e0e0}.kit-daterange.disabled .daterange-button{border-color:#c1c7d0;background-color:#f3f4f6;cursor:default}.kit-daterange.disabled .daterange-button .button-text{color:#9a9fa6}.kit-daterange.disabled .daterange-button .button-icon{stroke:#c1c7d0}.kit-daterange.disabled .label{color:#74777d}.kit-daterange.disabled .k-input{color:#9a9fa6;border-color:#c1c7d0;background-color:#f3f4f6}.kit-daterange.disabled .daterange-input-button .button-icon{stroke:#c1c7d0}.kit-daterange.left .daterange-input-button{left:0;right:initial}.kit-daterange.left .k-input{padding:4px 8px 4px 28px}.kit-daterange.left .daterange-button{flex-direction:row-reverse}.kit-daterange .daterange-button{display:none;align-items:center;padding:8px;width:100%;height:34px;grid-gap:8px;gap:8px;border-radius:4px;border:1px solid #efefef;background:#ffffff;cursor:pointer}.kit-daterange .daterange-button:hover{border-color:#c1c7d0}.kit-daterange .daterange-button .button-text{flex-grow:1;color:#27282a;font-size:13px;text-align:left}.kit-daterange .daterange-button .button-icon{display:block;width:16px;height:16px;fill:transparent;stroke:#002a3a}.kit-daterange .daterange-wrapper{display:flex;grid-gap:8px;gap:8px}.kit-daterange .label{margin-bottom:4px;font-weight:500;font-size:13px;color:#a9a8a8}.kit-daterange .daterange-input{display:flex;align-items:center;position:relative}.kit-daterange .daterange-input:hover .k-input{border-color:#c1c7d0}.kit-daterange .daterange-input-button{position:absolute;right:0;padding:0 8px;border:none;background:none;cursor:pointer}.kit-daterange .daterange-input-button .button-icon{display:block;width:16px;height:16px;fill:transparent;stroke:#002a3a}.kit-daterange .kit-daterange-default{display:flex}.kit-daterange .k-dateinput-wrap{border:none;border-radius:0;background:none}.kit-daterange .k-dateinput-wrap.k-state-focused{box-shadow:none}.kit-daterange .k-dateinput-wrap.k-state-focused .k-input{border-color:#00b0ad}.kit-daterange .k-input{padding:4px 28px 4px 8px;width:100%;height:34px;font-size:13px;font-weight:400;color:#002a3a;border-radius:4px;background-color:#fff;border:1px solid #efefef}.kit-daterange .k-input::placeholder{color:#74777d}.kit-daterange .k-input::selection{background:#00b0ad}.kit-daterange .k-popup{border:1px solid #efefef;box-shadow:none}.kit-daterange .k-popup .k-calendar-header{margin-bottom:20px;padding:6px;font-size:14px;font-weight:500}.kit-daterange .k-popup .k-calendar-title{padding:0;color:#000;line-height:1.26}.kit-daterange .k-popup .k-button:hover:before{background:none}.kit-daterange .k-popup .k-button-icon{padding:0;width:16px;height:16px;color:#002a3a}.kit-daterange .k-popup .k-prev-view .k-icon:before,.kit-daterange .k-popup .k-next-view .k-icon:before{position:absolute;top:-2px}.kit-daterange .k-popup .k-prev-view .k-icon:before{content:\"\\e016\"}.kit-daterange .k-popup .k-next-view .k-icon:before{content:\"\\e014\"}.kit-daterange .k-popup .k-today{padding:0 6px;color:#56a2f7}.kit-daterange .k-popup .k-today:hover{color:#56a2f7}.kit-daterange .k-popup .k-calendar-th,.kit-daterange .k-popup .k-calendar-td{padding:0;width:40px;height:40px;color:#000;font-weight:500;font-size:13px;line-height:1}.kit-daterange .k-popup .k-calendar-th{height:24px}.kit-daterange .k-popup .k-calendar-td{border-radius:0;border:1px solid #dfdfdf}.kit-daterange .k-popup .k-calendar-td:hover .k-link{color:#56a2f7;background:#ffffff}.kit-daterange .k-popup .k-calendar-td.k-state-focused .k-link,.kit-daterange .k-popup .k-calendar-td.k-state-active .k-link{box-shadow:none}.kit-daterange .k-popup .k-calendar-td.k-range-start,.kit-daterange .k-popup .k-calendar-td.k-range-end{background:none}.kit-daterange .k-popup .k-calendar-td.k-range-start.k-today .k-link,.kit-daterange .k-popup .k-calendar-td.k-range-end.k-today .k-link{color:#fff}.kit-daterange .k-popup .k-calendar-td.k-range-start .k-link,.kit-daterange .k-popup .k-calendar-td.k-range-end .k-link{color:#fff;border:1px solid #dfdfdf;border-radius:50%;background:#56a2f7}.kit-daterange .k-popup .k-calendar-td.k-range-mid{background:#aad0fb}.kit-daterange .k-popup .k-calendar-td.k-today .k-link{color:#56a2f7}.kit-daterange .k-popup .k-calendar-td.k-other-month .k-link{color:#a9a8a8}.kit-daterange .k-popup .k-link{margin:0;padding:0;width:100%;height:100%}.kit-daterange .k-popup .k-calendar-view{padding:0;grid-gap:0;gap:0}.kit-daterange .k-popup .k-calendar-content{padding:0 10px 10px}.kit-daterange .k-popup .k-calendar-yearview .k-calendar-td,.kit-daterange .k-popup .k-calendar-decadeview .k-calendar-td,.kit-daterange .k-popup .k-calendar-centuryview .k-calendar-td{width:76px;height:76px}.kit-daterange .k-popup .k-range-split-start:after,.kit-daterange .k-popup .k-range-split-end:after{background-image:none}\n"]
2366
+ },] }
2367
+ ];
2368
+ KitDaterangeComponent.propDecorators = {
2369
+ type: [{ type: core.Input }],
2370
+ label: [{ type: core.Input }],
2371
+ startLabel: [{ type: core.Input }],
2372
+ endLabel: [{ type: core.Input }],
2373
+ startPlaceholder: [{ type: core.Input }],
2374
+ endPlaceholder: [{ type: core.Input }],
2375
+ format: [{ type: core.Input }],
2376
+ defaultStartDate: [{ type: core.Input }],
2377
+ defaultEndDate: [{ type: core.Input }],
2378
+ min: [{ type: core.Input }],
2379
+ max: [{ type: core.Input }],
2380
+ disabled: [{ type: core.Input }],
2381
+ isValid: [{ type: core.Input }],
2382
+ iconPosition: [{ type: core.Input }],
2383
+ messageIcon: [{ type: core.Input }],
2384
+ messageText: [{ type: core.Input }],
2385
+ startDateControl: [{ type: core.Input }],
2386
+ endDateControl: [{ type: core.Input }],
2387
+ startDateChanged: [{ type: core.Output }],
2388
+ closed: [{ type: core.Output }],
2389
+ endDateChanged: [{ type: core.Output }],
2390
+ popup: [{ type: core.ViewChild, args: ['popup', { read: kendoAngularDateinputs.DateRangePopupComponent },] }]
2391
+ };
2392
+
2393
+ var KitDaterangeModule = /** @class */ (function () {
2394
+ function KitDaterangeModule() {
2395
+ }
2396
+ return KitDaterangeModule;
2397
+ }());
2398
+ KitDaterangeModule.decorators = [
2399
+ { type: core.NgModule, args: [{
2400
+ declarations: [
2401
+ KitDaterangeComponent,
2402
+ ],
2403
+ imports: [
2404
+ common.CommonModule,
2405
+ kendoAngularDateinputs.DateInputsModule,
2406
+ kendoAngularLabel.LabelModule,
2407
+ KitSvgIconModule,
2408
+ KitInputMessageModule,
2409
+ ],
2410
+ exports: [
2411
+ KitDaterangeComponent,
2412
+ ],
2413
+ providers: [
2414
+ kendoAngularDateinputs.DateRangeService,
2415
+ ],
2416
+ },] }
2417
+ ];
2418
+
2282
2419
  // KitButton
2283
2420
 
2284
2421
  /**
@@ -2291,6 +2428,8 @@
2291
2428
  exports.KitButtonModule = KitButtonModule;
2292
2429
  exports.KitCheckboxComponent = KitCheckboxComponent;
2293
2430
  exports.KitCheckboxModule = KitCheckboxModule;
2431
+ exports.KitDaterangeComponent = KitDaterangeComponent;
2432
+ exports.KitDaterangeModule = KitDaterangeModule;
2294
2433
  exports.KitDatetimepickerComponent = KitDatetimepickerComponent;
2295
2434
  exports.KitDatetimepickerModule = KitDatetimepickerModule;
2296
2435
  exports.KitDropdownComponent = KitDropdownComponent;