lib-pajakio-v2 1.0.16 → 1.0.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.
- package/dist/lib-pajakio-v2.common.js +1114 -66
- package/dist/lib-pajakio-v2.common.js.map +1 -1
- package/dist/lib-pajakio-v2.css +1 -1
- package/dist/lib-pajakio-v2.umd.js +1114 -66
- package/dist/lib-pajakio-v2.umd.js.map +1 -1
- package/dist/lib-pajakio-v2.umd.min.js +1 -1
- package/dist/lib-pajakio-v2.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ComponentsLayout/NavigationMenu.vue +2 -1
- package/src/components/DashboardHeader/index.vue +24 -0
- package/src/components/Dropdown/DropdownCompany.vue +74 -0
- package/src/components/Form/FormWysiwyg.vue +1172 -0
- package/src/components/index.js +2 -0
- package/src/router/index.js +6 -0
- package/src/views/Header.vue +42 -0
- package/src/views/Wysiwyg.vue +166 -0
|
@@ -275,6 +275,17 @@ module.exports = function (argument) {
|
|
|
275
275
|
};
|
|
276
276
|
|
|
277
277
|
|
|
278
|
+
/***/ }),
|
|
279
|
+
|
|
280
|
+
/***/ "0f32":
|
|
281
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
282
|
+
|
|
283
|
+
"use strict";
|
|
284
|
+
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_index_vue_vue_type_style_index_0_id_faab9602_lang_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("7dd7");
|
|
285
|
+
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_index_vue_vue_type_style_index_0_id_faab9602_lang_scss__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_index_vue_vue_type_style_index_0_id_faab9602_lang_scss__WEBPACK_IMPORTED_MODULE_0__);
|
|
286
|
+
/* unused harmony reexport * */
|
|
287
|
+
|
|
288
|
+
|
|
278
289
|
/***/ }),
|
|
279
290
|
|
|
280
291
|
/***/ "1212":
|
|
@@ -311,17 +322,6 @@ if (!version && userAgent) {
|
|
|
311
322
|
module.exports = version;
|
|
312
323
|
|
|
313
324
|
|
|
314
|
-
/***/ }),
|
|
315
|
-
|
|
316
|
-
/***/ "137a":
|
|
317
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
318
|
-
|
|
319
|
-
"use strict";
|
|
320
|
-
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_DropdownCompany_vue_vue_type_style_index_0_id_111f6c38_lang_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("aa00");
|
|
321
|
-
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_DropdownCompany_vue_vue_type_style_index_0_id_111f6c38_lang_scss__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_DropdownCompany_vue_vue_type_style_index_0_id_111f6c38_lang_scss__WEBPACK_IMPORTED_MODULE_0__);
|
|
322
|
-
/* unused harmony reexport * */
|
|
323
|
-
|
|
324
|
-
|
|
325
325
|
/***/ }),
|
|
326
326
|
|
|
327
327
|
/***/ "13d2":
|
|
@@ -486,13 +486,6 @@ module.exports = Object.hasOwn || function hasOwn(it, key) {
|
|
|
486
486
|
};
|
|
487
487
|
|
|
488
488
|
|
|
489
|
-
/***/ }),
|
|
490
|
-
|
|
491
|
-
/***/ "1adc":
|
|
492
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
493
|
-
|
|
494
|
-
// extracted by mini-css-extract-plugin
|
|
495
|
-
|
|
496
489
|
/***/ }),
|
|
497
490
|
|
|
498
491
|
/***/ "1d80":
|
|
@@ -625,6 +618,17 @@ module.exports = function (options, source) {
|
|
|
625
618
|
};
|
|
626
619
|
|
|
627
620
|
|
|
621
|
+
/***/ }),
|
|
622
|
+
|
|
623
|
+
/***/ "240e":
|
|
624
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
625
|
+
|
|
626
|
+
"use strict";
|
|
627
|
+
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_DropdownCompany_vue_vue_type_style_index_0_id_267c0afa_lang_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("b176");
|
|
628
|
+
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_DropdownCompany_vue_vue_type_style_index_0_id_267c0afa_lang_scss__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_DropdownCompany_vue_vue_type_style_index_0_id_267c0afa_lang_scss__WEBPACK_IMPORTED_MODULE_0__);
|
|
629
|
+
/* unused harmony reexport * */
|
|
630
|
+
|
|
631
|
+
|
|
628
632
|
/***/ }),
|
|
629
633
|
|
|
630
634
|
/***/ "241c":
|
|
@@ -1376,6 +1380,13 @@ module.exports = function (argument) {
|
|
|
1376
1380
|
/* unused harmony reexport * */
|
|
1377
1381
|
|
|
1378
1382
|
|
|
1383
|
+
/***/ }),
|
|
1384
|
+
|
|
1385
|
+
/***/ "7dd7":
|
|
1386
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
1387
|
+
|
|
1388
|
+
// extracted by mini-css-extract-plugin
|
|
1389
|
+
|
|
1379
1390
|
/***/ }),
|
|
1380
1391
|
|
|
1381
1392
|
/***/ "8085":
|
|
@@ -1838,13 +1849,6 @@ module.exports = function (argument) {
|
|
|
1838
1849
|
/* unused harmony reexport * */
|
|
1839
1850
|
|
|
1840
1851
|
|
|
1841
|
-
/***/ }),
|
|
1842
|
-
|
|
1843
|
-
/***/ "aa00":
|
|
1844
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
1845
|
-
|
|
1846
|
-
// extracted by mini-css-extract-plugin
|
|
1847
|
-
|
|
1848
1852
|
/***/ }),
|
|
1849
1853
|
|
|
1850
1854
|
/***/ "aa8b":
|
|
@@ -1939,6 +1943,13 @@ module.exports = DESCRIPTORS && fails(function () {
|
|
|
1939
1943
|
/* unused harmony reexport * */
|
|
1940
1944
|
|
|
1941
1945
|
|
|
1946
|
+
/***/ }),
|
|
1947
|
+
|
|
1948
|
+
/***/ "b176":
|
|
1949
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
1950
|
+
|
|
1951
|
+
// extracted by mini-css-extract-plugin
|
|
1952
|
+
|
|
1942
1953
|
/***/ }),
|
|
1943
1954
|
|
|
1944
1955
|
/***/ "b42e":
|
|
@@ -2029,6 +2040,13 @@ module.exports = function (name) {
|
|
|
2029
2040
|
/* unused harmony reexport * */
|
|
2030
2041
|
|
|
2031
2042
|
|
|
2043
|
+
/***/ }),
|
|
2044
|
+
|
|
2045
|
+
/***/ "c028":
|
|
2046
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
2047
|
+
|
|
2048
|
+
// extracted by mini-css-extract-plugin
|
|
2049
|
+
|
|
2032
2050
|
/***/ }),
|
|
2033
2051
|
|
|
2034
2052
|
/***/ "c04e":
|
|
@@ -2063,17 +2081,6 @@ module.exports = function (input, pref) {
|
|
|
2063
2081
|
};
|
|
2064
2082
|
|
|
2065
2083
|
|
|
2066
|
-
/***/ }),
|
|
2067
|
-
|
|
2068
|
-
/***/ "c19a":
|
|
2069
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2070
|
-
|
|
2071
|
-
"use strict";
|
|
2072
|
-
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_index_vue_vue_type_style_index_0_id_102b4565_lang_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("1adc");
|
|
2073
|
-
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_index_vue_vue_type_style_index_0_id_102b4565_lang_scss__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_index_vue_vue_type_style_index_0_id_102b4565_lang_scss__WEBPACK_IMPORTED_MODULE_0__);
|
|
2074
|
-
/* unused harmony reexport * */
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
2084
|
/***/ }),
|
|
2078
2085
|
|
|
2079
2086
|
/***/ "c430":
|
|
@@ -2404,6 +2411,17 @@ exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
|
|
2404
2411
|
} : $propertyIsEnumerable;
|
|
2405
2412
|
|
|
2406
2413
|
|
|
2414
|
+
/***/ }),
|
|
2415
|
+
|
|
2416
|
+
/***/ "d831":
|
|
2417
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
2418
|
+
|
|
2419
|
+
"use strict";
|
|
2420
|
+
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_FormWysiwyg_vue_vue_type_style_index_0_id_52b4ebd4_lang_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("c028");
|
|
2421
|
+
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_FormWysiwyg_vue_vue_type_style_index_0_id_52b4ebd4_lang_scss__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_v16_dist_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_v16_dist_index_js_ref_1_1_FormWysiwyg_vue_vue_type_style_index_0_id_52b4ebd4_lang_scss__WEBPACK_IMPORTED_MODULE_0__);
|
|
2422
|
+
/* unused harmony reexport * */
|
|
2423
|
+
|
|
2424
|
+
|
|
2407
2425
|
/***/ }),
|
|
2408
2426
|
|
|
2409
2427
|
/***/ "d9b5":
|
|
@@ -2686,6 +2704,7 @@ __webpack_require__.d(__webpack_exports__, "DropdownCompany", function() { retur
|
|
|
2686
2704
|
__webpack_require__.d(__webpack_exports__, "ModalDialog", function() { return /* reexport */ ModalDialog; });
|
|
2687
2705
|
__webpack_require__.d(__webpack_exports__, "FormInputTag", function() { return /* reexport */ FormInputTag; });
|
|
2688
2706
|
__webpack_require__.d(__webpack_exports__, "FormTextarea", function() { return /* reexport */ FormTextarea; });
|
|
2707
|
+
__webpack_require__.d(__webpack_exports__, "FormWysiwyg", function() { return /* reexport */ FormWysiwyg; });
|
|
2689
2708
|
__webpack_require__.d(__webpack_exports__, "ExpansionPanel", function() { return /* reexport */ ExpansionPanel; });
|
|
2690
2709
|
__webpack_require__.d(__webpack_exports__, "AnimatedIconLogo", function() { return /* reexport */ AnimatedIconLogo; });
|
|
2691
2710
|
|
|
@@ -36842,16 +36861,16 @@ var DashboardFootervue_type_style_index_0_id_2dbadb09_lang_scss = __webpack_requ
|
|
|
36842
36861
|
const DashboardFooter_exports_ = /*#__PURE__*/exportHelper_default()(DashboardFootervue_type_script_lang_js, [['render',DashboardFootervue_type_template_id_2dbadb09_render]])
|
|
36843
36862
|
|
|
36844
36863
|
/* harmony default export */ var DashboardFooter = (DashboardFooter_exports_);
|
|
36845
|
-
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader-v16/dist??ref--1-1!./src/components/DashboardHeader/index.vue?vue&type=template&id=
|
|
36864
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader-v16/dist??ref--1-1!./src/components/DashboardHeader/index.vue?vue&type=template&id=faab9602
|
|
36846
36865
|
|
|
36847
|
-
const
|
|
36866
|
+
const DashboardHeadervue_type_template_id_faab9602_hoisted_1 = {
|
|
36848
36867
|
class: "dashboard-header box-shadow"
|
|
36849
36868
|
};
|
|
36850
|
-
const
|
|
36869
|
+
const DashboardHeadervue_type_template_id_faab9602_hoisted_2 = {
|
|
36851
36870
|
key: 0,
|
|
36852
36871
|
class: "header-left"
|
|
36853
36872
|
};
|
|
36854
|
-
const
|
|
36873
|
+
const DashboardHeadervue_type_template_id_faab9602_hoisted_3 = {
|
|
36855
36874
|
class: "company-name"
|
|
36856
36875
|
};
|
|
36857
36876
|
const _hoisted_4 = {
|
|
@@ -36910,12 +36929,12 @@ const _hoisted_20 = {
|
|
|
36910
36929
|
class: "flex flex-col"
|
|
36911
36930
|
};
|
|
36912
36931
|
const _hoisted_21 = ["onClick"];
|
|
36913
|
-
function
|
|
36932
|
+
function DashboardHeadervue_type_template_id_faab9602_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
36914
36933
|
const _component_base_icon = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("base-icon");
|
|
36915
36934
|
const _component_dropdown_company = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("dropdown-company");
|
|
36916
36935
|
const _component_typo_text = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("typo-text");
|
|
36917
36936
|
const _component_base_button = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("base-button");
|
|
36918
|
-
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div",
|
|
36937
|
+
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", DashboardHeadervue_type_template_id_faab9602_hoisted_1, [$props.showCompany ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", DashboardHeadervue_type_template_id_faab9602_hoisted_2, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_dropdown_company, {
|
|
36919
36938
|
options: $props.companyList,
|
|
36920
36939
|
style: {
|
|
36921
36940
|
"width": "100%",
|
|
@@ -36925,11 +36944,16 @@ function DashboardHeadervue_type_template_id_102b4565_render(_ctx, _cache, $prop
|
|
|
36925
36944
|
cardStyle: "",
|
|
36926
36945
|
onChange: $options.setSelectedCompany,
|
|
36927
36946
|
searchAble: ['companyName', 'companyNpwp'],
|
|
36928
|
-
emptyListMsg: "Perusahaan tidak ditemukan"
|
|
36947
|
+
emptyListMsg: "Perusahaan tidak ditemukan",
|
|
36948
|
+
enableInfiniteScroll: $props.enableCompanyInfiniteScroll,
|
|
36949
|
+
hasMore: $props.companyHasMore,
|
|
36950
|
+
isLoadingMore: $props.companyLoadingMore,
|
|
36951
|
+
scrollThreshold: $props.companyScrollThreshold,
|
|
36952
|
+
onLoadMore: $options.onCompanyLoadMore
|
|
36929
36953
|
}, {
|
|
36930
36954
|
list: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(({
|
|
36931
36955
|
item
|
|
36932
|
-
}) => [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p",
|
|
36956
|
+
}) => [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", DashboardHeadervue_type_template_id_faab9602_hoisted_3, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(item.companyName), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", _hoisted_4, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(item.companyNpwp), 1)]),
|
|
36933
36957
|
label: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(slotProps => [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_5, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_6, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", _hoisted_7, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])($props.selectedCompany.companyName), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", _hoisted_8, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])($props.selectedCompany.companyNpwp), 1)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_base_icon, {
|
|
36934
36958
|
iconName: "expand_more",
|
|
36935
36959
|
class: "chevron",
|
|
@@ -36938,7 +36962,7 @@ function DashboardHeadervue_type_template_id_102b4565_render(_ctx, _cache, $prop
|
|
|
36938
36962
|
})
|
|
36939
36963
|
}, null, 8, ["style"])])]),
|
|
36940
36964
|
_: 1
|
|
36941
|
-
}, 8, ["options", "onChange"])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_9, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_10, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_base_icon, {
|
|
36965
|
+
}, 8, ["options", "onChange", "enableInfiniteScroll", "hasMore", "isLoadingMore", "scrollThreshold", "onLoadMore"])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_9, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_10, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_base_icon, {
|
|
36942
36966
|
iconName: "notifications_none"
|
|
36943
36967
|
}), _cache[3] || (_cache[3] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", {
|
|
36944
36968
|
class: "notif-dot"
|
|
@@ -36991,22 +37015,22 @@ function DashboardHeadervue_type_template_id_102b4565_render(_ctx, _cache, $prop
|
|
|
36991
37015
|
onClick: _cache[2] || (_cache[2] = (...args) => $options.toggleMenu && $options.toggleMenu(...args))
|
|
36992
37016
|
})])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])]);
|
|
36993
37017
|
}
|
|
36994
|
-
// CONCATENATED MODULE: ./src/components/DashboardHeader/index.vue?vue&type=template&id=
|
|
37018
|
+
// CONCATENATED MODULE: ./src/components/DashboardHeader/index.vue?vue&type=template&id=faab9602
|
|
36995
37019
|
|
|
36996
|
-
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader-v16/dist??ref--1-1!./src/components/Dropdown/DropdownCompany.vue?vue&type=template&id=
|
|
37020
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader-v16/dist??ref--1-1!./src/components/Dropdown/DropdownCompany.vue?vue&type=template&id=267c0afa
|
|
36997
37021
|
|
|
36998
|
-
const
|
|
37022
|
+
const DropdownCompanyvue_type_template_id_267c0afa_hoisted_1 = {
|
|
36999
37023
|
key: 0,
|
|
37000
37024
|
class: "search-container flex"
|
|
37001
37025
|
};
|
|
37002
|
-
const
|
|
37026
|
+
const DropdownCompanyvue_type_template_id_267c0afa_hoisted_2 = {
|
|
37003
37027
|
class: "text-black"
|
|
37004
37028
|
};
|
|
37005
|
-
const
|
|
37006
|
-
const
|
|
37029
|
+
const DropdownCompanyvue_type_template_id_267c0afa_hoisted_3 = ["onClick"];
|
|
37030
|
+
const DropdownCompanyvue_type_template_id_267c0afa_hoisted_4 = {
|
|
37007
37031
|
class: "text-black"
|
|
37008
37032
|
};
|
|
37009
|
-
function
|
|
37033
|
+
function DropdownCompanyvue_type_template_id_267c0afa_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
37010
37034
|
const _component_base_icon = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("base-icon");
|
|
37011
37035
|
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", {
|
|
37012
37036
|
class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])([[{
|
|
@@ -37025,10 +37049,12 @@ function DropdownCompanyvue_type_template_id_111f6c38_render(_ctx, _cache, $prop
|
|
|
37025
37049
|
}, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderSlot"])(_ctx.$slots, "label", {
|
|
37026
37050
|
opened: $data.opened
|
|
37027
37051
|
})], 2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", {
|
|
37052
|
+
ref: "optionsContainer",
|
|
37028
37053
|
class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["select-options min-w-full", [{
|
|
37029
37054
|
'card-options': $props.cardStyle
|
|
37030
|
-
}]])
|
|
37031
|
-
|
|
37055
|
+
}]]),
|
|
37056
|
+
onScroll: _cache[3] || (_cache[3] = (...args) => $options.handleOptionsScroll && $options.handleOptionsScroll(...args))
|
|
37057
|
+
}, [$props.searchAble.length > 0 && $props.options.length > 1 ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", DropdownCompanyvue_type_template_id_267c0afa_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", {
|
|
37032
37058
|
style: {
|
|
37033
37059
|
"width": "100%"
|
|
37034
37060
|
},
|
|
@@ -37049,7 +37075,7 @@ function DropdownCompanyvue_type_template_id_111f6c38_render(_ctx, _cache, $prop
|
|
|
37049
37075
|
"font-weight": "bold",
|
|
37050
37076
|
"text-align": "center"
|
|
37051
37077
|
}
|
|
37052
|
-
}, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p",
|
|
37078
|
+
}, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", DropdownCompanyvue_type_template_id_267c0afa_hoisted_2, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])($props.emptyListMsg), 1)], 2)) : (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], {
|
|
37053
37079
|
key: 2
|
|
37054
37080
|
}, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])($options.filtredOptions, option => {
|
|
37055
37081
|
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", {
|
|
@@ -37060,14 +37086,21 @@ function DropdownCompanyvue_type_template_id_111f6c38_render(_ctx, _cache, $prop
|
|
|
37060
37086
|
}]])
|
|
37061
37087
|
}, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderSlot"])(_ctx.$slots, "list", {
|
|
37062
37088
|
item: option
|
|
37063
|
-
}, () => [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p",
|
|
37064
|
-
}), 128))
|
|
37089
|
+
}, () => [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", DropdownCompanyvue_type_template_id_267c0afa_hoisted_4, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(option.companyName), 1)])], 10, DropdownCompanyvue_type_template_id_267c0afa_hoisted_3);
|
|
37090
|
+
}), 128)), $props.enableInfiniteScroll && $props.isLoadingMore ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", {
|
|
37091
|
+
key: 3,
|
|
37092
|
+
class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["select-option loading-option", [{
|
|
37093
|
+
'card-option': $props.cardStyle
|
|
37094
|
+
}]])
|
|
37095
|
+
}, _cache[5] || (_cache[5] = [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", {
|
|
37096
|
+
class: "text-black"
|
|
37097
|
+
}, "Memuat data berikutnya...", -1)]), 2)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 34), $data.opened ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", {
|
|
37065
37098
|
key: 0,
|
|
37066
|
-
onClick: _cache[
|
|
37099
|
+
onClick: _cache[4] || (_cache[4] = (...args) => $options.toggle && $options.toggle(...args)),
|
|
37067
37100
|
class: "select-overlay"
|
|
37068
37101
|
})) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 2);
|
|
37069
37102
|
}
|
|
37070
|
-
// CONCATENATED MODULE: ./src/components/Dropdown/DropdownCompany.vue?vue&type=template&id=
|
|
37103
|
+
// CONCATENATED MODULE: ./src/components/Dropdown/DropdownCompany.vue?vue&type=template&id=267c0afa
|
|
37071
37104
|
|
|
37072
37105
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader-v16/dist??ref--1-1!./src/components/Dropdown/DropdownCompany.vue?vue&type=script&lang=js
|
|
37073
37106
|
|
|
@@ -37100,14 +37133,50 @@ function DropdownCompanyvue_type_template_id_111f6c38_render(_ctx, _cache, $prop
|
|
|
37100
37133
|
emptyListMsg: {
|
|
37101
37134
|
default: "Data tidak ditemukan",
|
|
37102
37135
|
type: String
|
|
37136
|
+
},
|
|
37137
|
+
enableInfiniteScroll: {
|
|
37138
|
+
type: Boolean,
|
|
37139
|
+
default: false
|
|
37140
|
+
},
|
|
37141
|
+
hasMore: {
|
|
37142
|
+
type: Boolean,
|
|
37143
|
+
default: false
|
|
37144
|
+
},
|
|
37145
|
+
isLoadingMore: {
|
|
37146
|
+
type: Boolean,
|
|
37147
|
+
default: false
|
|
37148
|
+
},
|
|
37149
|
+
scrollThreshold: {
|
|
37150
|
+
type: Number,
|
|
37151
|
+
default: 40
|
|
37103
37152
|
}
|
|
37104
37153
|
},
|
|
37105
37154
|
data() {
|
|
37106
37155
|
return {
|
|
37107
37156
|
opened: false,
|
|
37108
|
-
keyword: ""
|
|
37157
|
+
keyword: "",
|
|
37158
|
+
loadMoreLocked: false,
|
|
37159
|
+
loadMoreUnlockTimer: null
|
|
37109
37160
|
};
|
|
37110
37161
|
},
|
|
37162
|
+
watch: {
|
|
37163
|
+
isLoadingMore(value) {
|
|
37164
|
+
if (!value) {
|
|
37165
|
+
this.loadMoreLocked = false;
|
|
37166
|
+
}
|
|
37167
|
+
},
|
|
37168
|
+
hasMore(value) {
|
|
37169
|
+
if (!value) {
|
|
37170
|
+
this.loadMoreLocked = false;
|
|
37171
|
+
}
|
|
37172
|
+
}
|
|
37173
|
+
},
|
|
37174
|
+
beforeUnmount() {
|
|
37175
|
+
clearTimeout(this.loadMoreUnlockTimer);
|
|
37176
|
+
},
|
|
37177
|
+
beforeDestroy() {
|
|
37178
|
+
clearTimeout(this.loadMoreUnlockTimer);
|
|
37179
|
+
},
|
|
37111
37180
|
computed: {
|
|
37112
37181
|
filtredOptions() {
|
|
37113
37182
|
if (this.searchAble.length < 1) return this.options;
|
|
@@ -37131,13 +37200,33 @@ function DropdownCompanyvue_type_template_id_111f6c38_render(_ctx, _cache, $prop
|
|
|
37131
37200
|
return;
|
|
37132
37201
|
}
|
|
37133
37202
|
this.opened = !this.opened;
|
|
37203
|
+
},
|
|
37204
|
+
handleOptionsScroll(event) {
|
|
37205
|
+
if (!this.enableInfiniteScroll || !this.opened) return;
|
|
37206
|
+
if (!this.hasMore || this.isLoadingMore) return;
|
|
37207
|
+
if (this.loadMoreLocked) return;
|
|
37208
|
+
const target = event && event.target ? event.target : this.$refs.optionsContainer;
|
|
37209
|
+
if (!target) return;
|
|
37210
|
+
const distanceToBottom = target.scrollHeight - target.scrollTop - target.clientHeight;
|
|
37211
|
+
if (distanceToBottom <= this.scrollThreshold) {
|
|
37212
|
+
this.loadMoreLocked = true;
|
|
37213
|
+
this.$emit("load-more", {
|
|
37214
|
+
keyword: this.keyword
|
|
37215
|
+
});
|
|
37216
|
+
clearTimeout(this.loadMoreUnlockTimer);
|
|
37217
|
+
this.loadMoreUnlockTimer = setTimeout(() => {
|
|
37218
|
+
if (!this.isLoadingMore) {
|
|
37219
|
+
this.loadMoreLocked = false;
|
|
37220
|
+
}
|
|
37221
|
+
}, 500);
|
|
37222
|
+
}
|
|
37134
37223
|
}
|
|
37135
37224
|
}
|
|
37136
37225
|
});
|
|
37137
37226
|
// CONCATENATED MODULE: ./src/components/Dropdown/DropdownCompany.vue?vue&type=script&lang=js
|
|
37138
37227
|
|
|
37139
|
-
// EXTERNAL MODULE: ./src/components/Dropdown/DropdownCompany.vue?vue&type=style&index=0&id=
|
|
37140
|
-
var
|
|
37228
|
+
// EXTERNAL MODULE: ./src/components/Dropdown/DropdownCompany.vue?vue&type=style&index=0&id=267c0afa&lang=scss
|
|
37229
|
+
var DropdownCompanyvue_type_style_index_0_id_267c0afa_lang_scss = __webpack_require__("240e");
|
|
37141
37230
|
|
|
37142
37231
|
// CONCATENATED MODULE: ./src/components/Dropdown/DropdownCompany.vue
|
|
37143
37232
|
|
|
@@ -37147,7 +37236,7 @@ var DropdownCompanyvue_type_style_index_0_id_111f6c38_lang_scss = __webpack_requ
|
|
|
37147
37236
|
|
|
37148
37237
|
|
|
37149
37238
|
|
|
37150
|
-
const DropdownCompany_exports_ = /*#__PURE__*/exportHelper_default()(DropdownCompanyvue_type_script_lang_js, [['render',
|
|
37239
|
+
const DropdownCompany_exports_ = /*#__PURE__*/exportHelper_default()(DropdownCompanyvue_type_script_lang_js, [['render',DropdownCompanyvue_type_template_id_267c0afa_render]])
|
|
37151
37240
|
|
|
37152
37241
|
/* harmony default export */ var DropdownCompany = (DropdownCompany_exports_);
|
|
37153
37242
|
// EXTERNAL MODULE: ./node_modules/js-cookie/dist/js.cookie.js
|
|
@@ -37203,6 +37292,22 @@ var js_cookie_default = /*#__PURE__*/__webpack_require__.n(js_cookie);
|
|
|
37203
37292
|
apiApp: {
|
|
37204
37293
|
type: [String],
|
|
37205
37294
|
default: "http://api.staging.pajak.io/"
|
|
37295
|
+
},
|
|
37296
|
+
enableCompanyInfiniteScroll: {
|
|
37297
|
+
type: Boolean,
|
|
37298
|
+
default: false
|
|
37299
|
+
},
|
|
37300
|
+
companyHasMore: {
|
|
37301
|
+
type: Boolean,
|
|
37302
|
+
default: false
|
|
37303
|
+
},
|
|
37304
|
+
companyLoadingMore: {
|
|
37305
|
+
type: Boolean,
|
|
37306
|
+
default: false
|
|
37307
|
+
},
|
|
37308
|
+
companyScrollThreshold: {
|
|
37309
|
+
type: Number,
|
|
37310
|
+
default: 40
|
|
37206
37311
|
}
|
|
37207
37312
|
},
|
|
37208
37313
|
data() {
|
|
@@ -37248,6 +37353,9 @@ var js_cookie_default = /*#__PURE__*/__webpack_require__.n(js_cookie);
|
|
|
37248
37353
|
setSelectedCompany(value) {
|
|
37249
37354
|
this.$emit("setSelectedCompany", value);
|
|
37250
37355
|
},
|
|
37356
|
+
onCompanyLoadMore(payload) {
|
|
37357
|
+
this.$emit("loadMoreCompany", payload);
|
|
37358
|
+
},
|
|
37251
37359
|
formatNpwp(val) {
|
|
37252
37360
|
if (!val) return "";
|
|
37253
37361
|
return val.replace(/(\d{2})(\d{3})(\d{3})(\d{1})(\d{3})(\d{3})/, "$1.$2.$3.$4-$5.$6");
|
|
@@ -37310,8 +37418,8 @@ var js_cookie_default = /*#__PURE__*/__webpack_require__.n(js_cookie);
|
|
|
37310
37418
|
});
|
|
37311
37419
|
// CONCATENATED MODULE: ./src/components/DashboardHeader/index.vue?vue&type=script&lang=js
|
|
37312
37420
|
|
|
37313
|
-
// EXTERNAL MODULE: ./src/components/DashboardHeader/index.vue?vue&type=style&index=0&id=
|
|
37314
|
-
var
|
|
37421
|
+
// EXTERNAL MODULE: ./src/components/DashboardHeader/index.vue?vue&type=style&index=0&id=faab9602&lang=scss
|
|
37422
|
+
var DashboardHeadervue_type_style_index_0_id_faab9602_lang_scss = __webpack_require__("0f32");
|
|
37315
37423
|
|
|
37316
37424
|
// CONCATENATED MODULE: ./src/components/DashboardHeader/index.vue
|
|
37317
37425
|
|
|
@@ -37321,7 +37429,7 @@ var DashboardHeadervue_type_style_index_0_id_102b4565_lang_scss = __webpack_requ
|
|
|
37321
37429
|
|
|
37322
37430
|
|
|
37323
37431
|
|
|
37324
|
-
const DashboardHeader_exports_ = /*#__PURE__*/exportHelper_default()(DashboardHeadervue_type_script_lang_js, [['render',
|
|
37432
|
+
const DashboardHeader_exports_ = /*#__PURE__*/exportHelper_default()(DashboardHeadervue_type_script_lang_js, [['render',DashboardHeadervue_type_template_id_faab9602_render]])
|
|
37325
37433
|
|
|
37326
37434
|
/* harmony default export */ var DashboardHeader = (DashboardHeader_exports_);
|
|
37327
37435
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader-v16/dist??ref--1-1!./src/components/DatePicker/index.vue?vue&type=template&id=dd52aaa6
|
|
@@ -41983,6 +42091,945 @@ var FormTextareavue_type_style_index_0_id_4b6a6dc5_lang_scss = __webpack_require
|
|
|
41983
42091
|
const FormTextarea_exports_ = /*#__PURE__*/exportHelper_default()(FormTextareavue_type_script_lang_js, [['render',FormTextareavue_type_template_id_4b6a6dc5_render]])
|
|
41984
42092
|
|
|
41985
42093
|
/* harmony default export */ var FormTextarea = (FormTextarea_exports_);
|
|
42094
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader-v16/dist??ref--1-1!./src/components/Form/FormWysiwyg.vue?vue&type=template&id=52b4ebd4
|
|
42095
|
+
|
|
42096
|
+
const FormWysiwygvue_type_template_id_52b4ebd4_hoisted_1 = {
|
|
42097
|
+
class: "form-wysiwyg flex flex-col"
|
|
42098
|
+
};
|
|
42099
|
+
const FormWysiwygvue_type_template_id_52b4ebd4_hoisted_2 = {
|
|
42100
|
+
class: "w-full"
|
|
42101
|
+
};
|
|
42102
|
+
const FormWysiwygvue_type_template_id_52b4ebd4_hoisted_3 = {
|
|
42103
|
+
key: 0,
|
|
42104
|
+
class: "toolbar"
|
|
42105
|
+
};
|
|
42106
|
+
const FormWysiwygvue_type_template_id_52b4ebd4_hoisted_4 = {
|
|
42107
|
+
key: 0,
|
|
42108
|
+
class: "toolbar-divider"
|
|
42109
|
+
};
|
|
42110
|
+
const FormWysiwygvue_type_template_id_52b4ebd4_hoisted_5 = ["disabled", "title", "onClick"];
|
|
42111
|
+
const FormWysiwygvue_type_template_id_52b4ebd4_hoisted_6 = {
|
|
42112
|
+
key: 1,
|
|
42113
|
+
class: "toolbar-text"
|
|
42114
|
+
};
|
|
42115
|
+
const FormWysiwygvue_type_template_id_52b4ebd4_hoisted_7 = ["contenteditable", "data-placeholder"];
|
|
42116
|
+
const FormWysiwygvue_type_template_id_52b4ebd4_hoisted_8 = ["innerHTML"];
|
|
42117
|
+
function FormWysiwygvue_type_template_id_52b4ebd4_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
42118
|
+
const _component_base_icon = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("base-icon");
|
|
42119
|
+
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", FormWysiwygvue_type_template_id_52b4ebd4_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", {
|
|
42120
|
+
class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(`label-${$props.labelPosition}`)
|
|
42121
|
+
}, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderSlot"])(_ctx.$slots, "label"), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", FormWysiwygvue_type_template_id_52b4ebd4_hoisted_2, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", {
|
|
42122
|
+
class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["editor-group", {
|
|
42123
|
+
error: $props.error,
|
|
42124
|
+
disabled: $props.disabled,
|
|
42125
|
+
readonly: $props.readonly && !$props.disabled
|
|
42126
|
+
}])
|
|
42127
|
+
}, [$props.showToolbar ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", FormWysiwygvue_type_template_id_52b4ebd4_hoisted_3, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])($options.resolvedToolbar, (item, index) => {
|
|
42128
|
+
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], {
|
|
42129
|
+
key: `${item.action}-${index}`
|
|
42130
|
+
}, [item.action === 'divider' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", FormWysiwygvue_type_template_id_52b4ebd4_hoisted_4)) : (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("button", {
|
|
42131
|
+
key: 1,
|
|
42132
|
+
type: "button",
|
|
42133
|
+
class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["toolbar-button", {
|
|
42134
|
+
active: $options.isActionActive(item)
|
|
42135
|
+
}]),
|
|
42136
|
+
disabled: $options.isActionDisabled(item),
|
|
42137
|
+
title: item.title || item.label,
|
|
42138
|
+
onMousedown: _cache[0] || (_cache[0] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])(() => {}, ["prevent"])),
|
|
42139
|
+
onClick: $event => $options.handleToolbarAction(item)
|
|
42140
|
+
}, [item.icon ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(_component_base_icon, {
|
|
42141
|
+
key: 0,
|
|
42142
|
+
iconName: item.icon,
|
|
42143
|
+
width: "18",
|
|
42144
|
+
height: "18",
|
|
42145
|
+
color: $options.isActionActive(item) ? '#3e7dc0' : '#59636E'
|
|
42146
|
+
}, null, 8, ["iconName", "color"])) : (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", FormWysiwygvue_type_template_id_52b4ebd4_hoisted_6, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(item.label), 1))], 42, FormWysiwygvue_type_template_id_52b4ebd4_hoisted_5))], 64);
|
|
42147
|
+
}), 128))])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", {
|
|
42148
|
+
ref: "imageInputRef",
|
|
42149
|
+
type: "file",
|
|
42150
|
+
class: "image-input",
|
|
42151
|
+
accept: "image/*",
|
|
42152
|
+
onChange: _cache[1] || (_cache[1] = (...args) => $options.handleImageSelected && $options.handleImageSelected(...args))
|
|
42153
|
+
}, null, 544), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", {
|
|
42154
|
+
class: "editor-wrapper",
|
|
42155
|
+
style: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeStyle"])($options.editorStyle)
|
|
42156
|
+
}, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", {
|
|
42157
|
+
ref: "editorRef",
|
|
42158
|
+
class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["editor-area", {
|
|
42159
|
+
'is-empty': $data.isEmpty
|
|
42160
|
+
}]),
|
|
42161
|
+
contenteditable: $options.isEditable,
|
|
42162
|
+
"data-placeholder": $props.placeholder,
|
|
42163
|
+
onInput: _cache[2] || (_cache[2] = (...args) => $options.handleInput && $options.handleInput(...args)),
|
|
42164
|
+
onFocus: _cache[3] || (_cache[3] = (...args) => $options.handleFocus && $options.handleFocus(...args)),
|
|
42165
|
+
onBlur: _cache[4] || (_cache[4] = (...args) => $options.handleBlur && $options.handleBlur(...args)),
|
|
42166
|
+
onPaste: _cache[5] || (_cache[5] = (...args) => $options.handlePaste && $options.handlePaste(...args)),
|
|
42167
|
+
onMouseup: _cache[6] || (_cache[6] = (...args) => $options.refreshToolbarState && $options.refreshToolbarState(...args)),
|
|
42168
|
+
onKeyup: _cache[7] || (_cache[7] = (...args) => $options.refreshToolbarState && $options.refreshToolbarState(...args)),
|
|
42169
|
+
onMousedown: _cache[8] || (_cache[8] = (...args) => $options.handleEditorMouseDown && $options.handleEditorMouseDown(...args)),
|
|
42170
|
+
onMousemove: _cache[9] || (_cache[9] = (...args) => $options.handleEditorMouseMove && $options.handleEditorMouseMove(...args)),
|
|
42171
|
+
onMouseleave: _cache[10] || (_cache[10] = (...args) => $options.handleEditorMouseLeave && $options.handleEditorMouseLeave(...args))
|
|
42172
|
+
}, null, 42, FormWysiwygvue_type_template_id_52b4ebd4_hoisted_7)], 4)], 2), $props.message ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", {
|
|
42173
|
+
key: 0,
|
|
42174
|
+
class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["helper-text", {
|
|
42175
|
+
'error-helper': $props.error
|
|
42176
|
+
}])
|
|
42177
|
+
}, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", {
|
|
42178
|
+
innerHTML: $props.message
|
|
42179
|
+
}, null, 8, FormWysiwygvue_type_template_id_52b4ebd4_hoisted_8)], 2)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])], 2)]);
|
|
42180
|
+
}
|
|
42181
|
+
// CONCATENATED MODULE: ./src/components/Form/FormWysiwyg.vue?vue&type=template&id=52b4ebd4
|
|
42182
|
+
|
|
42183
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader-v16/dist??ref--1-1!./src/components/Form/FormWysiwyg.vue?vue&type=script&lang=js
|
|
42184
|
+
|
|
42185
|
+
const TOOLBAR_ITEMS = {
|
|
42186
|
+
paragraph: {
|
|
42187
|
+
action: "paragraph",
|
|
42188
|
+
label: "P",
|
|
42189
|
+
title: "Paragraph"
|
|
42190
|
+
},
|
|
42191
|
+
heading1: {
|
|
42192
|
+
action: "heading1",
|
|
42193
|
+
label: "H1",
|
|
42194
|
+
title: "Heading 1"
|
|
42195
|
+
},
|
|
42196
|
+
heading2: {
|
|
42197
|
+
action: "heading2",
|
|
42198
|
+
label: "H2",
|
|
42199
|
+
title: "Heading 2"
|
|
42200
|
+
},
|
|
42201
|
+
bold: {
|
|
42202
|
+
action: "bold",
|
|
42203
|
+
icon: "format_bold",
|
|
42204
|
+
title: "Bold"
|
|
42205
|
+
},
|
|
42206
|
+
italic: {
|
|
42207
|
+
action: "italic",
|
|
42208
|
+
icon: "format_italic",
|
|
42209
|
+
title: "Italic"
|
|
42210
|
+
},
|
|
42211
|
+
underline: {
|
|
42212
|
+
action: "underline",
|
|
42213
|
+
icon: "format_underlined",
|
|
42214
|
+
title: "Underline"
|
|
42215
|
+
},
|
|
42216
|
+
strikeThrough: {
|
|
42217
|
+
action: "strikeThrough",
|
|
42218
|
+
icon: "strikethrough_s",
|
|
42219
|
+
title: "Strikethrough"
|
|
42220
|
+
},
|
|
42221
|
+
unorderedList: {
|
|
42222
|
+
action: "unorderedList",
|
|
42223
|
+
icon: "format_list_bulleted",
|
|
42224
|
+
title: "Bullet List"
|
|
42225
|
+
},
|
|
42226
|
+
orderedList: {
|
|
42227
|
+
action: "orderedList",
|
|
42228
|
+
icon: "format_list_numbered",
|
|
42229
|
+
title: "Numbered List"
|
|
42230
|
+
},
|
|
42231
|
+
blockquote: {
|
|
42232
|
+
action: "blockquote",
|
|
42233
|
+
icon: "format_quote",
|
|
42234
|
+
title: "Quote"
|
|
42235
|
+
},
|
|
42236
|
+
alignLeft: {
|
|
42237
|
+
action: "alignLeft",
|
|
42238
|
+
icon: "format_align_left",
|
|
42239
|
+
title: "Align Left"
|
|
42240
|
+
},
|
|
42241
|
+
alignCenter: {
|
|
42242
|
+
action: "alignCenter",
|
|
42243
|
+
icon: "format_align_center",
|
|
42244
|
+
title: "Align Center"
|
|
42245
|
+
},
|
|
42246
|
+
alignRight: {
|
|
42247
|
+
action: "alignRight",
|
|
42248
|
+
icon: "format_align_right",
|
|
42249
|
+
title: "Align Right"
|
|
42250
|
+
},
|
|
42251
|
+
alignJustify: {
|
|
42252
|
+
action: "alignJustify",
|
|
42253
|
+
icon: "format_align_justify",
|
|
42254
|
+
title: "Justify"
|
|
42255
|
+
},
|
|
42256
|
+
link: {
|
|
42257
|
+
action: "link",
|
|
42258
|
+
icon: "insert_link",
|
|
42259
|
+
title: "Insert Link"
|
|
42260
|
+
},
|
|
42261
|
+
insertImage: {
|
|
42262
|
+
action: "insertImage",
|
|
42263
|
+
icon: "insert_photo",
|
|
42264
|
+
title: "Insert Image"
|
|
42265
|
+
},
|
|
42266
|
+
unlink: {
|
|
42267
|
+
action: "unlink",
|
|
42268
|
+
icon: "link_off",
|
|
42269
|
+
title: "Remove Link"
|
|
42270
|
+
},
|
|
42271
|
+
undo: {
|
|
42272
|
+
action: "undo",
|
|
42273
|
+
icon: "undo",
|
|
42274
|
+
title: "Undo"
|
|
42275
|
+
},
|
|
42276
|
+
redo: {
|
|
42277
|
+
action: "redo",
|
|
42278
|
+
icon: "redo",
|
|
42279
|
+
title: "Redo"
|
|
42280
|
+
},
|
|
42281
|
+
clear: {
|
|
42282
|
+
action: "clear",
|
|
42283
|
+
icon: "format_clear",
|
|
42284
|
+
title: "Clear Format"
|
|
42285
|
+
},
|
|
42286
|
+
divider: {
|
|
42287
|
+
action: "divider"
|
|
42288
|
+
}
|
|
42289
|
+
};
|
|
42290
|
+
const DEFAULT_TOOLBAR = ["paragraph", "heading1", "heading2", "divider", "bold", "italic", "underline", "strikeThrough", "divider", "unorderedList", "orderedList", "blockquote", "divider", "alignLeft", "alignCenter", "alignRight", "alignJustify", "divider", "link", "insertImage", "unlink", "divider", "undo", "redo", "clear"];
|
|
42291
|
+
const ALIGNABLE_TAGS = ["P", "DIV", "H1", "H2", "H3", "BLOCKQUOTE", "LI", "PRE"];
|
|
42292
|
+
const SAFE_PROTOCOLS = ["http://", "https://", "mailto:", "tel:"];
|
|
42293
|
+
const SAFE_IMAGE_PROTOCOLS = ["http://", "https://", "data:image/", "blob:", "/"];
|
|
42294
|
+
const IMAGE_MIN_WIDTH = 40;
|
|
42295
|
+
const IMAGE_RESIZE_HANDLE_GAP = 16;
|
|
42296
|
+
const ALLOWED_TAGS = ["A", "B", "BLOCKQUOTE", "BR", "CODE", "DIV", "EM", "H1", "H2", "H3", "I", "IMG", "LI", "OL", "P", "PRE", "S", "SPAN", "STRIKE", "STRONG", "U", "UL"];
|
|
42297
|
+
/* harmony default export */ var FormWysiwygvue_type_script_lang_js = ({
|
|
42298
|
+
components: {
|
|
42299
|
+
BaseIcon: BaseIcon
|
|
42300
|
+
},
|
|
42301
|
+
props: {
|
|
42302
|
+
modelValue: {
|
|
42303
|
+
type: [String, Number],
|
|
42304
|
+
default: ""
|
|
42305
|
+
},
|
|
42306
|
+
placeholder: {
|
|
42307
|
+
type: String,
|
|
42308
|
+
default: "Write your content here"
|
|
42309
|
+
},
|
|
42310
|
+
message: {
|
|
42311
|
+
type: String,
|
|
42312
|
+
default: ""
|
|
42313
|
+
},
|
|
42314
|
+
error: {
|
|
42315
|
+
type: Boolean,
|
|
42316
|
+
default: false
|
|
42317
|
+
},
|
|
42318
|
+
disabled: {
|
|
42319
|
+
type: Boolean,
|
|
42320
|
+
default: false
|
|
42321
|
+
},
|
|
42322
|
+
readonly: {
|
|
42323
|
+
type: Boolean,
|
|
42324
|
+
default: false
|
|
42325
|
+
},
|
|
42326
|
+
labelPosition: {
|
|
42327
|
+
type: String,
|
|
42328
|
+
default: "top",
|
|
42329
|
+
validator(value) {
|
|
42330
|
+
return ["left", "top"].includes(value);
|
|
42331
|
+
}
|
|
42332
|
+
},
|
|
42333
|
+
minHeight: {
|
|
42334
|
+
type: [Number, String],
|
|
42335
|
+
default: 180
|
|
42336
|
+
},
|
|
42337
|
+
maxHeight: {
|
|
42338
|
+
type: [Number, String],
|
|
42339
|
+
default: ""
|
|
42340
|
+
},
|
|
42341
|
+
toolbar: {
|
|
42342
|
+
type: Array,
|
|
42343
|
+
default: () => []
|
|
42344
|
+
},
|
|
42345
|
+
showToolbar: {
|
|
42346
|
+
type: Boolean,
|
|
42347
|
+
default: true
|
|
42348
|
+
},
|
|
42349
|
+
sanitizeOnPaste: {
|
|
42350
|
+
type: Boolean,
|
|
42351
|
+
default: true
|
|
42352
|
+
},
|
|
42353
|
+
sanitizeOnBlur: {
|
|
42354
|
+
type: Boolean,
|
|
42355
|
+
default: true
|
|
42356
|
+
}
|
|
42357
|
+
},
|
|
42358
|
+
emits: ["update:modelValue", "update:text", "input", "change", "focus", "blur"],
|
|
42359
|
+
data() {
|
|
42360
|
+
return {
|
|
42361
|
+
isEmpty: true,
|
|
42362
|
+
isFocused: false,
|
|
42363
|
+
isEmitting: false,
|
|
42364
|
+
savedRange: null,
|
|
42365
|
+
imageResize: {
|
|
42366
|
+
active: false,
|
|
42367
|
+
target: null,
|
|
42368
|
+
startX: 0,
|
|
42369
|
+
startWidth: 0,
|
|
42370
|
+
maxWidth: 0
|
|
42371
|
+
},
|
|
42372
|
+
toolbarState: {
|
|
42373
|
+
bold: false,
|
|
42374
|
+
italic: false,
|
|
42375
|
+
underline: false,
|
|
42376
|
+
strikeThrough: false,
|
|
42377
|
+
unorderedList: false,
|
|
42378
|
+
orderedList: false,
|
|
42379
|
+
blockquote: false,
|
|
42380
|
+
align: "justifyLeft",
|
|
42381
|
+
formatBlock: "P"
|
|
42382
|
+
}
|
|
42383
|
+
};
|
|
42384
|
+
},
|
|
42385
|
+
computed: {
|
|
42386
|
+
resolvedToolbar() {
|
|
42387
|
+
const source = this.toolbar.length ? this.toolbar : DEFAULT_TOOLBAR;
|
|
42388
|
+
return source.map(item => {
|
|
42389
|
+
if (typeof item === "string") {
|
|
42390
|
+
return TOOLBAR_ITEMS[item] || null;
|
|
42391
|
+
}
|
|
42392
|
+
if (!item || !item.action) {
|
|
42393
|
+
return null;
|
|
42394
|
+
}
|
|
42395
|
+
return item;
|
|
42396
|
+
}).filter(item => item);
|
|
42397
|
+
},
|
|
42398
|
+
editorStyle() {
|
|
42399
|
+
const maxHeight = this.maxHeight ? this.normalizeSize(this.maxHeight) : "none";
|
|
42400
|
+
return {
|
|
42401
|
+
minHeight: this.normalizeSize(this.minHeight),
|
|
42402
|
+
maxHeight: maxHeight
|
|
42403
|
+
};
|
|
42404
|
+
},
|
|
42405
|
+
isEditable() {
|
|
42406
|
+
return !this.disabled && !this.readonly;
|
|
42407
|
+
}
|
|
42408
|
+
},
|
|
42409
|
+
watch: {
|
|
42410
|
+
modelValue(newValue) {
|
|
42411
|
+
if (this.isEmitting) {
|
|
42412
|
+
return;
|
|
42413
|
+
}
|
|
42414
|
+
this.setEditorValue(newValue);
|
|
42415
|
+
}
|
|
42416
|
+
},
|
|
42417
|
+
mounted() {
|
|
42418
|
+
this.setEditorValue(this.modelValue);
|
|
42419
|
+
this.refreshToolbarState();
|
|
42420
|
+
document.addEventListener("selectionchange", this.handleSelectionChange);
|
|
42421
|
+
},
|
|
42422
|
+
beforeUnmount() {
|
|
42423
|
+
document.removeEventListener("selectionchange", this.handleSelectionChange);
|
|
42424
|
+
this.stopImageResize();
|
|
42425
|
+
},
|
|
42426
|
+
methods: {
|
|
42427
|
+
normalizeSize(value) {
|
|
42428
|
+
return Number.isFinite(Number(value)) ? `${Number(value)}px` : String(value);
|
|
42429
|
+
},
|
|
42430
|
+
setEditorValue(value) {
|
|
42431
|
+
const editor = this.$refs.editorRef;
|
|
42432
|
+
if (!editor) {
|
|
42433
|
+
return;
|
|
42434
|
+
}
|
|
42435
|
+
let nextValue = value == null ? "" : String(value);
|
|
42436
|
+
if (this.sanitizeOnBlur && nextValue) {
|
|
42437
|
+
nextValue = this.sanitizeHtml(nextValue);
|
|
42438
|
+
}
|
|
42439
|
+
if (this.isHtmlEmpty(nextValue)) {
|
|
42440
|
+
nextValue = "";
|
|
42441
|
+
}
|
|
42442
|
+
if (editor.innerHTML !== nextValue) {
|
|
42443
|
+
editor.innerHTML = nextValue;
|
|
42444
|
+
}
|
|
42445
|
+
this.updateEmptyState();
|
|
42446
|
+
},
|
|
42447
|
+
handleInput() {
|
|
42448
|
+
this.emitModelValue();
|
|
42449
|
+
this.refreshToolbarState();
|
|
42450
|
+
},
|
|
42451
|
+
handleFocus() {
|
|
42452
|
+
this.isFocused = true;
|
|
42453
|
+
this.$emit("focus");
|
|
42454
|
+
this.refreshToolbarState();
|
|
42455
|
+
},
|
|
42456
|
+
handleBlur() {
|
|
42457
|
+
this.isFocused = false;
|
|
42458
|
+
if (this.sanitizeOnBlur) {
|
|
42459
|
+
const editor = this.$refs.editorRef;
|
|
42460
|
+
const sanitizedValue = this.sanitizeHtml(editor.innerHTML);
|
|
42461
|
+
if (editor.innerHTML !== sanitizedValue) {
|
|
42462
|
+
editor.innerHTML = sanitizedValue;
|
|
42463
|
+
}
|
|
42464
|
+
}
|
|
42465
|
+
const htmlValue = this.emitModelValue();
|
|
42466
|
+
this.$emit("change", htmlValue);
|
|
42467
|
+
this.$emit("blur", htmlValue);
|
|
42468
|
+
this.refreshToolbarState();
|
|
42469
|
+
},
|
|
42470
|
+
handlePaste(event) {
|
|
42471
|
+
if (!this.sanitizeOnPaste || !this.isEditable) {
|
|
42472
|
+
return;
|
|
42473
|
+
}
|
|
42474
|
+
event.preventDefault();
|
|
42475
|
+
const clipboardData = event.clipboardData || window.clipboardData;
|
|
42476
|
+
const htmlPayload = clipboardData.getData("text/html");
|
|
42477
|
+
const textPayload = clipboardData.getData("text/plain");
|
|
42478
|
+
let contentToInsert = "";
|
|
42479
|
+
if (htmlPayload) {
|
|
42480
|
+
contentToInsert = this.sanitizeHtml(htmlPayload);
|
|
42481
|
+
} else {
|
|
42482
|
+
contentToInsert = this.escapeHtml(textPayload).replace(/\n/g, "<br>");
|
|
42483
|
+
}
|
|
42484
|
+
this.focusEditor();
|
|
42485
|
+
document.execCommand("insertHTML", false, contentToInsert);
|
|
42486
|
+
this.handleInput();
|
|
42487
|
+
},
|
|
42488
|
+
handleSelectionChange() {
|
|
42489
|
+
if (this.isFocused) {
|
|
42490
|
+
this.refreshToolbarState();
|
|
42491
|
+
}
|
|
42492
|
+
},
|
|
42493
|
+
handleEditorMouseDown(event) {
|
|
42494
|
+
if (!this.isEditable) {
|
|
42495
|
+
return;
|
|
42496
|
+
}
|
|
42497
|
+
const targetImage = event.target;
|
|
42498
|
+
if (!targetImage || targetImage.tagName !== "IMG") {
|
|
42499
|
+
return;
|
|
42500
|
+
}
|
|
42501
|
+
if (!this.isOnImageResizeHandle(event, targetImage)) {
|
|
42502
|
+
return;
|
|
42503
|
+
}
|
|
42504
|
+
event.preventDefault();
|
|
42505
|
+
this.startImageResize(event, targetImage);
|
|
42506
|
+
},
|
|
42507
|
+
handleEditorMouseMove(event) {
|
|
42508
|
+
if (this.imageResize.active) {
|
|
42509
|
+
return;
|
|
42510
|
+
}
|
|
42511
|
+
const editor = this.$refs.editorRef;
|
|
42512
|
+
if (!editor) {
|
|
42513
|
+
return;
|
|
42514
|
+
}
|
|
42515
|
+
const targetImage = event.target;
|
|
42516
|
+
if (!targetImage || targetImage.tagName !== "IMG") {
|
|
42517
|
+
editor.style.cursor = "";
|
|
42518
|
+
return;
|
|
42519
|
+
}
|
|
42520
|
+
editor.style.cursor = this.isOnImageResizeHandle(event, targetImage) ? "nwse-resize" : "";
|
|
42521
|
+
},
|
|
42522
|
+
handleEditorMouseLeave() {
|
|
42523
|
+
if (this.imageResize.active) {
|
|
42524
|
+
return;
|
|
42525
|
+
}
|
|
42526
|
+
const editor = this.$refs.editorRef;
|
|
42527
|
+
if (editor) {
|
|
42528
|
+
editor.style.cursor = "";
|
|
42529
|
+
}
|
|
42530
|
+
},
|
|
42531
|
+
startImageResize(event, imageNode) {
|
|
42532
|
+
this.imageResize = {
|
|
42533
|
+
active: true,
|
|
42534
|
+
target: imageNode,
|
|
42535
|
+
startX: event.clientX,
|
|
42536
|
+
startWidth: this.getImageWidth(imageNode),
|
|
42537
|
+
maxWidth: this.getImageResizeMaxWidth()
|
|
42538
|
+
};
|
|
42539
|
+
imageNode.classList.add("resizing-image");
|
|
42540
|
+
document.body.style.userSelect = "none";
|
|
42541
|
+
window.addEventListener("mousemove", this.onImageResizeMove);
|
|
42542
|
+
window.addEventListener("mouseup", this.stopImageResize);
|
|
42543
|
+
},
|
|
42544
|
+
onImageResizeMove(event) {
|
|
42545
|
+
if (!this.imageResize.active || !this.imageResize.target) {
|
|
42546
|
+
return;
|
|
42547
|
+
}
|
|
42548
|
+
const deltaX = event.clientX - this.imageResize.startX;
|
|
42549
|
+
const nextWidth = Math.max(IMAGE_MIN_WIDTH, Math.min(this.imageResize.startWidth + deltaX, this.imageResize.maxWidth));
|
|
42550
|
+
this.imageResize.target.style.width = `${nextWidth}px`;
|
|
42551
|
+
this.imageResize.target.setAttribute("width", `${Math.round(nextWidth)}`);
|
|
42552
|
+
this.imageResize.target.style.height = "auto";
|
|
42553
|
+
},
|
|
42554
|
+
stopImageResize() {
|
|
42555
|
+
if (!this.imageResize.active) {
|
|
42556
|
+
return;
|
|
42557
|
+
}
|
|
42558
|
+
const resizedTarget = this.imageResize.target;
|
|
42559
|
+
if (resizedTarget) {
|
|
42560
|
+
resizedTarget.classList.remove("resizing-image");
|
|
42561
|
+
}
|
|
42562
|
+
this.imageResize = {
|
|
42563
|
+
active: false,
|
|
42564
|
+
target: null,
|
|
42565
|
+
startX: 0,
|
|
42566
|
+
startWidth: 0,
|
|
42567
|
+
maxWidth: 0
|
|
42568
|
+
};
|
|
42569
|
+
document.body.style.userSelect = "";
|
|
42570
|
+
window.removeEventListener("mousemove", this.onImageResizeMove);
|
|
42571
|
+
window.removeEventListener("mouseup", this.stopImageResize);
|
|
42572
|
+
const editor = this.$refs.editorRef;
|
|
42573
|
+
if (editor) {
|
|
42574
|
+
editor.style.cursor = "";
|
|
42575
|
+
}
|
|
42576
|
+
this.emitModelValue();
|
|
42577
|
+
},
|
|
42578
|
+
getImageWidth(imageNode) {
|
|
42579
|
+
const widthFromAttribute = Number(imageNode.getAttribute("width"));
|
|
42580
|
+
if (Number.isFinite(widthFromAttribute) && widthFromAttribute > 0) {
|
|
42581
|
+
return widthFromAttribute;
|
|
42582
|
+
}
|
|
42583
|
+
const rect = imageNode.getBoundingClientRect();
|
|
42584
|
+
if (rect.width > 0) {
|
|
42585
|
+
return rect.width;
|
|
42586
|
+
}
|
|
42587
|
+
return IMAGE_MIN_WIDTH;
|
|
42588
|
+
},
|
|
42589
|
+
getImageResizeMaxWidth() {
|
|
42590
|
+
const editor = this.$refs.editorRef;
|
|
42591
|
+
if (!editor) {
|
|
42592
|
+
return 1200;
|
|
42593
|
+
}
|
|
42594
|
+
const editorWidth = editor.clientWidth || 1200;
|
|
42595
|
+
return Math.max(editorWidth, IMAGE_MIN_WIDTH);
|
|
42596
|
+
},
|
|
42597
|
+
isOnImageResizeHandle(event, imageNode) {
|
|
42598
|
+
const imageRect = imageNode.getBoundingClientRect();
|
|
42599
|
+
const isInsideX = event.clientX >= imageRect.right - IMAGE_RESIZE_HANDLE_GAP;
|
|
42600
|
+
const isInsideY = event.clientY >= imageRect.bottom - IMAGE_RESIZE_HANDLE_GAP;
|
|
42601
|
+
return isInsideX && isInsideY;
|
|
42602
|
+
},
|
|
42603
|
+
emitModelValue() {
|
|
42604
|
+
const editor = this.$refs.editorRef;
|
|
42605
|
+
if (!editor) {
|
|
42606
|
+
return "";
|
|
42607
|
+
}
|
|
42608
|
+
let htmlValue = editor.innerHTML;
|
|
42609
|
+
if (this.isHtmlEmpty(htmlValue)) {
|
|
42610
|
+
htmlValue = "";
|
|
42611
|
+
if (editor.innerHTML !== "") {
|
|
42612
|
+
editor.innerHTML = "";
|
|
42613
|
+
}
|
|
42614
|
+
}
|
|
42615
|
+
this.updateEmptyState();
|
|
42616
|
+
this.isEmitting = true;
|
|
42617
|
+
this.$emit("update:modelValue", htmlValue);
|
|
42618
|
+
this.$emit("input", htmlValue);
|
|
42619
|
+
this.$emit("update:text", this.getPlainText());
|
|
42620
|
+
this.$nextTick(() => {
|
|
42621
|
+
this.isEmitting = false;
|
|
42622
|
+
});
|
|
42623
|
+
return htmlValue;
|
|
42624
|
+
},
|
|
42625
|
+
refreshToolbarState() {
|
|
42626
|
+
if (!this.selectionInsideEditor()) {
|
|
42627
|
+
this.toolbarState = {
|
|
42628
|
+
bold: false,
|
|
42629
|
+
italic: false,
|
|
42630
|
+
underline: false,
|
|
42631
|
+
strikeThrough: false,
|
|
42632
|
+
unorderedList: false,
|
|
42633
|
+
orderedList: false,
|
|
42634
|
+
blockquote: false,
|
|
42635
|
+
align: "justifyLeft",
|
|
42636
|
+
formatBlock: "P"
|
|
42637
|
+
};
|
|
42638
|
+
return;
|
|
42639
|
+
}
|
|
42640
|
+
const activeAlign = ["justifyLeft", "justifyCenter", "justifyRight", "justifyFull"].find(command => document.queryCommandState(command));
|
|
42641
|
+
const blockValue = (document.queryCommandValue("formatBlock") || "").replace(/[<>]/g, "").toUpperCase();
|
|
42642
|
+
this.toolbarState = {
|
|
42643
|
+
bold: document.queryCommandState("bold"),
|
|
42644
|
+
italic: document.queryCommandState("italic"),
|
|
42645
|
+
underline: document.queryCommandState("underline"),
|
|
42646
|
+
strikeThrough: document.queryCommandState("strikeThrough"),
|
|
42647
|
+
unorderedList: document.queryCommandState("insertUnorderedList"),
|
|
42648
|
+
orderedList: document.queryCommandState("insertOrderedList"),
|
|
42649
|
+
blockquote: blockValue === "BLOCKQUOTE",
|
|
42650
|
+
align: activeAlign || "justifyLeft",
|
|
42651
|
+
formatBlock: blockValue || "P"
|
|
42652
|
+
};
|
|
42653
|
+
},
|
|
42654
|
+
selectionInsideEditor() {
|
|
42655
|
+
const editor = this.$refs.editorRef;
|
|
42656
|
+
const selection = window.getSelection();
|
|
42657
|
+
if (!editor || !selection || !selection.rangeCount) {
|
|
42658
|
+
return false;
|
|
42659
|
+
}
|
|
42660
|
+
const range = selection.getRangeAt(0);
|
|
42661
|
+
return editor.contains(range.commonAncestorContainer);
|
|
42662
|
+
},
|
|
42663
|
+
focusEditor() {
|
|
42664
|
+
const editor = this.$refs.editorRef;
|
|
42665
|
+
if (!editor) {
|
|
42666
|
+
return;
|
|
42667
|
+
}
|
|
42668
|
+
editor.focus();
|
|
42669
|
+
if (!this.selectionInsideEditor()) {
|
|
42670
|
+
const range = document.createRange();
|
|
42671
|
+
range.selectNodeContents(editor);
|
|
42672
|
+
range.collapse(false);
|
|
42673
|
+
const selection = window.getSelection();
|
|
42674
|
+
selection.removeAllRanges();
|
|
42675
|
+
selection.addRange(range);
|
|
42676
|
+
}
|
|
42677
|
+
},
|
|
42678
|
+
handleToolbarAction(item) {
|
|
42679
|
+
if (this.isActionDisabled(item)) {
|
|
42680
|
+
return;
|
|
42681
|
+
}
|
|
42682
|
+
this.focusEditor();
|
|
42683
|
+
this.saveRange();
|
|
42684
|
+
switch (item.action) {
|
|
42685
|
+
case "paragraph":
|
|
42686
|
+
this.executeCommand("formatBlock", "P");
|
|
42687
|
+
break;
|
|
42688
|
+
case "heading1":
|
|
42689
|
+
this.executeCommand("formatBlock", "H1");
|
|
42690
|
+
break;
|
|
42691
|
+
case "heading2":
|
|
42692
|
+
this.executeCommand("formatBlock", "H2");
|
|
42693
|
+
break;
|
|
42694
|
+
case "bold":
|
|
42695
|
+
this.executeCommand("bold");
|
|
42696
|
+
break;
|
|
42697
|
+
case "italic":
|
|
42698
|
+
this.executeCommand("italic");
|
|
42699
|
+
break;
|
|
42700
|
+
case "underline":
|
|
42701
|
+
this.executeCommand("underline");
|
|
42702
|
+
break;
|
|
42703
|
+
case "strikeThrough":
|
|
42704
|
+
this.executeCommand("strikeThrough");
|
|
42705
|
+
break;
|
|
42706
|
+
case "unorderedList":
|
|
42707
|
+
this.executeCommand("insertUnorderedList");
|
|
42708
|
+
break;
|
|
42709
|
+
case "orderedList":
|
|
42710
|
+
this.executeCommand("insertOrderedList");
|
|
42711
|
+
break;
|
|
42712
|
+
case "blockquote":
|
|
42713
|
+
if (this.toolbarState.blockquote) {
|
|
42714
|
+
this.executeCommand("formatBlock", "P");
|
|
42715
|
+
} else {
|
|
42716
|
+
this.executeCommand("formatBlock", "BLOCKQUOTE");
|
|
42717
|
+
}
|
|
42718
|
+
break;
|
|
42719
|
+
case "alignLeft":
|
|
42720
|
+
this.executeCommand("justifyLeft");
|
|
42721
|
+
break;
|
|
42722
|
+
case "alignCenter":
|
|
42723
|
+
this.executeCommand("justifyCenter");
|
|
42724
|
+
break;
|
|
42725
|
+
case "alignRight":
|
|
42726
|
+
this.executeCommand("justifyRight");
|
|
42727
|
+
break;
|
|
42728
|
+
case "alignJustify":
|
|
42729
|
+
this.executeCommand("justifyFull");
|
|
42730
|
+
break;
|
|
42731
|
+
case "link":
|
|
42732
|
+
this.createLink();
|
|
42733
|
+
break;
|
|
42734
|
+
case "insertImage":
|
|
42735
|
+
this.triggerImagePicker();
|
|
42736
|
+
break;
|
|
42737
|
+
case "unlink":
|
|
42738
|
+
this.executeCommand("unlink");
|
|
42739
|
+
break;
|
|
42740
|
+
case "undo":
|
|
42741
|
+
this.executeCommand("undo");
|
|
42742
|
+
break;
|
|
42743
|
+
case "redo":
|
|
42744
|
+
this.executeCommand("redo");
|
|
42745
|
+
break;
|
|
42746
|
+
case "clear":
|
|
42747
|
+
this.executeCommand("removeFormat");
|
|
42748
|
+
this.executeCommand("unlink");
|
|
42749
|
+
this.executeCommand("formatBlock", "P");
|
|
42750
|
+
break;
|
|
42751
|
+
default:
|
|
42752
|
+
break;
|
|
42753
|
+
}
|
|
42754
|
+
},
|
|
42755
|
+
executeCommand(command, value = null) {
|
|
42756
|
+
this.focusEditor();
|
|
42757
|
+
this.restoreRange();
|
|
42758
|
+
document.execCommand(command, false, value);
|
|
42759
|
+
this.handleInput();
|
|
42760
|
+
},
|
|
42761
|
+
triggerImagePicker() {
|
|
42762
|
+
const imageInput = this.$refs.imageInputRef;
|
|
42763
|
+
if (!imageInput) {
|
|
42764
|
+
return;
|
|
42765
|
+
}
|
|
42766
|
+
imageInput.value = "";
|
|
42767
|
+
imageInput.click();
|
|
42768
|
+
},
|
|
42769
|
+
handleImageSelected(event) {
|
|
42770
|
+
var _event$target;
|
|
42771
|
+
const file = (_event$target = event.target) === null || _event$target === void 0 || (_event$target = _event$target.files) === null || _event$target === void 0 ? void 0 : _event$target[0];
|
|
42772
|
+
if (!file || !String(file.type).startsWith("image/")) {
|
|
42773
|
+
return;
|
|
42774
|
+
}
|
|
42775
|
+
const fileReader = new FileReader();
|
|
42776
|
+
fileReader.onload = () => {
|
|
42777
|
+
this.insertImage(String(fileReader.result || ""));
|
|
42778
|
+
};
|
|
42779
|
+
fileReader.readAsDataURL(file);
|
|
42780
|
+
},
|
|
42781
|
+
insertImage(rawImageSrc) {
|
|
42782
|
+
const imageSrc = this.normalizeImageSrc(rawImageSrc);
|
|
42783
|
+
if (!this.isSafeImageSrc(imageSrc)) {
|
|
42784
|
+
return;
|
|
42785
|
+
}
|
|
42786
|
+
this.focusEditor();
|
|
42787
|
+
this.restoreRange();
|
|
42788
|
+
const safeSrc = this.escapeHtml(imageSrc);
|
|
42789
|
+
document.execCommand("insertHTML", false, `<img src="${safeSrc}" alt="image">`);
|
|
42790
|
+
this.handleInput();
|
|
42791
|
+
},
|
|
42792
|
+
createLink() {
|
|
42793
|
+
this.restoreRange();
|
|
42794
|
+
const selection = window.getSelection();
|
|
42795
|
+
const selectedText = selection ? selection.toString() : "";
|
|
42796
|
+
const defaultUrl = selectedText && this.isSafeUrl(selectedText) ? selectedText : "https://";
|
|
42797
|
+
const rawUrl = window.prompt("Input URL", defaultUrl);
|
|
42798
|
+
if (!rawUrl) {
|
|
42799
|
+
return;
|
|
42800
|
+
}
|
|
42801
|
+
const normalizedUrl = this.normalizeUrl(rawUrl);
|
|
42802
|
+
if (!this.isSafeUrl(normalizedUrl)) {
|
|
42803
|
+
return;
|
|
42804
|
+
}
|
|
42805
|
+
this.focusEditor();
|
|
42806
|
+
this.restoreRange();
|
|
42807
|
+
const selectedRange = window.getSelection();
|
|
42808
|
+
if (selectedRange && selectedRange.toString()) {
|
|
42809
|
+
document.execCommand("createLink", false, normalizedUrl);
|
|
42810
|
+
} else {
|
|
42811
|
+
const safeUrl = this.escapeHtml(normalizedUrl);
|
|
42812
|
+
document.execCommand("insertHTML", false, `<a href="${safeUrl}" target="_blank" rel="noopener noreferrer">${safeUrl}</a>`);
|
|
42813
|
+
}
|
|
42814
|
+
this.handleInput();
|
|
42815
|
+
},
|
|
42816
|
+
normalizeUrl(rawUrl) {
|
|
42817
|
+
const trimmedUrl = String(rawUrl).trim();
|
|
42818
|
+
if (!trimmedUrl) {
|
|
42819
|
+
return "";
|
|
42820
|
+
}
|
|
42821
|
+
if (SAFE_PROTOCOLS.some(protocol => trimmedUrl.toLowerCase().startsWith(protocol))) {
|
|
42822
|
+
return trimmedUrl;
|
|
42823
|
+
}
|
|
42824
|
+
return `https://${trimmedUrl}`;
|
|
42825
|
+
},
|
|
42826
|
+
isSafeUrl(url) {
|
|
42827
|
+
if (!url) {
|
|
42828
|
+
return false;
|
|
42829
|
+
}
|
|
42830
|
+
return SAFE_PROTOCOLS.some(protocol => url.toLowerCase().startsWith(protocol));
|
|
42831
|
+
},
|
|
42832
|
+
normalizeImageSrc(rawSrc) {
|
|
42833
|
+
const cleanedSrc = String(rawSrc || "").trim();
|
|
42834
|
+
if (!cleanedSrc) {
|
|
42835
|
+
return "";
|
|
42836
|
+
}
|
|
42837
|
+
const normalizedSrc = cleanedSrc.toLowerCase();
|
|
42838
|
+
if (SAFE_IMAGE_PROTOCOLS.some(protocol => normalizedSrc.startsWith(protocol))) {
|
|
42839
|
+
return cleanedSrc;
|
|
42840
|
+
}
|
|
42841
|
+
return `https://${cleanedSrc}`;
|
|
42842
|
+
},
|
|
42843
|
+
isSafeImageSrc(src) {
|
|
42844
|
+
if (!src) {
|
|
42845
|
+
return false;
|
|
42846
|
+
}
|
|
42847
|
+
const normalizedSrc = src.toLowerCase();
|
|
42848
|
+
return SAFE_IMAGE_PROTOCOLS.some(protocol => normalizedSrc.startsWith(protocol));
|
|
42849
|
+
},
|
|
42850
|
+
saveRange() {
|
|
42851
|
+
const selection = window.getSelection();
|
|
42852
|
+
if (selection && selection.rangeCount) {
|
|
42853
|
+
this.savedRange = selection.getRangeAt(0).cloneRange();
|
|
42854
|
+
}
|
|
42855
|
+
},
|
|
42856
|
+
restoreRange() {
|
|
42857
|
+
if (!this.savedRange) {
|
|
42858
|
+
return;
|
|
42859
|
+
}
|
|
42860
|
+
const selection = window.getSelection();
|
|
42861
|
+
selection.removeAllRanges();
|
|
42862
|
+
selection.addRange(this.savedRange);
|
|
42863
|
+
},
|
|
42864
|
+
sanitizeHtml(htmlValue) {
|
|
42865
|
+
const source = document.createElement("div");
|
|
42866
|
+
source.innerHTML = htmlValue || "";
|
|
42867
|
+
const target = document.createElement("div");
|
|
42868
|
+
Array.from(source.childNodes).forEach(node => {
|
|
42869
|
+
const sanitizedNode = this.createSanitizedNode(node, document);
|
|
42870
|
+
if (sanitizedNode) {
|
|
42871
|
+
target.appendChild(sanitizedNode);
|
|
42872
|
+
}
|
|
42873
|
+
});
|
|
42874
|
+
return target.innerHTML;
|
|
42875
|
+
},
|
|
42876
|
+
createSanitizedNode(node, doc) {
|
|
42877
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
42878
|
+
return doc.createTextNode(node.textContent || "");
|
|
42879
|
+
}
|
|
42880
|
+
if (node.nodeType !== Node.ELEMENT_NODE) {
|
|
42881
|
+
return null;
|
|
42882
|
+
}
|
|
42883
|
+
const tagName = node.tagName.toUpperCase();
|
|
42884
|
+
if (!ALLOWED_TAGS.includes(tagName)) {
|
|
42885
|
+
const fragment = doc.createDocumentFragment();
|
|
42886
|
+
Array.from(node.childNodes).forEach(child => {
|
|
42887
|
+
const childNode = this.createSanitizedNode(child, doc);
|
|
42888
|
+
if (childNode) {
|
|
42889
|
+
fragment.appendChild(childNode);
|
|
42890
|
+
}
|
|
42891
|
+
});
|
|
42892
|
+
return fragment;
|
|
42893
|
+
}
|
|
42894
|
+
const element = doc.createElement(tagName.toLowerCase());
|
|
42895
|
+
if (tagName === "A") {
|
|
42896
|
+
const href = this.normalizeUrl(node.getAttribute("href") || "");
|
|
42897
|
+
if (this.isSafeUrl(href)) {
|
|
42898
|
+
element.setAttribute("href", href);
|
|
42899
|
+
element.setAttribute("target", "_blank");
|
|
42900
|
+
element.setAttribute("rel", "noopener noreferrer");
|
|
42901
|
+
}
|
|
42902
|
+
}
|
|
42903
|
+
if (tagName === "IMG") {
|
|
42904
|
+
const imageSrc = this.normalizeImageSrc(node.getAttribute("src") || "");
|
|
42905
|
+
if (!this.isSafeImageSrc(imageSrc)) {
|
|
42906
|
+
return null;
|
|
42907
|
+
}
|
|
42908
|
+
element.setAttribute("src", imageSrc);
|
|
42909
|
+
element.setAttribute("alt", node.getAttribute("alt") || "image");
|
|
42910
|
+
const imageWidth = Number(node.getAttribute("width"));
|
|
42911
|
+
if (Number.isFinite(imageWidth) && imageWidth > 0) {
|
|
42912
|
+
element.setAttribute("width", `${Math.max(IMAGE_MIN_WIDTH, Math.round(imageWidth))}`);
|
|
42913
|
+
}
|
|
42914
|
+
}
|
|
42915
|
+
const textAlign = this.extractAllowedTextAlign(node.getAttribute("style"));
|
|
42916
|
+
if (textAlign && ALIGNABLE_TAGS.includes(tagName)) {
|
|
42917
|
+
element.setAttribute("style", `text-align:${textAlign};`);
|
|
42918
|
+
}
|
|
42919
|
+
Array.from(node.childNodes).forEach(child => {
|
|
42920
|
+
const childNode = this.createSanitizedNode(child, doc);
|
|
42921
|
+
if (childNode) {
|
|
42922
|
+
element.appendChild(childNode);
|
|
42923
|
+
}
|
|
42924
|
+
});
|
|
42925
|
+
return element;
|
|
42926
|
+
},
|
|
42927
|
+
extractAllowedTextAlign(styleValue) {
|
|
42928
|
+
if (!styleValue) {
|
|
42929
|
+
return "";
|
|
42930
|
+
}
|
|
42931
|
+
const rules = styleValue.split(";").map(style => style.trim());
|
|
42932
|
+
const textAlignRule = rules.find(style => style.toLowerCase().startsWith("text-align"));
|
|
42933
|
+
if (!textAlignRule) {
|
|
42934
|
+
return "";
|
|
42935
|
+
}
|
|
42936
|
+
const parsed = textAlignRule.split(":");
|
|
42937
|
+
if (parsed.length < 2) {
|
|
42938
|
+
return "";
|
|
42939
|
+
}
|
|
42940
|
+
const alignValue = parsed[1].trim().toLowerCase();
|
|
42941
|
+
return ["left", "center", "right", "justify"].includes(alignValue) ? alignValue : "";
|
|
42942
|
+
},
|
|
42943
|
+
isActionActive(item) {
|
|
42944
|
+
switch (item.action) {
|
|
42945
|
+
case "paragraph":
|
|
42946
|
+
return this.toolbarState.formatBlock === "P" || this.toolbarState.formatBlock === "DIV";
|
|
42947
|
+
case "heading1":
|
|
42948
|
+
return this.toolbarState.formatBlock === "H1";
|
|
42949
|
+
case "heading2":
|
|
42950
|
+
return this.toolbarState.formatBlock === "H2";
|
|
42951
|
+
case "bold":
|
|
42952
|
+
return this.toolbarState.bold;
|
|
42953
|
+
case "italic":
|
|
42954
|
+
return this.toolbarState.italic;
|
|
42955
|
+
case "underline":
|
|
42956
|
+
return this.toolbarState.underline;
|
|
42957
|
+
case "strikeThrough":
|
|
42958
|
+
return this.toolbarState.strikeThrough;
|
|
42959
|
+
case "unorderedList":
|
|
42960
|
+
return this.toolbarState.unorderedList;
|
|
42961
|
+
case "orderedList":
|
|
42962
|
+
return this.toolbarState.orderedList;
|
|
42963
|
+
case "blockquote":
|
|
42964
|
+
return this.toolbarState.blockquote;
|
|
42965
|
+
case "alignLeft":
|
|
42966
|
+
return this.toolbarState.align === "justifyLeft";
|
|
42967
|
+
case "alignCenter":
|
|
42968
|
+
return this.toolbarState.align === "justifyCenter";
|
|
42969
|
+
case "alignRight":
|
|
42970
|
+
return this.toolbarState.align === "justifyRight";
|
|
42971
|
+
case "alignJustify":
|
|
42972
|
+
return this.toolbarState.align === "justifyFull";
|
|
42973
|
+
default:
|
|
42974
|
+
return false;
|
|
42975
|
+
}
|
|
42976
|
+
},
|
|
42977
|
+
isActionDisabled(item) {
|
|
42978
|
+
return item.action === "divider" || !this.isEditable;
|
|
42979
|
+
},
|
|
42980
|
+
updateEmptyState() {
|
|
42981
|
+
const editor = this.$refs.editorRef;
|
|
42982
|
+
if (!editor) {
|
|
42983
|
+
this.isEmpty = true;
|
|
42984
|
+
return;
|
|
42985
|
+
}
|
|
42986
|
+
this.isEmpty = this.isHtmlEmpty(editor.innerHTML);
|
|
42987
|
+
},
|
|
42988
|
+
isHtmlEmpty(htmlValue) {
|
|
42989
|
+
if (!htmlValue) {
|
|
42990
|
+
return true;
|
|
42991
|
+
}
|
|
42992
|
+
const cleaned = String(htmlValue).replace(/ /gi, "").replace(/<br\s*\/?>/gi, "").replace(/\s+/g, "");
|
|
42993
|
+
if (!cleaned) {
|
|
42994
|
+
return true;
|
|
42995
|
+
}
|
|
42996
|
+
const inspector = document.createElement("div");
|
|
42997
|
+
inspector.innerHTML = htmlValue;
|
|
42998
|
+
const textContent = (inspector.textContent || "").replace(/\u200B/g, "").trim();
|
|
42999
|
+
const hasImage = Boolean(inspector.querySelector("img"));
|
|
43000
|
+
if (hasImage) {
|
|
43001
|
+
return false;
|
|
43002
|
+
}
|
|
43003
|
+
return textContent.length === 0;
|
|
43004
|
+
},
|
|
43005
|
+
getPlainText() {
|
|
43006
|
+
const editor = this.$refs.editorRef;
|
|
43007
|
+
if (!editor) {
|
|
43008
|
+
return "";
|
|
43009
|
+
}
|
|
43010
|
+
return (editor.innerText || "").replace(/\u200B/g, "").trim();
|
|
43011
|
+
},
|
|
43012
|
+
escapeHtml(value) {
|
|
43013
|
+
return String(value || "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
43014
|
+
}
|
|
43015
|
+
}
|
|
43016
|
+
});
|
|
43017
|
+
// CONCATENATED MODULE: ./src/components/Form/FormWysiwyg.vue?vue&type=script&lang=js
|
|
43018
|
+
|
|
43019
|
+
// EXTERNAL MODULE: ./src/components/Form/FormWysiwyg.vue?vue&type=style&index=0&id=52b4ebd4&lang=scss
|
|
43020
|
+
var FormWysiwygvue_type_style_index_0_id_52b4ebd4_lang_scss = __webpack_require__("d831");
|
|
43021
|
+
|
|
43022
|
+
// CONCATENATED MODULE: ./src/components/Form/FormWysiwyg.vue
|
|
43023
|
+
|
|
43024
|
+
|
|
43025
|
+
|
|
43026
|
+
|
|
43027
|
+
|
|
43028
|
+
|
|
43029
|
+
|
|
43030
|
+
const FormWysiwyg_exports_ = /*#__PURE__*/exportHelper_default()(FormWysiwygvue_type_script_lang_js, [['render',FormWysiwygvue_type_template_id_52b4ebd4_render]])
|
|
43031
|
+
|
|
43032
|
+
/* harmony default export */ var FormWysiwyg = (FormWysiwyg_exports_);
|
|
41986
43033
|
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader-v16/dist??ref--1-1!./src/components/ExpansionPanel/index.vue?vue&type=template&id=01544323
|
|
41987
43034
|
|
|
41988
43035
|
const ExpansionPanelvue_type_template_id_01544323_hoisted_1 = {
|
|
@@ -42192,6 +43239,7 @@ const AnimatedIconLogo_exports_ = AnimatedIconLogovue_type_script_setup_true_lan
|
|
|
42192
43239
|
|
|
42193
43240
|
|
|
42194
43241
|
|
|
43242
|
+
|
|
42195
43243
|
|
|
42196
43244
|
|
|
42197
43245
|
// CONCATENATED MODULE: ./src/install.js
|