Skip to content

Commit 97ac146

Browse files
committed
remove inbox element and style slotted directly
1 parent a841df6 commit 97ac146

File tree

6 files changed

+15
-77
lines changed

6 files changed

+15
-77
lines changed

README.md

+2-8
Original file line numberDiff line numberDiff line change
@@ -326,17 +326,11 @@ if you want to change opened date picker style please read [jb-calendar](https:/
326326
## add custom element in input box
327327

328328
in jb-input you can put icon or any other custom html DOM in input box. to doing so you just have to place custom DOM in `jb-date-input` tag and add `slot="start-section"` or `slot="end-section"` to place it before or after input field.
329-
for better result i suggest you use `jb-date-input-inbox-element` tag but its optional and you can use your own custom tag too.
330-
`jb-input-inbox-element` will add some style to make sure your icon will place in center and will not overflow nad make your job easier if you want more controll you can skip it and use your own tag.
331329
example:
332330

333331
```HTML
334332
<jb-date-input>
335-
<jb-date-input-inbox-element slot="end-section">
336-
<div>after</div>
337-
</jb-date-input-inbox-element>
338-
<jb-date-input-inbox-element slot="start-section">
339-
<div>before</div>
340-
</jb-date-input-inbox-element>
333+
<div slot="end-section">after</div>
334+
<div slot="start-section">before</div>
341335
</jb-date-input>
342336
```

lib/inbox-element/inbox-element.html

-3
This file was deleted.

lib/inbox-element/inbox-element.scss

-11
This file was deleted.

lib/inbox-element/inbox-element.ts

-51
This file was deleted.

lib/jb-date-input.scss

+12
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,18 @@
9595
}
9696
}
9797
}
98+
::slotted([slot="start-section"]), ::slotted([slot="end-section"]){
99+
height: 100%;
100+
display: flex;
101+
justify-content: center;
102+
align-items: center;
103+
max-height: 100%;
104+
overflow-y: hidden;
105+
background-color: transparent;
106+
padding: 8px 16px;
107+
width: auto;
108+
box-sizing: border-box;
109+
}
98110
}
99111

100112
.message-box {

lib/jb-date-input.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ import 'jb-calendar';
44
// eslint-disable-next-line no-duplicate-imports
55
import { JBCalendarWebComponent } from 'jb-calendar';
66

7-
import './inbox-element/inbox-element';
8-
// eslint-disable-next-line no-duplicate-imports
9-
import {JBDDateInputInboxElementWebComponent} from './inbox-element/inbox-element';
107
//import cloneDeep from 'lodash.clonedeep';
118

129
import { InputTypes, ValueTypes, ElementsObject, DateRestrictions, JBDateInputValueObject, ValueType, InputType, ValidationValue, JBCalendarValue } from './types';
@@ -17,7 +14,7 @@ import { ValidationHelper } from '../../../common/scripts/validation/validation-
1714
import { ValidationItem, WithValidation } from '../../../common/scripts/validation/validation-helper-types';
1815
import { requiredValidation } from './validations';
1916

20-
export {ValidationItem,InputTypes as JBDateInputInputTypes,ValueTypes, JBDateInputValueObject,JBDDateInputInboxElementWebComponent};
17+
export {ValidationItem,InputTypes as JBDateInputInputTypes,ValueTypes, JBDateInputValueObject};
2118

2219
if(HTMLElement== undefined){
2320
//in case of server render or old browser

0 commit comments

Comments
 (0)