PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.1.2
JetFormBuilder — Dynamic Blocks Form Builder v3.1.2
3.6.3.1 3.6.3 3.6.2.2 3.6.2.1 3.6.2 3.6.1.1 3.6.1 3.6.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.1.0 2.1.1 2.1.10 2.1.11 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 3.0.0 3.0.0.1 3.0.0.2 3.0.0.3 3.0.1 3.0.1.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.0.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.3.2 3.3.3 3.3.3.1 3.3.4 3.3.4.1 3.3.4.2 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.5.1 3.4.5.2 3.4.6 3.4.7 3.4.7.1 3.5.0 3.5.1 3.5.1.1 3.5.1.2 3.5.2 3.5.2.1 3.5.3 3.5.4 3.5.5 3.5.6 3.5.6.1 3.5.6.2 3.5.6.3 3.6.0
jetformbuilder / assets / src / admin-vuex-package / components / EntryColumnsTable.vue
jetformbuilder / assets / src / admin-vuex-package / components Last commit date
Alerts 2 years ago BoxActions 2 years ago PaymentsPage 2 years ago TableColumns 2 years ago VuiBoxes 2 years ago ActionsWithFilters.vue 2 years ago ChooseAction.vue 2 years ago ClearFiltersButton.vue 2 years ago DetailsTableWithStore.vue 2 years ago EntriesList.vue 2 years ago EntriesTable.vue 2 years ago EntriesTableSkeleton.vue 2 years ago EntryColumnList.vue 2 years ago EntryColumnsTable.vue 2 years ago FormBuilderPage.vue 2 years ago PageActions.vue 2 years ago PostBoxContainer.vue 2 years ago PostBoxGrid.vue 2 years ago PostBoxSimple.vue 2 years ago PostBoxSkeleton.vue 2 years ago PostBoxTable.vue 2 years ago SideBarBoxes.vue 2 years ago TablePagination.vue 2 years ago
EntryColumnsTable.vue
217 lines
1 <template>
2 <div
3 :class="getClasses"
4 >
5 <div
6 class="list-table-item__cell--body jfb-ellipsis"
7 >
8 <div
9 v-if="initial.editable && isEnableEdit"
10 class="list-table-item__cell--body-value jfb-control"
11 >
12 <keep-alive>
13 <component
14 :is="getComponentEditControl"
15 :options="initial.control_options"
16 v-model="editedCellValue"
17 />
18 </keep-alive>
19 </div>
20 <template v-else-if="getComponentColumn">
21 <component
22 :is="getComponentColumn"
23 :value="value"
24 :full-entry="entry"
25 :entry-id="entryId"
26 :scope="scope"
27 />
28 </template>
29 <template v-else-if="getComponentType">
30 <component
31 :is="getComponentType"
32 :value="value"
33 :full-entry="entry"
34 :entry-id="entryId"
35 :scope="scope"
36 />
37 </template>
38 <div
39 v-else
40 class="list-table-item__cell--body-value"
41 v-html="value"
42 />
43 </div>
44 <div
45 class="list-table-item__cell--actions"
46 v-if="initial.editable && editedCellValue !== initialValue"
47 >
48 <span
49 class="dashicons dashicons-undo"
50 @click="revertChangesColumn"
51 ></span>
52 </div>
53 </div>
54 </template>
55
56 <script>
57 import ScopeStoreMixin from '../mixins/ScopeStoreMixin';
58 import GetColumnComponent from '../mixins/GetColumnComponent';
59
60 export default {
61 name: 'EntryColumnsTable',
62 props: {
63 entry: Object,
64 column: String,
65 entryId: Number,
66 },
67 mixins: [ ScopeStoreMixin, GetColumnComponent ],
68 computed: {
69 initial() {
70 return this.entry[ this.column ] ?? {};
71 },
72 value() {
73 return this.initial.editable ? this.editedCellValue : this.initialValue;
74 },
75 initialValue() {
76 /**
77 * Such nesting can be subject
78 * to the use of a component with settings
79 *
80 * For example status with icon (icon_status)
81 */
82 return this.initial?.value ?? this.initial?.value?.value ?? false;
83 },
84 initialType() {
85 return this.initial?.type ?? 'string';
86 },
87 initialClasses() {
88 return this.initial?.classes ?? [];
89 },
90 getClasses() {
91 const classes = [
92 'list-table-item__cell',
93 'cell--' + this.column,
94 'cell-type--' + this.initialType,
95 ...this.initialClasses,
96 ];
97
98 if ( ! classes.includes( 'overflow-visible' ) && this.isShowOverflow ) {
99 classes.push( 'show-overflow' );
100 }
101
102 if ( this.initial.editable ) {
103 classes.push( 'is-editable' );
104 }
105
106 return classes;
107 },
108 editedCellValue: {
109 get() {
110 jfbEventBus.reactiveCounter;
111
112 return this.getter( 'editedCellValue', [ this.column, this.entry ] );
113 },
114 set( value ) {
115 this.commit( 'updateEditableCell', {
116 record: this.entry,
117 column: this.column,
118 initial: this.initialValue,
119 props: {
120 value,
121 },
122 } );
123 jfbEventBus.reactiveCounter ++;
124 },
125 },
126 isEnableEdit() {
127 jfbEventBus.reactiveCounter;
128
129 return this.getter( 'isEnableEdit' );
130 },
131 isShowOverflow() {
132 return this.getter( 'options/isShowOverflow' );
133 },
134 getComponentType() {
135 return this.getItemComponent( this.initialType );
136 },
137 getComponentColumn() {
138 return this.getItemComponent( this.column );
139 },
140 getComponentEditControl() {
141 return this.getColumnComponentByPrefix( this.initial?.control, 'control' );
142 },
143 },
144 methods: {
145 revertChangesColumn() {
146 this.commit( 'revertChangesColumn', {
147 record: this.entry,
148 column: this.column,
149 } );
150 jfbEventBus.reactiveCounter ++;
151 },
152 getItemComponent( column ) {
153 return this.getColumnComponentByPrefix( column, 'item' );
154 },
155 },
156 };
157 </script>
158
159 <style lang="scss">
160
161 .jfb-ellipsis {
162 overflow: hidden;
163 text-overflow: ellipsis;
164 }
165
166 .list-table-item__cell {
167 overflow: hidden;
168 text-overflow: ellipsis;
169
170 &.overflow-visible.overflow-visible {
171 overflow: visible;
172 }
173
174 &.is-editable {
175 display: flex;
176 justify-content: space-between;
177 column-gap: 1em;
178
179 span.dashicons {
180 transition: all 0.2s ease-in-out;
181 padding: 0.2em;
182 border-radius: 50%;
183 box-shadow: unset;
184 cursor: pointer;
185 background-color: #fff;
186 }
187 }
188 &--body {
189 flex: 1;
190 }
191
192 &--body-value {
193 overflow: hidden;
194 text-overflow: ellipsis;
195
196 &.jfb-control {
197 flex: 1;
198 padding: 0.1em;
199
200 & > * {
201 width: 100%;
202 }
203 }
204 }
205
206 &.show-overflow.show-overflow {
207 word-break: break-word;
208 white-space: normal;
209 line-height: 1.5;
210 }
211
212 &:hover .list-table-item__cell--body-is-editable span.dashicons:hover {
213 box-shadow: 0 0 8px #ccc;
214 }
215 }
216
217 </style>